Book a Demo

Author Topic: Inserting a hyplerlink in an rtf auto-generated document  (Read 8256 times)

roates

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
  • It is not that hard
    • View Profile
Inserting a hyplerlink in an rtf auto-generated document
« on: November 12, 2018, 10:12:33 am »
Hi,

I'm hoping someone may have experience with this issue and a way forward.

When working with rtf document templates a hyperlink can be added via [Publish | Insert | Hypelink] which causes a dialog to be displayed seeking two values:
1. Link Text
2. Link Code (or URL)

In my document I'm creating a list of policy documents, represented in the model by ArchiMate_Contract elements.

I would like to have each element name displayed in the list to be a hyperlink using the following field values:

1. {Element.Name}
2. {Element.valueOf(Dept.EA::Hyperlink1)}

Can someone comment on whether this is possible and if so, how it is done when editing an rtf template?

regards,

Russell


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Inserting a hyplerlink in an rtf auto-generated document
« Reply #1 on: November 12, 2018, 05:51:03 pm »
I think the ValueOf can only be used for tagged values.
I'm not sure what "Dept.EA::Hyperlink1" refers to, but if it is a tagged value I guess it should work.

In case that doesn't work you can always resort to using an SQL fragment.
I often use that for this type of information.

Third alternative is to use a linked document to store that information.
We often include linked documents into our document generation for those parts that change only now and then, such as introduction, version history etc..
This is of course only an option if you don't need that info in a structured way.

Geert

roates

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
  • It is not that hard
    • View Profile
Re: Inserting a hyplerlink in an rtf auto-generated document
« Reply #2 on: November 13, 2018, 07:48:59 am »
Hi Geert,

Thanks for taking the time to comment. I didn't explain it very well :)

Yes you're right that was a tagged value.

For the sake of example, let's say we have 2 properties of an element that we want to combine in an RTF report as a clickable hyperlink in the outputted document:

We'll use Element.Name and Element.Alias an enter the following data into those fields:

Element.Name = "Google"
Element.Alias = "https://google.com"

Question, how to combine both of those fields in the rtf template so that the printed output will look and behave like a standard hyperlink in the document?

Sparx provides for adding a hyperlink to a rtf template via the Insert | Hyperlink menu item. That displays a two field dialog-box (Link Text, Link Code (or URL)).

That seems the only mechanism for adding a hyperlink and it doesn't support entering anything from a model data field.

So basic question, how does one present model data via a hyperlink structure in an rtf template?

cheers,

Russell







benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: Inserting a hyplerlink in an rtf auto-generated document
« Reply #3 on: November 13, 2018, 10:18:19 am »
Hi Russell,

I haven't experimented with your particular use case, but I have tried something similar before when generating a data dictionary. I was generating a list of base class names (for the current class being reported on) and I wanted to combine the base name with a hyperlink to the base class (parent element) somewhere else in the document.

As Geert suggests, I had to use a custom query. The same approach could work for you - it might be worth a try anyway.

For details on how to set up the custom query, see this webinar video at around 7:30 mins:
https://sparxsystems.com/resources/webinar/documentation/data-dictionary-enhanced/enterprise-architect-enhanced-document-generation.htm

I hope that helps.


roates

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
  • It is not that hard
    • View Profile
Re: Inserting a hyplerlink in an rtf auto-generated document
« Reply #4 on: November 13, 2018, 02:06:07 pm »
Hi Ben,

Thanks for your comment and the video link!

Your approach may certainly do the trick. I'll report back how it goes.

Great video BTW.

cheers,

Russell

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: Inserting a hyplerlink in an rtf auto-generated document
« Reply #5 on: November 15, 2018, 03:18:14 pm »
Hi Russell,

I investigated the idea a bit further with respect to your use case, and unfortunately that won't work. EA would need a delimiter to separate the combined URL/label string (possibly something as simple as a space would suffice if the URL was listed first). The GUID/label approach I used already provides a delimiter by virtue of the braces in the GUID. Some additional smarts are probably needed in the generator to detect and handle this situation as well.

I'd encourage you to submit a feature request for this.

Ben