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.
This method returns an object of the PP.TS.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 service for workbook working var service = workbookBox._Service; // Get data source var source = workbookBox.getSource(); // Get current factor catalog moniker var rubOdId = source.getRubOdId().id; // Get current factor catalog key var rubKey = source.getRub().meta.obInst.obDesc.k; var metaHierarchy; // Get service for working with hierarchies in data source var hieService = service.getHieService(); // Determine callback function var onOpenFromRubOdId = function () { // Determine array of levels in current factor catalog hierarchy console.log("List f 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: