Allows rendering of custom panels with content defined by scripts that combine Velocity, HTML and other scripting technologies... right on the Work Item form.
- If you are using Polarion 22 R2 or newer, please remove this extension so Polarion starts properly - it is no longer needed.
- To get more information on how to use the OOTB version of this feature, check the official Polarion Help.
- If you want to disable the OOTB extension and use this one instead (not recommended), you can do it via a system configuration property com.polarion.alm.ui.forms.extensions.velocity.enabled by setting it to "false"
How to install
-
Download and unzip the packaged extension.
-
Move the folder bin/com.polarion.alm.velocityform from the zip file com.polarion.alm.velocityform_<version>.zip into:
<Polarion Installation Folder>/polarion/extensions/
. -
Restart Polarion.
How to use
- Create the report using Velocity.
- Save the file with the script (i.e.
my_script.vm
) in folder
<Polarion Installation Folder>/scripts/
. - Go to the Administration - Work Items - Form Configuration.
- Add/Edit Form Layout of the Work Item type you want to add the Velocity Form to.
- Add a line defining the extension with parameters:
- id - always "velocity_form",
- label - choose how the form will be labeled,
- script - provide the file's name with the script that should be processed and rendered.
EXAMPLE: <extension id="velocity_form" label="Test Form" script="my_script.vm"/>
Useful Tips
- The Velocity Context allows access to the usual objects of the Open API -
$trackerService
,- it also allows access to the Rendering API -
$transaction
, - it contains a reference to the current Work Item it is being used on -
$object
.
- it also allows access to the Rendering API -
- To check for access rights and persistence of the Work Item, use:
#if(!$object.isUnresolvable() && $object.isPersisted())
.
- To get the Rendering API version of the Work Item, use:
#set($wi = $transaction.workItems().getBy().oldApiObject($object))
.
- To use the .render() method of the Rendering API, it is necessary to specify the format and target for the render() method by using:
$wi.render().htmlFor().forFrame()
.
Known Limitations
- Content created using this extension cannot be printed.
- In Polarion <= 2019 SR2 JavaScript execution is not supported due to how the content is injected into the Work Item form page.
- Polarion 2019 SR3 brought full support for JavaScript execution in any Work Item Form Extensions.