SharePoint 2010 ECM Code Sample: Generate Managed Metadata Hierarchy

SharePoint 2010

Use this SharePoint 2010 code sample to generate the path of the taxonomy from a specified term up to its parent.

Last modified: April 20, 2011

Applies to: SharePoint Server 2010

The Generate Managed Metadata Hierarchy code sample is located in the file in the path C:\Program Files\Microsoft SDKs\SharePoint 2010\Samples, and demonstrates how to generate a managed metadata hierarchy.

Download the SharePoint 2010 sample code described in this topic from Code Gallery.

Test this project on your development site or test site.

Building the Sample

  1. In Microsoft Visual Studio 2010, open the *.sln file.

  2. On the Properties pane, change the Site URL value to be the absolute address of your development test site. For example, http://MyDevServer/. Ensure that you include the closing forward slash.

Running the Sample

This code sample generates the taxonomy path for a term up to the parent. It is based on getting the property from a field that is set on a document set, but you can use it for other scenarios.

Note Note

The sample assumes that the hierarchy is no more than 10 terms deep and that the term is used only in one term set.