InterSystems IRIS Data Platform 2019.2  /  Implementing InterSystems IRIS Business Intelligence

Implementing InterSystems IRIS Business Intelligence
Other Export/Import Options
Previous section           Next section
InterSystems: The power behind what matters   

This appendix describes additional options for exporting and importing Business Intelligence elements, as a supplement to the chapter “Packaging Business Intelligence Elements into Classes.” It discusses the following topics:
This appendix assumes that you are familiar with the process of exporting from and importing into Atelier.
Also see “Accessing the Samples Shown in This Book,” in the first chapter.
Creating a Business Intelligence Container Class
As noted in the chapter “Packaging Business Intelligence Elements into Classes,”you can package pivot tables and other folder items into InterSystems IRIS™ classes. You can package as many elements as needed into a single class, which is easier to export and import than many separate files.
To create such a class:
Include as many XML definitions as needed within <items>. You can copy the definitions in Atelier or from exported XML files. Also see the next section, which describes edits you should make.
Also be sure to copy and paste only the definition, not the XML declarations at the top of the file. That is, do not copy the following line into the XData block:
<?xml version="1.0" encoding="UTF-8"?>
For example:
Class BI.Model.DashboardItems Extends %DeepSee.UserLibrary.Container

XData Contents [ XMLNamespace = "" ]
<dashboard dashboard definition here ...
<dashboard another dashboard definition here ...
<pivot pivot definition here ...
<pivot another pivot definition here ...
<pivot yet another pivot definition here ...

When you compile this class or when you call its %Process() instance method, the system creates the items defined in the XData block. Specifically, it imports these definitions into the internal global that the User Portal uses.
The same class can also define the %OnLoad() callback, which can execute any additional code needed when these items are set up.
For samples of pivot tables and dashboards that are packaged into class definitions, see the sample classes BI.DashboardsEtc and HoleFoods.DashboardsEtc.
If you delete a container class, that has no effect on the pivots and dashboards that currently exist.
Exporting and Importing Folder Items
This section describes the older API for exporting and importing folder items.
Exporting Folder Items Programmatically
To export folder items programmatically, use the following command:
Do ##class(%DeepSee.UserLibrary.Utils).%Export(itemname,filename)
For example:
 set DFIname="Chart Demos/Area Chart.pivot"
 set filename="c:/test/Chart-Demos-Area-Chart-pivot.xml"
 do ##class(%DeepSee.UserLibrary.Utils).%Export(DFIname,filename)

 set DFIname="KPIs & Plugins/KPI with Listing.dashboard"
 set filename="c:/test/KPIs-Plugins-KPI-with-Listing-dashboard.xml"
 do ##class(%DeepSee.UserLibrary.Utils).%Export(DFIname,filename)
Alternative Technique (for Exporting Multiple Items)
To export multiple items programmatically into a single XML file, use the $system.OBJ.Export() method. The first and second arguments for this method are as follows:
For example:
 set items("Chart Demos-Area Chart.pivot.DFI")=""
 set items("Chart Demos-Bar Chart.pivot.DFI")=""
 set items("Chart Demos-Bubble Chart.pivot.DFI")=""
 set filename="c:/test/Chart-Samples.xml"
 do $system.OBJ.Export(.items,filename)
You can also use this method to export other items such as classes; for details, see the Class Reference for %SYSTEM.OBJ.
Importing Folder Items Programmatically
To import folder items programmatically:
 Do ##class(%DeepSee.UserLibrary.Utils).%Import(pFile, pReplace, pVerbose)
For example:
 set filename="c:/test/Chart-Demos-Area-Chart-pivot.xml"
 do ##class(%DeepSee.UserLibrary.Utils).%Import(filename,1,1) 

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-16 06:44:52