Click or drag to resize

ISchema Interface


Represents a schema for a page. All pages in the Ingeniux CMS are created from a schema, which defines page structure. However, changes to a schema are not automatically applied to pages created from it. In order for a page's structure to stay in sync with a schema, you must sync it in schema designer.

Namespace:  Ingeniux.CMS
Assembly:  Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.308
Syntax
public interface ISchema : ISchemaWithVersions<ISchemaVersion>, 
	ISchemaWithVersions, ISchemaCommon, IEntity<ISchemaManager>, IEntity, 
	IEntityEvents, ISchemaBasic

The ISchema type exposes the following members.

Properties
  NameDescription
Public propertyArchived
Gets/sets the archived value of this entity
(Inherited from IEntity.)
Public propertyContentUnitsInstantiability
Gets the collection of information on whether a Content Unit can be instantiated, and how many times it can be instantiated.
(Inherited from ISchemaBasic.)
Public propertyCreated
Gets the entity's creation date.
(Inherited from IEntity.)
Public propertyCreationUser
Gets the ID of the User who created this entity.
(Inherited from IEntity.)
Public propertyCurrentVersion
Gets the current version of the this schema
(Inherited from ISchemaWithVersionsT.)
Public propertyCurrentVersionNumber
Gets the current version number of the schema
(Inherited from ISchemaWithVersions.)
Public propertyDrafting
Gets whether the schema is in drafting state. When a schema is in drafting state, it cannot be used for page creation.
(Inherited from ISchemaCommon.)
Public propertyErrors
Gets any errors associated with this schema.
(Inherited from ISchemaBasic.)
Public propertyFriendlyName
Gets and sets the schema's friendly name.
(Inherited from ISchemaCommon.)
Public propertyIcon
Gets and sets the icon of the page to be created with this schema.
(Inherited from ISchemaCommon.)
Public propertyIsComponent
Gets and sets whether this schema is for a component page.
(Inherited from ISchemaBasic.)
Public propertyIsDynamicSitePage
Gets and sets whether the page to be created from this schema is a Dynamic Site Server page or a traditional XSLT page. Dynamic Site Server pages are not required to have stylesheet values.
(Inherited from ISchemaBasic.)
Public propertyLastModified
Gets the date when the entity was most recently modified.
(Inherited from IEntity.)
Public propertyLastModifiedUser
Gets the ID of the User who lasted edited the entity.
(Inherited from IEntity.)
Public propertyManager
Gets the manager that retrieved this entity instance.
(Inherited from IEntityTManager.)
Public propertyOriginPage
Gets the page that updated or created this schema. This page will always be a page with presentations.
(Inherited from ISchemaBasic.)
Public propertyPresentations
Gets the schema's presentations collection, which is applied to all pages created from this schema.
(Inherited from ISchemaBasic.)
Public propertyRootName
Gets and sets the name of the schema's root element.
(Inherited from ISchemaCommon.)
Public propertyRuntimeIndexable
Gets/sets whether the Schema should be indexed at Runtime. This property will instruct the Runtime content indexing system for searches, to include the Schema for indexing or not.
Public propertySchemaSystemSecurity
Gets/sets the access security of the schema.
(Inherited from ISchemaWithVersions.)
Public propertySession
Gets the session that retrieved this entity. An entity is always session-specific.
(Inherited from IEntity.)
Public propertySessionId
Gets the unique ID of the session that retrieved this entity.
(Inherited from IEntity.)
Public propertyStylesheet
Gets and sets the entry XSLT style sheet name, located in the "xml/stylesheets" folder.
(Inherited from ISchemaBasic.)
Public propertyThumbnailRelativePath
Gets and sets the thumbnail image path of the schema to be associated with this schema.
(Inherited from ISchemaWithVersions.)
Public propertyVersioning
Represents the version number of the object
(Inherited from ISchemaCommon.)
Public propertyViewName
Gets and sets the name of this page type's MVC view.
(Inherited from ISchemaBasic.)
Public propertyWorkflowDefinition
Gets and sets the workflow defintion for this schema. If set, pages created with this schema will be added to a workflow based on this defintion right away.
(Inherited from ISchemaCommon.)
Public propertyWorkflowRequired
Gets and sets whether pages created via this schema are added to a workflow after creation. If this property is set to true, the WorkflowDefinition property must be set to a valid workflow definition. Otherwise, validation will fail.
(Inherited from ISchemaCommon.)
Top
Methods
  NameDescription
