Template Files
Template Resolution Properties
Templates are loaded from document attachments with fallback to the template hierarchy. The resolution mechanism tracks where the configuration was found using these properties:Velocity Context Variables
All Risksheet Velocity templates receive a context containing Polarion services, document objects, and utility tools. The available context variables depend on the template type.Common Context (All Templates)
Top Panel Template Context (risksheetTopPanel.vm)
The top panel template renders at the /api/panel endpoint and has full access to the common Velocity context plus:
Errors in the top panel template render as a red error message box in place of the panel content, displaying the exception details.
PDF Export Template Context (risksheetPdfExport.vm)
The PDF export template renders at the /api/pdfscript endpoint and includes additional context:
See PDF Export Template for detailed template structure and macro reference.
Velocity Syntax Reference
Variables and Properties
Directives
Embedding JavaScript in Velocity
A key pattern in Risksheet templates is bridging server-side Polarion data to client-side JavaScript logic. The Velocity template executes on the server and generates HTML/JavaScript that runs in the browser:PDF Export Configuration Properties
The PDF export configuration service manages loading of therisksheetPdfExport.vm template:
Project Template Installation
Risksheet ships with predefined project templates that can be installed via the administration interface:Installation Properties
Runtime Configuration Properties
When templates are loaded at runtime, the application exposes version and configuration metadata through the window context:Error Handling
Complete Example
A top panel template that extracts a document custom field and registers aqueryFactory function for filtering linked items by product family:
- Accessing document custom fields with
$doc.getOldApi().getValue() - Rendering server-side data into HTML for display
- Passing server-side values to client-side JavaScript variables
- Registering a
queryFactoryfunction that uses document-level context to filter which items are available for linking in Risksheet columns
typeProperties.queryFactory property in the sheet configuration:
See Also
- Top Panel Template — detailed reference for
risksheetTopPanel.vmstructure and customization - PDF Export Template — detailed reference for
risksheetPdfExport.vmand export macros - Custom Renderer Templates — client-side JavaScript cell renderers for custom column display
- Velocity Template Context — complete reference for available context variables and services
- Configuration Properties Index — all sheet configuration properties
- Template Path Configuration — configuring document template paths