MicroStrategy ONE
Add-on Execution
In order to cause an add-on to be executed, you must specify at the page-level in the Page Configuration file that you want a specific page to execute your add-on. Multiple add-ons can be defined for a single page. In this case, the add-ons are executed in the order in which they are defined in the page.
The following XML sample would appear in a page's <addons> node in the Page Configuration file to cause "AddOn1" to be executed:
<addon name="customclasses.addons.AddOn1" / >
The name of an add-on (that is, the name attribute of the <addon> node) is actually a fully-qualified class name.
Once all the beans have been initialized and the request has been processed, collectData() is invoked on all of them. The collectData() method triggers the beans to retrieve any necessary information from the MicroStrategy Intelligence Server. After this is done, the beans have all the necessary information to render their output so no connections to Intelligence Server are needed.
Passing Properties to Add-ons
Add-ons can be defined to have dynamic properties passed into their execution by the Page Configuration file, using the following syntax:
<addon name="com.addon.AddOn2">
<properties>
<property name="prop1" source="const" type="string" value="v1"/>
<property name="prop2" source="request" type="string" name=”n1” value="v2"/>
<property name="prop2" source="preference" type="string" name=”n1” value="v2"/>
</properties>
</addon>
These properties may prove useful if you wish to pass dynamic values into the add-on based on parameters being used by Web Beans on the same page. Typically, these properties are used to specify the name of the bean from the Page Configuration file on which the add-on is intended to act. The source for the properties can be a constant, request, or preference.
When add-ons include properties, the corresponding set method for a given property from within the add-on definition is invoked. For example, if the name of the property is beanName, then the add-on uses the public method named setBeanName(String value)defined in the add-on.