Download the required JDBC driver (i.e., based on the database type you are using) and copy it to the <SP_HOME>/lib directory.
This driver must be OSGI compatible in order to be detected.
Generating a widget
To generate create a widget and display it in a dashboard, follow the steps below:
Start and access the WSO2 SP Dashboard Portal. For detailed instructions, see Visualizing Data.
Thenclick Create Widget to open the Create Widget wizard.
In the first page, enter a name for the new widget. In this example, let's enter Transactions as the name.
Click Next. Then select a data provider for the widget. The data provider is the source from which the widget extracts information to be displayed. In this example, let's select RDBMS Batch Data Provider as the data provider.
As a result, the page is populated with the default configurations of the Sample_DB datasource. Click Next to proceed.
The parameters you need to configure vary depending in the data provider you select. The following are the parameters you need to configure for the other available data providers.
The parameters available to be configured for these data providers depend on how the data providers are configured via WebSocket messages. For more information, see Working with Data Providers.
Siddhi Store Data Provider
The Siddhi application that stores the data to be visualized in the Siddhi store.
Only the siddhi event table/ aggregation definition needs to be added here, with applicable annotations (@store, @PrimaryKey) (Note: For aggregation, aggregation input stream should also be defined)
Static query: This involves providing a simple query without using any external values. Here, you do not need to enter widget inputs. e.g. from MasterpassTransactionDataStreamByCardType within '2018-**-** **:**:**'per 'hours'select card_brand_name,region as re, sum(totalAmount) as total group by region
Dynamic query(with widget inputs): This involves adding external inputs received from publisher widgets under Add widget inputs. You can click + to add more inputs. You need to specify the default values to be used in the query if no input is received from publisher widgets. e.g. return"from MasterpassTransactionDataStreamByCardType within "+ from + "L, "+ to +"L per '"+ per + "s' select card_brand_name,region as re, sum(totalAmount) as total group by region";
return "from MasterpassTransactionDataStreamByCardType within " + from + "L, "+ to +"L per '" + per + "s' select card_brand_name,region as re, sum(totalAmount) as total group by region";
The frequency with which you want the data provider to poll data from the Siddhi store. The time interval is specified in seconds.
The map type to convert the data received via WebSocket in order to update them in the widget. Supported mapping types are, xmljson and text.
The WebSocket topic to which WSO2 SP needs to listen in order to display information in the widget
Metadata related to the stream
The metadata related to the stream. The attributes of the stream into which the events published in the widget are received can be added here. The fields in the table is as follows:
Metadata Name: The name of the stream attribute.
Metadata Type: The metadata type of the attribute. This can be one of the following.
Linear: Data is received in numerical format.
Ordinal: Data is received in string format.
Time: data is received as timestamps.
The definition of the stream from which events published in the widget are fetched is as follows: define stream SweetTotalStream(namestring, totalProduction long);
This can be entered as metadata as shown below:
RDBMS Streaming Data Provider
The name of the data source from which the widget extracts information to be displayed.
Dynamic Query Generation Configuration
Static query: This involves providing a simple query without using any external values. Here, you do not need to enter widget inputs.
Dynamic query(with widget inputs): This involves adding external inputs received from publisher widgets under Add widget inputs. You can click + to add more inputs. You need to specify the default values to be used in the query if no input is received from publisher widgets.
Entering a query: return "select * from TRANSACTIONS_TABLE";
Adding widget inputs:
The name of the table from which the data provider must poll data.
A data column that is used by the data provider to identify new records.
Columns in the Table that contain time data, separated by commas.
timeFieldOne , timeFieldTwo
The frequency with which you want the data provider to poll data from the database. The time interval is specified in seconds.
The frequency with which you want the data provider to run purging queries on the database. The time interval is specified in seconds.
The number of records you want the data provider to publish at a time.
Select a chart type of your choice. For this example, let's select Line/Area/Bar Chart Parent.
Configure your chart as follows:
Select the data fields that should represent the X and Y axes of your graph. In this example, let's select Country for the X axis and Amount for the Y axis.
If you want to do a color categorization, select the field based on which you want it to be done.
If you want to design another chart within the same graph, click Add Chart and configure that chart as required.
If you want to do any advance configurations, expand the Advanced Settings section and do the required configurations. For more information about the advanced settings you can configure, see Customizing charts.
If the chart is a publisher widget, expand the Data Publishing Configuration section. Then specify how the widget outputs need to be displayed by entering the required text as shown in the example below. To add a new widget output, you can click +.
Once you have configured your chart(s) as required, click Preview to see how it will look when it is added. In this example, the widget configured looks as follows.
To save the widget, click Create. A message appears to inform you that the widget is successfully created. Now this widget can be used in any dashboard. Once you click Create you are also redirected to the landing page.
Open the Dashboard Designer wizard for an existing dashboard (for detailed instructions, see Editing Dashboards). Then click on the required page.
This opens the Widget Store as shown below.
The Transactions widget you created is displayed under Generated Widgets.
The following are advanced settings that you can use when you configure widgets.
Time formatting regex: The charts in WSO2 SP Dashboard Portal handle time series data automatically and format them accordingly. However, if you want to customize how they are formatted, you can specify the required time format in a regex format as explained in d3 documentation .
Tick axis angles: If you want to rotate the ticks of an axis,you can specify the amount (in degrees) as a numerical value.
Maximum length of the dataset: This property can be used if you want to limit the number of data points that are visible in a given chart at a time.
Add Chart (when generating Line/ Area/ Bar charts): This can be used if you want to draw another line, area or bar chart on the same XY plane using the same data set. Properties to configure another chart are provided in the form.
Color set to use in the charts: Charts are shipped with a default color set that is used to visualize the data. If you want to override this color set, you can define your own color set by using this option. You can define a list of colors in hex format that can be used in the charts.
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.