Skip to main content

Prerequisites

  • A working domain model with at least one entity type
  • A sheet configuration displaying entity properties
  • Basic knowledge of Velocity template syntax

Step 1: Add a Property with Server Rendering

In your domain model YAML, add a property to an entity type and configure it with a serverRender pattern. The server evaluates this template for each work item and returns the computed value:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      title:
        type: string
      computedLabel:
        serverRender: "$item.id - $item.title"
The serverRender value is a Velocity template expression. The server evaluates it in a context that includes the current work item and platform services.

Step 2: Understand Available Context Variables

Server-rendered properties have access to these context variables during template evaluation:
VariableDescriptionAvailability
$itemWork item model object (title, status, author, created, updated)All work items
$wiLow-level work item API for operations not on $itemWork item entities only
$moduleCurrent LiveDoc (moduleFolder, moduleName, space)Document-scoped entities
$contextPowersheet context (project, document scope)Always
$txCurrent transaction for read-only operationsAlways
diagram

Step 3: Configure the Property as Read-Only

Server-rendered properties are automatically marked as non-editable. However, you should also set readable: true and updatable: false in your property definition:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      computedLabel:
        serverRender: "$item.id - $item.title"
        readable: true
        updatable: false
Even if you set updatable: true, the server rendering mechanism overrides this setting and prevents client-side edits. The value is always computed from the template.

Step 4: Add the Computed Property as a Column

In your sheet configuration, add a column that binds to the computed property:
columns:
  SystemRequirement.computedLabel:
    title: "Label"
    width: 200
The column displays the server-computed value for each row.

Step 5: Use Custom Field Data in Templates

If your entity type has a customFieldName mapping, you can access the Polarion custom field value within the template:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      riskScore:
        customFieldName: risk_score
      riskLabel:
        serverRender: "#if($item.riskScore > 5)High Risk#else Low Risk#end"
        readable: true
        updatable: false
Velocity templates support #if, #else, #foreach, and other directives. Use them to create dynamic labels, computed statuses, or aggregated displays.

Step 6: Map Property Names with serverName

When the Polarion field name differs from the name you want to expose in the sheet, use serverName to create an alias:
properties:
  friendlyName:
    serverName: internalPolarionFieldId
    type: string
The exact behavior of serverName aliasing with server-rendered properties may depend on your Polarion version. Test the configuration with a simple template first.

Verify

After adding a computed property:
  1. Open the powersheet document in Polarion
  2. You should now see the column displaying dynamically computed values for each row
  3. Confirm the column is read-only (you should not be able to edit cells)
  4. If you see #SERVER_RENDER_ERROR instead of a value, check the Debug Template Errors guide

See Also

Source Code
  • Property.java
  • MetadataTest.java
  • DataPropertyFactory.java
  • ServerRenderer.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/RowItemFactory.ts