This is a shared library which allows other plugins to integrate with the Reporting Plugin.
Details
Maven 2
Dependency XML
<dependency>
<groupId>net.customware.confluence<groupId>
<artifactId>confluence-reporting</artifactId>
<version>1.0</version>
</dependency>
Repository XML
<repository>
<id>atlassian-m2-contrib</id>
<name>Atlassian Maven 2 Contributor Repository</name>
<url>
https://maven.atlassian.com/contrib</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Instructions
This library allows other plugins to provide their own implementations of report macros (report-table, report-block), reporter macros (content-reporter, user-reporter), filters (text-filter), or sorters (number-sort). These will fully integrate with the existing reports, reporter and the like, as well as with other third-party plugins.
Generally, your plugin will probably not need to implement all of the above, possibly just one or two types. Below are instructions for creating a macro of each type.
Report Macros
These are the macros which generate the actual report formatting, such as tables or lists. The easiest way to provide your own report is by extending the AbstractReportMacro. It contains several abstract methods to implement. Check the documentation for details on when each is called.
Reports may also have their own ReportOutput types, in which case you will need to create a subclass of AbstractReportOutputMacro to support it.
Reporter Macros
This will probably be the most common macros created, since they will let you define a custom data source for your reports. The simplest method is to extend the AbstractReporterMacro. Of primary interest is the createQuery() method. This will return the Query which does the actual searching later in the process. It should be populated with settings retrieved from the MacroInfo. It's generally not a good idea to store the actual MacroInfo in the Query since the Query may last longer than the initial report execution.
Filter Macros
If your plugin deals with custom types, you may want to provide your own filtering capabilities. Essentally, you will need to provide a org.randombits.confluence.filtering.criterion.Criterion instance via a AbstractFilterMacro. Just implement the createCriterion method with your custom criterion returned. Criterion objects essentially check if a object matches certain requirements, which is what a filter does.
Sort Macros
The simplest way to provide custom sorting for your objects is to have them implement the standard Comparable interface and use the natural-sort macro. However, if that's not possible, you can provide your own sorting capabilities by extending the AbstractSortMacro class and returning a custom Comparator implementation.
Summary
The reporting plugin has had some extra flexibility added. We look forward to seeing how other plugins take advantage of these new capabilities.