microsoft ® official course developing managed metadata solutions microsoft sharepoint 2013...
TRANSCRIPT
Microsoft® Official Course
Developing Managed Metadata Solutions
Microsoft SharePoint 2013
SharePoint Practice
Module Overview
Understanding Managed Metadata
Configuring Managed Metadata Term Sets•Working with Managed Metadata Fields
Lesson 1: Understanding Managed Metadata
Overview of Managed Metadata
The Managed Metadata Service Application
Term Store Hierarchy
Understanding Terms•Discussion: Using Terms
Overview of Managed Metadata
•Managed metadata encourages users to tag content with a consistent set of terms and keywords• Terms• Keywords• Hashtags
•Using Managed Metadata Fields•Managed Metadata in Other SharePoint Services
The Managed Metadata Service Application
•The Managed Metadata Service Application•Configuring the Service Application:• Starting the Managed Metadata Web Service• Creating the Service Application
$serviceAppPool = Get-SPServiceApplicationPool "SharepointServicesPool"
$metaDataServiceApp = New-SPMetadataServiceApplication –Name "Managed Metadata Service Application" –ApplicationPool $serviceAppPool –DatabaseServer "LONDON" –DatabaseName "MetadataServiceDB"
New-SPMetadataServiceApplicationProxy –Name "Managed Metadata Service Application Proxy" –ServiceApplication $metaDataServiceApp –DefaultProxyGroup
Term Store Hierarchy
•Term Stores• Term store administrators• The Term Store Management Tool
•Groups• Group Managers• Group Contributors
•Term Sets• Term Set Owners• Term Set Contacts• Term Set Stakeholders
Understanding Terms
• Labels• Synonyms• Abbreviations• Languages
•Copying, Reusing and Pinning Terms• Copied terms and independent• Reused terms are single terms that appear in multiple locations.• Pinned terms are reused terms that can only be edited in one location
•Availability and Deprecation
Discussion: Using Terms
Read the following scenarios in the student manual:•Categorizing Products• Improving Search Results
Discuss each scenario with the class and decide how you would configure groups, term sets, and terms to satisfy the requirements.
Lesson 2: Configuring Managed Metadata Term Sets
Obtaining Taxonomy Sessions and Term Stores
Creating Groups and Term Sets
Creating Terms
Demonstration: Building a Term Set with the Server-Side Object Model
Using Terms•Managing Permissions and Stakeholders
Obtaining Taxonomy Sessions and Term Stores
•Opening a Taxonomy Session
•Opening a Term Store
TaxonomySession taxonomySession = new TaxonomySession(siteCollection);
TermStore termStore = taxonomySession.TermStores[ "Managed Metadata Service Application Proxy"];
Creating Groups and Term Sets
•Working with Groups
•Working with Term Sets
group = termStore.CreateGroup("Vehicles", groupGUID);
termStore.CommitAll();
carsTermSet = vehiclesGroup.CreateTermSet("Cars", termSetGUID);
termStore.CommitAll();
Creating Terms
•Creating New Terms
Guid newTermGUID =
new Guid("02639124-4dfa-4174-89d2-4f506f3a5d55");
termSet.CreateTerm("Mini Van", 1033, newTermGUID);
termStore.CommitAll();
Demonstration: Building a Term Set with the Server-Side Object Model
In this demonstration, you will see how to:•Add references to a console application to work with SharePoint managed metadata.•Connect to a taxonomy session and open a term store.•Obtain or create a new group in a term store.•Obtain or create a new term set in a group.•Create a new term and commit changes to the term set.
Using Terms
•Creating Labels
•Reusing Terms
•Reusing Terms with Pinning
Label newLabel = miniVanTerm.CreateLabel("Camper Van", cultureID, false);
Term reusedTerm = destinationTerm.ReuseTerm (sourceTerm);
Term reusedTerm = destinationTerm.ReuseTermWithPinning (sourceTerm);
Managing Permissions and Stakeholders
•The TaxonomyRights Enumeration•Checking Permissions
•Adding Contributors and Managers to Groups
•Adding Stakeholders to TermSets
group.DoesUserHavePermissions(TaxonomyRights.Contributor)
group.AddContributor("CONTOSO\MelissaK");
group.AddGroupManager("CONTOSO\BartD");
carsTermSet.AddStakeHolder("CONTOSO\JesseM");
Lab A: Developing Managed Metadata Solutions (Part 1)
Exercise 1: Creating and Configuring the Corporate Structure App
Exercise 2: Displaying the Existing Taxonomy Groups•Exercise 3: Creating a Group, a Term Set, and Terms
Lab Scenario
Contoso Pharmaceuticals consists of a number of divisions, each of which contains several teams. Contoso users increasingly need to capture details of the division and the team as metadata on various types of content. Your task is to deploy a term set that represents the corporate structure, together with a site column that enables people to use the term set in lists and libraries. Because Contoso operates a range of SharePoint 2013 installations and SharePoint Online subscriptions, you will use an app to automate the deployment of the term set and site column.
Lab Discussion Questions
Discuss the following questions with the class:
•Why is it necessary to add a <script> tag to the default.aspx page in Exercise 1, Task 3?
•Why is it necessary to add a permission request for the Web scope to AppManifest.xml?
Lesson 3: Working with Managed Metadata Fields
Creating Managed Metadata Fields
Single-Value Fields•Multiple Value Fields
Creating Managed Metadata Fields
•Creating a Managed Metadata Field•Creating a Connected Hidden Note Field•Connecting a Managed Metadata Field to a Term Set
Single-Value Fields
•Reading Single-Valued Taxonomy Fields1. Get the item2. Cast the field value as a TaxonomyFieldValue3. Use the Label and TermGuid properties
•Setting Single-Valued Taxonomy Fields1. Get the field and the item2. Cast the field and a TaxonomyField3. Create a new TaxonomyFieldValue and set its
properties to match a term.4. Call the SetFieldValueByValue() method.5. Update the item.
Multiple Value Fields
•Reading Multi-Valued Taxonomy Fields1. Get the item2. Cast the field value as a
TaxonomyFieldValueCollection3. Loop through the collection
•Setting Multi-Valued Taxonomy Fields1. Get the item2. Cast the field as a TaxonomyField3. Concatenate a string of term labels and GUIDs4. Pass the string to the
TaxonomyFieldValueCollection constructor5. Call the
SetFieldValueByValueCollection()method6. Update the item.
Lab B: Developing Managed Metadata Solutions (Part 2)
Exercise 1: Obtaining the Host Web•Exercise 2: Adding Metadata Site Columns
Lab Scenario
You have a SharePoint-hosted app that displays information from the Managed Metadata service application and also creates a new taxonomy group and term set with terms that describe the Contoso corporate structure. In order to apply these terms to items in lists and libraries, users require a managed metadata site column which is bound to the Contoso term set. You have been asked to add code to the Corporate Structure App that creates and connects such a managed metadata site column.
Lab Discussion Questions
Discuss the following questions with the class:
•Why does the Corporate Structure app require a permission request for the Web scope when it deals with managed metadata?
• In order to use the Corporate Unit site column with items in a list or library, what other steps must a user or site administrator take?