Dashboard > Atlassian Plugins > ... > Plugins > Reporting Plugin
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  Reporting Plugin
Added by david, last edited by David Peterson on Apr 04, 2008  (view change) show comment
Labels: 


Sure thing. The example below should allow a user to upload an attachment when editing the page, and will display the attachment as an image when viewing or editing:

{hidden-data}
*Image:* {attachment-data:Image}
{hidden-data}
{report-image:data:Image > reference:value > content:download path}

This makes use of the report-image macro, the Reference Supplier ({attachment-data} stores its links as 'reference' objects) and Content Supplier.

Hi David,
I have a piece of code:

{report-block}
{content-reporter:scope=@self|type=page}
  {user-filter:content:creator|users=global:current user}
{content-reporter}
{report-body}
This content is visible, if the current user and page creator the same.
{report-info:content:creator > name}
{report-info:global:current user > name}
{report-body}
{report-block}


Why is it not working?

Thanks.

Currently you can't use keychain values for other parameters. In this case, however, you can use the '@self' special value to indicate that the user should be the current user. Eg:

{user-filter:content:creator|user=@self}

This was undocumented, so I've added it to the user-filter page for future reference.

Hi,

First

Another newbie trying to get his arms around the syntax for the Reporting plug-in. If there are any tutorials or any other documentation please let me know. Thank you.

Second

Hope you will help me with this report.
In a page under individuals personal space there is a call to a live template. The template contain the following Scaffolding macros:

*Coding Language:* 
{list-data:codeLang|type=check|multiple=true|separator=pipe}
{list-option:C++}C++{list-option}
{list-option:Csharp}C#{list-option}
{list-option:C}C{list-option}
{list-option:Ada}Ada{list-option}
{list-option:Java}Java{list-option}
{list-option:perl}perl{list-option}
{list-data}
----
*Operating Systems:*
{list-data:opSys|type=check|multiple=true|separator=pipe}
{list-option:MSWindows}MSWindows{list-option}
{list-option:Linux}Linux{list-option}
{list-option:UNIX}UNIX{list-option}
{list-option:Realtime-Linux}Realtime-Linux{list-option}
{list-option:Realtime-Windows}Realtime-Windows{list-option}
{list-option:vxWorks}vxWorks{list-option}
{list-data}
----

A separate page contains the following report:

{report-block:output=wiki}
  {content-reporter:space=@personal > children|type=+page|labels=skillslist|matchAll=true}
    {text-sort:content:creator}
    {text-filter:data:codeLang|minLength=1}
    {text-filter:data:opSys|minLength=1}
  {content-reporter}
  {report-body}
    h2. {report-info:content:creator > user:full name}
    Coding Language : {report-info:data:codeLang}
    Operating System: {report-info:data:opSys}
  {report-body}
  {report-empty}
    {warning}You have a problem -- No Results.{warning}
  {report-empty}
{report-block}

Which puts out a very nice report:

Bugs Bunny

Coding Language : ADA, JAVA, perl
Operating System: Realtime-Linux, Realtime-Windows, vxWorks

Donald Duck

Coding Language : C#, JAVA
Operating System: MSWindows, Linux, UNIX

Eric Heinicke

Coding Language : C++, C#, C
Operating System: Realtime-Linux, Realtime-Windows

Scooby Doo

Coding Language : perl
Operating System: UNIX

What I am having trouble figuring out is what to add to the report so that, say, only individuals with C# skills will be reported on.

Thanks,
--Eric

Hi Eric,

Firstly, there aren't any tutorials per-se, but there are several examples available in the 'Recipes' tab above, or the broader list here.

With regards to your report, there are two problems here. Firstly, due to the wide variety of data types you can link to in list-data it always stores its values as a 'reference' to the original object, rather than the object itself. As such, you need a 'reference:value' in your filter. Secondly, because it's a multiple option list, you will need to use the new collection-filter (you must be running 2.0.0 for this to work). The example below will only list people who do know C++ but exclude people who have worked on any form of Windows.

{content-reporter:space=@personal > children|type=+page|labels=skillslist|matchAll=true}
    {text-sort:content:creator}
    {collection-filter:data:codeLang|matchItems=any}
      {text-filter:data:codeLang > reference:value|include=C++}
    {collection-filter}
    {collection-filter:data:opSys|matchItems=any}
      {text-filter:reference:value|exclude=.*Windows}
    {collection-filter}
{content-reporter}

Thank you David,

