This Polarion extension provides functionality of diffing:
- fields of 2 documents (either different or the same in different revisions)
- work items of 2 documents (also either of different documents or of the same in different revisions)
- inlined content of 2 documents, inserted there not via work items, but directly
- arbitrary set of work items in one project with their counterpart work items from another project
...and then to merge selected diffs in any direction. First 2 options are available either via selecting 2 certain documents or via a collection of documents.
In case of diffing work items, appropriate counterpart work items (from another document or another project) are always seeking by selected link role.
Additionally, the extension provides functionality to make a copy of selected document in other location.
Important
Starting from version 5.0.0 only latest version of Polarion is supported. Right now it is Polarion 2410.
The latest version of the extension can be downloaded from the releases page and installed to Polarion instance without necessity to be compiled from the sources.
The extension should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.extension.diff-tool/eclipse/plugins
and changes will take effect after Polarion restart.
Important
Don't forget to clear <polarion_home>/data/workspace/.config
folder after extension installation/update to make it work properly.
This extension is compatible with:
- Polarion 2410
- Java 17
- PDF-Exporter v8
This extension can be produced using maven:
mvn clean package
To install the extension to Polarion ch.sbb.polarion.extension.diff-tool-<version>.jar
should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.extension.diff-tool/eclipse/plugins
It can be done manually or automated using maven build:
mvn clean install -P install-to-local-polarion
For automated installation with maven env variable POLARION_HOME
should be defined and point to folder where Polarion is installed.
Changes only take effect after restart of Polarion.
- Open a project where you wish Documents comparison to be available
- On the top of the project's navigation pane click β (Actions) β π§ Administration. Project's administration page will be opened.
- On the administration's navigation pane select Documents & Pages β Document Properties Sidebar.
- In opened Edit Project Configuration editor find
sections
-element:β¦ <sections> <section id="fields"/> β¦ </sections> β¦
- And insert following new line inside this element:
β¦ <extension id="diff-tool" label="Documents Comparison" /> β¦
- Save changes by clicking πΎ Save
Repeat the instructions above except that on the step 5 use the following line:
β¦
<extension id="copy-tool" label="Documents Copy" />
β¦
- Open a project where you wish these nodes to be available
- On the top of the project's navigation pane click β (Actions) β π§ Administration. Project's administration page will be opened.
- On the administration's navigation pane select Portal β Topics.
- Depending on which view type you are using choose to edit either Default or Admin view.
- In opened Topics Configuration editor insert following line inside
topics
-element:β¦ <topic id="diff-tool"/> β¦
- Save changes by clicking πΎ Save
The Diff Tool UI makes numerous requests to Polarion using the REST API to retrieve information about documents and their workitems. These requests can be processed in parallel to improve performance.
The number of parallel requests can be configured in polarion.properties
file:
ch.sbb.polarion.extension.diff-tool.chunk.size=2
Default value is 2
. Increasing this value may speed up the process but can also overload your Polarion server.
- On the top of the project's navigation pane click β (Actions) β π§ Administration. Project's administration page will be opened.
- On the administration's navigation pane select
Diff Tool
. There are 2 sub-menus with different configuration options for Diff Tool. - They have either
Quick Help
section with short description or their content is self-evident. - To change configuration of Diff Tool extension just edit corresponding section and press
Save
button.
- Open a document in Polarion.
- In the toolbar choose Show Sidebar β Document Properties β Documents Comparison.
- Choose another document and desired options and click
Compare
. - Another tab will be opened in browser listing documents differences. Later you can select certain differences and merge them in any direction.
- Open a document in Polarion.
- In the toolbar choose Show Sidebar β Document Properties β Documents Copy.
- Choose destination of target document, desired options and click
Create Document
. - When document is created you will see success message with a link to it.
- In Polarion navigation tree choose Diff Tool β Multiple Work Items.
- Choose target project, link role by which items to be linked, then select work items from table below to be compared, preliminary filtering them to show ones you need.
- Finally, click Compare button.
- Another tab will be opened in browser listing selected work items differences. Later you can select certain differences and merge them in any direction.
- In Polarion navigation tree choose Diff Tool β Collections.
- You will see 2 tables listing collections. Left one is displaying collections from current project, right one is displaying collections from project selected in dropdown Target project.
- Select one collection from left table and one collection from right table, preliminary filtering them to show ones you need.
- Choose link role by which work items to be linked, then click Compare button.
- Another tab will be opened in browser listing documents differences. You can change documents from collections to be compared in side pane. Later you can select certain differences and merge them in any direction.
This extension provides REST API. OpenAPI Specification can be obtained here.
diffText
and diffHtml
functions are available in Velocity context referenced by $diffTool
variable.
Example:
$diffTool.diffText("Some text", "Some another text").getResult()
or
$diffTool.diffHtml("<html><body><div>Some text</div></body></html>", "<html><body><div>Some another text</div></body></html>").getResult()
Also, isDifferent
can be used if you need to show something specific for cases when the values are the same:
#set($diffResult = $diffTool.diffText("Some text", "Some text"))
#if($diffResult.isDifferent())
$diffResult.getResult()
#else
No changes
#end