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 aserverRender pattern. The server evaluates this template for each work item and returns the computed value:
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:| Variable | Description | Availability |
|---|---|---|
$item | Work item model object (title, status, author, created, updated) | All work items |
$wi | Low-level work item API for operations not on $item | Work item entities only |
$module | Current LiveDoc (moduleFolder, moduleName, space) | Document-scoped entities |
$context | Powersheet context (project, document scope) | Always |
$tx | Current transaction for read-only operations | Always |
Step 3: Configure the Property as Read-Only
Server-rendered properties are automatically marked as non-editable. However, you should also setreadable: true and updatable: false in your property definition:
Step 4: Add the Computed Property as a Column
In your sheet configuration, add a column that binds to the computed property:Step 5: Use Custom Field Data in Templates
If your entity type has acustomFieldName mapping, you can access the Polarion custom field value within the template:
Step 6: Map Property Names with serverName
When the Polarion field name differs from the name you want to expose in the sheet, useserverName to create an alias:
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:- Open the powersheet document in Polarion
- You should now see the column displaying dynamically computed values for each row
- Confirm the column is read-only (you should not be able to edit cells)
- If you see
#SERVER_RENDER_ERRORinstead of a value, check the Debug Template Errors guide
See Also
- Use Velocity Templates — Velocity template syntax and patterns
- Access Polarion Services — using platform services in templates
- Debug Template Errors — troubleshooting rendering failures
- Add a Custom Property — defining custom properties
Sources
Sources
Source Code
Property.javaMetadataTest.javaDataPropertyFactory.javaServerRenderer.javaprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/RowItemFactory.ts