<< SOLVED >> Creating a Drop down on an available space.

Description
peltech
Posts: 10
Joined: Fri Apr 11, 2014 10:01 am

<< SOLVED >> Creating a Drop down on an available space.

Postby peltech » Wed Sep 10, 2014 1:07 pm

Hey Folks,

I am trying to create a drop down menu that would be filled with the documents (except the wiki pages), that are within the given space.
I have the below lines, but unfortunately no luck with them.

#set($trackerProject = $trackerService.getTrackerProject( $page.getSpace().getProjectId())
{parameter:page|type=enum:$modules|multi=false|value=$trackerService.moduleManager.getModules($trackerProject, $page.space.name)}


any help would be appreciated.

Thanks
Last edited by peltech on Tue Sep 16, 2014 5:19 am, edited 1 time in total.

Sandro_F
Posts: 19
Joined: Wed Jan 19, 2011 8:40 am

Re: Creating a Drop down on an available space.

Postby Sandro_F » Mon Sep 15, 2014 7:15 am

Well, something like this will work:

Code: Select all

#set($moduleManager = $trackerService.getModuleManager())
#set($modulesPrint = "")
#set($documents = $moduleManager.getModules($trackerService.getTrackerProject($page.getSpace().getProjectId()), $polarionTool.location.append("00_Documents")))
#foreach($d in $documents)
 #set($modulesPrint = "$modulesPrint,$d.getModuleName()")
#end

#set($modulesPrint = $modulesPrint.substring(1,$modulesPrint.length()))

{parameter:param1|type=enum|allowed-values=$modulesPrint}
{parameter-form}
Documents: {parameter-editor:param1}
{parameter-form}


Please note that you need http://extensions.polarion.com/extensio ... ting-tools extension for calling "$polarionTool.location.append("00_Documents")))" to get a valid ILocation reference.

Regards,
Sandro

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

Re: Creating a Drop down on an available space.

Postby martins » Mon Sep 15, 2014 10:12 am

You don't need the $polarionTool to get the location. You can also use:

Code: Select all

#set($project = $projectService.getProject($page.getProject()))
#set($docsLocation = $project.location.getLocation($space))
#set($documents = $trackerService.moduleManager.getModules($project,$docsLocation))

Kind regards

Martin

peltech
Posts: 10
Joined: Fri Apr 11, 2014 10:01 am

Re: Creating a Drop down on an available space

Postby peltech » Tue Sep 16, 2014 5:19 am

Works like a charm, thanks to @Sandro_F and @martins...

Had to modify very minor things, but thank you so much guys... for someone who would like to use it...

Code: Select all

#set($moduleManager = $trackerService.getModuleManager())
#set($modulesPrint = "")
#set($space = $page.space.name)
#set($project = $projectService.getProject($page.getProject()))
#set($docsLocation = $project.location.getLocation($space))
#set($documents = $trackerService.moduleManager.getModules($project,$docsLocation))
#foreach($d in $documents)
#set($modulesPrint = "$modulesPrint,$d.getModuleName()")
#end
#set($modulesPrint = $modulesPrint.substring(1,$modulesPrint.length()))

{parameter:param1|type=enum|allowed-values=$modulesPrint}
{parameter-form}
Documents: {parameter-editor:param1}
{parameter-form}


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 7 guests