DocumentManagerCreateDocument Method (ConnectionId, SessionId, DocumentId, CategoryId, DocumentId, Int32, String, Object, Object, Object, String, String, String, String, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Creates a new document without content. This method exists only for the Content Studio copying functionality and should be used for special purposes only. The document cannot be created in a category for binary documents (uploaded files). This methods supports anonymous callers.

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

public virtual int CreateDocument(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId parentDocumentId,
	CategoryId categoryId,
	DocumentId editTemplateId,
	int orderInHierarchy,
	string documentName,
	Object published,
	Object publishDate,
	Object archiveDate,
	string marking,
	string bodyProperties,
	string fileExtension,
	string guoid,
	out string retFileName
)

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).
parentDocumentId
Type: ContentStudio.DocumentDocumentId
The id of an existing document that should be the parent of the new document. Pass zero if the document should not have a parent.
categoryId
Type: ContentStudio.DocumentCategoryId
The id of an existing category that will host the document.
editTemplateId
Type: ContentStudio.DocumentDocumentId
The id of an existing Editing Template id. This parameter is required only when creating a Presentation Template document. Otherwise pass zero.
orderInHierarchy
Type: SystemInt32
Specifies how the document should be sorted within its document hierarchy within the same level. Pass zero to let Content Studio handle the ordering automatically.
documentName
Type: SystemString
The name of the document. This parameter cannot be a zero length string and cannot exceed MAX_DOCUMENTNAME_SIZE number of characters.
published
Type: SystemObject
Indicates if the document should be published or not. This parameter must be possible to cast or convert to a boolean but can be null to indicate to use the default value.
publishDate
Type: SystemObject
A DateTime value that indicates the date when the document should be published. This parameter must be possible to cast or convert to the DateTime data type but can be null to use the default value.
archiveDate
Type: SystemObject
A DateTime value that indicates when the document should be archived and no longer published. To indicate no limit pass DateTime.MinValue or an empty string. This parameter must be possible to cast or convert to the but can be null to use the default value.
marking
Type: SystemString
A short description of the document. This parameter cannot exceed MAX_MARKING_SIZE number of characters. This parameter can be null to use the default value.
bodyProperties
Type: SystemString
The content of the document's BODY tag to be applied on the content created later for the new document. This parameter cannot exceed MAX_BODYPROPERTIES_SIZE number of characters. This parameter can be null to use the default value.
fileExtension
Type: SystemString
The file extension of the document. This parameter cannot exceed MAX_FILE_EXTENSION_SIZE number of characters. This parameter can be null to use the default value.
guoid
Type: SystemString
A unique identifier from a copied document. This parameter must be a valid GUOID or null and is only used by the Content Studio advanced copying functionality.
retFileName
Type: SystemString
Returns the relative filename of the document

Return Value

Type: Int32
The return value is the id of the newly created document.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database.
ArgumentNullExceptionA parameter cannot be null.
ArgumentOutOfRangeExceptionThe file name passed in is reserved
ArgumentExceptionA parameter data exceeded its maximum allowed length.
SqlExceptionAn error occurred when executing the command against the Content Studio database
InvalidOperationExceptionCannot call the SaveContent method for uploaded files
Content Studio permissions

Create/Write permission on the category is required. Additionally, if workflow is applicable, workflow rules will apply as well.
See Also

Reference