Find page>children across specific spaces

  • 1
  • Question
  • Updated 3 years ago
Hi All

I am trying to create a report table that will contain two columns.

First column is "Space name" - this column will need to look for spaces with label = 'customers'. 

Second column is "Active projects" - this row will need to return the page title for each child of the page called "Active documents" in each space labelled 'customers'. 

Something like below abstract:



For first column I've done as below - surpose it is ok:


For second column I am in big trouble - all I have is:
As you may see I have entered the source manually in the Local Reporter, just to have some kind of output.. 

Question is: is there someway to %inject" space keys? Instead of the "DE" I have typed above, is it possible to inject space keys from column 1 of my table?

Or is it better to report on contents of labelled spaces (in relation to spaces in column 1) and then filter results to only list/display the children of "Active documents"...? I have not been able to do this.

Any help on this question is highly appreciated.

Thanks in advance.

Anders
Photo of Anders Felter

Anders Felter

  • 7 Posts
  • 0 Reply Likes
  • lost

Posted 3 years ago

  • 1
Photo of Chuck Gould

Chuck Gould

  • 93 Posts
  • 2 Reply Likes
You might try a different approach.  I did something similar where I had a Projects page and wanted to report all projects underneath that page and then aggregate all the pages across multiple wiki spaces.

What I came up with was this:

Each child page under the Projects page in a wiki space has a label on it called "itprojects".

I create an aggregate report across all wiki spaces by using the following wiki markup:

{local-reporter:value:label itsprojects > label:content} 
{local-reporter} 

This means the subsequent report will report based on all visible wiki spaces all pages with the label "itsprojects".

As part of the table, I report for each page the wiki space associated with it.

{report-info:page:space}

should do the trick.

This means you only have one reporter statement. I have found local-reporter to be the quickest and typically do not use any other reporters.

The resulting table can then be sorted by the space name, page name or both.

The child pages are all created by using live-templates.  The benefit of this is the label can be assigned by the live template.  If the label is accidentally removed from the child-page the next time it is rendered it is automatically added back on.

The project page consists of scaffolding information (ServiceRocket plugin) and all the free-form notes pages related to the project reside underneath the project page.

Hope this helps.

Let me know if you have questions.
Photo of Anders Felter

Anders Felter

  • 7 Posts
  • 0 Reply Likes
Hi Chuck

Thanks for your support on this. I like your solution and will try it out myself. 

However, I would prefer to avoid the use of labels for this purpose. - Modus operandi in my company is to move pages from the parent "Active documents" to an other parent called "Withdrawn documents" at some stage... Possibly other parents too.

For this reason I would prefer to pinpoint various parents and report on their children: title, which space they belong to and so on.

Any experience with this and I am all ears :-) 

Thanks again.
Photo of Chuck Gould

Chuck Gould

  • 93 Posts
  • 2 Reply Likes
Anders.

Sorry I missed this before, but you should not need to inject the space keys.  Simply use the page name. It has been my experience Confluence will act on the content based on the name without the space key.  I had to modify the space-reporter a little for my environment, but this worked for me.  Thanks for the question, it got me to thinking.  I can use something like this else where for me.

{report-table}{space-reporter:spaces=@all}
{text-filter:space:name|include=.*ISO.*}
{space-reporter}
{report-column:title=Space Name}{report-info:space:name}{report-column}
{report-column:tiele=Active Projects}
{report-list}
{local-reporter:page:children|source=Projects}
{report-body}
{report-info:content:title}{report-info:content-modification date}
{report-body}
{report-list}
{report-column}
{report-table}
Photo of Anders Felter

Anders Felter

  • 7 Posts
  • 0 Reply Likes
Hi Chuck 

Thanks for hanging in for me :-).

If I leave out the local-reporter spacekey and just enter the page name (in my case: Active documents) in the source field, nothing will be returned... Column 2 of my table will be blank...?!

Does it really work for you - leaving out the spacekey?

I am running:

Confluence: 5.8.16 
Reporting 6.2.0

Cheers
Photo of Chuck Gould

Chuck Gould

  • 93 Posts
  • 2 Reply Likes
Anders,

I am embarrassed to admit the original code was developed on Confluence 3.4.9 / Reporting plugin unknown. (very out of date).  I don't manage the server, just use it.

I do have a test environment with Confluence 5.1.3 and Reporting 4.23  (also behind the times, that the code works in.

It is likely that a combination of Confluence and Reporting upgrades has changed how things behave.

There is a parameter on the report table that might help by setting injected=true



Here are screen shots of the report in Confluence 5.1.3.



Results



Hope this helps a little bit.
Photo of Anders Felter

Anders Felter

  • 7 Posts
  • 0 Reply Likes
Hi Chuck

Thanks again for your support. 

I've spent some time (hours) now and finally I found the right solution - use Grouping reporter:

 
Part of the styling cannot be seen on this screen shot but the reporting structure is there. 

Feeling much better now :-) 

Cheers
Photo of Chuck Gould

Chuck Gould

  • 93 Posts
  • 2 Reply Likes
Great, thanks for sharing.
Photo of Chuck Gould

Chuck Gould

  • 93 Posts
  • 2 Reply Likes
Anders,

What we did was place a data field (status) on the page using scaffolding and have the value assigned via a pick list.  Then when the status changed, the page automatically appeared in the correct report (via filtering).

This eliminated having to train people to move pages from one location to another.

Using the ServiceRocket composition plugin, I was able to create a card deck with each page being a different report based on status.

That way management only has to click a tab to see what they want.  Each tab is effectively a separate report.  Storing the local-reporter values in variables and reusing them prevents replicating queries to get results.

I am effectively running 9 reports on one page - typical render time is 5-10 seconds, processing 327 child pages across 30 wiki spaces. 



Sample project home page



We use this as a poor mans project portfolio system.