DSD-DBS / capella-polarion

Capella-Polarion Bridge - bi-directional integration of the 2 things based on REST API
https://dsd-dbs.github.io/capella-polarion/
4 stars 1 forks source link

Mixed Authority Mode for Document Generation and small additional features #85

Closed micha91 closed 4 months ago

micha91 commented 4 months ago

In this PR we introduce the new mixed authority mode which allows the user to specify sections in a document in Polarion, which should be overwritten by the rendered content of a jinja template. The start of this section is identified by this Polarion Wiki Macro - the important parts are the div class and its ID:

<div class="c2pAreaStart" id="TestArea">
#if ($document.getStatus().id == "draft")
<span style="font-weight: bold;background-color: #FFFF00;">↓↓↓Below this point all content is autogenerated and will be overwritten ↓↓↓</span>
#end
</div>

The end of an autogenerated section is identified by this Macro:

<div class="c2pAreaEnd" id="TestArea">
#if ($document.getStatus().id == "draft")
<span style="font-weight: bold;background-color: #FFFF00;">↑↑↑Above this point all content is autogenerated and will be overwritten ↑↑↑</span>
#end
</div>

In addition the following minor features were implemented: Documents

WorkItems It's now possible to insert diagrams in a jinja template. E.g.

{{ insert_diagram(work_item, object.tree_view, "tree_view") }}

will insert the tree_view diagram of object. The diagram will be stored with "tree_view" as file name in the work items attachments. If there already is a diagram named tree_view this one will be used instead of generating another one. So if you use the add_tree_diagram serializer, the diagram will only be generated once.