Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This recipe generates a list of contents that contains a specific text or macro.

Result

...

Recipe

Apps

Reporting for Confluence Server & Data Center

Level

Easy

Estimated time

10 minutes

Macros

Content Reporter, Report Column, Report Info, Report Table, Text Filter

Suppliers

Body Supplier, Collection Supplier, Content Supplier, Text Supplier

Storage format

You can copy and paste this code into the Confluence Source Editor:

...

You can recreate the example in the editor view:

...

Steps

Line

Description

1

The report will be formatted as a table with Report Table

2

Content Reporter is used retrieve all contents in Confluence, with space parameter set to '@all'.

3

The contents retrieved from Content Reporter is filtered for the desired text or macro. This is done with Text Filter, setting supplier key to 'Content Supplier Supplier Keychains Body Supplier'. The first part 'Content Supplier' retrieves the body of each content from the Content Reporter. This is then chained using '>' sign to Body Supplier, which supplies the storage text for the bodies. Required parameter is set to true to filter out blank texts, and include parameter is set to '.*macroname.*', i.e. the name of the macro.'

4

Two columns is created Report Column, with title set accordingly.

5

Title of each content is displayed via Report Info, setting supplier key to 'Content Supplier'.

6

The number of matches with 'macroname' for each content is displayed with Report Info, setting supplier key to 'Content Supplier Supplier Keychains Body Supplier Supplier Keychains Text Supplier Supplier Keychains Collection Supplier'. The first part 'Content Supplier' retrieves the body of each content from the Content Reporter. This is then chained using '>' sign to Body Supplier, which supplies the storage text for the bodies. This is in turned chained to 'Text Supplier' which retrieves the collection of matches for 'macroname'. Finally this collection is chained to 'Collection Supplier' to get the number of items in the list.

Line-by-Line Explanation

  • N/A