1 / 25

Code Tax: Programming With The Taxonomy API In SharePoint 2010

Code Tax: Programming With The Taxonomy API In SharePoint 2010. Patrick Tucker. About Me. Patrick Tucker Strategic Data Systems, MS Gold Partner Principal Consultant, SharePoint MCT, MCTS, MCPD, MCITP, MCSD, MCAD, MCDBA Patrick.Tucker@sds-consulting.com | tuckersnet@live.com

makaio
Download Presentation

Code Tax: Programming With The Taxonomy API In SharePoint 2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 • Patrick.Tucker@sds-consulting.com | tuckersnet@live.com • Blog: www.tuckersnet.com • Twitter: @TuckersNet

  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? • The Taxonomy picker Control • Managed Metadata Columns • 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. 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…

  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 http://sitecollectionUrl/_vti_bin/taxonomyclientservice.asmx • 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 • 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: www.tuckersnet.com • Twitter: @TuckersNet

More Related