Skip to main content

Template Types

Velocity Templates — Server-side templating language for dynamic configuration and data transformation with access to Polarion services Top Panel Template — Customize the HTML panel above the RISKSHEET grid to display document metadata, custom fields, and navigation controls PDF Export Template — Generate customizable PDF exports with data filtering, page breaks, styling, and multi-page image support Custom Renderer Templates — Create client-side JavaScript renderers for specialized cell displays, custom data formats, and interactive grid cells

Template Execution Architecture

diagram

When to Use Each Template Type

Use CaseTemplate TypeExecutionOutput
Display document metadata in headerTop PanelServer (Velocity)HTML
Generate PDF export with custom layoutPDF ExportServer (Velocity)PDF
Render specialized cell data formatCustom RendererClient (JavaScript)HTML/SVG
Dynamic configuration from external filesVelocityServer (Velocity)JSON/Config
Interactive grid cell with buttonsCustom RendererClient (JavaScript)Interactive HTML

Template Context and Access

All template types have access to:
  • Document context: Custom fields, metadata, revision information
  • Work item data: Links, properties, related items (in appropriate contexts)
  • Configuration: Columns, enums, ratings, data type definitions
  • Services: Polarion APIs for querying work items, repositories, and permissions
  • Utilities: JSON parsing, HTML escaping, date formatting

Key Constraints

Velocity templates execute on each request. Avoid expensive operations (multiple API calls, complex calculations). Cache results using template variables.
Always escape user-supplied data in output. Use $esc.html(), $esc.javascript(), and $esc.xml() utilities. The Polarion security model is enforced—users see only data they have permission to access.
Templates use Apache Velocity syntax with support for directives (#if, #foreach, #set), references ($variable), and escape tools. Silent references ($!variable) suppress null value output.
KB ArticlesSource Code
  • DocumentConfigProvider.java
  • RisksheetSetupService.java
  • AppConfig.ts
  • AppConfigParser.ts
  • RisksheetProduct.java