It looks like a beautiful thing, unfortunately we are running version 1.3.2 of Reporting Plugin,  for Confluence we are running 2.6.0.  Will 2.0.0 run with this older version of Confluence?  We are not ready to update to the new version of Confluence yet.  If 2.0.0 will not run under our version, is there another approach to take to get a similar result?

Thank you,
--Eric

Unfortunately there is no alternate method I can think of for 1.3.2. 2.0.0 may work in Confluence 2.6, but it is completely untested. I'd suggest trying it in a test environment.

If it comes to the worst, you could upgrade, test it, and if it fails, uninstall it. There are no data changes with the new version. You may have to restart confluence to clear the class cache though if it doesn't install or uninstall cleanly.

View the rest of this thread. Most recent comment: Apr 02, 2008
5 more comments by: Eric Heinicke, David Peterson

Hi David,
A new problem I am hoping that you can point me in the right direction is based on the solution from the previous problem you helped me with.

I am trying to generate a dynamic report of individuals skills, garnering these skills from labeled pages under their personal areas. It is dynamic in that the person generating the report indicates a set of skills, e.g. coding languages, that they are interested in matching to individuals. This set of skills are indicated through a scaffolding list-data object at the top of the page that also contains the report code. The skill values are fed into the report and only individuals that have those skills are reported on. My question is what mechanism can I use to get the indicated values from the list-data object and then feed them into the report? Would expand-on, local-reporter help with this? Something else? Do you know of any examples?

Here is an excerpt of the code. The xxx in the statement text-filter:reference:value|include=xxx is the list of coding languages to filter on:

*Select Coding Languages to Report on:* 
{list-data:codeLang2|type=check|multiple=true|separator=pipe}
{list-option:C++}C++{list-option}
{list-option:C}C{list-option}
{list-option:Csharp}C#{list-option}
{list-option:Ada}Ada{list-option}
{list-option:Java}JAVA{list-option}
{list-option:perl}perl{list-option}
{list-data}
----
{report-block:output=wiki}
    {content-reporter:space=@personal > children|type=+page|labels=skillslist|matchAll=true}
        {text-sort:content:creator > user:full name}
        {collection-filter:data:codeLang|matchItems=any}
               {text-filter:reference:value|include=xxx}
        {collection-filter}
    {content-reporter}
    {report-body}
        h2. {report-info:content:creator > user:full name}
            Coding Language : {report-info:data:codeLang}
    {report-body}
    {report-empty}
        {warning}You have a problem -- No Results.{warning}
    {report-empty}
{report-block}

Thank you,
--Eric

I think the simplest way would be to create a User Macro which injected a parameter for the 'include' value. Eg, adapting your report above, put this into your user macro (via the Administration section):

Name: skillfinder
Body:

{report-block:output=wiki}
    {content-reporter:space=@personal > children|type=+page|labels=skillslist|matchAll=true}
        {text-sort:content:creator > user:full name}
        {collection-filter:data:codeLang|matchItems=any}
               {text-filter:reference:value|include=$param0}
        {collection-filter}
    {content-reporter}
    {report-body}
        h2. {report-info:content:creator > user:full name}
            Coding Language : {report-info:data:codeLang}
    {report-body}
    {report-empty}
        {warning}You have a problem -- No Results.{warning}
    {report-empty}
{report-block}

You can then execute the report like this:

{skillfinder:C++}

The '$param0' value will be injected into the report by the user macro.

Did 2.1.1 break the link checker recipe?

I'm getting this error:

Error formatting macro: report-table: net.customware.confluence.reporting.supplier.SupplierValueException: Error while comparing 'link:url': Expected symbol:
This is not currently in the context of a report.
This is not currently in the context of a report.
This is not currently in the context of a report.
This is not currently in the context of a report.

Here's my code:

{report-table}

{content-reporter:type=page|labels=iphotoenglishlinkcheck}
  {text-sort:content:title}

  {expand-on:content:outgoing links|as=link}
    {boolean-filter:link:is external|value=true}
    {text-sort:link:url}
  {expand-on}
{content-reporter}

{report-column:title=Status}{link-validator:timeout=10}{report-info:expanded:link > link:url}{link-validator}{report-column}
{report-column:title=Link}{report-info:expanded:link|link=true}{report-column}

{report-empty}
_There are no outgoing links available._
{report-empty}

{report-table}

Thoughts?

This looks like a bug in the natural sorting algorithm that text-sort uses. I thought I had resolved those in 2.1.1, but it seems a few cases were missed. Could you create a