velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nat...@esha.com>
Subject Re: Velocity vmlibs
Date Thu, 16 May 2002 14:25:14 GMT
Bill said:
[snip]
> UtilityTool: General catch-all for conversion utilities, escaping HTML
> characters, min/max, etc. It also hooks into the Common's project
> corg.apache.commons.beanutils.BeanUtils.getProperty() for dynamic
> property lookup (since $bean.$property is a syntax error in Velocity).

cool.  share if you can!

> FormatTool: Date, time, number (currency, etc.) formatting sensitive to
> locale and timezone.

yeah, we've got a DateTool in the tools library right now.  i'm not thrilled
with it's current state, but i'm working on it.  my next patch/proposal
should make locale & timezone support easier.   number/currency formatting
is something we don't have right now.  so again, if you can contribute it,
that'd be cool.

> VelocityTool: Experimental. I started this a few weeks ago and haven't
> gotten pack to it. It provides for an evaluate method to perform dynamic
> evaluations within a template. I had to suspend this the getProperty()
> in the Utility tool solved my immediate need.

neat.  there always seems to be someone looking for this sorta thing on the
user list every now and then.  chances are that someone wants this.

> In terms of packaging, I think that in the realm of the ToolboxManager
> in the velocity-tools area.

the ToolboxManager stuff just went through a major redesign.  now there is a
generic ToolboxManager interface and a few implementations thereof.   it'd
be great if you'd check it out.  the veltools community is pretty small so
far, so more feedback is good.  i'd particularly check out the
XMLToolboxManager.  it supports adding tools to the context, initializing
them, and also now supports string, number, and boolean data.  here's a
quick example of a config file for it:

<toolbox>
    <tool>
        <key>foo</key>
        <class>com.acme.FooTool</class>
    </tool>
    <data type="number">
        <key>myweight</key>
        <value>161.2</value>
    </data>
 </toolbox>

if you are working in a servlet environment, the ServletToolboxManager
offers the same function and adds support for placing tools in different
scopes.  it's already integrated into the VelocityViewServlet, but i'm
curious to hear if people find it difficult to use with their own servlets.

[snip]

Nathan Bubna
nathan@esha.com


--
To unsubscribe, e-mail:   <mailto:velocity-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-dev-help@jakarta.apache.org>


Mime
View raw message