Issue with dynamic references to elements [message #1740371] |
Fri, 12 August 2016 11:28 |
|
Hi,
when I generate text from an owned comment containing dynamic references to elements the link is not resolved.
Script fragment used
[for (c:Comment | p.ownedComment)]
[c._body/]
[/for]
Sample output
The {@link #_2B138FM5EeahzqGgVqHSyg} view describes ...
Am I wrong, i.e. do I have to post-process / filter the text myself or is it an Gendoc / Acceleo issue?
Since -- in my understanding -- Acceleo returns the raw, unprocessed comment another question is:
If this issue is an error, should it be filed to Acceleo or GenDoc?
Regards
Carsten Pitz
|
|
|
Re: Issue with dynamic references to elements [message #1740373 is a reply to message #1740371] |
Fri, 12 August 2016 12:04 |
Tristan Faure Messages: 460 Registered: July 2009 |
Senior Member |
|
|
Hello this is a very interesting question, I assume you are using Papyrus
Then yes it is a Gendoc behavior, something very simple would be to add Papyrus bundles a method to replace "@Link"
For example String replaceLinksByNameOrLabel (String body, Element context)
This method will replace each occurence of {@link #... } by :
- its name if it is a NamedElement
- the result of gendoc getLabel operation otherwise
to call it you would do this :
[for (c:Comment | p.ownedComment)]
[c._body.replaceLinksByNameOrLabel(c) /]
[/for]
does it sound OK for you ? If yes I will open a bug/enhancement on gendoc bugzilla.
Another nice feature would be to generate hyperlinks according to the @Link values but it is a little bit more complex
[Updated on: Fri, 12 August 2016 12:05] Report message to a moderator
|
|
|
Re: Issue with dynamic references to elements [message #1740375 is a reply to message #1740373] |
Fri, 12 August 2016 12:19 |
|
Many thanks Tristan,
your proposal is not just OK for me, it is my preferred solution because it gives the choice either to use the comment as is or "post-processed".
And yes, I use Papyrus. In this very case my playground installation the Papyrus 2.0.0 version with GenDoc 0.6.0RC1.
Regards
Carsten Pitz
|
|
|
|
Powered by
FUDForum. Page generated in 0.03106 seconds