Version

Taxonomy.getTermsInweb

This method is used to retrieve managed metadata from a SharePoint site. You can get all the existing terms for a site.

Syntax

SPlus.Taxonomy.getTermsInWeb (url, termSetId, storeId, function (terms){
        for (var i=0; i < terms.length; i++) {//Loop the terms Array
            var term = terms [i];//Getting one of the requested terms
            //TODO: Implement what to do with the terms and it’s child terms
        }
}, function (errorResponse){
        var error = errorResponse['error#displayValue']; //Getting the error
        //TODO: Implement how to handle errors
}, function (cancelResponse){
        //TODO: Implement how to handle a user’s cancel
});

Taxonomy.getTermsInWeb Parameters

Parameter

Type

Description

url

String

URL to the SharePoint site.

termSetId

String

Term Set collection identifier. This value specifies a set of Term objects (related terms).

storeId

String

Term store identifier. This value references a database that contains all the metadata.

onSuccess callback function

Parameter

Description

function (terms)

Success callback function to be implemented, which receives an Array with the terms.

onError callback function

Parameter

Description

function (eResponse)

Error callback function to be implemented, which receives the eResponse JavaScript Object.

onCancel callback function

Parameter

Description

function (result)

Cancel callback function to be implemented.