getDictionaries (isCalendar, parentIfNotCalendar)
isCalendar. Specifies whether to get table or calendar dictionaries. If this parameter is set to True the method returns calendar dictionaries, otherwise it returns table dictionaries.
parentIfNotCalendar. A table dictionary parent is a JSON object that represents Od structure. It is relevant if the isCalendar parameter is set to False.
The getDictionaries method returns repository dictionaries.
To execute the example, in the HEAD tag of the HTML page add links to the following JS and CSS files:
PP.js.
PP.Metabase.js.
resources file (such as resources.en).
PP.css.
In the SCRIPT tag add the following script:
//repository connection var mb = new PP.Mb.Metabase( { PPServiceUrl: "PPService.axd?action=proxy", Id: "WAREHOUSE", UserCreds: { UserName: "sa", Password: "Qwerty1" } }); mb.open(); //service for working with import object var dataImportService = new PP.Mb.DataImportService({ Metabase: mb }); dataImportService.GetObjectsCompleted.add(onObjectsLoaded); // request objects: //all calendar dictionaries dataImportService.getDictionaries(true); //all folders dataImportService.getFolders(); //all MDM dictionaries dataImportService.getRepositories(); function onObjectsLoaded(sender, args) { var objs = args.Objects; for (var i = 0; i < objs.length; i++) { // names and keys of obtained objects are displayed in the browser console console.log(objs[i].n + (" ")+ objs[i].k) } }
After executing the example the method returns all calendar dictionaries, folders and MDM repositories of the selected repository. Their names and keys are displayed to the browser console.
See also: