Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 14

Description

Live template
templateTypetemplate
templateOption{"label":"Macro Reference Live Template v2","value":"475515464","templateType":"template"}
templateTypeOption{"label":"Confluence template/blueprint","value":"template"}
templateId475515464
excerptDescription This is a reporter which can expand on items returned from another, contained reporter.

...

This reporter will expand on a list of sub-items in the original report. See the examples for more information.

...

Check out the  Best practices when using Reporting .

...

Parameters

...

Name

...

Required

...

Migratable to Cloud?

...

Default Value

...

Description

...

[default] /key

...

(/)

...

  • NO

No The key that will be retrieved from each item in the contained report.

...

If it is a list, this reporter will return an  Expanded Supplier  result for each of the items in that list.

...

If it is a single item, a single  Expanded Supplier  result will be returned.

...

If it is empty, the result will depend on whether the allowEmpty parameter is  true  or  false .

...

See allowEmpty  for details. 

...

as

...

(/)

...

  • NO

No The name to set each expanded item as when accessing it in the report.

...

May not be item , as this is reserved for the original item being expanded.

...

matchAll

...

(

...

x)

...

  • NO

No true

...

If set to  false  content matching  any  of the criteria will be returned. Otherwise, the content must match  all  criteria. 

...

allowEmpty

...

(

...

x)

...

  • NO

No false

...

If set to  true , the parent item will still be returned even if the specified key value is empty.

...

Editor View

...

Macro Edit View

...

Not applicable. 

...

Notes

...

Filtering and Sorting

...

You can add filter and sort macros into the this macro. The object being sorted on will

...

be   the value of the currently expanded item , as opposed to the original item, or the 'expanded' object. Additionally, the original sort order provided by the internal reporter is not changed if two of the 'expanded' values have an equal sort value.

...

For example, let's say you want to list the 10 most recent comments to pages which are children of the current page, where the commenter is not in the 'employee' group. You would do something like this:

...

{report-table:maxResults=10}

...

{expanding-reporter:page:all

...

comments|as=comment}

...

{local-reporter:page:children}{local-reporter}

...

{user-filter:comment:creator|group=-employee}

...

{date-sort:comment:creation

...

date|order=descending}

...

{expanding-reporter}

...

{report-column:title=Title}{report-info:expanded:comment>comment:title|link=true}{report-column}

...

{report-column:title=Creator}{report-info:expanded:comment>comment:creator|link=true}{report-column}

...

{report-column:title=Date}{report-info:expanded:comment>comment:creation

...

date|format=MMM

...

d,

...

yyyy}{report-column}

...

{report-empty}_No

...

comments

...

available._{report-empty}

...

{report-table}

...

Another example is to pull outgoing links of pages which are from external websites only.

...

{report-table}

...

{expanding-reporter:content:outgoing

...

links|as=Outlink}

...

{content-reporter:types=page}{content-reporter}

...

{boolean-filter:link:is

...

external|value=true|required=true}

...

{expanding-reporter}

...

{report-column:title=Page}

...

{report-info:expanded:item|link=true}

...

{report-column}

...

{report-column:title=URL}

...

{report-info:expanded:Outlink>link:url}

...

{report-column}

...

{report-column:title=External}

...

{report-info:expanded:Outlink>link:is

...

external}

...

{report-column}

...

{report-table}

...

Converting from expand-on

...

This macro replaces the expand-on macro present prior to Reporting 3.0.0

...

Below is an example of converting from expand-on  to {expanding-reporter}. It is a simple report which will output the children of the current page who have comments, as well as the the first 50 characters of each comment, in reverse date order.

...

Using expand-on

...

{report-table}

...

{local-reporter:content:children}

...

{text-sort:content:title}

...

{expand-on:content:all

...

comments|as=comment}

...

{date-sort:content:creation

...

date|order=descending}

...

{expand-on}

...

{local-reporter}

...

{report-column:title=Page}{report-info:expanded:item

...

>

...

content:title|link=true}{report-column}

...

{report-column:title=Comment

...

Summary}{report-info:expanded:comment

...

>

...

content:body

...

>

...

text:first

...

50|render=wiki}{report-column}

...

{report-table}

...

Using expanding-reporter

...

{report-table}

...

{expanding-reporter:content:all

...

comments|as=comment}

...

{local-reporter:content:children}

...

{text-sort:comment:page

...

>

...

content:title}

...

{date-sort:content:creation

...

date|order=descending}

...

{expanding-reporter}

...

{report-column:title=Page}{report-info:expanded:item

...

>

...

content:title|link=true}{report-column}

...

{report-column:title=Comment

...

Summary}{report-info:expanded:comment

...

>

...

content:body

...

>

...

text:first

...

50|render=wiki}{report-column}

...

{report-table}

...

Things to note

...

expanding-reporter  is  around  the original report, not  inside  it.

...

The text-sort was moved into the  expanding-reporter . The reason for this is that expanding does its own sorting on the whole result set. In this case, it makes more sense to group comments by the parent page first, then by their creation date. In other places, you may not want to do that.

...

The 'expanded:item' and 'expanded:comment' keys are exactly the same as before. The  expanding-reporter  outputs the same structure as expand-on.
fieldGroupKeys{"gnidfuekr7":["net.customware.confluence.plugin.scaffolding__gnidfuekr7__data_0_6lzup4lc0u"]}

Tutorial Examples

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
excerptTypesimple
cqllabel = "expanding-reporter"