EPTSchemaGetCategoryEPTSchemaXML Method (ConnectionId, SessionId, XMLSchemaTypes, Int32, Boolean) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Returns the Xml schema used by an edit template from an Ept document or category.

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

public string GetCategoryEPTSchemaXML(
	ConnectionId connectionId,
	SessionId sessionId,
	XMLSchemaTypes schema,
	int objectId,
	bool isCategory
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that uniquely 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).
schema
Type: ContentStudioXMLSchemaTypes
The type of schema to obtain.
objectId
Type: SystemInt32

The object id. This value represents either a category or a document.

isCategory
Type: SystemBoolean

A value that indicates whether objectId represents a category (true or a document (false).

Return Value

Type: String
A schema that describes the ept schema used by the ept documents. Depending on the value of the schema parameter the returned schema can be one either the Xdr-format or in the standard Xsd-schema format. Developers that validates ept-documents using the returned schema should use the Xsd-format rather than the deprecated Xdr format. Content Studio uses the Xdr format with legacy extensions internally to store validation rules and should for that reason not be used.
Examples

The following small ept-document generates the Xsd-schema below.

<?xml version="1.0" encoding="utf-8"?>
<CSEPT>
  <CSRecord>
    <data1>Value 1</data1>
    <data2>Value 2</data2>
    <data3/>
  </CSRecord>
</CSEPT>
<xs:schema attributeFormDefault="unqualified" 
           elementFormDefault="qualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="CSEPT">
     <xs:complexType>
        <xs:sequence>
           <xs:element name="CSRecord">
             <xs:complexType mixed="true">
                <xs:choice maxOccurs="unbounded">
                   <xs:element name="data1" type="xs:string" default="Value 1"/>
                   <xs:element name="data2" type="xs:string" default="Value 2"/>
                   <xs:element name="data3" type="xs:string" />
                </xs:choice>
             </xs:complexType>
           </xs:element>
        </xs:sequence>
     </xs:complexType>
  </xs:element>
</xs:schema>
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
InvalidOperationExceptionThere is no schema of the requested type for the edit template (id=NN). Please save and approve the edit template to synchronize the schema.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

READ or BROWSE permission on the edit template is required.
Remarks

Note Note
Although this method can return an Xdr schema, external callers using this schema are strongly encouraged to use the Xsd schema instead.

This method is the preferred method to use when reading an ept schema since it does not require the caller to first find the Editing template identifier.

This method was added in CS 5.2

When objectId represents a document this document must be either an Ept document or an Ept Editing template.

When objectId represents a category this category must be of the Ept document type.

All other document or category types generates a CSException of type 1106 - "Invalid object type"

See Also

Reference