"List of Matches"

  • 1
  • Question
  • Updated 3 years ago
Hi,

we just started with the Reporting plugin and after reviewing the receipts on your wiki some things remain unclear for us.

We want to use the Reporting plugin to collect macro bodies. Our aim is to collect all occurrences of a certain macro (Macro name: “requirement”) and display the macro body alongside the containing wiki page in a table.

To achieve this we tried to use text:find and then apply some pattern matching. However text:find returns a collection.

Our question is: Is there a way to iterate over this collection and apply the pattern to every entry?

 

Regards,

Robert

Photo of Robert Lehmann

Robert Lehmann

  • 2 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of Nurhana Ziana Bt. Hanafi

Nurhana Ziana Bt. Hanafi, Employee

  • 3500 Posts
  • 269 Reply Likes
Hello Robert,

Is "requirement" a user macro?

For your information, it is not possible to grab only macro body via Reporting. However, you may pull Scaffolding values or whole contents of the page instead.

Thanks&Regards,
Ziana
Photo of Robert Lehmann

Robert Lehmann

  • 2 Posts
  • 0 Reply Likes
Hello Ziana,


yes, requirement is a user macro. 


I already managed to extract the body of my macro. However, my problem is that there may be more than one occurrence of the user macro per page and I have no clue how to iterate over all findings. I used something like this to extract parameters and body of my user macro:

content:body > body:text > text:find "Shortdescr..(.*?)./" > collection:first> match:group 1

 

Something like “collection:iterate” besides “collection:first” would do the trick for me.

  

Regards,

Robert