Introduction
...
Let's look at a typical example of a report:
...
...
Reporters | Report Body | Default Text |
---|---|---|
These pull the information into the report. Results can be sorted or filtered here. Reporters can be combined or grouped for more results. Reporter macros are named with the following convention: | This formats the information pulled by the reporter and displays it in a report. The report body iterates over the results from the reporter i.e. if there are 5 results, the report body will print 5 times. Report body macros tend to be Report Info, Report Column (if Report Table is used), and/or Report On. | This displays in place of any results if the results returned from the reporter are zero. |
Keys and Suppliers
Macros used in the "reporters" and the report body generally makes use of Suppliers for Reporting to retrieve information.
Given a Key, a specified supplier will return an object. A supplier is referenced by its Prefix.
Panel | ||
---|---|---|
| ||
In the above example, This reporter will thus return a list of Page objects that are children of the current page. |
...
Always keep note of the type of object your report is returning. This is of immense help when trying to understand which Suppliers to use both in your report and in your Key-value chains. There is a supplier for every return type, even text, and lists.
The Supplier documentation will provide you with the return type of every Key and the link to its supplier documentation.
The Content Supplier can be used with all Confluence data types e.g., pages, blog posts, attachments, and comments. It provides common information about any of these objects. To get more type-specific information you will need to use the specific supplier.
Report Context
Each reporter will provide a "context" for the report results via its Key-value chain. This is the domain from which the report body can retrieve data. In the example in the previous section, the "context" was the current page's children. The report can then only access information from the current page's children.
...
You will find that all reporters will follow this naming convention: <type>-reporter
e.g. Content Reporter. Each reporter can only access data within that type directly. For example, the Space Reporter cannot return information about page creators but can return information about space creators.
The Local Reporter is a special case reporter, where the context is the current page by default and filtered by you
The Local Reporter is the only reporter that allows you to provide a key-value chain as the context, with a catch: your context needs to be within the default context, which is the current page, or the page you indicate is the source.
...
Panel |
---|
This page was created on: 2014 2014-04-25 00:00:58.838. |
Report On can also be used similarly to expand on an object available on the current page.
Using Reporting in Conjunction with Scaffolding
The Scaffolding add-on provides a Scaffold Supplier which allows the Reporting Plugin to access data from Scaffold fields. This combination of features has been used in many ways by users, not least in the following:
Allowing users to enter metadata on a page and generate a report elsewhere in the site based on the metadata
Providing users a structured way to enter information into the wiki and then collating this data elsewhere using Reporting