Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] How to get the TargetFolder from script(I need to get the targetFolder from the language)
[Acceleo] How to get the TargetFolder from script [message #1001230] Wed, 16 January 2013 04:33 Go to next message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Hello,

There is any standard variable or command to get the target folder from an Acceleo script?

I'd like to do something like this:

[template private pathToDataFile(aClass : Class)]
[targetFolder/]/[aClass.testDataFileName()/]
[/template]

and then, in the main template


br = new BufferedReader( new FileReader (new File ("[aClass.pathToDataFile()/]")));


If I dont add the target folder to the path, the generated code cannot find the test data file.

Thank you!
Re: [Acceleo] How to get the TargetFolder from script [message #1001709 is a reply to message #1001230] Thu, 17 January 2013 03:57 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

This feature does not exists. You can't retrieve the target folder from the generator unless you create a Java service to do it by keeping in memory the target folder given to your Java launcher.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



Re: [Acceleo] How to get the TargetFolder from script [message #1002319 is a reply to message #1001709] Fri, 18 January 2013 06:53 Go to previous message
Federico Toledo is currently offline Federico Toledo
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
thank you! I've made it work in that way
Previous Topic:[Acceleo] Accents
Next Topic:Model, XML, XMLSchema, XMI and Model -to-text transformation
Goto Forum:
  


Current Time: Mon Jul 28 22:48:32 EDT 2014

Powered by FUDForum. Page generated in 0.05590 seconds