Polarion ALM extension to validate and repair XML structure of different Polarion objects, at the moment - WorkItems, Documents and Collections.

Important

Starting from version 1.0.0 only latest version of Polarion is supported. Right now it is Polarion 2606.

Quick start

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.xml-repair/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.

Documentation

Installation

To install this extension, copy the JAR file ch.sbb.polarion.extension.xml-repair-<version>.jar to your Polarion installation directory at:

<polarion_home>/polarion/extensions/ch.sbb.polarion.extension.xml-repair/eclipse/plugins

Restart Polarion for the changes to take effect.

Note: For detailed build and installation instructions, including automated installation options, see the Development Guide.

Enabling "XML-Repair" in the Navigation Tree

  1. Open the Polarion project where you want to activate the extension.
  2. On the top of the project's navigation pane click ⚙ (Actions) ➙ 🔧 Administration. Project's administration page will be opened.
  3. On the administration's navigation pane select Portal ➙ Topics.
  4. Depending on which view type you are using choose to edit either Default or Admin view.
  5. In the Topics Configuration editor, insert the following inside the <topics> element:
    …
    <topic id="xml-repair"/>
    …
    
  6. Save changes by clicking 💾 Save.

After Polarion restart, the "XML-Repair" item will appear in the project's left navigation panel. The single <topic id="xml-repair"/> entry enables it together with the pages below it:

Page What it does
General checks Scans WorkItems, Documents and Collections for XML issues and repairs the selected ones.
Structural link Finds documents whose structure link role differs from the selected one, and changes it.
Purge outdated data Finds attributes which are filled on the scanned entities but no longer defined in their custom fields configuration, and clears the selected ones.

Clicking "XML-Repair" itself opens an entry page that links to all of them.

A document structures its content with one link role, parent by default. The role is chosen at creation time and is not visible afterwards, so a document created with another role looks the same but behaves differently.

  1. Pick the role every document should use, then press Scan.
  2. The results list the documents using another role, and the Link Role column names the role each one uses today. A document warns when it already holds links of the selected role.
  3. Under Existing <role> links, choose what happens to such a link: interrupt the change and report it (the default), move the link to another role, ignore it and accept that Polarion drops it later, or delete it now.
  4. Tick the documents to switch and press Change role.

The page scans documents only, and always on HEAD: it writes through the same path as a repair, so it obeys the Repair Authorization setting below. Moving or deleting a link also saves the work item holding it.

Polarion strips a structural link by role alone, never comparing it against the document tree, so a link the document already holds under the selected role is lost the next time its work item is saved. That is why the default stops rather than switching silently. The other answers move, keep or remove those links, and report which ones they touched.

Purge outdated data

An attribute counts as outdated when it holds a value on an entity but is not part of the custom fields configuration for that entity's type. Removing a custom field definition leaves such values behind.

  1. Choose what to scan, exactly as on the General checks page, then press Scan.
  2. The "Outdated attributes" block lists what the scan found, with how many items hold each attribute. Every attribute starts ticked; unticking one removes the items that only held that attribute from the results.
  3. Tick the items to clean up and press Purge.

Purging writes through the same path as a repair, so it obeys the Repair Authorization setting below and is refused for a scan pinned to a revision or baseline.

Extension Configuration

  1. On the top of the project's navigation pane click ⚙ (Actions) ➙ 🔧 Administration. Project's administration page will be opened.
  2. On the administration's navigation pane select XML Repair. There is Repair Authorization sub-menu where you can restrict which users should have access to repair functionality. Quick Help section of this page contains short description about restriction logic.
  3. To change configuration of XML Repair extension just edit corresponding section and press Save button.

REST API

This extension provides REST API. OpenAPI Specification can be obtained here.