Bill said:
> With the discussion about whether or not to keep a separate generic
> tools directory, I thought it would be helpful to come up with a list of
> tools that would be nice to have. Many may have been mentioned on this
> or the users list and may already exist in some form that would allow
> them to be reused with little effort. With some of the tools listed
> below there's some overlap in functiontionality but the main thing I was
> trying to do is come up with some sort of list.
good idea.
> EmailTool - Send email using a template. Having this functionality can
> make a compelling reason to use Velocity since you can't really do this
> with JSP. Potentially, this could use an already configured
> VelocityEngine in VelocityViewServlet, and/or, it could be completely
> stand alone requiring it's own configured VelocityEngine instance and
> not be dependent on the servlet API. I've heard Turbine has such a tool.
hmm. something like this could be very cool. my instinct would be to say
it shouldn't be tied to the VVS. while we definitely want it to be able to
work with that, i don't think we should tie people to it. i'm curious that
you called it EmailTool. do you anticipate using this as a tool with the
ToolboxManager et. al.? i'm trying to envision how such functionality would
best be structered/implemented.
> IteratorTool - A wrapper class that converts various classes and
> interfaces into an iterator. ...FisherMill implements most of
> these features
yeah, i've already noted intention to clean it up and add it in the STATUS.
> See also webwork.util.MakeIterator
> , webwork.util.SubsetIteratorFilter
> and JSP taglib
> IteratorMergeTool - A wrapper class that allows merging two (or more)
> See also webwork.util.MergeIteratorFilter
> IteratorSortTool - Sorts an iterator.
> webwork.util.SortIteratorFilter
if there's demand and patch/contrib for these functions, then i'll give 'em
a run through, but i don't have time or motivation to really look into or
dev this myself.
> IteratorBeanTool - Iterates over properties on a Bean.
> #foreach ( $property in $beanIterater($person) )
> Name: $property.name
> Value: $property.value
> Type: $property.type
> #if ( $property.instanceof("String") )
> $property.name is a String
> #end
> #end
intriguing. not sure i totally follow or like what's happening here, and
the syntax is invalid ($beanIterater($person) is a no-no). but i'd be
interested in seeing code for such a function/tool.
> EvalTool - Evaluates a Velocity expression into the current output
> Writer or context varible.
yeah, i'll probably check this in shortly. i guess i'm forced to take
geir's silence as a sign that he isn't retracting his opposition to folding
tools/tools into tools/view. frustrating.
> MapTool - Converts an ArrayList of name=value pairs into a real Map.
> Until real Map support is added, this could be a useful way of
> specifying named parameters to methods, macros and directives.
hmm. well, hopefully we won't have to wait forever for the Map support
patch/proposal to get into a release of Velocity proper, but until then,
this may indeed come in handy to some folks. we'll just deprecate/drop it
when the time comes.
> JavaTool - helper methods for Java costructs that aren't supported
> natively through VTL.
> - Array length
> - instanceof
blech. i can't say i'm a fan of this at all. i *really* despise the idea
of instanceof checks happening in a "view" (as in the 'V' of MVC)
technology. need for that in a template just screams bad design to me.
likewise, people probably shouldn't be doing anything more than #foreach on
arrays in a template. and most of all, if anyone really needs either of
these things, then writing a tool to do them is *really* simple.
> NumberTool - Parses a number specified as a String into a Float, Long,
> etc. Should also support parsing locale specific formatting. May also
> support formatting numbers as well or that could be a separate
> NumberFormatTool class.
hmm. MathTool already does parsing (albeit minus locale support, but
patches are welcome!). as for number->string formatting, i don't think
MathTool is the place.
> StringTool - Formats and converts strings in various ways. See
no. just use org.apache.commons.lang.StringUtils
it has a public constructor and provides these functions. but, all this
does bring up a point on documentation. (Tim, you reading this?) in our
tools documentation, it'd probably be good to point people to the utils
available to them in commons-lang.
> DateTimeTool - Formats and converts dates and times in various ways.
if there's something there you want that isn't in the already existing
DateTool, then send a patch. otherwise, we don't need another one.
> I18NTool - Formats Strings, Numbers, Currency, Percent, DateTime, Date
> and time in a locale specific manner.
this sounds nice. i might prefer calling it FormatTool, so formatting
that's not really locale-dependent would fit comfortably as well. i think
this would probably be the best place for doing general number formatting as
well.
so, by my reckoning the list ought be:
-----------
IteratorTool/FisherMill - nathan will commit
EvalTool - nathan will commit
FormatTool - takers anyone?
MapTool (temporary only) - takers anyone?
EmailTool - more discussion/someone to work on it?
IterateBeanTool - more discussion/someone to work on it?
Add locale-sensitive parsing to MathTool - takers anyone?
other iterator/list support within/beyond FisherMill - any interest?
----------
good start to discussion. i'll slip these items (and others anyone?) into
the STATUS doc to keep tabs on them.
Nathan Bubna
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]