velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Colson <tcol...@happysearch.com>
Subject VelocityFormatter and other tools
Date Tue, 01 Jul 2003 19:01:57 GMT
Say folks -
  I've been around for a while, but didn't realize there is a
VelocityFormatter class in the core that has some format functionality.

The only docs seem to be javadoc right now, and one of the archive posts
seems to indicate that this class should move over into the Tools area.

Before posing anything for the velocity-developers, I'm interest in some
user feedback on this feature.

Do you use this formatter?
How did you find out about it?
Did you know it has a nifty little Alternator method?

Would it cause a lot of pain if this class was removed from the core and
placed into the tools package?

Assuming somebody (like me) were to write up documentation, what do you
think of the format Gabriel used here:
http://www.happysearch.com/velocity/tools/docs/generic/DateTool.html

Too technical? Just right?

Would you find it useful to have separate User and Developer guides for
tools?

Also just curious, would you prefer a tool that 'acts upon a data
item' or a wrapper that 'wraps the data item'?
Ex. Using a tool that acts on a data item
context.put("formatTool", new VelocityFormatter());
context.put("start_date", record.getStartDate());

Template
$formatterTool.formatShortDate($start_date)

Or using a wrapper called Formatter...
context.put("start_date", new Formatter(record.getStartDate()) );

Template
$start_date = which defaults to getShortDate(), or whatever the
Formatter.setDefaultFormat(SimpleDateFormat.SHORT) is set to
$start_date.LONG() = which calls getLONG()
$start_date.xxxx = which calls whatever additional stuff the formatter can
do



Cheers,
Timo




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


Mime
View raw message