Render data revision on wiki page
Render data revision on wiki page
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?
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?
Re: Render data revision on wiki page
Hello,
I think that's what you are looking for:
Kind regards
Martin
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
Re: Render data revision on wiki page
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
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
Re: Render data revision on wiki page
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
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
Re: Render data revision on wiki page
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
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
Re: Render data revision on wiki page
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
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
Re: Render data revision on wiki page
Hello afwl,
you need the Wiki Scripting Tools extension installed. Without this fundamental extension it won't work.
Kind regards
Martin
you need the Wiki Scripting Tools extension installed. Without this fundamental extension it won't work.
Kind regards
Martin
Re: Render data revision on wiki page
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
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
Re: Render data revision on wiki page
You better install extensions not in directory
but in a directory like
then the extension won't get lost when you update your server next time.
Kind regards
Martin
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
Re: Render data revision on wiki page
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
So thanks for reminding me and reassuring me that this is a good idea.
afwl
-
- Posts: 37
- Joined: Tue Jul 30, 2013 1:08 pm
Re: Render data revision on wiki page
Hello,
wie installed the Wiki Scripting Toll, but it is still not working. Are there any prerequisites like Java ect ?
Kind regards
Peter
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: No registered users and 2 guests