Metadata and Taxonomy Programming Model in SharePoint Server 2010 (ECM)

Applies to: SharePoint Server 2010

This topic introduces the managed metadata programming model. For a complete list of the types available in each namespace, click the link to that namespace.

Namespaces

This section introduces the namespaces in the enterprise metadata management API.

Table 1. Namespaces

Namespace

Description

Microsoft.SharePoint.Taxonomy

Includes classes that provide the basic functionality provided by enterprise metadata management. Examples include types for managing terms, term sets, groups, and keywords.

Microsoft.SharePoint.Taxonomy.ContentTypeSync

Includes classes that manage the synchronization of content types between site collections.

Microsoft.SharePoint.Taxonomy.Generic

Includes classes for collections of generic metadata items.

Microsoft.SharePoint.Taxonomy.WebServices

Includes classes for the Web services used to manage taxonomies in rich-client applications and Web-client applications.

Types

This section introduces the most notable types in the enterprise metadata management API.

Table 2. Notable Microsoft.SharePoint.Taxonomy types

Type

Description

ChangedGroup

Represents a change that happened to a Group object.

ChangedItem

Represents one change to the TermStore object.

ChangedItemCollection

Represents a collection of ChangedItem objects.

ChangedItemType

Represents the type of changed object.

ChangedOperationType

Indicates the type of operation that caused a change.

ChangedTerm

Indicates a change that happened to a Term object.

ChangedTermSet

Indicates a change that happened to a TermSet object.

ChangedTermStore

Represents the changed version of a TermStore object.

Group

Represents the top-level container in a TermStore object.

GroupCollection

A collection of Group objects.

HiddenListFullSyncJobDefinition

Defines the timer job responsible for keeping the list that TaxonomyField objects use for lookup current.

ImportManager

Used to import individual TermSet instances into a Group.

Note

The data for the import is specified in a *.csv that must follow a well known format.This class can be retrieved from the method GetImportManager().This is a useful class for bootstrapping a TermStore with individual term sets, but for more complex data it is recommended that the writable APIs for Group, TermSet and Term be used to import data.

Label

Represents the name of a Term object in a specific language. Aterm can have one or more labels in the default language, and zero or more labels in the non-default language. If the term has labels in a language, one of the labels must be the default label.

LabelCollection

Represents a collection of Label objects.

StringMatchOption

Indicates what type of string matching should be performed when comparing strings.

TaxonomyField

Represents a taxonomy field. The TaxonomyField class is a custom field class that inherits from the SPFieldLookup class. If you set the properties of the TaxonomyField class, call the Update() method for changes to take effect in the database. The TaxonomyFieldValue class contains the field value for the TaxonomyField class.Either the TaxonomyFieldControl object or the TaxonomyWebTaggingControl object server controls can render a TaxonomyField object.

TaxonomyFieldControl

Provides the edit experience for a TaxonomyField object.

TaxonomyFieldEditor

Represents the CodeBehind for the create new column editing page when a managed metadata column is created.

TaxonomyFieldValue

Represents a single value held in a TaxonomyField object.

TaxonomyFieldValueCollection

Represents the multi-value object for the taxonomy column.

TaxonomyItem

The TaxonomyItem class is a base class that represents an item in the term store.

TaxonomyRights

Represents a bitmask identifying the taxonomy permissions.

TaxonomySession

Wraps up all of the associated TermStore objects for a SPSite object.

TaxonomyWebTaggingControl

Represents a generic Web control for picking managed metadata terms.

Term

Represents a Term or a Keyword in a managed metadata hierarchy.

TermCollection

Represents collection of Term objects.

TermSet

Represents a hierarchical or flat set of Term objects known as a "TermSet".

TermSetCollection

Represents a collection of TermSet objects.

TermSetItem

Provides an abstraction of the TaxonomyItem object that is a parent of Term objects.

TermStore

Represents a store that contains metadata within child Group objects, TermSet objects, and Term objects.

TermStoreCollection

Represents a collection of TermStore objects.

TreeControl

Constructs a JSON representation of the data source and initializes an instance of the client tree control.

Table 3. Notable Microsoft.SharePoint.Taxonomy.ContentTypeSync types

Type

Description

ContentTypePublisher

Publishes or unpublishes a content type on the hub site. After a managed metadata service application and its proxy are provisioned and a site has been designated as the hub on the service application, use this class to publish or unpublish the content types on the hub site.

ContentTypeSyndicationException

Represents an exception that happens during content type syndication.

SyndicationStatus

Indicates the current stage of the content type syndication process.

Table 4. Notable Microsoft.SharePoint.Taxonomy.Generic types

Type

Description

GenericCollection<T>

The GenericCollection class for all public generic collections.

IndexedCollection<T>

Represents a generic abstract base class collection with support for containing items which require integer, string and GUID indexers.

PropertyCollection<T>

A generic abstract base class collection with support for containing items that are complex property types such as Label.

ReadOnlyDictionary<TKey, TValue>

Represents a read-only collection of keys and values.

TaxonomyItemCollection<T>

Represents a generic abstract base class collection with support for containing taxonomy items such as the Group object and the Term object.

Table 5. Notable Microsoft.SharePoint.Taxonomy.WebServices types

Type

Description

TaxonomyClientService

Provides the Web service methods needed for a client application to host a managed metadata control.

This Web service enables a client to interact with the managed metadata TermStore object and get the data through label matching, per T:Microsoft.SharePoint.Taxonomy.TermSet, or by GUID. Updates to the TermStore can also be made by adding a new Term object.

See Also

Tasks

How to: Customize Content Type Syndication in SharePoint Server 2010 (ECM)

Concepts

Managing Enterprise Metadata in SharePoint Server 2010 (ECM)

Enterprise Content Management (ECM) Code Samples for SharePoint Server 2010

SharePoint 2010 ECM Code Sample: Managing Managed Metadata Dependencies

SharePoint 2010 ECM Code Sample: Content Type Based Metadata

Querying on Managed Metadata Field Values in SharePoint Server 2010 (ECM)

Rich Media Programming Model in SharePoint Server 2010 (ECM)

Document Management Programming Model in SharePoint Server 2010 (ECM)

Records Management Programming Model in SharePoint Server 2010 (ECM)

Publishing Programming Model in SharePoint Server 2010 (ECM)