Unsupported
Thumb_1-wiki-scripting

Wiki Scripting Tools

 Adds the velocity tools and Polarion specific objects to the velocity context of active wiki pages to extend scripting possibilities.

Description

share this page via facebook share this page via LinkedIn share this page via Twitter share this page via Google+ share this page via email More sharing services
This extension is related to the Classic Wiki technology that is now outdated and replaced by our new LivePage format. We still maintain Classic Wiki but we are no longer extending its feature set.

Please consider implementing the use case you are looking for using a LivePage.

Installation

Copy com.polarion.alm.extension.vcontext-<version>.jar into <Polarion Installation Folder>/polarion/plugins and restart Polarion.

-or-

read  <Polarion Installation Folder>/polarion/extensions/README.txt how to install the extension.

Generic Velocity Tools

Context Varaible Name Description
$dateTool ComparisonDateTool A tool with the abillity to manipulate, format, compare and describe the periods between dates.
$mathTool MathTool A tool for performing floating point math.
$numberTool NumberTool A tool for formatting numbers.
$renderTool RenderTool A tool to evaluate and render arbitrary strings of VTL (Velocity Template Language).
$escapeTool EscapeTool A tool to help with common escaping needs in Velocity templates.
$resouceTool ResourceTool A tool to simplify access to ResourceBundles for internationalization or other dynamic content needs.
$alternatorTool AlternatorTool Utility class for easily alternating over values in a list and tool for easy creation of Alternators in templates.
$valueParser ValueParser A tool to retrieve and parse String values pulled from a map. This provides the basis for the ParameterParser in VelocityView.
$listTool ListTool A tool to help when working with arrays or Lists. This tool transparently handles both the same way.
$sortTool SortTool A tool that allows a user to sort a collection (or array, iterator, etc) on any arbitary set of properties exposed by the objects contained within the collection.
$iteratorTool IteratorTool A convenience tool to use with #foreach loops. It wraps a list to let the designer specify a condition to terminate the loop, and reuse the same list in different loops.

 

Polarion Tool and XML Tool

The Polarion Tool is stored in the context variable $polarionTool, the XML Tool in the variable $xmlTool. Information on the usage of the tools can be found in the JAVADOC or in the following table of use case:

Read a file from the repository and parse it as DOM.

#set($repoService = $polarionTool.repositoryService)
#set($connection = $repoService.getReadOnlyConnection($polarionTool.location))
#set($path = "/.polarion/announcements/announcements.rss")
#set($input = $connection.getContent($polarionTool.location.getLocation($path)))
#set($doc = $xmlTool.documentBuilderFactory.newDocumentBuilder().parse($input))
RSS contains $doc.documentElement.getElementsByTagName("item").length items.

Load a metric value.

#set($fbRepository = $polarionTool.factBaseRepository)
#set($fbId = "workitems-data")
#set($prjId = "playground")
#set($workItemsData  = $fbRepository.loadFactBase($fbId,$prjId,null,false))
#set($factId = "RESOLVED-UNRESOLVED.UNRESOLVED")
Unresolved work items: $workItemsData.findElement($factId).getValue()

Access a custom enumeration.

#set($enumType = $polarionTool.typeFactory.getEnumType("risk"))
#set($contextId = $trackerService.getTrackerProject("playground").contextId)
#set($dataService = $trackerService.dataService)
#set($riskEnum = $dataService.getEnumerationForEnumId($enumType,$contextId))
{pre}$riskEnum.allOptions{/pre}

Load the modules of a project.

#set($project = $trackerService.getTrackerProject("playground"))
#set($moduleManager= $trackerService.moduleManager)
{pre}$moduleManager.getModules($project,$polarionTool.location){/pre}


More details on the provided functionality can be found in the JavaDoc: 

 http://svn.polarion.org/repos/community/Polarion%20Connectors/Polarion%20Extensions/WikiExtensions/com.polarion.alm.extension.vcontext/javadoc/index.html

Information

Vendor Ben Glee & Massimo Bozzetti (Siemens PLM)
Published Version 1.3.2 - October 2010
Categories
Products
Price Free
1887 Downloads
Unsupported Extension This extension is not supported by Siemens PLM.
Requirements Polarion 2010