• Save
SharePoint 2010 Managed Metadata
Upcoming SlideShare
Loading in...5
×
 

SharePoint 2010 Managed Metadata

on

  • 13,130 views

SharePoint 2010 Managed Metadata, presented by Nick Hobbs at Capgemini UK, 2nd May 2012. ...

SharePoint 2010 Managed Metadata, presented by Nick Hobbs at Capgemini UK, 2nd May 2012.

Please note, the presentation included a live demo showing how to use Managed Metadata via the UI. This obviously cannot be included in the slides.

These are the topics discussed:

- What is Managed Metadata?
- Why use it?
- How can I use Managed Metadata via the UI?
- How does it work behind-the-scenes?
- How can I use it programmatically?
- What problems and limitations are there?

Statistics

Views

Total Views
13,130
Views on SlideShare
7,769
Embed Views
5,361

Actions

Likes
2
Downloads
0
Comments
0

8 Embeds 5,361

http://nickhobbs.wordpress.com 5152
https://nickhobbs.wordpress.com 184
http://www.linkedin.com 12
http://webcache.googleusercontent.com 4
https://www.linkedin.com 4
http://translate.googleusercontent.com 3
http://g2m1 1
http://www.sharepointanalysthq.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Microsoft have provided a good overview of Managed Metadata, so I will use some of their notes and I have added to them.A link to Microsoft’s overview of Managed Metadata will be provided at the end:http://technet.microsoft.com/en-us/library/ee424402.aspx
  • Groups - Only users who are designated as contributors to a specific group can manage term sets that belong to the group or create new term sets within it.
  • Local term setsare created within the context of a site collection. For example, if you add a column to a list in a document library, and create a new term set to bind the column to, the new term set is local to the site collection that contains the document library.Global term setsare created outside the context of a site collection, in a centrally managed term store. For example, the term store administrator could create a term set group called "Human Resources" and designate a person to manage the term set group. The group manager would create term sets that relate to Human Resources, such as job titles and pay grades in the Human Resources term set group.Users can see only global term sets and term sets that are local to the user's site collection.
  • DemoShow Term Store Management ToolSelect Managed Metadata ServiceTerm Store AdministratorsCreate GroupGroup Managers & Group Contributors define permissions.Create Global Term SetTerm Set Owner, Stakeholder, and Contact are only "informational" and do not define permissions.Create TermAvailable for TaggingShow existing tagsHierarchy (Team)Reused terms (Country & Location)Deprecated term (Group B, Term Set C, Term E)Create Document LibraryCreate new field – Protective Marking – using term set Protective MarkingCreate new field – create local term set – Document Type (Specification, Proposal, Invoice)Note: Submission policy by default allows users to add terms to the term set.Show setting up and using Enterprise Keywords.Show how to add existing fieldEnterprise Metadata and Keywords Settings Upload document and choose Terms & Enterprise KeywordsTurn on Metadata driven navigationShow Navigation HierarchiesShow Key Filters
  • Additional points It seems that Managed Metadata in the Sandbox is very limited and has to be setup manually.At the SharePoint Conference one MVP suggested the sandbox can only use local term sets, although documentation suggests global term sets are possible with these limitations.

