MLCInformationGetMLCSiblingInformation Method (ConnectionId, SessionId, DocumentId, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Returns information about localized version of an MLC document given the language of the localized version.

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

public static MLCSiblingInformation GetMLCSiblingInformation(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId documentId,
	string languageCode
)

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).
documentId
Type: ContentStudio.DocumentDocumentId
The original document to get a localized version for. This document must exist.
languageCode
Type: SystemString
The language identifier of the localized version to get information for.

Return Value

Type: MLCSiblingInformation
A MLCSiblingInformation containing MLC member data.
Exceptions

ExceptionCondition
CSException One of the following conditions
  • 1001 - The SessionID is invalid.
  • 1002 - Permission denied.
  • 1009 - Invalid parameter value.
  • 1100 - The document does not exist.
  • 1558 - The document is not an MLC member document.
  • 1561 - The language does not exists in the specified MLC.
  • 1838 - The document is not published.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

Browse permission is required on the document and anonymous callers are supported.
Remarks

If there is no version of the document in the requested language the DocumentID property will be zero.
Examples

This code shows how can get information about a sibling document written in the Italian language and how to display it as an Html list in a Content Studio document. The code also checks whether there actually exists a version in Italian before reading any detailed information about the found sibling.

System.Text.StringBuilder sbu = new System.Text.StringBuilder();
sbu.AppendLine("<ul>");
try
{
   ContentStudio.Document.MLC.MLCSiblingInformation sibi = 
      ContentStudio.Document.MLC.MLCInformation.GetMLCSiblingInformation(
                                                CS_ConnectionId,
                                                CS_UserSessionId,
                                                CS_InsertedDocumentId,
                                                "it");
   if(sibi.DocumentId > 0)
   {
     ContentStudio.Document.CSDocumentInformation docu = 
        new ContentStudio.Document.CSDocumentInformation(CS_ConnectionId, 
                                                         CS_UserSessionId, 
                                                         sibi.DocumentID, 
                                                         CSDocumentInformation.ContentToLoad.None);
     sbu.AppendLine(String.Format(" <li>Document: {0} ({1})</li>", 
                                   docu.DocumentName, 
                                   sibi.DocumentID));
   }
   else
     sbu.Append(" <li>There is no Italian version of this document</li>");
}
catch(CSException cex)
{
    switch(cex.Number)
    {
       case 1558:
          sbu.AppendLine(" <li>Error: The document is not an MLC document!</li>");
          break;
       case 1561:
          sbu.AppendLine(" <li>Error: No support for Italian!</li>");
          break;
       default:
          sbu.AppendLine(" <li>Error: {0}!</li>", cex.Message);
          break;
    }
}
catch(Exception ex)
{
    sbu.AppendLine(String.Format(" <li>Error: {0}</li>", ex.Message));
}
sbu.AppendLine("</ul>");
Response.Write(sbu.ToString());
See Also

Reference