Content item types
This section describes how the various types of content items in Content Manager relate to one another.
The following diagram shows the various items in the Content Manager:
The content items are used in several namespaces in the TOM.NET API—use the classes and methods in the TOM.NET API to navigate through the content structure and access these objects:
Tridion.ContentManager.AudienceManagement-
The
Tridion.ContentManager.AudienceManagementnamespace contains theTargetGroupclass.
Tridion.ContentManager.CommunicationManagement-
The
Tridion.ContentManager.CommunicationManagementnamespace contains the following classes:ComponentTemplatePagePageTemplatePublicationStructureGroupTemplateBuildingBlock
Tridion.ContentManager.ContentManagement-
The
Tridion.ContentManager.ContentManagementnamespace contains the following classes:CategoryComponent(includes Multimedia Components)FolderKeywordSchemaVirtualFolder
TOM.NET example
In the following templating example, to identify which Schema is used by the first Component that resides in the root Folder of a specific Publication (identified in this sample by the unique identifier publicationURI), you would write the following templating code:
// Define a filter to return only Components.
OrganizationalItemItemsFilter filter = new OrganizationalItemItemsFilter(engine.GetSession());
filter.ItemTypes = new ItemType[] { ItemType.Component };
// Get the Publication identified by publicationURI.
Publication publication = (Publication) engine.GetSession().GetObject(publicationURI);
// Get the list of Components in the root Folder of the Publication.
IEnumerable<RepositoryLocalObject> list = publication.RootFolder.GetItems(filter);
Component component = (Component)list.First();
// Get the Schema of the first Component in that list.
Schema schema = component.Schema;
This templating code breaks down as follows:
engine.GetSession()returns the TOM.NET entry pointGetObject(publicationURI)accesses a specific Publication by URI (Universal Resource Identifier, a unique identifier for this Content Manager item)RootFolderaccesses the root folder of this PublicationGetItems(filter)gets all content items in this Folder that satisfy the filter (which has been set up to retrieve only Components).list.Firstgets the first of these Componentscomponent.Schemagets the Schema on which this Component is based
Note that the Schema you retrieve may not reside in the same Folder as the Component that uses it.