Public methodAddAllowedRootCategory
Adds a new root category to the allowed root categories collection.
(Inherited from ISchemaCommon.)
Public methodAddDefaultCategory
Adds a new default category.
(Inherited from ISchemaCommon.)
Public methodAddField
Adds a new schema field to the collection, either at the specified position or at the end.
(Inherited from ISchemaCommon.)
Public methodAllowedCategoryRoots
Retrieves the collection of categories. Categories and their descendants in this collection are allowed to be associated with pages created with this schema.
(Inherited from ISchemaCommon.)
Public methodAllowedCategoryRootsCount
Gets the count of allowed root categories.
(Inherited from ISchemaCommon.)
Public methodClearAllowedCategoryRoots
Clears all allowed root categories.
(Inherited from ISchemaCommon.)
Public methodClearDefaultCategories
Clear all default categories.
(Inherited from ISchemaCommon.)
Public methodClearFields
Clears all Fields from the collection.
(Inherited from ISchemaCommon.)
Public methodDefaultCategories
Retrieves the default categories collection for pages created with this schema. When page is created, these categories are automaticaly applied to the page.
(Inherited from ISchemaCommon.)
Public methodDefaultCategoriesCount
Gets the count of default categories.
(Inherited from ISchemaCommon.)
Public methodField(Int32)
Retrieves a schema field by its positional index.
(Inherited from ISchemaCommon.)
Public methodField(String)
Retrieves a schema field by its name.
(Inherited from ISchemaCommon.)
Public methodFields
Gets the collection of fields in this schema.
(Inherited from ISchemaCommon.)
Public methodFieldsCount
Gets the count of fields in this schema.
(Inherited from ISchemaCommon.)
Public methodGetDuplicateFieldUniqueIds
Detects if there are fields in the schema that contain colliding UniqueIds
(Inherited from ISchemaCommon.)
Public methodIsSystemSchema
Checks whether this Schema is an essential schema that comes with default CMS instance.
(Inherited from ISchemaWithVersionsT.)
Public methodRemoveAllowedRootCategory
Removes a category from the the allowed root categories collection.
(Inherited from ISchemaCommon.)
Public methodRemoveDefaultCategory
Removes a default category.
(Inherited from ISchemaCommon.)
Public methodRemoveField
Removes from the collection a schema field at a specified index.
(Inherited from ISchemaCommon.)
Public methodSave
Saves this schema.
(Inherited from ISchemaWithVersions.)
Public methodSetThumbnail
Sets a thumbnail image for this schema
(Inherited from ISchemaWithVersions.)
Public methodTouch
Updated the entity's LastModified value to the current time.
(Inherited from IEntity.)
Public methodUpdateContent
Updates the schema with provided XML content and saves the schema in draft mode. If new content doesn't have a matching root name and friendly name, it will not be accepted.
(Inherited from ISchemaWithVersions.)
Public methodValidateData
Validates this entity's data. Implemented by concrete inheriting types.
(Inherited from IEntity.)
Public methodValidateUserPermission
Validates the user permission on the current entity. Implemented by concrete inheriting types. It is called automatically upon saving an entity.
(Inherited from IEntity.)
Public methodVersion
Retrieves the specific version for this schema
(Inherited from ISchemaWithVersionsT.)
Public methodVersions
Retrieves a collection of version objects belongs to schema
(Inherited from ISchemaWithVersionsT.)
Public methodVersionsCount
Retrieved the number of versions existing for this schema
(Inherited from ISchemaWithVersions.)
Top
Events
  NameDescription
Public eventAfterEntitySave
This event is fired after a Entity object is saved.
(Inherited from IEntityEvents.)
Public eventBeforeEntitySave
This event is fired before any Entity object is about to be saved.
(Inherited from IEntityEvents.)
Top
Examples

Schemas are retrieved by the SchemaByID, SchemaByFriendlyName, and SchemaByRootName methods of the SchemaManager object.

C#
using (IUserSession session = store.OpenReadSession(currentUser))
{
       ISchemaManager schemaManager = session.SchemasManager;
       ISchema detailsSchema = schemaManager.SchemaByFriendlyName("Details");
}

Schemas are created with the CreateSchema or CreateComponentSchema method of the SchemaManager object, or they are imported from XML schema content with the ImportSchema method.

C#
using (IUserSession session = store.OpenWriteSession(currentUser))
{
       ISchemaManager schemaManager = session.SchemasManager;
       ISchema newSchema = schemaManager.CreateSchema("NewsDetails", "News Details", 3, false, true, "News_Details");
}

