Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo3] properties file
[Acceleo3] properties file [message #662217] Tue, 29 March 2011 14:27 Go to next message
Eclipse UserFriend
Hi!,

I was searching for information about the use of getProperty and the properties file.
I think that the use of properties file is only possible inside the acceleo project...

But...Could be possible to have a file (maybe a properties file) but next to the uml file (so could be possible to have properties attached to an uml diagram) in a way that can be used to generate code?

For example, in my case it could be nice that if I have a properties file with a propertie that told me from where to import the 'persistence'
Thank you!
Re: [Acceleo3] properties file [message #662298 is a reply to message #662217] Wed, 30 March 2011 03:40 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sergio,

With Acceleo 3.0.x, it is possible but it is a bit tricky since it will require some changes in the Java launcher class generated by Acceleo.

You would have to override the method "createAcceleoService()" to access the Acceleo service instance used during your generation. From there you can simply use the 'addProperties' methods to add new properties.

With Acceleo 3.1.x, starting with M6, it is now way easier to manipulate properties files. You can create an AbstractPropertiesLoaderService that will have to return the java.util.Properties object matching the given name (persistence.properties for example). With this new mechanism, you will be able to load your properties files as you want. You can have a look here to have more informations.

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com
Re: [Acceleo3] properties file [message #662437 is a reply to message #662298] Wed, 30 March 2011 12:26 Go to previous message
Eclipse UserFriend
great!

thank you!
Previous Topic:[Xpand] Error "Couldn't find property 'a' for type 'b::c'" when "a" is EDataType
Next Topic:Workflow
Goto Forum:
  


Current Time: Fri Jul 25 03:50:41 EDT 2025

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

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

Back to the top