DocTypeManagerGetForObject Method (ConnectionId, SessionId, Int32, CSFileObjectTypes, Int32) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Returns the doctype in use by a either a document a category, unit or the site root.

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

public string GetForObject(
	ConnectionId connectionId,
	SessionId sessionId,
	int objectId,
	CSFileObjectTypes objectType,
	int versionNumber
)

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).
objectId
Type: SystemInt32
An identifier to the object to return.
objectType
Type: ContentStudio.DocumentCSFileObjectTypes
The type of object indicated by the parameter.
versionNumber
Type: SystemInt32
Indicates the version number of the document. Ignored unless objectType is Document. Use the following values to determine what document version to read the doctype for:
ValueMeaning
less than -2Fails with an ArgumentOutOfRangeException.
-2Read the current draft or if not found the current approved version.
-1Read the current draft.
0Read the approved document.
greater than 0Read the version with this specific version number.

Return Value

Type: String
Xml
Examples

<root>
  <status>0 </status>
  <statustext>Success</statustext>
  <data>
    <doctype id="integer value"
             inherited="bit value"
             inheritedfrom="string value"
             name="string value"
             declaration="string value" />
    </data>
</root>
Element/attributeTypeDescription
/root/statusinteger valueindicates the outcome of the call, always 0 (meaning success)
/root/statustextstring valuethe textual representation of the outcome, always Success
/root/data/doctypeRoot element for the returned document type declaration
/root/data/doctype@idintegerthe id of the document type declaration
/root/data/doctype@inheritedbit (0 / 1)Indicates whether the document type declaration has been inherited from a parent object.
/root/data/doctype@inheritedfromstringWhen inherited; the name of the object that defines the doctype; otherwise, empty
/root/data/doctype@namestringthe name of the doc type e.g. XHTML 1.0 Transitional
/root/data/doctype@declarationstringThe actual document type declaration in use, e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Exceptions

Content Studio permissions

Read permission is required on the objects in question.
Remarks

This method was added in CS 5.4 to enable reading doctype of previous versions of a document.

Remarks

When objectId represents a document, the returned value is the doctype used by this document. For containers (categories, units and the site root) the returned value represents the doctype that containing documents will have.
See Also

Reference