Render data revision on wiki page

Description
afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Render data revision on wiki page

Postby afwl » Thu Nov 28, 2013 3:53 pm

Hello all,

I would like to know how I can render the current revision on a wiki page.

The situation is this:
We have a wiki page that contains a traceability matrix, i.e. a table that shows requirement work items and related test case work items.
The table content is generated via a macro that contains queries to retrieve the relevant work items in their current state.
This table shall be exported to PDF on certain occasions, and I would like to include the revision from which the data were derived.

So far I have $[revision] included in the PDF footer. But this renders the revision when the wiki page code was last edited. What I need is the revision of the current table content.

(Additional question: How to get the relevant revision into the printout when exporting from an earlier revision, such as a baseline?)

Can anyone help?

martins
Posts: 181
Joined: Thu Nov 05, 2009 3:24 pm

Re: Render data revision on wiki page

Postby martins » Tue Dec 03, 2013 12:07 pm

Hello,

I think that's what you are looking for:

Code: Select all

   #set($dataService = $trackerService.dataService)
   #set($baseRev = "")
   #set($baseRev = $dataService.getCurrentBaselineRevision())
   #if($baseRev!="")
      #set($trackerProject = $trackerService.getTrackerProject($page.getProject()))
      #set($baselineManager = $trackerProject.getBaselinesManager())
      #set($baseline = $baselineManager.getRevisionBaseline($baseRev))
      #set($baseName = "")
      #set($baseName = $baseline.getName())
      #if($baseName=="")
         Repository Revision: $baseRev
      #else
         Baseline: $baseName - Repository Revision: $baseRev
      #end
   #else
      #set($repcon = $polarionTool.getRepositoryService().getReadOnlyConnection("default"))
      #set($headRev = $repcon.getLastRevision($repcon.getRepositoryInfo().getRootLocation()))
      Repository Revision: $headRev
   #end

Kind regards

Martin

afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Re: Render data revision on wiki page

Postby afwl » Fri Dec 20, 2013 2:19 pm

Hello Martin,

sorry for not responding so long – I have been busy to meet a project deadline.

Thanks for your code. I think this is what I need.
When I return from my Christmas holidays in January, I'll try if it works.

Best regards
and a Merry Christmas

afwl

lsimons
Posts: 8
Joined: Thu May 03, 2012 1:39 pm

Re: Render data revision on wiki page

Postby lsimons » Thu Jan 02, 2014 3:56 pm

Hi afwl,

Would you be willing to share your macro for generating tables from the trace data? I think we are trying to do a similar thing and go through a bunch of contortions to get our trace matrix from Polarion to Excel to PDF.

Thanks,
Louis

afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Re: Render data revision on wiki page

Postby afwl » Mon Jan 27, 2014 4:26 pm

Hi Louis,

we use a macro called ExtensibleTraceabilityTable.
It is contained in this Polarion extension:
"Dynamic Traceability Table" by Ben Glee
http://extensions.polarion.com/polarion ... ion=PE-350

We just customized the queries to fill the columns, and the macro line that defines how each work item is rendered inside its table cell.

This yields a wiki page with a traceability matrix, which can be exported to PDF.

Good luck
afwl

afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Re: Render data revision on wiki page

Postby afwl » Mon Jan 27, 2014 5:26 pm

Hello Martin,

today I found the time to try your code more thoroughly.

It appears that the base revision number ($baseRev) is displayed correctly, but the baseline name ($baseName) is empty.
In case of using the macro in head revision, $headRev does not exist so only the variable name is displayed instead of its value.

On checking where the macro got stuck, I found this:
$baselineManager exists, but $baseline does not, so $baseName remains empty. (I did assign a name to the baseline when creating it.)
$polarionTool does not exist, so all following methods apparently do not work. (Do I need to install anything special in order to use $polarionTool?)
I checked for existence with statements like this: #if(!$myVariable).

So, may I ask for your help once again?

Kind regards
afwl

martins
Posts: 181
Joined: Thu Nov 05, 2009 3:24 pm

Re: Render data revision on wiki page

Postby martins » Tue Jan 28, 2014 6:34 am

Hello afwl,

you need the Wiki Scripting Tools extension installed. Without this fundamental extension it won't work.

Kind regards

Martin

afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Re: Render data revision on wiki page

Postby afwl » Mon Feb 03, 2014 9:36 am

Hello Martin,

thanks for your reply.

I remember that we used to have those Wiki Scripting Tools installed before, but they apparently got lost during our last server migration.

I'll have them reinstalled (which may take a while; I cannot do this myself), and then I'll try your code again.

Thanks for now
afwl

martins
Posts: 181
Joined: Thu Nov 05, 2009 3:24 pm

Re: Render data revision on wiki page

Postby martins » Tue Feb 04, 2014 6:42 am

You better install extensions not in directory

Code: Select all

polarion/plugins/

but in a directory like

Code: Select all

polarion/extensions/POP.Extensions/eclipse/plugins

then the extension won't get lost when you update your server next time.

Kind regards

Martin

afwl
Posts: 24
Joined: Mon Nov 19, 2012 2:49 pm

Re: Render data revision on wiki page

Postby afwl » Tue Feb 04, 2014 2:34 pm

I got the same advice before, by the trainer during a wiki scripting training.
So thanks for reminding me and reassuring me that this is a good idea.

afwl

peterfriedrich
Posts: 40
Joined: Tue Jul 30, 2013 1:08 pm

Re: Render data revision on wiki page

Postby peterfriedrich » Fri Apr 13, 2018 7:10 am

Hello,
wie installed the Wiki Scripting Toll, but it is still not working. Are there any prerequisites like Java ect ?
Kind regards
Peter


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests