CategoryManagerCreate Method (ConnectionId, SessionId, DocumentTypes, String, CategoryId, UnitId, Boolean, Boolean, DocumentId, DocumentId, String, String, String, CategoryManagerUseMetaSecurity, DocumentId, String, NullableInt32, String) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Creates a category in Content Studio and in the underlying file system.

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

public int Create(
	ConnectionId connectionId,
	SessionId sessionId,
	DocumentTypes documentType,
	string categoryName,
	CategoryId parentCategoryId,
	UnitId unitId,
	bool searchable,
	bool useServersideValidation,
	DocumentId startDocumentId,
	DocumentId defaultTemplateId,
	string bodyProperties,
	string description,
	string guoid,
	CategoryManagerUseMetaSecurity useMetaSecurity,
	DocumentId editTemplateId,
	string customViewUrl,
	Nullable<int> maxContentSize,
	string[] allowedFileTypes


Type: ContentStudioConnectionId
A value that identifies the web site
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
Type: ContentStudio.DocumentDocumentTypes
The document type of the category. Document types can be saved but this is generally not recommended. If you set the document type to None an error occurs.
Type: SystemString
The name of the category. This parameter cannot be empty.
Type: ContentStudio.DocumentCategoryId
The parent category that should act as a parent of the new category. This parameter can be zero if there is no parent category in this case the UnitID parameter must be a valid unit.
Type: ContentStudio.DocumentUnitId
An existing unit that will host the category. If a ParentCategory has been specified this parameter is ignored and can be set to zero.
Type: SystemBoolean
Indicates that the category can be used in unit-wide full-text search operations.
Type: SystemBoolean
Set this parameter to true to use the built in server side validation of EPT-data.
Type: ContentStudio.DocumentDocumentId
The document that is used as start document of the Category. This parameter can be zero if the category does not have any start document.
Type: ContentStudio.DocumentDocumentId
This is the template document that acts as the default template of the category. This parameter can be zero if no template exists.
Type: SystemString
Data that will be placed in the body tag of the containing documents. The parameter cannot exceed MAX_BODYPROPERTIES_SIZE characters in length but can be null to use the default value which is an empty string.
Type: SystemString
A short string description of the category. This parameter cannot exceed MAX_DESCRIPTION_SIZE characters in length but can be null to use the default value which is an empty string.
Type: SystemString
A unique identifier from a copied category. This parameter must be a valid GUOID or null and is only used by the Content Studio advanced copying functionality.
Type: ContentStudio.DocumentCategoryManagerUseMetaSecurity
Set to true to use meta data security with this category. False turns off this functionality
Type: ContentStudio.DocumentDocumentId
If the document is an ept-document EditTemplateId must be supplied. Otherwise set to 0
Type: SystemString
Defines a custom view to use in cs-admin
Type: SystemNullableInt32
Defines (in bytes) the maximum allowed content size of a document, zero indicates no limit. Pass null to use the default value (zero). This parameter cannot be negative.
Type: SystemString
Defines an array of file extensions that can be used for documents in this category. The file extension must start with a period (.). Use the value *. to allow any file extension. If any of the entries contains .* all other items will be discarded. This parameter cannot be an empty array and at least one array member must contain a valid file extension or be empty. This parameter can be null (Nothing in Visual Basic) to use the default value (.*). Internally this array is joined to a comma delimited string of file extensions and the size of this inter value cannot exceed MAX_ALLOWED_FILETYPES_SIZE number of characters, thus always keep in mind the extra comma added to each file extension when checking the text length of all elements in the array.
For categories that stores EPT documents, this value is always set to a hard coded value since only the .xml and .ept extensions are allowed.

Return Value

Type: Int32
The id of the category created.

CSExceptionA business rule was violated in the underlying Content Studio database
SqlExceptionAn error occurred when executing the command against the Content Studio database
ArgumentOutOfRangeExceptionA value was passed in that lies outside of the acceptable data range.
Content Studio permissions

Create Container permission on the parent container is required to create a category.

This method was introduced in Content Studio version 5.1
See Also