You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2001/03/15 07:14:04 UTC

IMPORTANT NOTICE - properties have changed

Today, working towards the 1.0 release, Jason finished his cleanup of
the Velocity properties.

This may cause pain, as things changed.  But they are for the better, so
before you use the latest build with existing apps / servlets, make sure
you update your properties, and move Runtime class calls to Velocity
class calls.

Many people probably rely on the built-in default properties, so this
won't be as heinous as it appears - I believe most people use only a few
anyway.

This involved two sets of changes :

1) property names : many have been changed to normalize their patterns
and make the meanings clear.  Therefore, if you have velocity.properties
files, you will need to change the properties.  The new properties can
be found in 

  /org/apache/velocity/runtime/defaults/velocity.properties

as well as described in the developer docs on the site (will be checked
in tonight...).

The biggest changes are how the resources are set up, and the addition
of 'multi-valued properties' :

resource set up :

resource.loader = <name>
<name>.resource.loader.path = <path1>,<path2>,<path3>
<name>.resource.loader.cache = false
(etc)

ex (from the defaults)

resource.loader = file

file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = .
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2

Further, resource.loader and <name>.resource.loader.path should support
multiple, comma-separated values to have multiple simultaneous loaders,
as well as multiple paths for the FileResourceLoader and the
JarResourceLoader.

2) configuration API : the configuration API should be accessed via the
o.a.v.app.Velocity class :

Velocity.setProperty( String, Object)
Object Velocity.getProperty( String )
Velocity.init()
Velocity.init( filename )
Velocity.init( Properties )

These delegate through to the Runtime class, but we reserve the right to
do what we want in Runtime, and will do everything possible to keep the
application API stable in Velocity.  For instance, I suppose that
Runtime.init( filename) and Runtime.init( Properties ) might go away.


Over there next few days, there will be a few nips and tucks as this
gets finished, so try to pay attention  :)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

RE: IMPORTANT NOTICE - properties have changed

Posted by Paulo Gaspar <pa...@krankikom.de>.
This order change still makes no sense to me. It confuses me even while 
just reading the properties.

When I start reading a line from a property file, I immediately expect 
finding what kind of property it is with the first token, just as it 
happens in most property files.

If I find "resource", I immediately know that it is a resource related 
property, but if I find "file", I have to go on reading the rest and
even looking up where the hell this "file" come from. And if the line 
is something like
  dbsource.resource.loader.modificationCheckInterval = 2

I will tend to think that it is some new data extraction thing instead
of a database resource loader, until I read the rest.

It is a fraction of a second but it is enough to slow down a visual 
text scan.


Making a property file more English-like in word ordering and so makes
as less sense to me as trying to make English more Java-like.


Keep in mind that I am against the idea and not (at all) against the 
person.


Thanks and have fun,
Paulo Gaspar


> -----Original Message-----
> From: gmj@mta4.srv.hcvlny.cv.net [mailto:gmj@mta4.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> 
> 
> ex (from the defaults)
> 
> resource.loader = file
> 
> file.resource.loader.description = Velocity File Resource Loader
> file.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> file.resource.loader.path = .
> file.resource.loader.cache = false
> file.resource.loader.modificationCheckInterval = 2
>