Access Live Document Comments from Wikipage/Velocity?

Description
Bernardo
Posts: 5
Joined: Thu Mar 14, 2013 2:35 pm

Access Live Document Comments from Wikipage/Velocity?

Postby Bernardo » Wed Dec 17, 2014 2:42 pm

Hello, I would like to know a way to create some statistics on live document comments, e.g.
a. Amount/List of comments
b. Amount/List of comment owners
c. Amount/List of unresolved comments, resolved comments

I don´t find useful notes in the SDK. Can anyone recommend anything? Any velocity code known to access these data?
Many thanks, Bernardo

sergeD
Posts: 21
Joined: Tue Feb 05, 2013 9:24 am

Re: Access Live Document Comments from Wikipage/Velocity?

Postby sergeD » Mon Dec 22, 2014 5:29 pm

Hello,

I tried to create such a wiki some months ago but have not investigated more since.I was not fully satisfied with as i was not successful to find the comments referred Work Items .
BTW, you have to use IModule, and then try:
#foreach ( $module in $modules)
#set ($docComments=$module.getComments())
#if (!$docComments.isEmpty()) ...
#foreach ( $aComment in $docComments)
#if (!$aComment.getParentComment()) ## IF to consider only Root Comments
$aComment.getText().getContent()
$aComment.isResolvedComment()
#set ($childComments=$aComment.getChildComments())...
#foreach ( $childComment in $childComments)..
Hope it helps
Sergio

DCwom
Posts: 35
Joined: Mon Sep 29, 2014 7:00 pm

Re: Access Live Document Comments from Wikipage/Velocity?

Postby DCwom » Tue Jan 10, 2017 6:59 pm

I only want to know if there are comments for a given Live Doc so I tried just this code snippet:

Code: Select all

#set ($docComments=$doc.moduleName.getComments())
#if ($docComments.isEmpty())
*Empty*
#else
*NOT Empty*
#end


But the code always returns NOT empty even if no comments exist in the Live Doc

DCwom
Posts: 35
Joined: Mon Sep 29, 2014 7:00 pm

Re: Access Live Document Comments from Wikipage/Velocity?

Postby DCwom » Wed Jan 11, 2017 4:22 pm

Ok, I solved my own problem, here's my wiki code. Now if I can only figure out how to check if the recycle bin is empty...

Code: Select all

###
### This script checks all of the Live docs in the space named Verification to see if they have any Live Doc comments (not WI comments).
###
#set($docsList = $trackerService.getModuleManager().getModules($project,$project.getLocation().append("Verification").getRelativeLocation($project.getLocation())))

1.1 VERIFICATION DOCUMENT SPACE
#foreach($doc in $docsList)

## Comment test
   #set ($CommentFlag = "FALSE")
   #foreach ( $aComment in $doc.getComments())
      #if ($aComment )
      #set ($CommentFlag = "TRUE")
      #end
   #end
   #if ($CommentFlag == "TRUE")
   #warning("Document Contains COMMENTS")
   #end
   

smarty
Posts: 33
Joined: Fri Jan 18, 2013 4:43 pm
Location: Germany / Frankfurt
Contact:

Re: Access Live Document Comments from Wikipage/Velocity?

Postby smarty » Tue Jan 17, 2017 1:44 pm

DCwom wrote:Now if I can only figure out how to check if the recycle bin is empty...


Hello DCwom,

maybe you can make use of the Workitems in Recycle Bin Macro to check for the opposite.

Regards, Martin

p.s.: I am not the vendor marked on the extensions portal.
My environment: Polarion ALM 2016 SR2 on Windows Server 2008,
Polarion-JIRA Connector to JIRA 7.x

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

Re: Access Live Document Comments from Wikipage/Velocity?

Postby peterfriedrich » Fri Apr 21, 2017 8:51 am

Hello
thanks for this post it was valuable.
Futhermore does anybody know how to get the link of a documents comment ?
The function getURI just result in an unreachable link: subterra:data-service:objects:/default/....
regards
Peter


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 1 guest