Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Properties
[Acceleo] Properties [message #537473] Wed, 02 June 2010 10:55 Go to next message
Daniel  is currently offline Daniel
Messages: 44
Registered: June 2010
Member
Hi, I am trying to migrate the UML2java module to Acceleo 3.0.0.

I used the mt2mtl feature and I have seen that it doesnt import the properties files, for example, in a template called class.mtl it has generated:

[if (getProperty('gen.constructor') = true)]

And I know that refers to a file named default.properties in which I found the following

# Generate default constructor
gen.constructor=true

Should I copy-paste it and thats all or should I do any other thing to get it work?

Thank you very much.
Re: [Acceleo] Properties [message #537489 is a reply to message #537473] Wed, 02 June 2010 11:29 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1622
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020500010504050201000303
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Daniel,

[if (getProperty('gen.constructor') = true)] will not work out of the
box : properties are Strings, so you should have
"getProperty('gen.constructor') = 'true'" instead (we no longer try and
adapt types).

Other than that, the properties system is still present in Acceleo 3.0,
but it is more organized than it was in Acceleo 2. You now need to
explicitely tell Acceleo which properties files it should use, and
that's done through the generated Java launcher. Please see the
documentation of the "getProperties()" method of the launcher, or in the
provided documentation : Help => Help Contents ; go into "Acceleo Model
To Text" and open the User Guide. Documentation of the properties usage
is in the section "Customizing Acceleo Generations With Properties".

This should do the trick ^^.

Laurent Goubet
Obeo

Daniel wrote:
> Hi, I am trying to migrate the UML2java module to Acceleo 3.0.0.
>
> I used the mt2mtl feature and I have seen that it doesnt import the
> properties files, for example, in a template called class.mtl it has
> generated:
>
> [if (getProperty('gen.constructor') = true)]
>
> And I know that refers to a file named default.properties in which I
> found the following
>
> # Generate default constructor
> gen.constructor=true
>
> Should I copy-paste it and thats all or should I do any other thing to
> get it work?
>
> Thank you very much.


--------------020500010504050201000303
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------020500010504050201000303--
Re: [Acceleo] Properties [message #538196 is a reply to message #537489] Sun, 06 June 2010 05:49 Go to previous message
Daniel  is currently offline Daniel
Messages: 44
Registered: June 2010
Member
Thank you very much!!!
Previous Topic:[JET] Running JET via Java Code only returns static contents of the template
Next Topic:[Acceleo] Fix me!
Goto Forum:
  


Current Time: Fri Aug 01 01:49:31 EDT 2014

Powered by FUDForum. Page generated in 0.03447 seconds