SP.Taxonomy.TaxonomySession object (sp.taxonomy)

SharePoint 2013

Wraps all of the associated TermStore objects for a site collection.

Last modified: July 18, 2013

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var object = new SP.Taxonomy.TaxonomySession()

The TaxonomySession object has the following members.

Constructor

The TaxonomySession object has the following constructor.

Constructor

Description

TaxonomySession

Initializes a new instance of the SP.Taxonomy.TaxonomySession object (sp.taxonomy) object.

Methods

The TaxonomySession object has the following methods.

Method

Description

getDefaultKeywordsTermStore

Gets the TermStore object to be used for keywords.

getDefaultSiteCollectionTermStore

Gets the TermStore object to be used for metadata that are specific to the site collection, such as column-specific TermSet objects.

getTaxonomySession

This method retrieves a TaxonomySession object for performing taxonomy-related operations.

getTerm

Gets a Term object that is based on Term IDs. If the current Term belongs to multiple TermSet objects, it will arbitrarily return the Term from one of the TermSet objects.

getTerms

Gets Term objects for the current TaxonomySession object.

getTermsById

Gets a set of Term objects based on Term IDs. If a Term is part of more than one TermSet object, it will arbitrarily return the Term object from one of the TermSet objects.

getTermSetsByName

Gets all TermSet objects from all TermStore objects that have a name in the specified language.

getTermSetsByTermLabel

Gets all of the TermSet objects from all of the TermStore objects that contain Term objects with matching LCID specific labels for all specified strings.

getTermsInDefaultLanguage

Searches Label objects in the TermStore objects’ default language, and returns Term objects that are not scoped scoped to an Site object from all TermSet objects, in all TermStore objects that contain a Label object that matches the provided string.

getTermsInWorkingLocale

Searches Label objects in the TermStore working language, and returns Term objects from all TermSet objects, which are not scoped to an SP.Site object (sp.js) object, from all TermStore objects with a Label matching the provided string.

getTermsWithCustomProperty

Gets Term objects with custom properties for the current TaxonomySession object.

updateCache

Forces the taxonomy cache to communicate with the Managed Metadata Service to check for changes to any taxonomy objects.

Properties

The TaxonomySession object has the following properties.

Property

Description

offlineTermStoreNames

Gets a StringCollection of names of TermStore objects that are currently offline.

termStores

A collection of TermStore objects that are associated with the SPWebApplication object of the current SPSite object.

Show: