Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Issue with dynamic references to elements
Issue with dynamic references to elements [message #1740371] Fri, 12 August 2016 11:28 Go to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
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 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
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 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
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 12:44 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
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: Fri Apr 19 14:11:46 GMT 2024

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

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

Back to the top