SyncronizedEPTDocumentSave Method (CSDocument) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Saves the content of the document loaded with an option to change or specify document properties. If the document does not exist it will be created, otherwise it will be updated.

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

public virtual void Save(
	CSDocument properties
)

Parameters

properties
Type: ContentStudio.DocumentCSDocument
An instance of a CSDocument class that contains properties of the document to save. This argument can be null (Nothing in Visual Basic) to use default values.
The following CSDocument properties are ignored with this implementation.
  • DocumentName (use the DocumentName property instead
  • Content
  • DocumentID
  • CategoryID
  • FileName
    FileName can be specified in version 5.2 and later when a new document is created for the first time and the DocumentFileNamingConvention property is set to UserDefinedFileName
  • FileExtension
    FileExtension is ignored in version 5.0 only.

The following properties are only taken into consideration when creating new documents

  • ParentDocumentID
  • OrderInHierarchy
  • Guoid
  • FileName (see above for more information).

You only have to set values for the properties in the DocumentProperties object that you would like to change (document update) or supply non-default values for (document creation).

Note Note

The FileExtension property can only be set to one of the extensions that are allowed for EPT documents.
This is a breaking change compared with version 5.0 where the FileExtension was ignored due to the fact that EPT document only could have .xml as file extension.

If you save a document that has a file extension that no longer meets the policies, either the category file extension policy or the global EPT document policy, the document cannot be saved with that extension and a CSException (The document type is not allowed, number 1521) is thrown.

Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
ArgumentOutOfRangeExceptionA value was passed in that lies outside of the acceptable data range.
SqlExceptionAn error occurred when executing the command against the Content Studio database
ArgumentNullExceptionA string parameter was null and the parameter does not accept null values
ArgumentExceptionOccurs when creating a new document: documentName cannot be null or empty
InvalidOperationException Occurs only if schema binding is enabled and ValidateOnSave is false.
The number of fields does not match the number of fields specified in the schema
or
Cannot save. The field "%FieldName%" does not exist in the EPT schema.
XmlSchemaException When schemabound and ValidateOnSave is true and the data set does validate against the Ept schema.
Content Studio permissions

WRITE permission on the document is required.
Remarks

This method does not approve (publish) or check in the document. In addition to the Xml content you can also save document properties with this method by using the properties parameter.

Note Note
The behavior of this method changed in Content Studio 5.2. Prior to version 5.2 Save sends the entire Ept document to the underlying CS API but in version 5.2 only the fields that are changed is sent. The underlying Content Studio API ensures that all fields are saved anyway. This change solves some issues with the Server Side validation that could generate validation errors in some cases even though the field that caused the validation problem was not changed.
See Also

Reference