CSSyncronizedDocument Constructor (ConnectionId, SessionId, DocumentId, CSDocumentInformationContentToLoad) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Creates a new instance of the CSSyncronizedDocument class and loads the content of an existing Content Studio document. Use this constructor when you intend to work with an existing document.

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

public CSSyncronizedDocument(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId documentId,
	CSDocumentInformationContentToLoad version
)

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 typically is retrieved from a call to the OpenSession method of the AuthenticationBase class
documentId
Type: ContentStudio.DocumentDocumentId
An identifier to a Content Studio document.
The following conditions apply for this parameter:
  • The document must exist
  • The document cannot be an uploaded file
  • Depending on the value of the Version it must have a certain status
version
Type: ContentStudio.DocumentCSDocumentInformationContentToLoad
One of the CSDocumentInformationContentToLoad enumeration members that defines what content version of the document to load. if this value is None the following content related properties are not loaded: Also, if Version is Approved or None the document is opened as read-only and cannot be changed or saved.
Exceptions

ExceptionCondition
CSException
  • 1001 - Session is invalid
  • 1002 - Permission denied
  • 1804 - The document could not be found.
  • 1809 - The document is already checked out by %UserName%
  • 1811 - The document is protected.
  • 1820 - Can not check out the document. It has been sent for revision by %USERNAME%
  • 1830 - There is currently no approved content.
  • 2115 - Workflow: Action not available for the caller.
InvalidOperationExceptionUploaded files cannot be opened with CSSyncronizedDocument
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

READ permission on the document is required to load its Approved content. WRITE permission to load writable its Draft content.
Remarks

If the Approved content is requested, the document cannot be changed and the ReadOnly property returns true. When the Draft is loaded, the document is checked out and can be changed and saved as many times as needed until the document is closed or approved. A loaded Draft has exclusively checked out the document on the caller's behalf provided that no one else already has it checked out. If the document is checked out by another user a CSException is thrown, a condition that the calling code must handle thoroughly.
See Also

Reference