Metabase.getPathToRoot

Syntax

(objectKey, includeClasses, withEmptyFolders, callback, noCache)

Parameters

objectKey. Key of the repository object, up to the root of which the user gets hierarchy from the application server.

includeClasses. Array that contains classes of objects to be returned. Instances of the PP.Mb.Ui.MetabaseObjectClass enumeration.

withEmptyFolders. Determines whether empty folders should be included. If this parameter is set to True, empty folders are included, otherwise they are not.

includeRoot. Determines whether key node must be included. If this parameter is set to True, root node is included, otherwise it is not included.

callback. Callback procedure, an instance of the PP.Delegate class. Optional parameter.

noCache. Determines whether to use cache when sending request. If this parameter is set to True, the cache is used, otherwise it is not used.

Description

The getPathToRoot method returns hierarchy to the root of selected object.

Example

To execute the example the HTML page must contain the DimTree component named dimTree, which source is the dim dimension and a service used to work with dimensions named dimSrv (see Example of Creating the DimensionTree Component). Output in the browser console the object that contains information on all hierarchy objects up to the dim dimension:

mb.getPathToRoot(dim.getKey(), dim.getClass(), false, function (sender, args)

{

    var res = JSON.parse(args.ResponseText).GetObjectsResult;

    console.log(res)

})

After executing the example the browser console displays the object that contains descriptions of all parent folders for the dim object and all objects, stored in these folders, that have the same class as the dim object.

See also:

Metabase