Code samples for SDC2010 session on SharePoint 2010 development
In this zip file you can find the sample code of the demo’s that Ton Stegeman and I did (weblog and Twitter) It is 1 Visual Studio solution that contains these projects:
- Sample for creating a managed metadata field from a feature. Associate the managed metadata column to a content type. Attach the content type to a list.
- Sample Powershell script for importing a termset
- Web part that does a search query for a managed metadata field. Sample allows you to find content using specific terms, or content using the selected term and all underlying terms in the hierarchy.
- Web part contains an example of the query object model and the new federated search object model.
- Code sample that shows you how to create a search query for a social tag. This way you can run search queries and find content that are tagged by users using “I like it” or SharePoint labels.
- Code sample to set the default value of a managed metadata field to a specific term. The sample sets the default value of a termstore field on a list.
- This code sample shows you how to set a value of a managed metadata field for a listitem to a specific term.
- This sample application creates a CAML query to query a list and find all items that have the same term as the specified term. It also has the option to find all items that have either the same term or any of the terms lower in the hierarchy.
The slides for the session can also be downloaded.
Enjoy, Donald and Ton