Suppliers are services provided by various plugins which provide information about particular content. This is made particular use of by the Reporting Plugin, which uses suppliers to generate the content of the reports displayed.
Available Suppliers
Usage
Typically, suppliers are used in the background by other macros. In particular, the macros in the Reporting Plugin make extensive use of them.
Generally, you can chain supplier keys together using the '>' character. For example, if the current item is a Confluence page, you can access the page creator's full name with a key chain like this:
Note that each key has a prefix (eg. 'content:' and 'user:') and a key value. The prefix for each supplier is listed below. In this case, the 'content:' prefix belongs to the Content Supplier. Looking on that page will reveal that the 'creator' key returns a User, which is supported by the User Supplier. And the User Supplier has a key value called 'full name' which returns the user's full name.
If you look on the description pages, you'll also note that some suppliers require the prefix and others do not. In our case, both the Content Supplier and the User Supplier do not require the prefix. So another way of stating the above key chain is like so:
However, note that specifying the prefix will generally be more efficient and in some cases is actually required. Also, it makes it clearer what type of value you are expecting to deal with to later editors of the page.
Providing your own Suppliers
The Supplier architecture has been designed to allow 3rd-party plugins to provide their own supplier implementations. This can be advantageous for both users and plugin developers for many reasons, including the following:
- Teach me Once: Consistent method for accessing and displaying data across plugins.
- Don't Reinvent the Wheel: Enables use of existing plugins (such as the Reporting Plugin and Linking Plugin) while accessing new data sources.
For more information on how to provide or make use of suppliers in your own plugin, check out the Confluence Supplier Library documentation.