Skip to main content



      Home
Home » Eclipse Projects » Gendoc » Issue with dynamic references to elements
Issue with dynamic references to elements [message #1740371] Fri, 12 August 2016 07:28 Go to next message
Eclipse UserFriend
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 08:04 Go to previous messageGo to next message
Eclipse UserFriend
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 08:05] by Moderator

Re: Issue with dynamic references to elements [message #1740375 is a reply to message #1740373] Fri, 12 August 2016 08:19 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Issue with dynamic references to elements [message #1740380 is a reply to message #1740375] Fri, 12 August 2016 08:44 Go to previous message
Eclipse UserFriend
Good, we have opened a bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=499604
Previous Topic:Relative path on static images
Next Topic:Gendoc and submodel
Goto Forum:
  


Current Time: Wed Jul 23 06:24:33 EDT 2025

Powered by FUDForum. Page generated in 0.04274 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top