Capella links inside descriptions of elements

115 views Asked by At

In Capella, in the descriptions of my model elements, I am using hypertext links towards other elements of the model. When I generate a document with M2Doc, these links are not properly transformed/interpreted.

Example: a Capella hypertext link towards the "Cabin Screen" model element...

<p>Link:</p>
<p><a href="hlink://11e922f1-192b-43a5-9060-f935c26998a5">Cabin Screen</a></p>

... becomes an hypertext link with the following address in the generated Word document:

hlink://11e922f1-192b-43a5-9060-f935c26998a5/

But there is no way to "follow this link": Resulting link in Word & Impossible navigation

What I need to achieve is to have the original link transformed in a bookmark reference (I have a bookmark for this element somewhere else in my document)

{REF 11e922f1-192b-43a5-9060-f935c26998a5 \h }

I was wondering whether one service allows to automatically transform these links in bookmark references (BookmarkRef)? If not, has this request been raised already?

1

There are 1 answers

1
Yvan Lussaud On

This replacement depend on the way you are creating your bookmark IDs. If you are using the same way as the sample templates provided with the M2Doc IFE project, you can use the replaceLink() service. This service is only available if you install M2Doc Capella extensions. You can use it like this:

myCapellaElement.description.fromHTMLBodyString().replaceLink(myCapellaElement)

Otherwise you can have a look at the implementation to implement your own version.