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
| Name | Prefix | Summary |
|---|---|---|
| Attachment Supplier | attachment | Supplies information about attachments in Confluence. |
| Boolean Supplier | boolean | Allows some simple post-processing on boolean values. |
| Child Counter Supplier | child-counter | Provides access to the 'current' and 'next' counter for the number of children added to a page in Confluence. |
| Class Supplier | class | Provides information about object classes. |
| Collection Supplier | collection | Provides information about collections of items. |
| Comment Supplier | comment | Supplies information about comments attached to Pages or News Items in Confluence. |
| Content Supplier | content | Supplies information about Confluence content, such as pages, news items, attachments and comments. |
| Date Supplier | date | Provides information about dates. |
| Debug Supplier | debug | Provides access to various objects useful for debugging. |
| Email Supplier | Supplies information about email addresses. | |
| Expanded Supplier | expanded | This provides access to the 'expanded' object created by the expand-on and expanding-reporter macros. |
| Global Supplier | global | This supplier can be used from any context, and provides information about global values, such as the current user, the date/time, etc. |
| Grouped Supplier | grouped | Provides access to the results of the {grouping-reporter}. |
| Label Supplier | label | Provides information about Confluence content labels. |
| Link Supplier | link | Provides information about links coming from Confluence content. |
| Mail Supplier | Supplies information about archived email files stored in Confluence. | |
| Map Entry Supplier | entry | Provides access to the key and value of a specific map entry. |
| Map Supplier | map | Provides information about 'Map' collections, which are collections of information with a key/value relationship. |
| Match Supplier | match | This provides access to match values using regular expressions. |
| News Supplier | news | Supplies information about news items (a.k.a blog posts) in Confluence. |
| Number Supplier | number | Provides information about numbers. |
| Object Supplier | object | Provides general information about any object. |
| Page Supplier | page | Supplies information about Confluence pages. |
| Reference Supplier | reference | Provides information about references, which are the data type used by Scaffolding list-data-related macros. |
| Report Supplier | report | Provides access to information about the current report. |
| Request Supplier | request | Provides access to the headers and parameters passed in the HTTP request for the current context. |
| Salesforce.com Contact Supplier | contact | Supplies information about Salesforce.com contacts. (Only in version 1.x of the plugin) |
| Salesforce.com Supplier Version 1 | salesforce | Provides access to Salesforce.com account information. (Only in version 1.x of the plugin) |
| Salesforce.com Supplier Version 2 | sf | Provides access to any type of SalesForce object, please refer to the SalesForce Standard Objects API for a complete list of all object types as well as all available fields for each object |
| Scaffold Data Supplier | data | Provides access to data set using Scaffolding Data macros. |
| Session Supplier | session | Provides access to the HTTP Session context. |
| Space Supplier | space | This supplier provides key values for Confluence Spaces. |
| Stats On Supplier | stats-on | Performs basic statistical analysis on values in a Collection of items. |
| Stats Supplier | stats | Provides access to calculated statistics on a set of data. |
| Task Supplier | task | Provides access to information about specific tasks created by a Tasklist macro |
| Tasklist Supplier | tasklist | Provides access to the items in a Tasklist. |
| Text Supplier | text | Provides information about text values. |
| Tracking Data Supplier | track | Provides information from the Tracking Plugin regarding content view counts. |
| User Group Supplier | user-group | Provides information about user groups. |
| User Supplier | user | Provides information about Confluence Users. |
| Value Supplier | value | Finds or creates specific values for use with keychains. |
| Variable Supplier | variable | Retrieves variables set with the report-variable macro in the current context. |
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:
content:creator > user:full name
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:
creator > full name
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.
Discussions