You can create the toolbox similar as standalone BAM described here. In this section we shall we how to modify the default toolbox and get the toolbox functionality for tenant.
Here we see how to edit the KPI sample toolbox. In this section the following topics are included,
Modifying Stream Definition
Modifying Analytics script
Modifying portal dashboard gadgets
Extract the $BAM_HOME/samples/toolbox/KPI_Phone_Retail_Store.tbox follow the below steps.
Modifying Stream Definition
Go to stream definition directory within the extracted directory.
Include the tenant credentials in the streams.properties in the following properties.
No Format |
---|
streams.definitions.defn1.username=tenantadmin@tenanatadmin.com
streams.definitions.defn1.password=tenantadmin |
Modifying Analytics script
Modify the script as mentioned as mentioned in writing the tenant based hive script . That is you should modify the Cassandra credentials when accessing the data.
Go to analytics directory within the toolbox extracted directory.
Open the phone_retail_store_script and edit it by changing the cassandra credentials.
Eg:
No Format "cassandra.ks.username" = "tenantadmin@tenantadmin.com" , "cassandra.ks.password" = "tenantadmin "
Further analytic script of the toolbox can be modified as mentioned here.
Modifying portal dashboard gadgets
You have to modify the URL mentioned in accessing the jaggery applications in the gadget xmls.
Go to dashboard/gadgets directory within the extracted toolbox directory.
Open all .xml files (gadget xmls) and edit url following if exists. If it's not existing you can skip this section of steps.
Eg: phone_brand_quantity_bar.xml
No Format |
---|
.........................
function update() {
var respJson = null;
$.ajax({
url: "https://localhost:9443/t/tenantadmin/jaggeryapps/gadgetgen/phone_brand_quantity.jag",
dataType: 'json',
//GET method is used
type: "POST",
async: false,
//pass the data
data: "",
//Do not cache the page
cache: false,
//success
success: function (html) {
respJson = html;
}
})
........................ |
Simlarly update all gadget xmls within the gadgets folder.
After updating all toolbox artifacts, zip the root extracted toolbox directory (KPI_Phone_Retail_Store) and rename to .tbox extension. This concludes all modifications for the tenant based toolbox. Now you can install the toolbox as mentioned here.