Community
Thumb_html_snippet_injector_1

Polarion Notification Bar leveraging the HTML Snippet Injector

 The interface of Polarion can now be adjusted by injecting code snippets to the main Polarion frame.

Description

As of Polarion 22 R2 admins can customize the Polarion user interface by injecting HTML and JavaScript snippets into Polarion’s HTML pages. This extension is an example of a simple notification bar that alerts users about upcoming downtimes of Polarion by reading a remote text file and displaying the bar atop of Polarion content frame.


The concept of this example javascript snipped extension is to periodically pull a JSON file that contains data for notifications to be displayed. The content of the file is transformed to HTML and appended to the If the file is empty, the header is hidden.


Use this example to get inspiration on what can be achieved by injecting HTML and JavaScript snippets into Polarion. Bear in mind that the HTML elements, their classes, and ids are not stable Polarion API and be changed or removed in future Polarion versions.

 

You have two options to inject JavaScript into Polarion's main content frame:

  • Via Polarion properties (Requires access to the filesystem.)
  • Configuration Properties in Polarion Global Administration.

 

For this example, we are using the Polarion property com.siemens.polarion.scriptInjection.mainHead in the polarion.properties file, which appends the string (of HTML/JS/CSS) to the <head>) tag of the main pages of Polarion.

 

Alternatively, you can insert the custom code via the following runtime Configuration Properties in Polarion Global Administration:
scriptInjection.mainHead=<string>

 

Please note, that the string needs to be in one-line format. To get your HTML in one line you can use tools such as this one.


For more details, please see Customize Polarion User Interface section in Polarion help.


HTML snippet customization offers a lot of power and flexibility, but be careful. With great power comes great responsibility and admins implementing these extensions need to adequately understand the functional, performance, security, and end-user impact they can have on end users. Visit our Polarion Community for guidance and learn how other customers leverage the benefits of this new feature.

 

Information

Vendor Siemens PLM
Published Version is aligned with Polarion 22 R2 - October 2022
Categories
Price Free
68 Downloads
Community Supported Extension This extension is not supported by Siemens PLM.
Requirements Polarion 22 R2 (3.22.2)
Last tested with Polarion 22 R2 (3.22.2)