Skip to main content

Velocity Templates

Core Velocity template syntax, available context variables, macro definitions, and best practices for all Risksheet template types.

Top Panel Template

Customize the panel above the Risksheet grid with buttons, filters, summary statistics, risk profile displays, and interactive controls using Velocity and HTML.

PDF Export Template

Configure PDF export layout, page structure, table formatting, and content rendering using the risksheetPdfExport.vm Velocity template and export helper macros.

Custom Renderer Templates

Build custom cell renderers and row header renderers using server-side Velocity templates for specialized data display and conditional visual formatting.

Template Resolution Flow

Templates follow the same inheritance chain as the risksheet.json configuration file. When Risksheet loads a template (such as risksheetPdfExport.vm for PDF export), it searches for the file in this order: diagram This resolution order means a document-level attachment always takes precedence over inherited templates. If no template is found at any level, Risksheet uses its built-in default behavior.
To create a document-specific template that overrides the inherited default, use Menu > Override Template in the Risksheet interface. This detaches the document configuration from the global template and creates local copies of all configuration files, including Velocity templates. You can revert back to template inheritance later, but reverting discards any document-specific customizations.

Template Types Summary

Template FilePurposeServer EndpointRendering Engine
risksheetPdfExport.vmPDF export script generation/api/pdfscriptVelocity + JavaScript
Top panel Velocity templateCustom UI panel above the grid/api/panelVelocity + HTML
pdfExportMacros.vmShared helper macros for PDF exportIncluded by PDF templateVelocity
serverRender column scriptsPer-column custom cell renderingPer-column configurationVelocity
Row header rendererCustom row header displayheaders.rowHeader.rendererJavaScript function

Template Context Access

All Velocity templates have access to a rich context that includes:
Context VariableDescription
Document objectCurrent Polarion LiveDoc document with metadata
TransactionActive Polarion transaction for data operations
Polarion servicesServer-side API for querying work items and project data
Velocity toolsStandard Velocity utility classes for formatting and logic
Risksheet configurationCurrent risksheet.json settings including columns, enums, and ratings
Revision parameterDocument revision for historical views (PDF export)
If a Velocity template contains syntax errors or references unavailable context variables, Risksheet renders the error as a red message box in place of the expected output. Check the Polarion server logs for detailed template rendering errors.
KB ArticlesSupport TicketsSource Code
  • DocumentConfigProvider.java
  • RisksheetSetupService.java
  • AppConfig.ts
  • AppConfigParser.ts
  • RisksheetProduct.java