Check for history view in wiki macro

Description
Zwi_B&R
Posts: 12
Joined: Fri Nov 19, 2010 9:35 am
Location: Austria
Contact:

Check for history view in wiki macro

Postby Zwi_B&R » Mon May 30, 2011 6:49 am

Hello!

We're using the "Home"-wiki of modules to build documents we can export as PDF.
In this wiki we're using a self-written macro to show workitems (with a customized header).
This works fine, I can even show a specific revision of a workitem (using getVersionedInstance() ).

Now I'd like to use the "History" view of the "Home"-wiki to see any old revision of this document.
This should possible because the "History" view gives me the specified revision of the wiki page and my macro can do the same for the workitems.

The problem is:
Inside the macro I don't know if I should show the HEAD revision of the workitem or an older revision.
Up to know I gained the following informations:
  • $page.revision (which gives me the choosen revision when in "History" view, but when in "Current" view it shows the revision of the last change in page.xml)
  • revision of the module directory in the repository
  • revision of the workitem directory
  • revision of page.xml
...but I couldn't find a condition that works for any possible combination of changes.
Note that there are several possibilities where the last change may have been done (in a workitem, in page.xml or in module.xml).
And things get even worse, if someone uses a workitem from another module in this wiki...

Therefore it would be very handsome to get the information if I'm on "Current" or "History" view (or something like that).

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

Re: Check for history view in wiki macro

Postby martins » Mon May 30, 2011 7:34 am

Hello,

I think you'd like to do the same as we do :) . Especially for this purpose we developed the extension "Enhanced Module and Document View" (PE-285).

Our modules wiki pages look like this:
First we include a static header (only visible in PDF) as front page for the generated PDF Dokument.
Then we include a script for selecting the version / revision of the document to view (only visible in Wiki, not in PDF, similar to the showGUI of EMDView).
After this we include the EMDView page and call the macro "generateView" with the appropriate parameters, taken from the actual context (name of the module) and the script mentioned before (to select version / revision).
We call the script "generateView" twice, first for generating a "table of content" view, second for rendering the content itself.

Greetings

Martin

Zwi_B&R
Posts: 12
Joined: Fri Nov 19, 2010 9:35 am
Location: Austria
Contact:

Re: Check for history view in wiki macro

Postby Zwi_B&R » Mon May 30, 2011 8:40 am

Hello,
thanks for you fast reply, Martin!

I already had a look at EMDView. It's quite powerful but not exactly what we need (as far as I've seen), because we use the module wiki not only for showing the list of workitems, but also for the layout of the document and for some text/images that is not inside any workitems.

An input field for entering the desired revision will be my plan B.
But I was hoping to be able to use the "History" view because it's already there (and I wouldn't have to know about how to implement such an input field... :wink: )

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: Check for history view in wiki macro

Postby NickEntin » Mon May 30, 2011 9:40 am

Hi,

if you're in the history view, there is variable $revs initialized (with the revision number, you're looking at).

Hopefully this will help you to to determine if you're in history view or not. It might be non-official feature, but this is what came to my mind.
If you need additional help - please ask support.

Best regards,
Nick

Zwi_B&R
Posts: 12
Joined: Fri Nov 19, 2010 9:35 am
Location: Austria
Contact:

Re: Check for history view in wiki macro

Postby Zwi_B&R » Mon May 30, 2011 10:36 am

Thanks a lot, Nick!
This is exactly what I was looking for! :P
best regards
Roman

briancolton1
Posts: 1
Joined: Tue Nov 15, 2011 1:19 pm
Location: San Diego
Contact:

Re: Check for history view in wiki macro

Postby briancolton1 » Sun Nov 20, 2011 1:57 pm

Really thanks for decent stuff which help me alot !


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: jordanif3 and 24 guests