On top of the risksheet view, there is a panel in the header that shows the risksheet document custom fields.
It is possible to configure what fields are visible in this area.
This is being done by a configuration file: risksheetTopPanel.vm
<div class="row"> <div class="one wide column rs-label">Item:</div> <div class="four wide column rs-value">$!document.customFields.item</div> <div class="two wide column rs-label">Owner:</div> <div class="four wide column rs-value">$!document.customFields.owner</div> <div class="two wide column rs-label">Version:</div> <div class="two wide column rs-value">$!document.customFields.version</div> </div> <div class="row"> <div class="one wide column rs-label">Model:</div> <div class="four wide column rs-value">$!document.customFields.model</div> <div class="two wide column rs-label">Core Team:</div> <div class="four wide column rs-value">$!document.customFields.team</div> <div class="two wide column rs-label">Updated on:</div> <div class="two wide column rs-value">$!document.updated</div> </div>
Format:
- The document output shall be an HTML document
- You can use velocity scripting there.
- Most importantly - you can refer to any LiveDoc document custom field
- See: $!document.customFields.version
Where to put the document
Similar to the configuration of the table columns, you can:
a) configure the setting specifically for the opened document
b) or configure the default settings per document template.
A) Configure Header for Opened Document
- Open the live document
- Open attachments panel
- Attach the risksheetTopPanel.vm to the document
- If it is already attached there - click the Overwrite button
- If it is already attached there - click the Overwrite button
- and save the document
B) Configure Header for all the documents based on the same template
- Open the live document
- Check that it is connected with a template:
- Open document properties
- The custom field (id:templateDoc) must point to the document template. Open the document template by clicking on the document icon (see picture)
- If such document custom field does not exist, create one in polarion admnistration
- If such document custom field does not exist, create one in polarion admnistration
- Open document properties
- Attach the configuration document to the template document, by following chapter points 2-4 from chapter A) Configure Header for Opened Document
What is in the Velocity Context?
basically you have access to document via:
document - com.nextedy.risksheet.model.Document
doc - com.nextedy.risksheet.polarion.RisksheetPolarionServiceImpl.wrapDocument(IModule, ReadOnlyTransaction).objRen
doc.getOldApi() - com.polarion.alm.tracker.model.IModule
documentId (java.lang.String)
projectId (java.lang.String)
you can also access:
tx - com.polarion.alm.shared.api.transaction.ReadOnlyTransaction
transaction = tx - com.polarion.alm.shared.api.transaction.ReadOnlyTransaction
documentId - String - "spaceId/documentId" of the document
projectId - String - project id
old Polarion services:
trackerService ($ITrackerService)
securityService (ISecurityService)
txService (ITransactionService)
repositoryService (IRepositoryService)
utilObjects:
gson (com.google.gson.Gson)
objectFactory (ObjectFactory)
esc (EscapeTool)
currentDate (new java.util.Date())
calendar ( java.util.Calendar.getInstance())
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article