openFromRubOdId(rubOdId: String, rubKey: Number, wbk: PP.TS.WbkDocument, callback: PP.Delegate);
rubOdId. Moniker of the time series database, whose hierarchy should be opened.
rubKey. Time series database key.
wbk. Workbook document.
callback. Callback function.
The openFromRubOdId method opens workbook hierarchy by time series database moniker.
The method returns an object of the PP.Mb.MetaHierarchy type.
To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Get level names in hierarchy of the current time series database:
// Get workbook service var service = workbookBox._Service; // Get data source var source = workbookBox.getSource(); // Get moniker of the current factor catalog var rubOdId = source.getRubOdId().id; // Get key of the current factor catalog var rubKey = source.getRub().meta.obInst.obDesc.k; var metaHierarchy; // Get service used to work with data source hierarchies var hieService = service.getHieService(); // Determine callback function var onOpenFromRubOdId = function () { // Determine level array in current factor catalog hierarchy console.log("List of levels in current factor catalog hierarchy:") var levels = metaHierarchy.getLevels(); for (var i in levels) { console.log(i + ". " + levels[i].n); }; }; // Get workbook hierarchy by factor directory key metaHierarchy = hieService.openFromRubOdId(rubOdId, rubKey, source, PP.Delegate(onOpenFromRubOdId, this));
After executing the example the browser console displays names of levels in hierarchy of the current time series database:
List of levels in hierarchy of the current time series database:
0. Period
1. Measurement unit
2. Country
3. Factor
See also: