Prerequisites
- A domain model with at least one server-rendered property (see Create a Computed Property)
- Familiarity with Velocity template syntax
Available Platform Services
Powersheet automatically injects the following Polarion services into every server-rendered template evaluation context:| Variable | Service | Purpose |
|---|---|---|
$trackerService | ITrackerService | Query work items, access project tracker metadata |
$txService | ITransactionService | Transaction management and context |
$repositoryService | IRepositoryService | Project metadata, users, roles, configuration |
$securityService | ISecurityService | Permission checks, user authentication, role-based access |
Step 1: Use $trackerService to Query Work Items
The$trackerService provides access to Polarion’s tracker for querying work items and project data:
Step 2: Use $repositoryService for Repository Metadata
The$repositoryService provides access to project-level metadata, users, and roles:
Step 3: Use $securityService for Permission Checks
The$securityService enables role-based visibility and permission-aware computed values:
$securityService:
- Show or hide sensitive data based on user role
- Display different labels depending on write permissions
- Create audit-friendly computed fields showing access status
Step 4: Use $tx for Transaction Context
The$tx variable provides access to the current transaction, useful for read-only operations that need transactional consistency:
The exact methods available on each service depend on your Polarion version and API. Consult your Polarion SDK documentation for the complete method reference of ITrackerService, IRepositoryService, ISecurityService, and ITransactionService.
Step 5: Combine Multiple Services
For complex computed properties, combine several services in a single template:Step 6: Handle Service Errors
If a service call fails, the template engine returns#SERVER_RENDER_ERROR. Protect against common failures:
Verify
After adding service-based computed properties:- Open the powersheet document in Polarion
- You should now see computed values populated from platform services
- Test with different user accounts to verify permission-aware fields display correctly
- If any cells show
#SERVER_RENDER_ERROR, consult the Debug Template Errors guide
See Also
- Create a Computed Property — defining server-rendered properties
- Use Velocity Templates — template syntax and patterns
- Debug Template Errors — troubleshooting rendering failures
- Set Entity Permissions — entity-level access control
Sources
Sources
Source Code
prod-powersheet-src/com.nextedy.powersheet.client/src/modules/DocumentProvider/DocumentProvider.tsxServerRendererTest.javaprod-powersheet-src/com.nextedy.powersheet.client/cypress/e2e/admin/admin.cy.tsprod-powersheet-src/com.nextedy.powersheet/src/com/nextedy/powersheet/PowersheetService.javaweb.xml