Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

All three artifacts are optional. You can have all three types or either one of them in one toolbox, and only the available artifacts will be deployed. The custom toolbox can be installed by following the steps in section, Installing custom toolbox. 

Toolbox Structure

Toolbox artifacts should be placed in the structure shown below:

...

The following are the properties to be included in the analyzers.properties file, if there ar two scripts by the names 'my_script' and 'my_another_script' that need to be included to the toolbox.

...

As shown above, linking the analyzer script to the toolbox occurs through 'analyzers.scripts.script1.filename' property.

The cron property is optional. It should be mentioned in this property file if you want to schedule the script. Both scripts shown above are scheduled with cron expression '1 * * * * ? *'. If a script doesn't need to be schedules to run, avoid having the specific this cron property in the analyzers.properties file.

...

As shown in the structure of the toolbox, the stream definitions should be placed under streamDefn folder. The stream definitions are the definitions of your data stream published to BAM. You can have any number of stream definitions within one toolbox, but they should be defined in different files.

For example, if your data is published with the stream definition shown below, it should be copied to a file and placed under the streamDefn folder. (The file name is not important but the content of the files is).

Code Block
{
                   'name':'org.wso2.bam.mystream',
                   'version':'1.0.0',
                   'nickName': 'My_Stream',
                   'description': 'This is the stream definition which I'm using used to send data to bam',
                   'metaData':[
                           {'name':'clientType','type':'STRING'}
                   ],
                   'payloadData':[
                           {'name':'my_field_1','type':'STRING'},
                           {'name':'my_field_2','type':'INT'},
                           {'name':'my_field_3','type':'INT'},
                           {'name':'my_field_4','type':'STRING'}
                   ]
}

...

As shown in the toolbox structure, the dashboard artfacts artifacts should be placed under the dashboard directory. Dashboard artifcats artifacts can be for Gadget Dashboard or Jasper Dashboard or both. You need to have the respective artifacts for the dashboard in which your data is visualized. The following section describes how to include artifctas artifacts in the toolbox.

Gadget Dashboard Artifacts

...

As shown above, all gadget xmls to be included in the dashboard should be placed under the 'gadgets' folder, including any .css/.js files, if any. If jaggery files are used in the gadget xmls, they should be placed in the 'jaggery' folder in the 'dashboard' folder. Finally, the dashboard tabs and gadgets for the tabs should be mentioned in the 'dashboard.properties' file. According to what is mentioned in the dashboard.propertied properties file, the gadgets and tabs will be organized in the gadget dashboard.

Info
titleNote

...

Jaggery is a 100% open source framework to write Web applications and HTTP-focused Web services purely in Java Script, for all aspects of the application: front-end, server-side logic, communication and persistence. For more information on Jaggery, refer to: http://jaggeryjs.org

Assume you have gadget xmls as My_Gadget_1.xml, My_Gadget_2.xml, My_Gadget_3.xml, My_Gadget_4.xml under the gadgets folder. You are want to add My_Gadget_1.xml, My_Gadget_2.xml to the first tab, and My_Gadget_3.xml, My_Gadget_4.xml to the second. Then the dashboard.properties should be as follows.

...

Similar to anayzers.properties file, tab1, tab2 are reference in the properties. 'dashboard.tabs.tab1.name' denotes the title of the tab denoted by reference tab1. tab1, will have the gadgets My_Gadget_1.xml, My_Gadget_2.xml in the that order. Similarly. for the tab2, the title is 'Tab-2 Title' and the gadgets will be My_Gadget_3.xml, My_Gadget_4.xml in that order.

Jasper Dashboard Artifacts

Jasper Dashboard related artifacts are given below.

Image Removed

As shown above, all the jrxml files to be included in the jasper dashboard should be placed under the 'jasper' directory, and the jrxml file should be linked to the toolbox via the jasper.properties file. Also, if the database needs to be accessed via the jrxml file, you have to provide the datasuorce configuration xml file, which also should be placed under the 'dashboard' directory and included in the jasper.properties file.

Assume you have My_Jasper.jrxml file in the jasper folder. And you are using the My_Datasource.xml configuration file which consists of the connection parameters, etc to the datasource as shown in the folllowing example.

Code Block
languagehtml/xml
<configuration>
   <url>jdbc:h2:repository/database/samples/ot/WSO2CARBON_DB;AUTO_SERVER=TRUE</url>
   <username>wso2carbon</username>
   <password>wso2carbon</password>
   <driverClassName>org.h2.Driver</driverClassName>
   <maxActive>50</maxActive>
   <maxWait>60000</maxWait>
   <testOnBorrow>true</testOnBorrow>
   <validationQuery>SELECT 1</validationQuery>
   <validationInterval>30000</validationInterval>
</configuration>

For the above scenario, the jasper.properties should be as follows.

Code Block
jasper.tabs=tab1
jasper.tabs.tab1.name=My Jasper Tab Title
jasper.tabs.tab1.jrxml=My_Jasper.jrxml
datasource=MyDataSource
datasource.configuration=My_Datasource.xml

According to the above configuration, there will be one tab and the title of that tab will be 'My Jasper Tab Title'. Associated jasper file is 'My_Jasper.jrxml'. The datasource configuration is provided by 'datasource.configuration' property.

Packing the Toolbox

After including all required artifacts as described above in a directory, zip archive it and change the file extension to .tbox. The name of the .tbox is taken as the name of the toolbox. You are now ready to install your toolbox. For information, refer to section Installing custom toolbox.

...