MLCInformationGetMLCMemberInformationCollection Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Returns a list of all member categories in an MLC.

Namespace: ContentStudio.Document.MLC
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public static List<MLCMemberInformation> GetMLCMemberInformationCollection(
	ConnectionId connectionId,
	SessionId sessionId,
	CategoryId categoryId
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
categoryId
Type: ContentStudio.DocumentCategoryId
Represents any member in an MLC

Return Value

Type: ListMLCMemberInformation
A generic ListT collection of MLCMemberInformation objects containing MLC member data.
Exceptions

ExceptionCondition
CSException One of the following conditions
  • 1001 - The SessionID is invalid.
  • 1002 - Permission denied.
  • 1503 - The category does not exist.
  • 1554 - The category is not an MLC member.
  • 1555 - The MLC master could not be located.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

Read or browse permission on the MLC master is required and anonymous calls are supported. However, the properties CategoryName, ModuleName and PathName of the returned MLCMemberInformation will be empty unless the caller has Read permission.
Examples

The code snippet below shows how to get MLC information about the current category. The sample writes an Html table on a Content Studio document that contains
  • the category name combined with its id and whether the category is the master category
  • the language of the category including the language code
try
{
    System.Collections.Generic.List<ContentStudio.Document.MLC.MLCMemberInformation> li =
           ContentStudio.Document.MLC.MLCInformation.GetMLCMemberInformationCollection(CS_ConnectionId,
                                                            CS_UserSessionId,
                                                            CS_InsertedCategoryId);
    System.Text.StringBuilder bu = new System.Text.StringBuilder();
    bu.AppendLine("<table>");
    bu.AppendLine(" <tr><th>Category info</th><th>Language info</th></tr>");
    foreach (ContentStudio.Document.MLC.MLCMemberInformation mifo in li)
    {
        bu.Append(" <tr>");
        bu.Append("  <td>");
        bu.Append(String.Format("Category: {0} ({1}) IsMaster: {2}",
                               mifo.CategoryName,
                               mifo.CategoryID,
                               mifo.IsMasterCategory ? "Yes" : "No"));
        bu.AppendLine("  </td>");
        bu.Append("  <td>");
        bu.Append(String.Format("Language: {0} ({1})",
                               mifo.LanguageName,
                               mifo.LanguageCode));
        bu.AppendLine("  </td>");
        bu.AppendLine(" </tr>");
    }
    bu.AppendLine("</table>");
    Response.Write(sbu.ToString());
}
catch (Exception ex)
{
    Response.Write(String.Format("<h3>Error: {0}</h3>", ex.message));
}
See Also

Reference