Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code Tax: Programming With The Taxonomy API In SharePoint 2010

Similar presentations


Presentation on theme: "Code Tax: Programming With The Taxonomy API In SharePoint 2010"— Presentation transcript:

1 Code Tax: Programming With The Taxonomy API In SharePoint 2010
Patrick Tucker

2 About Me Patrick Tucker Strategic Data Systems, MS Gold Partner
Principal Consultant, SharePoint MCT, MCTS, MCPD, MCITP, MCSD, MCAD, MCDBA | Blog:

3 The Managed Metadata Experience
How do we interact with managed metadata in sharepoint?

4 Managed Metadata in SharePoint
A way to do classification of content based on attributes Applies to documents, list items & pages at the column level Assists SharePoint in being a document management & collaboration platform Taxonomy and Folksonomy

5 Where Is Managed Metadata Surfaced?
Managed Metadata Columns The Taxonomy picker Control The Document Information Panel Search

6 Managed Metadata and Taxonomy
Managed Metadata Service Application Taxonomy Term Store Term Sets Managed Metadata Column Type

7 Taxonomy Term Store Available through Managed Metadata Service
Comprised of system or admin created term sets Term sets may be global or local, open or closed Hierarchical Groups contain Term Sets Term sets contain terms Terms may have a default label and other labels (Synonyms)

8 Behind the Scenes Taxonomies are stored in a single database
Each root site in a site collection contains a “TaxonomyHiddenList” The “Taxonomy Update Scheduler” timer job syncs hourly to update this list Taxonomy field values are implemented as lookup columns The “Managed Metadata” Field is actually comprised of multiple columns TaxonomyField TaxKeywordTaxHTField “TaxCatchAll” “TaxCatchAllLabel”

9 Managed Metadata Limitations
Practical Limitations: Not supported in InfoPath forms Not supported in SharePoint Workspace Not supported in Datasheet views Limited Support in SPD Workflows Per TechNet, the recommended storage guidelines are: Max 7 levels of nesting in a term store Max 1000 term sets in a term store Max 30,000 terms in a term set Max 1 million total items in a term store

10 Working with the managed metadata service programmatically
The Taxonomy API Working with the managed metadata service programmatically

11 Options Server side object model (Microsoft.SharePoint.Taxonomy)
Sorry, not available to sandboxed solutions The Taxonomy Client Service Declarative XML PowerShell

12 Object Model Need to Reference Microsoft.SharePoint.Taxonomy DLL
Entry point is a new Taxonomy Session, connects to MMS instance Classes in Taxonomy Namespace mirror Hierarchy Seen in Term Store Management Tool TaxonomySession class TermStore class (takes name of MMS Proxy) Group class TermSet class Term class (may contain nested terms)

13 So The Hierarchy Is… MMS Instance Term Store Groups Term Sets Terms

14 Terms, Keywords and Synonyms
Terms are either managed terms or enterprise keywords Each Term may be marked as available for tagging Each term has a default label Synonyms are added under the “Other Labels” section Synonyms are exposed in code through a labels collection on each term. The default label is the first term in the collection.

15 Creating New Term Store Items In Code
Get a reference to session Term Store The termStore class contains a CreateGroup method The Group class contains a CreateTermSet method The TermSet class contains a create term method Tips to Remember . . . Adding items to the term store is transactional. We must remember to call “CommitAll()”

16 DEMO Traverse the hierarchy of groups, Term Sets and Terms
Display the hierarchy in a tree view control via a custom web part Create a new group, term set and terms programmatically Retrieve and display the newly created terms

17 The Taxonomy Client Service
The taxonomyclientservice.svc is available, but limited Operations to retrieve term store items and add terms are available

18 Taxonomy Client Service
Navigate to Do you know the Guids of your term store and term Set? XML parsing is in your future

19 The Taxonomy Field Type
Custom list definitions will need to create the field – Declaratively or programmatically (or both) This field is exposed in the UI via the taxonomy picker control Page layouts may also make use of this field type to tag pages as well as items and documents

20 Implementing a Taxonomy Field in a Custom List
Create site columns (taxonomy & note field) Create content type and reference the columns Link the taxonomy field up to a term set Declarative approach Will need sspID and term set Guids in XML Programmatic approach also works with partial declarative code

21 Setting Taxonomy Field Values
Allows the user to select term(s) to tag content The control shows up on new and edit forms The control may be used on custom page layouts

22 DEMO Use the taxonomy web service to display term store items
Create a custom list definition that contains a managed metadata column Set a taxonomy field value for a list item in code

23 The Undiscovered Country
What’s new with managed metadata in SharePoint 2013?

24 So What’s Changed in 2013? Managed Metadata Navigation
Terms intended use may be for navigation Target pages are attached to terms and drive the navigation of the site CSOM – Client Side Object Model Support Available to .NET, Silverlight and JavaScript Projects may reference the Microsoft.SharePoint.Client.Taxonomy assembly Datasheet view support for the managed metadata column type Custom properties may be added to a term to store additional Data More than just additional labels, this is a dictionary of metadata for your metadata Exposed in the Taxonomy Term Store management UI and in code

25 Q and A Patrick.Tucker@sds-consulting.com | tuckersnet@live.com
Blog:


Download ppt "Code Tax: Programming With The Taxonomy API In SharePoint 2010"

Similar presentations


Ads by Google