A schema's serialization output matches schema files in previous-generation CMS content:

XML
<?xml version="1.0" encoding="utf-8"?>
<Schema name="AtoZIndex" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
    <AttributeType dt:type="id" name="ID" required="yes" />
    <AttributeType dt:type="string" name="Name" required="yes" />
    <AttributeType default="8" dt:type="int" name="Icon" />
    <AttributeType default="A to Z Index" dt:type="string" name="FriendlyName" />
    <AttributeType default="true" dt:type="boolean" name="SS" />
    <AttributeType default="default.xsl" dt:type="string" name="DefaultStyleSheet" />
    <AttributeType default="" dt:type="string" name="DefaultCategorization" />
    <AttributeType name="Version" dt:type="int" default="1" />
    <AttributeType name="UniqueID" dt:type="int" default="57" />
    <ElementType content="textOnly" name="Exports" />
    <ElementType content="textOnly" dt:type="string" name="Title" />
    <ElementType content="textOnly" dt:type="string" name="Abstract" />
    <ElementType content="eltOnly" name="xpowergroupstart_SEOGroup" />
    <ElementType content="textOnly" dt:type="string" name="NavName">
      <description>The text used for links in site navigations.  Defaults on page creation to the title.</description>
    </ElementType>
    <ElementType content="textOnly" dt:type="string" name="BrowserBarTitle" />
    <ElementType content="textOnly" dt:type="string" name="MetaDescription" />
    <ElementType content="textOnly" dt:type="string" name="MetaKeywords" />
    <ElementType content="textOnly" dt:type="enumeration" name="Priority" values=".9 .8 .7 .6 .5 .4 .3 .2 .1" />
    <ElementType content="textOnly" dt:type="boolean" name="NoFollow" />
    <ElementType content="textOnly" dt:type="boolean" name="NoIndex" />
    <ElementType content="textOnly" dt:type="boolean" name="NoODP" />
    <ElementType content="eltOnly" name="xpowergroupend" />
    <ElementType content="eltOnly" name="dhtml_BodyCopy" />
    <ElementType content="eltOnly" name="xpowertaxonomynavigation_ExclusionCategory">
      <description>Select a category that will exclude tagged items from the A-Z index</description>
    </ElementType>
    <ElementType content="eltOnly" name="xpowernavigation_AncestorNavigation" />
    <ElementType content="eltOnly" name="xpowercomponent_SiteControl" />
    <ElementType content="eltOnly" name="AtoZIndex" order="seq">
      <attribute type="ID" />
      <attribute type="Name" />
      <element hidden="false" label="Title" readonly="false" required="true" type="Title" />
      <element hidden="false" label="Abstract" readonly="false" required="true" type="Abstract" />
      <element Expanded="false" hidden="true" label="SEO Group" readonly="false" required="false" type="xpowergroupstart_SEOGroup" />
      <element hidden="false" label="Navigation Name" readonly="false" required="false" type="NavName" />
      <element hidden="false" label="Browser Bar Title" readonly="false" required="false" type="BrowserBarTitle" />
      <element hidden="false" label="Meta Description" readonly="false" required="false" type="MetaDescription" />
      <element hidden="false" label="Meta Keywords" readonly="false" required="false" type="MetaKeywords" />
      <element hidden="false" label="Priority" readonly="false" required="false" type="Priority" />
      <element hidden="false" label="No Follow" readonly="false" required="false" type="NoFollow" />
      <element hidden="false" label="No Index" readonly="false" required="false" type="NoIndex" />
      <element hidden="false" label="No ODP" readonly="false" required="false" type="NoODP" />
      <element type="xpowergroupend" />
      <element hidden="false" label="Body Copy" readonly="false" required="false" type="dhtml_BodyCopy" />
      <element Depth="" FilterParentPages="" FilterSchemas="" IncludePages="false" StartNodes="" hidden="false" label="Exclusion Category" readonly="false" required="false" type="xpowertaxonomynavigation_ExclusionCategory" />
      <element Expanded="false" GenerationOrder="down" MaxDepth="" MaxNodes="" Navigation="Ancestors" Query="" StartPage="x2" hidden="true" label="Ancestor Navigation" readonly="true" required="false" type="xpowernavigation_AncestorNavigation" />
      <element CompTypes="SiteControl" Component="x10" hidden="true" label="Site Control" readonly="true" required="false" type="xpowercomponent_SiteControl" />
    </ElementType>
</Schema>
See Also