-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Where to place velocity.properties?
PostPosted: Thu Feb 16, 2006 6:35 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
As I modified the Velocity templates for my POJO generation I want to some settings for Velocity in velocity.properties.

I already placed the velocity.properties in my project home or in the plugins directory, but the settings were ignored. Who can tell me where I have to put the file that it is recognized while generating templates with hbm2template.

Rgds,
Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 7:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what do you need to set in velocity.properties ?

I explicitly prevent it to isolate its inner workings.

btw. fyi the next version will use freemarker instead of velocity.

still would be interested in knowing what additonal setup you want to do ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:24 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
max wrote:
btw. fyi the next version will use freemarker instead of velocity.


I already read that Velocity will be replaced by freemarker. I am not very happy with that, but I have to live with that. Best would be to make the template engine configurable if possible.

max wrote:
still would be interested in knowing what additonal setup you want to do ?

I want to set the parameter
Code:
velocimarco.permissions.allow.inline.to.replace.global=true


I wrote a macro to get

Code:
public static final String MY_PROPERTY = "myProperty";

constants in my classes. The macro generates the MY_PROPERTY String from a property-name. Even if the macro is not overridden locally I get a warning when generating my templates.

Code:
[hibernatetool] WARN   logVelocityMessage, Velocimacro : VM addition rejected : getUpperCaseAccessor : inline not allowed to replace existing VM


As I need this String in serveral places in my code, I thought best would be to write a macro for that.

Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
caterham wrote:
max wrote:
btw. fyi the next version will use freemarker instead of velocity.


I already read that Velocity will be replaced by freemarker. I am not very happy with that, but I have to live with that. Best would be to make the template engine configurable if possible.


I did not see you commenting on why it would be a bad thing ?

but note nothing prevents you from using Velocity in your own implementation of Exporter ? (we just don't want to maintain velocity templates because they are simply to fragile)

max wrote:
still would be interested in knowing what additonal setup you want to do ?

I want to set the parameter
Code:
velocimarco.permissions.allow.inline.to.replace.global=true

[/quote]

hmm ... if velocity reads the system properties then you can set it globally, but as it is now it is not really possible to override the velocity.properties thing...we call engine.init(p) where p is the set of settings needed by the tools.

btw. i don't get why you need it enabled ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:52 am 
Beginner
Beginner

Joined: Thu Nov 25, 2004 7:07 am
Posts: 43
Location: Germany
max wrote:
I did not see you commenting on why it would be a bad thing ?

but note nothing prevents you from using Velocity in your own implementation of Exporter ? (we just don't want to maintain velocity templates because they are simply to fragile)
[/qoute]

I saw your voting thread, but the decision was already done. And it's just because I got used to velocity now. I think I will get used to freemarker, too. Maybe it will take some time (we all don't have).

max wrote:
caterham wrote:
I want to set the parameter
Code:
velocimarco.permissions.allow.inline.to.replace.global=true



hmm ... if velocity reads the system properties then you can set it globally, but as it is now it is not really possible to override the velocity.properties thing...we call engine.init(p) where p is the set of settings needed by the tools.

btw. i don't get why you need it enabled ;)

I will try the system properties way. The only reason is, I want to get rid off that warning message. Maybe I should define an other log level instead. ;-)

Axel

_________________
You'll never get a second chance to make a first impression!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well - objective comments are still very welcome ;)

...and yes, velocity is very verbose about its stuff...complete nightmare, right ? :)

I think you will like freemarker; and please don't hesitate to tell me if something is bad (or even good) about it ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.