Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » LoadURI from the "commons" bundle(unclear description in the tutorial)
LoadURI from the "commons" bundle [message #1613043] Thu, 12 February 2015 11:17 Go to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Hi,

According to the documentation, it seems that the loadURI could provide an interesting facility to works with severral of source models in parallel.

Does anybody have try using this service and could provide a working example, please?

The description in the new tutorial is not clear:

Quote:

loadURI(uri : String) : String
Load a model from its URI. For example, the call : p.load('file://c:/test/file.notation') will load the file located at file://c:/test/file.notation.
Loading another model in order to be able to use its elements in script


Is the provided signature actually the right one?

How shall it be used to set the value of a variable in the "let" statement?

Thanks,

Yves


Yves

[Updated on: Thu, 12 February 2015 11:18]

Report message to a moderator

Re: LoadURI from the "commons" bundle [message #1693153 is a reply to message #1613043] Wed, 22 April 2015 06:41 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hello
as defined in 8.1.1 section in gendoc documentation : http://www.eclipse.org/gendoc/documentation/Gendoc_v0.5_tutorial.pdf

element.load ('extension') will look the resource corresponding to the given element the new extension.
Example element is contained in resource file://c:/test/model.uml
the call : element.load ('notation') will load file://c:/test/model.notation

There are other services to load absolute uri or relative
-loadRelative
-loadURI




Re: LoadURI from the "commons" bundle [message #1693435 is a reply to message #1693153] Fri, 24 April 2015 08:46 Go to previous messageGo to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Hi Tristan,

Yes I read that, my point is: how to use those statements in practical terms.

How can I use them in "let" statement in order to assign a variable? In the examples given is the document, it's not clear how "p" is declared and initialized.

A sample of code would be fine.


Yves

[Updated on: Fri, 24 April 2015 08:47]

Report message to a moderator

Re: LoadURI from the "commons" bundle [message #1693469 is a reply to message #1693435] Fri, 24 April 2015 12:15 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Actually all the load services returns an empty String so you just have to put it in your template and then call other queries getting elements.
Please take care that Acceleo has a cache which always return the same value from a given argument. So if you do :
let e = query(element)
e.load(...)
let e2 = query(element)
e2 will be equals to e1 even if some new resources have been loaded




Previous Topic:GenDoc compatibility with Eclipse Luna SR1a?
Goto Forum:
  


Current Time: Tue Apr 23 16:12:21 GMT 2024

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

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

Back to the top