DocumentManagerCreate Method (ConnectionId, SessionId, DocumentId, CategoryId, DocumentId, Int32, String, NullableBoolean, NullableDateTime, NullableDateTime, String, String, String, String, String, String, String, String, 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. 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 Create(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentId parentDocumentId,
	CategoryId categoryId,
	DocumentId editTemplateId,
	int orderInHierarchy,
	string documentName,
	Nullable<bool> published,
	Nullable<DateTime> publishDate,
	Nullable<DateTime> archiveDate,
	string marking,
	string bodyProperties,
	string guoid,
	string content,
	string introduction,
	string headerData,
	string keywords,
	string menuData,
	string menuTarget,
	string menuUrl,
	string virtualPath,
	string originalFileName,
	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 will have 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. This parameter should be zero to let Content Studio decide the order.
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: SystemNullableBoolean
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: SystemNullableDateTime
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 datatype but can be null to use the default value.
archiveDate
Type: SystemNullableDateTime
A DateTime value that indicates when the document should be archived and no longer published. To indicate no limit pass DateTime.MinValue. 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. This parameter cannot exceed MAX_BODYPROPERTIES_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.
content
Type: SystemString
The document content to save. This parameter can be null to use the default value.
introduction
Type: SystemString
The introduction content. This parameter can be null to use the default value. Besides being an introduction for a regular document this field is used by Active Scripting components to save their parameter Xml data.
headerData
Type: SystemString
The header data. This data will form the HEAD element in HTML documents and must be valid according to the actual schema rules for that element. This parameter can be null to use the default value.
keywords
Type: SystemString
A list of keywords for the document. This value cannot exceed MAX_KEYWORD_SIZE characters in length. This parameter can be null to use the default value.
menuData
Type: SystemString
User defined data for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_DATA_SIZE characters in length. This parameter can be null to use the default value.
menuTarget
Type: SystemString
User defined target for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_TARGET_SIZE characters in length. This parameter can be null to use the default value.
menuUrl
Type: SystemString
User defined url data for menu items. Only applicable if the document acts as a menu node. This value cannot exceed MAX_MENU_URL_SIZE characters in length. This parameter can be null to use the default value.
virtualPath
Type: SystemString
The virtual path for this document. The virtual path must be unique on each site.
originalFileName
Type: SystemString
The original file name of the document. This parameter cannot exceed MAX_FILE_NAME_SIZE number of characters. This parameter can be null to leave the value as is.
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