DocumentManagerRename Method Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Changes the file name of a document.

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

public string Rename(
	DocumentId documentId,
	string newFileName
)

Parameters

documentId
Type: ContentStudio.DocumentDocumentId
The document id for the document to be renamed. This value must be resolved.
newFileName
Type: SystemString
New name of the file. If this file name contains a file extension, this extension must be allowed according to the AllowedFileExtension of the category. If no extension is specified the default extension is used. If a path is provided the path part is ignored rather that generating an exception.

Return Value

Type: String
The new file path for the document.
Exceptions

ExceptionCondition
ArgumentNullExceptionnewFileName cannot be null.
ArgumentExceptiondocumentId is not resolved.
CSInvalidSessionExceptionThe session is invalid.
CSDocumentNotFoundExceptionThe document does not exist.
CSPermissionDeniedExceptionPermission to the document was denied.
CSExceptionCSExceptions generated
NumberDescription
1018Permission denied. The caller has not the group right needed to save executable content.
1508The name contains invalid characters.
1512The name already exists, choose another name.
1811Failed to save the document. The category is protected.
1820You must check in the document first.
IOExceptionContent Studio cannot write one or more files to the underlying file system.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

APPROVE permission on the document is required.
Remarks

Unlike many other methods that changes data on a document this method does not require the document to be checked out by the caller. If document is checked out by another user the method will fail and a CSException with number 1820 will be thrown.
Note Note
This method is new in Content Studio version 5.2
See Also

Reference