You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Nathan Bubna <nb...@gmail.com> on 2005/11/17 20:02:27 UTC

MessageTool improvements Was: Re: Is there a line continuation character in Velocity?

On 11/17/05, Glenn Holmer <gh...@weycogroup.com> wrote:
> On Thursday 17 November 2005 12:08, Nathan Bubna wrote:
> > i don't believe there is in Velocity 1.4.  in the upcoming 1.5
> > release, there is support for multi-line directives, string literals,
> > and set statments.
>
> I'll live with it :)  The only place where I've really wished I had it
> is the example I gave (Struts tools, $text.get with a bunch of
> parameters).

heh.  then you'll probably appreciate what i have in store for
MessageTool (aka $text).   it should make it much easier for you to
clean things up a bit.  basically, i want to improve on my TextKey
trick in VelocityTools 1.2 to enable more readable and flexible syntax
such as the following:

$text.foo.bar.exists  instead of  $text.exists("foo.bar")

$text.foo.setArgs([$baz])  instead of  $text.get('foo', [$baz])

and probably

#set( $foo = $text.foo.addArg($baz) )
$foo.addArg($woogie)
$foo.addArg($wally)

instead of

$text.get('foo', [$baz, $woogie])
$text.get('foo', [$baz, $wally])

there'll also be a setBundle() method:

#set( $foo = $text.foo.setBundle('whatever') )
$foo.bar
$foo.title
$foo.button

instead of

$text.get('foo.bar', 'whatever')
$text.get('foo.title', 'whatever')
$text.get('foo.button', 'whatever')

get the idea?

i actually pretty much finished it a while ago.  perhaps i'll test and
check in soon...

> --
> ____________________________________________________________
> Glenn Holmer                          gholmer@weycogroup.com
> Software Engineer                        phone: 414-908-1809
> Weyco Group, Inc.                          fax: 414-908-1601
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org