SchemaFieldCollection Class Content Studio 5.7 SDK
Content Studio Web Content Management System

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

This class implements a collection of fields in a Content Studio EPT schema. It also facilitates the work with EPT schemas in Content Studio.
Inheritance Hierarchy

SystemObject
  ContentStudio.Document.EPTSchemaFieldCollection

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

public sealed class SchemaFieldCollection : IEnumerable

The SchemaFieldCollection type exposes the following members.

Constructors

  NameDescription
Public methodSchemaFieldCollection
Loads the schema for the actual category.
Top
Properties

  NameDescription
Public propertyCount
Returns the number of schema field names in the collection.
Public propertyEditTemplate
Gets the identifier of the edit template that defines the schema.
Public propertyEditTemplateCategory
Gets the identifier of the category where the edit template that defines the schema is located.
Public propertyEPTDocumentCategory
Gets the identifier of the category where the schema is used.
Public propertyItem
Gets a field at a specified location
Public propertySchemaXml
Returns the underlying Xml Schema as Xml.
Top
Methods

  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodIsSchemaField
Gets a value that indicates whether the field exists in the schema or not.
Public methodToString (Inherited from Object.)
Top
Examples

The following code snippet obtains the Xml schema for an EPT document category and displays its fields and the schema itself. (It is assumed to be executed on a Content Studio aspx page)

C#
int EPTCategory = 168; //This category must be an EPT document category

ContentStudio.Document.EPT.SchemaFieldCollection shmacoll = 
   new ContentStudio.Document.EPT.SchemaFieldCollection(CS_ConnectionId, CS_UserSessionId, EPTCategory);
//Write a list of the schema fields
Response.Write ("<ul>");
foreach(string S in shmacoll)
   Response.Write ("<li>" + S + "</li>");
Response.Write ("</ul><br />");
//Write the schema as well
Response.Write (Server.HtmlEncode(shmacoll.SchemaXml));
Visual Basic
Dim EPTCategory As Integer = 168 'This category must be an EPT document category
Dim shmacoll As New _ 
     ContentStudio.Document.EPT.SchemaFieldCollection(CS_ConnectionId, CS_UserSessionId, EPTCategory)
'Write a list of the schema fields
Response.Write ("<ul>")
For Each  S As String In shmacoll
   Response.Write ("<li>" & S & "</li>")
Next
Response.Write ("</ul><br />")
'Write the schema as well
Response.Write (Server.HtmlEncode(shmacoll.SchemaXml))
See Also

Reference