velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergiy Kovalchuk (JIRA)" <>
Subject [jira] Commented: (VELTOOLS-113) new DisplayTool features
Date Wed, 11 Feb 2009 01:15:59 GMT


Sergiy Kovalchuk commented on VELTOOLS-113:

I am almost done implementing those, will upload patch in next couple days. Is it ok to put
everything into single patch? Do you need unit tests for those?

Also while I am at it I wanted to add another method:

$display.plural(int num, String singular, String plural)

that will try to build plural form of a noun if "plural" param is not set (based on couple
simple rules), otherwise will just return provided "plural". For example:

plural(5, "cat") => cats
plural(5, "fox") => foxes
plural(5, "mouse", "mice") => mice
plural(1,  "mouse", "mice") => mouse

> new DisplayTool features
> ------------------------
>                 Key: VELTOOLS-113
>                 URL:
>             Project: Velocity Tools
>          Issue Type: New Feature
>          Components: GenericTools
>            Reporter: Nathan Bubna
>            Priority: Minor
> More ideas from the dev list:
> ----------------------------------------------------------------------------------------------
> On Sat, Feb 7, 2009 at 3:41 PM,  <> wrote:
> Hello,
> I wanted to share with you a few ideas I have about new simple
> improvements for DisplayTools. I should be able to make patches for
> them if you are interested.
> #snip
> 2. Add new "property" parameter to
> list(Object list, String delim, String finaldelim, String property)
> method that will format an array or collection of objects on selected
> property (similar to SortTools).
> 3. Add new method:
> stripTags(Object obj, String... allowedTags)
> that will strip all (html) tags from the text except those listed in
> allowedTags (allowed tags are passed like this: "br","img","p").
> 4. Add new method:
> br(Object obj)
> that will replace \n with "<br />\n"
> 5. Add new "preserveWords" parameter to:
> truncate(Object truncateMe, int maxLength, String suffix, boolean preserveWords)
> that will truncate a string to a last complete word within maxLength
> instead of exact character.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message