{content-reporter}
Plugin: Reporting Plugin
Reports on Confluence content (pages, news, comments, attachments, etc).
Description
The content can be filtered by space, type, scope or labels, as well as any custom filters specified in the body of the macro.
Usage
Parameters
| Name |
Required |
Default |
Description |
| space(s) | | @self | The list of spaces to search in. Each space may be prefixed by either '+' (to indicate the space is required) or '-' (to indicate the space must be excluded).
May be one of the following:
- @self - (default) The space the current content is in.
- @personal - Personal spaces only.
- @global - Global spaces, that is, non-personal spaces.
- @all - All spaces, both global and personal.
- SPACE KEY - Any other space key may be specified explicitly.
|
| type(s) | | all | The list of content types to allow. Each type may be prefixed by either a '+' (to indicate it is require) or '-' (to indicate it must be excluded). May be any of the following:
- page
- news
- comment
- attachment
- spacedescription
|
| label(s) | | | List of label checks. E.g. "one, +two, -three" would list content which had the "two" label but not the "three" label. |
| scope | | | List of pages, news items, etc which are in scope. If the content is a page, the scope can be expanded to their children, descendents or ancestors:
- > children - The direct children of the specified page. E.g. 'scope=My Page > children'
- > descendents - All descendents of the specified page. E.g. 'scope="My Page" > descendents'
- > ancestors - All ancestors of the specified page. E.g. 'scope=My Page > ancestors'
|
| matchAll | | true | If set to 'false', content matching any of the criteria will be returned. Otherwise, the content must match all criteria. |
| time | | | Allows the specification of a period of time to search within. E.g. '7d' will only allow content modified in the last 7 days. |
Recipes
See Also
the parameter scope doesn't seem to work if i specified a space and type.
e.g {content-reporter:space=aKey|type=page|scope=Home > children} this should report the pages under the page 'Home' right ?Jason
I would expect that to work. Could you post the whole report macro you´re using?
When using content-reporter I seem to have rows returned in the report that are duplicated (one for each save of the same page). Is that the intent?
For example:
{report-table} {content-reporter:space=@self|types=page|scope=Starting Home page>children} {text-sort:content:title} {content-reporter} {report-column:title=Page Name}{report-info:content:title|link=true}{report-column} {report-column:title=CR Date}{report-info:content:creation date}{report-column} {report-table}Returns 2 lines even if all I had was one child document (under Starting Home), which I created and then updated. Note that it's a page created from boilerplate with scaffolding. Not sure if that matters.
Forgot to mention I'm using:
Reporting plugin 1.0.2
Scaffolding 1.4.18
Confluence 2.2.9
Hmm. It definitely shouldn't be doing that. Could you please create a bug report at http://jira.adaptavist.com/browse/REPOR with the full details of the problem - that way I'll be sure to address it in the next release.
I can't seem to signup for an account in JIRA or even create anonymous new issue under Scaffolding or Report plugin (not in drop down).
Anyway, here's more details. I think the problem is scaffolding plugin not reporting plugin.
I created a page with 2 child pages, with one updated. Using content-reporter it correctly only lists the 2 pages once each. Also the Confluence search only hits those pages once each.
If I create a simple boilerplate and repeat the test, the content-reporter lists 3 rows. Two for the page updated. Also the Confluence search hits the updated page twice. So I end up with 3 items in the search and content-reporter output.
It seems using the OK (or Apply) button to create and update generates sort of unique entries in the Confluence index, which content-reporter sees and outputs.
Simple boilerplate used:
{composition-setup} {scaffold:name=DoubleTest} *DummyField:* {text-data:DummyField|max-length=30|width=240px}{text-data} {scaffold}Creating page via link:
{create-page:parent=@self|boilerplate=DoubleTest|prompt=Enter title for your Wiki test}Create new wiki problem here{create-page}And seeing the doubled output:
{report-table} {content-reporter:space=@self|types=page|scope=Starting Home>children} {text-sort:content:title} {content-reporter} {report-column:title=Page Name}{report-info:content:title|link=true}{report-column} {report-column:title=CR Date}{report-info:content:creation date}{report-column} {report-table}Hmm. I'm not sure that Scaffolding is the problem, since the report you describe doesn't use any Scaffolding data. That said, if you're using an old version of Scaffolding (say, prior to 2.2-DR2) there was a bug in there related to the 'recently updated' list on the dashboard which may be related to the one you describe.
As such, I'd suggest switching to [Scaffolding 2], not only for this reason, but also because it will allow you to access the data saved in Scaffolding in reports.
Just to clarify it's only a problem on pages with scaffolding and fine on pages without scaffolding as far as I can tell.
On a test of Scaffold 2 with Confluence 2.2.10 the problem appears to no longer exist at least on a new test. Not sure of existing pages prior to Scaffold 2 and then upgraded to Scaffold 2. I'll try and determine that later.
Having thought about it further, I think you're right - the problem is a bug which was in 1.4.x. Using Scaffolding 2 should resolve the issue.
Hi,
I can't seem to be able to get the content reporter to work from one space to another. The exact code that will work in one space will not work when modified to work from another. In the following example both the specified space and the specified page exist and the code works when in the same space as the page it refers to. It gives me the following error when used from another space (with the space attribute added):
Any ideas?
{report-block:maxResults=1} {content-reporter:space=uutiset|type=page|scope=Kainalojutut > children|labels=§kainalojuttu_ktl} {text-sort:content:date} {content-reporter} {report-body} h2. {report-info:content:title|link=false} {report-info:content:body|render=wiki} {report-body} {report-block}I'm using Confluence Version: 2.2.9 Build:#527 07.09.2006
regards
Ville Valtasaari
Hi Ville,
The trick here is that the space parameter and the scope parameter both need to be set to the target space if you're working elsewhere. The 'space' parameter basically helps trim down the possible pages to look in, and the 'scope' parameter then filters further based on relationships. So, to get your macro working, try it like this:
{content-reporter:space=uutiset|type=page|scope=uutiset:Kainalojutut > children|labels=§kainalojuttu_ktl}Hope that helps.
Would it be possible to have the labels parameter work as follows:
Currently specifying a label with no +- sign prepended seems to have no effect (and the documentation above is not clear about this case).
Thanks for your thoughts.
Your suggestion is how labels are intended to work. Although it might help if you think of it as OPTIONAL, REQUIRED and EXCLUDED.
More information is available here. Let us know if you have any further questions.
Ah, thanks, the link you provided clarified what I was looking for!
Cheers for fast reply.
Is there a way to use this or any of the other reporting macros to create a custom "recently updated" report? I need to limit the number of items that appear in the recently updated panel.
I'd also be interested in limiting the number of items returned, i.e. most recent 3 items. At the moment I'm using the time parameter, which is not ideal.
You can limit the number of results displayed by setting 'maxResults' in the report itself (i.e. report-table, report-list, report-block, rather than the reporter.
I posted this on the replace and render page, but seems like the reporting tool may help.
I'd appreciate any advice.
I've been desperately trying to find a way to automatically assign pages and blogs created from a parent page. My first issue is that I don't know what label to look for. For example, my space may consist of companies and each company has pages that relate to products. I would like to have a link from the company page that creates a child product page. I want the child page to inherent the main company label.
For example:
Parent has 2 labels: company AND apple (there might be an adjacent page with two labels company AND IBM)
Parent has a create page and create news links as follows:
1. Create Child Page:
{create-page:template=NewFund\|prompt=Add a new fund to this Shop}New Fund{create-page}2. Create News:
{link-to:add news\|labels=visitnote}(+) Add Visit Notes{link-to}I would like the following to occur:
To make matters a bit more cumberson... in reality the new pages would only inherit the term apple (ie- the name of the company) I would then use the addlabel macro to give these a fund label for the first link or a visitnote label for the second.
I think that if I can figure out a list of the labels on the page then I could figure out which label to use. This goes for other parts of the page as well. For example, on the parent page I display a list of blogs that have been created from that parent page. Staying with the example above, I'd like to display the "visit notes" created on the parent page using the following macro:
{blog-posts:5 | content=title | labels=apple,visitnote | match-labels=all}It seems simple enough, but I am using a template for the page and need the label "apple" to be dynamic (ie- there will be pages where the term is IBM, MSFT, CISCO, etc.).
Thanks for any help you could provide.
Hello,
I want to display a list of all editors of in a space. But with the following macros I get the content creators several times (if they created several content objects). What is a better way to extract this information? Unfortunatelly I'm too unexperienced with the reporting plugin.
Thank you for your help,
judith
{report-list}
{content-reporter:space=@self|type=page,news}
{content-reporter}
{report-body}
{report-info:content:creator > user:name|link=true}
{report-body}
{report-list}
You should be able to use the new repeat-filter (added in 2.1.0) to filter out multiples of the user. You'll also need to sort the results by the user name. Eg:
{report-list} {content-reporter:space=@self|type=page,news} {text-sort:content:creator > user:name} {content-reporter} {repeat-filter:content:creator > user:name} {report-body} {report-info:content:creator > user:name|link=true} {report-body} {report-list}Updated by Jeff Sackett
Jul 04, 2008 06:45
Hi All!
I am trying to create a report that is giving me problems - it would help if someone could indicate what I am doing wrong. We are trying to create a report containing homepage content for all spaces where the homepage is labeled 'foo'. But, it could be the case that other non-homepages are also labeled 'foo'. I would expect the following to work based on what I have seen:
Rollup Report
{report-table} {content-reporter:space=@all\|type=page\|labels=foo} {boolean-filter:content:space:homepage\|value=true} {content-reporter} {report-column:title=Space}{report-info:content:space\|link=true}{report-column} {report-column:title=Report}{report-info:content:body\|render=wiki}{report-column} {report-empty}No Report{report-empty} {report-table}But, of course it does not. It ends up including all pages that are labeled 'foo', not just homepages... Any ideas? Thanks in advance. By the way, we are using Confluence 2.8.1. Thanks again.
-jeff
I'm kind of surprised you get any pages back at all...the boolean-filter is a little wonkey. I would probably do the report something like this:
{report-table} {space-reporter:space=@all} {expand-on:space:homepage:as=homepage} {content-filter:@self|label=foo} {expand-on} {space-reporter} {report-column:title=Space}{report-info:expanded:item|link=true}{report-column} {report-column:title=Report}{report-info:expanded:homepage > content:body|render=wiki}{report-column} {report-empty}No Report{report-empty} {report-table}Thanks David,
I see where you are going here... Unfortunately, I get the following:
I used your code segment above verbatim except placed a vertical bar between homepage and as=homepage in the expand-on:
{report-table} {space-reporter:space=@all} {expand-on:space:homepage|as=homepage} {content-filter:@self|label=foo} {expand-on} {space-reporter} {report-column:title=Space}{report-info:expanded:item|link=true}{report-column} {report-column:title=Report}{report-info:expanded:homepage > content:body|render=wiki}{report-column} {report-empty}No Report{report-empty} {report-table}Thanks again!
-jeff
I think it must have been late when I wrote my last suggestion
expand-on works on collections, and is actually totally unnecessary in this situation... Try this instead:
{report-table} {space-reporter:space=@all} {content-filter:space:homepage|label=foo} {space-reporter} {report-column:title=Space}{report-info:@self|link=true}{report-column} {report-column:title=Report}{report-info:space:homepage > content:body|render=wiki}{report-column} {report-empty}No Report{report-empty} {report-table}Hi David,
Thanks for your efforts! I had tried something similar to this before, but I tried again to be sure I have not entered something in error.
It seems that the content-filter used in your sample filters out all spaces but mine. My space's home page does not have a label foo, but when I removed that requirement in the filter - only my space's home page's content is printed out in the report... If I do include the label requirement, I get 'No Report' (the report-empty string). Is there some keyword we are missing in the space-reporter context that serves as a local variable to the filter (to put it in coding terms)? It's as if space=@self is the only space being checked???
Regards,
-jeff
David, there seems to be a compatibility problem for the current content-reporter with the Confluence 2.6.2 we are running. When using the scope parameter I get the error message "Error formatting macro: content-reporter: java.lang.NoClassDefFoundError: com/atlassian/confluence/links/AbstractAttachmentLink". I checked the existence of the required class. It is really missing. In confluence 2.8.1 the parameter 'scope' works as expected. Is there a workaround for Confluence 2.6.2? We would like to update to 2.8.1 to get the manual page ordering, but we are afraid of other problems as long as the reporting und scaffolding plugins are not released for Confluence 2.8.x.
By the way: the problem is the same with the local-reporter and the source parameter.
Thank you in advance for your help.
Günter
Yeah, you're correct, the latest is basically compatible with 2.7 only. It has been tested a bit in 2.8 and seems to generally work but there are possibly some features which may not work. Scaffolding definitely has issues with 2.8, although someone has posted a workaround which lets you at least get back up and running.
For the moment, the recommended version to use if you need Scaffolding in particular is 2.7.x. We're working on 2.8 compatibility, but it has to fit in with our other scheduled projects, so it can take longer than any of us would really like...
I am getting error when I try use the code as below.
{report-table} {content-reporter:space=@self\|types=page\|scope=projects>children} {text-sort:content:title} {content-reporter} {report-column:title=Page Name}{report-info:content:title\|link=true}{report-column} {report-table}the error I am getting is:
Error formatting macro: content-reporter: java.lang.NoClassDefFoundError: com/atlassian/confluence/links/AbstractAttachmentLink
text-sort: This macro must be used in a sortable location, such as a reporter macro.
please help in this regard!
Hi there,
I think this is essentially the same issue as the previous commenter - the content-reporter macro specifically is incompatible with Confluence 2.6.x. The solution is to use the local-reporter instead, which will have the added benefit of being much more efficient to boot. Something like this:
{local-reporter:content:children|source=projects} {text-sort:content:title} {local-reporter}Hi,
Even {local-reporter}\ is not working for me. I am getting same type of error when I used {content-reporter}
Error formatting macro: local-reporter: java.lang.NoClassDefFoundError: com/atlassian/confluence/links/AbstractAttachmentLink
As previous commenter said, I am facing the problem with both {content-reporter} and as well as {local-reporter}. we are using confluence 2.6.2 version.
Please help!
In that case, the only solution at present is to upgrade to Confluence 2.7. 2.8 is still unsupported presently, so I would avoid that version for now.
I am trying to use the report table and content reporter to pull info from the children. I can get some of the report columns to work, but can't seem to figure out how to get the columns trying to pull info from with in the children to work.
{report-table} {content-reporter:space=@self\|types=page\|scope=2009 Business Cases>children,-Information Technology,-Creative,-eCommerce,-Retail,-HR-FI} {text-sort:content:title} {content-reporter} {report-column:title=2009 Business Cases}{report-info:content:title\|link=true}{report-column} {color:#ff0000}{report-column:title=Approved}{report-info:content:Approved}{report-column}{color} {color:#ff0000}{report-column:title=Sponsor}{report-info:content:Sponsor}{report-column}{color} {report-column:title=Modified}{report-info:content:creation date\|format=dd MMM}{report-column} {report-column:title=Creator}{report-info:content:creator\|link=false}{report-column} {report-empty} This report is empty {report-empty} {report-table}The code in RED is what I can not figure out how to get into the columns.
Thanks,
Crystal
I'm going crazy trying to filter on multiple fields in a report. Using "matchAll=false" seems to completely ruin the report. When I include it, the scope of the report is totally ignored. Here is my code:
{report-table} {content-reporter:type=+page|scope=Reports > children|matchAll=false} {text-filter:content:body|include=.*Payee.*} {text-filter:content:title|include=.*Payee.*} {content-reporter} {report-column:title=Title}{report-info:content:title|link=true}{report-column} {report-column:title=Category}{report-info:data:IssueClassification|render=wiki}{report-column} {report-column:title=Platform}{report-info:data:IssuePlatform|render=wiki}{report-column} {report-column:title=Updated}{report-info:content:modification date|format=MMMM dd, yyyy}{report-column} {report-column:title=Status}{report-info:data:IssueStatus|render=wiki}{report-column} {report-empty}No issues found matching your search.{report-empty} {report-table}If I leave out the "matchAll=false" flag or set "matchAll=true", I get one result back, which is expected. But when I include "matchAll=false", it returns ALL pages in my space. So not only is it ignoring both filters, it is also ignoring the scope!!!
Am I doing something wrong here, or is this a bug? Confluence is 2.7.3, Reporting is the latest version.
Thanks!
I think the problem here is that it literally only requires one parameter to be matched (including the type and scope params). As such, every page will match 'type=+page', so every page is displayed.
What is needed is an 'or' filter, that can contain other filters. You might be able to use the collection-filter to hack around this. Eg:
{content-reporter:type=+page|scope=Reports > children} {collection-filter:@self|matchFilters=any} {text-filter:content:body|include=.*Payee.*} {text-filter:content:title|include=.*Payee.*} {collection-filter} {content-reporter}collection-filter is intended to be used on lists, etc, but will still work on single items.
I didn't realize that matchAll applied to the type and scope as well. That certainly explains my results.
I guess I expected matchAll=false in content-reportre to behave like matchFilters=any. Maybe I'll submit a feature request.
Thank you for the suggestion of using collection-filter, but it unfortunately doesn't work. I get no results back for the report.
Thanks for your quick response!