UnitManagerCreate Method (ConnectionId, SessionId, String, DocumentId, 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 unit 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)
Syntax

public int Create(
	ConnectionId connectionId,
	SessionId sessionId,
	string unitName,
	DocumentId startId,
	string metaData,
	string description,
	string telephoneNumber,
	string faxNumber,
	string address,
	string zipCode,
	string city,
	string email,
	string guoid
)

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).
unitName
Type: SystemString
The name of the unit to create. This value cannot be empty or exceed MAX_NAME_SIZE characters in length. Additionally it cannot contain restricted characters or names such as names that are forbidden in the file system like COM1 or NUL or names indicating special folders in ASP.NET.
startId
Type: ContentStudio.DocumentDocumentId
The document that is used as start document of the unit. This parameter is zero if the unit has no start document
metaData
Type: SystemString
Meta data that should be included with every document in the unit. This parameter cannot exceed MAX_METADATA_SIZE characters in length. Pass null if you wish to use the default value.
description
Type: SystemString
A short description of the unit. This parameter cannot exceed MAX_DESCRIPTION_SIZE characters in length. Pass null if you wish to use the default value.
telephoneNumber
Type: SystemString
A string representing the unit's telephone number. This parameter cannot exceed MAX_TELEPHONE_SIZE characters in length. Pass null if you wish to use the default value.
faxNumber
Type: SystemString
A string representing the unit's fax number. This parameter cannot exceed MAX_FAXNUMBER_SIZE characters in length. Pass null if you wish to use the default value.
address
Type: SystemString
A string representing the unit's address. This parameter cannot exceed MAX_ADDRESS_SIZE characters in length. Pass null if you wish to use the default value.
zipCode
Type: SystemString
A string representing the unit's zip code. This parameter cannot exceed MAX_ZIPCODE_SIZE characters in length. Pass null if you wish to use the default value.
city
Type: SystemString
A string representing the unit's city. This parameter cannot exceed MAX_CITY_SIZE characters in length. Pass null if you wish to use the default value.
email
Type: SystemString
A string representing the unit's email. This parameter cannot exceed MAX_EMAIL_SIZE characters in length. Pass null if you wish to use the default value.
guoid
Type: SystemString
A unique identifier from a copied unit. This parameter must be a valid GUOID or null and is only used by the Content Studio advanced copying functionality.

Return Value

Type: Int32
The identifier of the newly created unit.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
SqlExceptionAn error occurred when executing the command against the Content Studio database
ArgumentExceptionA parameter has a value that exceeds the maximum allowed size - or - The UnitName parameter is empty - or - The Guoid parameter is not null and is not a valid GUOID.
Content Studio permissions

CreateContainer permission on the site root is required.
See Also

Reference