combine metadata and local-reporter macro

Michal Zebrowski January 22, 2012

Hello,

I have a parent page and a set of children pages with metadata f.e.:

{metadata:SEC}IK1{metadata}
{metadata:SEC}IK2{metadata}
{metadata:SEC}IK5{metadata}
{metadata:SEC}IK10{metadata}
and so on

now, what I want to do is to list all metadata from children pages on parent page using local-reporter macro.

I tried something like this:

{metadata-from:{report-info:content:title|link=false}|NAME}

but that doesnt work

In other words: I dont know how to inject a current page name to {metadata-from} macro.

4 answers

1 accepted

0 votes
Answer accepted
David Peterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2012

Try the reverse - get the metadata value via {report-info}. Metadata comes with a Supplier to allow retrieval via the Reporting Plugin. So, this should work:

{report-info:metadata:NAME}

Hopefully. :)

Michal Zebrowski January 23, 2012

That's exactly what I'm looking for. However it doesn't work for me. More details below.

I have three pages - Two child pages named 'Meta child page 1' and 'Meta child page 2' and parent page named 'Meta parent page'. Child pages have "metatest" label.

Meta child page 1 code:

{metadata:Sec}IK1{metadata}
{excerpt}
Excerpt from Meta child page 1
{excerpt}

Meta child page 2 code:

{metadata:Sec}IK15{metadata}
{excerpt}
Excerpt from Meta child page 2
{excerpt}

Meta parent page code:

{metadata-from:Meta child page 1|Sec}
{metadata-from:Meta child page 2|Sec}
{report-table}
{content-reporter:types=page|labels=+metatest}{content-reporter}
{report-column:title=Page}{report-info:title|link=true}{report-column}
{report-column:title=Metatest}{report-info:metadata:Sec}{report-column}
{report-column:title=Excerpt (column header)}{report-info:excerpt|link=true|render=wiki}{report-column}
{report-table}

And that's what I get (see image)

Metadata is not visible, when I use reporter macro. I don't know where is the problem.

metadata plugin is v. 2.1.0 and reporter plugin is v. 3.4.2

1 vote
Martin Moser January 22, 2012

Not quite sure I understand your question, but have you tried something like this:

{metadata-report:Page,SEC|key=YOURSPACEKEY|root=@self|pages=@descendants|maxResults=1000|sort=Page}

If you need to filter further you could do so using

labels=label1,label2

(See https://studio.plugins.atlassian.com/wiki/display/META/Metadata+plugin+version+1+documentation for more information about metadata-reports)

Michal Zebrowski January 23, 2012

Thx.

Do You know how to get an excerpt from the page using this macro?

I tried:

metadata-report:Sec,Page,Excerpt|key=TEST|root=@self|pages=@descendants|maxResults=1000|sort=Page|style=list}

where Sec is metadata's name, but it only lists metadata's value and link to the page. Excerpt is not visible.

Martin Moser January 23, 2012

Hi Pecet,

never used Excerpt - it is listed under additional internal metadata at https://studio.plugins.atlassian.com/wiki/display/META/Confluence+Metadata+Plugin#ConfluenceMetadataPlugin-Additionalinternalmetadata but apparently it isn't really working, at least not for me (just tried it out myself) :-(

... or I'm doing something wrong ...

Martin Moser January 23, 2012

Of course as a workaround one could always just simply define {metadata:Excerpt} and use that ...

0 votes
David Peterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2012

I'm not sure exactly what the Metadata supplier details are unfortunately. However, you should be able to use Metadata's own standard display macros if you want - just don't specify the source location. Reporting renders reports in the context of the page they are reporting on, so as far as the metadata macro is concerned, it is executing on the original page.

Michal Zebrowski January 29, 2012

Looks like I need metadata plugin is v. 2.1.3 at least.

Thx for all answers.

0 votes
Thomas Wendel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2012

Hi Pecet,

Sorry, but what exactly do you want to achieve?

You got child-pages and each one of them has metadata on it (e.g. the first one hast {metadata:SEC}IK1{metadata}, the second one {metadata:SEC}IK2{metadata}, etc.)?
And on the parent page you want a list of all child-pages with their metadata?

Please clarify a bit.

Cheers,
Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events