Report Macro
The plugin provides Blueprint Validation Report macro that can be used to query the JSON data. The macro has five parameters:
Parameter |
Description |
Template |
Template id or blueprint template full module key |
JSON Path |
JSON path to filter data |
Column |
A list of columns to print in the table |
Captions |
A list of column captions |
Order |
The name of the column to sort records |
All parameters are optional though it is strongly recommended to specify at least the Template, otherwise your report will print all data pages which can be too many.
Template
Specify template id or blueprint template full module key. A full module key contains a plugin key and a template key separated by semicolon, for example: com.mesilat.blueprints-vcard:company-template.
The macro uses Confluence caching for faster response with larger reports. The cache key is a combination of the Template and JSON Path parameters and gets invalidated when a page is created from the specified template, as well as when it is updated, removed or restored. Thus very frequent page operations may cause slower reports.
JSON Path
If you need only a portion of your data you can specify JSON path selector.
Let's say we have company data and would like to report only companies with sales over 250 Bln USD. We could use the following query:
[?(@.sales>250)]
or to query all UK companies:
[?(@.country=='UK')]
To query a single sales column
sales
The plugin uses Java implementation of JSON path. For more information about the syntax and available options please refer to Jayway JsonPath project.
Columns
A list of columns to include in report, semicolon-separated:
Column |
Description |
page |
A link to a Confluence data page |
template |
Confluence template |
data.<attribute> |
A data attribute, for example: data.sales |
data.* |
All data attributes |
data |
Same as data.* |
Examples:
page;data
page;template;data.sales;data.profit
data.title;data.position;data.value;data.assets;data.sales;data.profits;data.country
Captions
A semicolon-separated list of column captions.
Examples:
Company;Sales
Page;Template;Sales;Profit
Page;Position;Value, Bln USD;Assets, Bln USD;Sales, Bln USD;Profits, Bln USD;Country
Order
A column to sort
Examples:
data.position
data.country
page.title
If no value is given for the Order parameter than the sort is by page title.