SharePoint 2010 Managed Metadata SharePoint 2010 Managed Metadata Presentation Transcript

  • Managed Metadata By Nick Hobbs 2nd May 2012Principal SharePoint Developer, Capgemini UK www.nickhobbs.net
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 2 Agenda What is Managed Metadata? Why use it? How can I use Managed Metadata via the UI? How does it work behind-the-scenes? How can I use it programmatically? What problems and limitations are there? Questions?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 3What is Managed Metadata?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 4 What is Managed Metadata? A hierarchical collection of centrally managed terms that you can define, and then use as attributes for list items. Available only in SharePoint Server 2010 not in Foundation 2010. A term is a word or a phrase that can be associated with an item. A term set is a collection of related terms. A column can be specified to contain a term from a specific term set. A group is a set of term sets that all share common security requirements. Managed Metadata refers to the fact that terms and term sets can be created and managed independently from the columns.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 5 Local vs Global Term Sets Local term sets are created within the context of a site collection. Global term sets are created outside the context of a site collection, in a centrally managed term store. Users can see only global term sets and term sets that are local to the users site collection.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 6 Enterprise Keywords Enterprise Keywords is a predefined column which can be added to a list or directly onto content types. Similar to other taxonomy fields, but uses the Enterprise Keywords control. Allows multiple values by default. Allows Enterprise Keywords and Managed Terms to be selected. All enterprise keywords are part of a single, non-hierarchical term set called ‘Keywords’.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 7 Term Store Management Tool The Term Store Management Tool is used to manage the term store. With the appropriate permissions, you can use this tool to:  Add, modify, or delete – Groups, Term Sets, Terms.  Arrange terms within a term set into a hierarchy.  Create synonyms of terms.  Specify language variants for each term.  Reuse/share terms with other term sets.  Deprecate terms.  Import terms (CSV).  Convert enterprise keywords into managed terms, moving them into a term set.  Grant permissions on groups of term sets. It is found via Central Administration, and also in Site Settings.
  • Nick Hobbs 2 May 2012Managed Metadata www.nickhobbs.net Page 8Term Store Management Tool
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 9Why use it?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 10 Why use it? Enables enterprise-wide reuse. No need to create and sync lookup lists in every site collection, or embed all values in choice fields. Hierarchical terms – select from a hierarchy, and optionally show the full path when the value is displayed. Metadata driven navigation on document libraries  Navigation Hierarchies  Key Filters Term set management can be controlled with permissions independently of the sites in which they are used (for centrally managed terms).
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 11 Why use it? More consistent use of terminology:  Easier to build robust processes and solutions that rely on metadata.  Improved search results.  Search refinement panel. Dynamic. Values are not written into the field definition, unlike e.g. choice fields. Increased flexibility. Term Store Administrators and contributors can maintain and adapt metadata as business needs evolve. Changes automatically synchronise to all columns that use them. Multi-lingual labels can be specified for terms on multi-lingual sites. Reusable content types (Content Type Hub) bind to the same term sets everywhere, or to different term sets in each site collection.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 12How can I use Managed Metadata viathe UI?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 13How can I use Managed Metadata via the UI?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 14How does it work behind-the-scenes?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 15 How does it work behind-the-scenes? A Taxonomy Field is a lookup field derived from SPFieldLookup and looks up from: TaxonomyHiddenList  An instance in each site collection.  Used as the lookup list for all Taxonomy Fields in the site collection.  Contains all terms used in the site collection.  The list item id (integer) for the term is known as WSS ID, and is therefore unique only to terms used in the site collection.  Located in the site collection at /Lists/TaxonomyHiddenList.  The list ID can be found as a property on the web taxonomyhiddenlist.  Viewing a taxonomy field value gets the language-specific label (or path) of the term from the TaxonomyHiddenList.  Editing a taxonomy field value queries the term store directly for all terms.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 16 How does it work behind-the-scenes? Taxonomy Update Scheduler runs hourly, pushing down term store changes to the hidden lists, automatically updating taxonomy field values in all lists as they lookup against the TaxonomyHiddenList. The Taxonomy Field Value consists of: {wssid};#{label}|{termguid} A Managed Metadata field is actually comprised of 2 fields:  A Taxonomy Field (TaxonomyFieldType)  A Hidden Text Field (Note) WSS ID & Label stored in the Taxonomy Field as {wssid};#{label}  The lookup value to the TaxonomyHiddenList. Label|Guid pair stored in the Hidden Text Field as {label}|{termguid}  The label & Guid for the term in the term store.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 17 How does it work behind-the-scenes? Hidden Text Field  Display Name: {Taxonomy Field Name}_0  Internal Name & Static Name:  Pre-SP1: {Taxonomy Field Name}TaxHTField0  Post-SP1: Random name similar to: k9cea7ffb6ad43dcb9ee90ce43506c7f TaxCatchAll & TaxCatchAllLabel Fields  Each list containing a Taxonomy Field also has the hidden TaxCatchAll and TaxCatchAllLabel fields – should add to your content types too.  Display names "Taxonomy Catch All Column“ & "Taxonomy Catch All Column1".  Contains the WSS ID of each taxonomy value used in the item.  Search uses these to do managed metadata searches and refinements against list items without having to inspect all taxonomy fields in every list.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 18 How does it work behind-the-scenes? TaxonomyTaggingWebControl is a web control which behaves similar to the Taxonomy Field Control  It is bound to the term set in a similar manner to the Taxonomy Field.  It may be used e.g. on custom search forms to pick a term to search for. The TaxonomyFieldAdded site collection feature is required to use managed metadata.  It creates the TaxonomyHiddenList, sets up the event receivers and adds the site columns.  Activated on all site definitions except Blank Site.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 19How can I use it programmatically?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 20 How can I use it programmatically? Namespace: Microsoft.SharePoint.Taxonomy Term  Name – gets the name using the current LCID  Parent – parent term  Terms – child terms  IsAvailableForTagging  TermSet  CreateLabel(…)  GetTerm(…), GetTerms(..) + overloads
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 21 How can I use it programmatically? TermSet  Name  Group  Terms  IsAvailableForTagging  IsOpenForTermCreation  GetTerm(…), GetTerms(…), GetAllTerms(…) + overloads Group  Name  IsSiteCollectionGroup – for local term sets  TermSets  CreateTermSet(...) + overloads
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 22 How can I use it programmatically? TermStore  Name  KeywordsTermSet – enterprise keywords.  Session – the current taxonomy session.  CommitAll() – Note: multiple commits are required if modifying parent and child terms/term sets together.  RollbackAll()  GetTerm(...), GetTerms(...), GetTermSet(...), GetTermSets(...), GetGro up(...) + overloads and similar. Used to get terms, term sets, and groups by name without having to traverse the term hierarchy to find them.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 23 How can I use it programmatically? TaxonomySession  Starting point to access the term store programmatically.  Constructor needs an SPSite. Provides context to locate the local term sets specific to the site collection, and global term sets linked to the web application.  DefaultSiteCollectionTermStore – returns the term store in the Managed Metadata Service defined as the default for the web application.  TermStores – all term stores accessible by name, e.g. if you have multiple Managed Metadata Services.  GetTerm(...), GetTerms(...), GetTermSets(...) + overloads and similar – like those found in TermStore.Taxonomy Term Group Term Set Term Session Store
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 24 How can I use it programmatically? CAML to define the Taxonomy Field <Field ID="{15181134-8839-47A9-9A38-D116FFFF0006}“ Type="TaxonomyFieldType“ Type=“TaxonomyFieldType “ DisplayName="Subject“ Name=“CustomSubject“ or StaticName=“CustomSubject“ Type=“TaxonomyFieldTypeMulti” Group=“Custom“ Required="FALSE“ DisplaceOnUpgrade="TRUE“ Description=“…“ ShowField="Term1033“ ShowField=“Term$Resources:core,Language;” EnforceUniqueValues="FALSE“ /> CAML to define the Hidden Text Field <Field ID="{15181134-8839-47A9-9A38-D116EEEE0006}" Type="Note" DisplayName="Subject_0" Name=“CustomSubjectTaxHTField0" StaticName=“CustomSubjectTaxHTField0" ShowInViewForms="FALSE" Required="FALSE" Hidden="TRUE" Note: When defining a content type, the CanToggleHidden="TRUE" Hidden Text Field must be referenced DisplaceOnUpgrade="TRUE“ RowOrdinal="0" /> BEFORE the Taxonomy Field.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 25 How can I use it programmatically? CAML to Bind Taxonomy Field to Hidden Text Field & Term Set <Customization> <ArrayOfProperty> <Property> <Name>SspId</Name> - SspId is the Term Store Id <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"> a98dd270-8577-4db8-99e1-b9e894624fdc </Value> </Property> <Property> <Name>TermSetId</Name> - TermSetId binds the Taxonomy field to the <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" Term Set. p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"> a7ae10cd-6c7c-4386-a1f2-7abec8e759e2 </Value> </Property> <Property> <Name>TextField</Name> - TextField binds the Taxonomy field to the <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" Hidden Text Field using its’ Field ID. p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"> 15181134-8839-47A9-9A38-D116EEEE0006 </Value> </Property> … </ArrayOfProperty> </Customization> • This CAML goes inside the field definition. Useful for sandboxed solutions. • Cannot bind the field to a different term set for each list instance without manually changing it. • Also requires the GUIDs to be known up-front and embedded into the CAML.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 26 How can I use it programmatically? Code to Bind Taxonomy Field to Hidden Text Field & Term Set using (SPSite site = new SPSite("http://site")) { TaxonomyField taxonomyField = (TaxonomyField)site.RootWeb.Fields*“Subject"+; - Gets the taxonomy field & hidden text field SPField hiddenTextField = site.RootWeb.Fields*“Subject_0"+; TaxonomySession session = new TaxonomySession(site); - Opens a new taxonomy session TermStore termStore = session.DefaultSiteCollectionTermStore; - Uses the default site collection term store Group group = termStore.Groups*“Enterprise Term Sets"+; - Selects a group & term set to bind to the field TermSet termSet = group.TermSets["Subject"]; taxonomyField.TextField = hiddenTextField.Id; - TextField - Binds the hidden text field taxonomyField.SspId = termSet.TermStore.Id; - SspId – Term Store Id taxonomyField.TermSetId = termSet.Id; - TermSetId – binds the field to the term set taxonomyField.AnchorId = Guid.Empty; - AnchorId – The term to use as the root term. taxonomyField.Open = false; - Open – Whether users can enter new terms. taxonomyField.AllowMultipleValues = false; - AllowMultipleValues – For multi-value fields. taxonomyField.IsPathRendered = false; - IsPathRendered – Whether to show the full taxonomyField.TargetTemplate = string.Empty; hierarchical path of the term. - TargetTemplate - Web-relative URL of the taxonomyField.Update(true); target page that is used to construct the hyperlink } on each Term when the TaxonomyField is rendered.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 27 How can I use it programmatically? Setting a Taxonomy Field Value programmatically  As explained earlier, Taxonomy Field Values consist of 3 parts: {wssid};#{label}|{termguid}  Use this to set a value in an ItemAdding event receiver via the AfterProperties.  List item field values can be set easily using TaxonomyField.SetFieldValue(…), passing in the list item, and either a Term or a TaxonomyFieldValue.  If you don’t use this, you have to set the Taxonomy Field with the {wssid};#{label} and the Hidden Text Field with the {label}|{termguid}.  A TaxonomyFieldValue can be created using: TaxonomyFieldValue.PopulateFromLabelGuidPair("Label|<GUID>")  This automatically adds the term to the TaxonomyHiddenList if not there already.  It also gets the WSS ID and sets up all 3 parts of the TaxonomyFieldValue.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 28 How can I use it programmatically? Querying for a taxonomy field value:  Finding a specific term:  SELECT Title FROM SCOPE() WHERE SCOPE = ‘All Sites’ AND MyTaxonomyField = ‘#0termguid’  Finding a term or any term below it in the term hierarchy (descendents):  SELECT Title FROM SCOPE() WHERE SCOPE = ‘All Sites’ AND MyTaxonomyField = ‘#termguid’  Only works on columns, not profile properties.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 29What problems and limitations arethere?
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 30 What problems and limitations are there? Managed Metadata is not supported by:  InfoPath forms.  SharePoint Workspace.  Content Query Web Part.  Office Document Information Panel.  Editing in Datasheet Mode.  Views cannot use Begins With or Contains operators.  Calculated fields.  Office 2007 and earlier.  Acrobat X. SharePoint Designer Workflows read/write invalid values.  Worked around using a Custom Action to get/set values programmatically.  Possibly fixed in Dec 2011 CU.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 31 What problems and limitations are there? Import from CSV  Separate CSV file for each term set.  Does not support synonyms, translations of terms, or merging terms.  Cannot predefine the term set and term IDs (GUID) – normally used for:  Binding fields to term sets.  Importing data or site structure using managed metadata terms.  Querying / filtering.  Custom code can use the object model to import an entire term store. Export to CSV not possible without writing code. Copying a site collection or content from one farm to another will require the term store data to be copied over, i.e. backup & restore of the MMS database.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 32 What problems and limitations are there? Profile properties using a Term Set:  Hierarchical search not possible on profile properties, is possible on list fields.  Can be set as Required, but allows it to be empty "by design". Multi-Value taxonomy fields and profile properties do not work properly in the Refinement Panel. & and " converted to Unicode special character equivalents  TaxonomyItem.NormalizeName docs explain about & but not ". Managed Metadata term containing a comma is difficult to enter into a taxonomy field – treated as multiple terms. List View Lookup Threshold allows by default up to 8 lookup fields including taxonomy fields in a list. Cannot change this in SP Online.
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 33 What problems and limitations are there? Sandbox (SharePoint Online / Office 365) cannot programmatically access the Taxonomy namespace:  Cannot programmatically bind fields to term sets.  Cannot declaratively bind fields to term sets using CAML as the term set Guids are not known.  Cannot import terms with their Guids.  Cannot export terms even programmatically.  Cannot find out the term Guids, so cannot do anything which requires the Guid, e.g. hierarchical queries.  Cannot use the TaxonomyWebTaggingControl as it can only be bound to a term set programmatically.
  • Nick Hobbs 2 May 2012Managed Metadata www.nickhobbs.net Page 34 Questions
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 35 Resources Managed Metadata Overview  http://technet.microsoft.com/en-us/library/ee424402.aspx Introduction to Managed Metadata  http://office.microsoft.com/en-us/sharepoint-server-help/introduction-to- managed-metadata-in-sharepoint-server-2010-HA101859256.aspx Managed Metadata Limitations  http://www.sharepointanalysthq.com/2011/06/managed-metadata-column- limitations/ Managed metadata CSV input file format  http://technet.microsoft.com/en-us/library/ee424396.aspx Querying on Managed Metadata Field Values  http://msdn.microsoft.com/library/ff625182.aspx How to set Taxonomy Field Values programmatically  http://nickhobbs.wordpress.com/2012/02/21/sharepoint-2010-how-to-set- taxonomy-field-values-programmatically/
  • Nick Hobbs 2 May 2012 Managed Metadata www.nickhobbs.net Page 36 Resources User Profile Property Using Term Set, Required Validation Does Not Work  http://nickhobbs.wordpress.com/2012/02/07/sharepoint-2010-bug-user- profile-property-using-term-set-required-validation-does-not-work/ Managed Metadata Converts Ampersand and Double Quotes to Unicode  http://nickhobbs.wordpress.com/2012/03/29/sharepoint-2010-managed- metadata-converts-ampersand-and-double-quotes-to-unicode/ People Refinement Panel does not work properly with Multi-Value taxonomy user profile properties  http://nickhobbs.wordpress.com/2012/04/03/sharepoint-2010-bug-people- refinement-panel-does-not-work-properly-with-multi-value-user-profile- properties/ Search Refinement Panel’s TaxonomyFilterGenerator Produces Unexpected Results  http://nickhobbs.wordpress.com/2012/04/19/sharepoint-2010-bug-search- refinement-panels-taxonomyfiltergenerator-produces-unexpected-results/
  • Nick Hobbs 2 May 2012Managed Metadata www.nickhobbs.net Page 37 More information Nick Hobbs nick@nickhobbs.net www.nickhobbs.net www.linkedin.com/in/nhobbs