Creating a Business Intelligence Container Class
As noted in Packaging Business Intelligence Elements into Classes, you can package pivot tables and other folder items into InterSystems IRIS® data platform 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:
The class must extend %DeepSee.UserLibrary.ContainerOpens in a new tab.
The class must include an XData block named Contents. For this XData block, you must specify the XML namespace as follows:
[ XMLNamespace = "http://www.intersystems.com/deepsee/library" ]
The top-level element within the XData block must be <items>.
Include as many XML definitions as needed within <items>. You can copy the definitions in Studio 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"?>
Class BI.Model.DashboardItems Extends %DeepSee.UserLibrary.Container
XData Contents [ XMLNamespace = "http://www.intersystems.com/deepsee/library" ]
<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.