You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Eelco Hillenius <ee...@topicus.nl> on 2003/07/02 22:23:34 UTC

velocity tools playground

So, did you (the current maintainers) think about creating something like a playground for contributions like earlier mentioned on this list? Or do you think the wiki should play that role?

Anyway, I think this is a small but usefull patch. In my opinion it is a very common case to work with longs (timestamps) internally where you want to display dates.

-- BEGIN

Index: DateTool.java
===================================================================
RCS file: /home/cvspublic/jakarta-velocity-tools/src/java/org/apache/velocity/tools/generic/DateTool.java,v
retrieving revision 1.2
diff -u -r1.2 DateTool.java
--- DateTool.java 28 May 2003 00:17:15 -0000 1.2
+++ DateTool.java 2 Jul 2003 20:18:56 -0000
@@ -282,6 +282,12 @@
         {
             return ((Calendar)obj).getTime();
         }
+  if(obj instanceof Long) 
+  {
+   Date d = new Date();
+   d.setTime(((Long)obj).longValue());
+   return d;
+  }
         try
         {
             //try parsing the obj as String w/a DateFormat

-- END

Eelco

Re: velocity tools playground

Posted by Nathan Bubna <na...@esha.com>.
Eelco Hillenius said:
> So, did you (the current maintainers) think about creating something like a
> playground for contributions like earlier mentioned on this list? Or do you
think
> the wiki should play that role?

I'm pretty sure there isn't any feasible way to create/have an open
"playground" in CVS.  Really, for those w/o commit access, the forums for
ideas and development are the wiki, the mailing lists, and bugzilla.

as far as openness, ease of use and organization, i think the wiki is your
best bet for a "playground."  it's also a really good place to capture and
organize valuable discussions on the mailing lists.  once a patch for a bug or
enhancement is developed and production-ready, it should probably still be
submitted to bugzilla for the sake of permanence and visibility.

> Anyway, I think this is a small but usefull patch. In my opinion it is a
very common
> case to work with longs (timestamps) internally where you want to display
dates.

yes, i think it is a reasonable patch.  i'll get it in ASAP.

P.S.  plain text emails are much preferred on these lists. :-)

Nathan Bubna
nathan@esha.com


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


Re: velocity tools playground

Posted by Will Glass-Husain <wg...@forio.com>.
Hi,

If you put a patch on the wiki, remember to bracket it with <nowiki> 
</nowiki> so it doesn't get interpreted.  You might want to use a <PRE> tag
as well.

WILL

----- Original Message ----- 
From: "Tim Colson" <tc...@cisco.com>
To: "'Velocity Developers List'" <ve...@jakarta.apache.org>
Sent: Thursday, July 03, 2003 8:45 AM
Subject: RE: velocity tools playground


> Eelco -
>
> I'm not a maintainer, but I'll give you my opinion, valued at far less
> than 2 cents. :-)
>
> Personally, I like the idea of folks throwing patches like this one up
> on a VelocityPatches page on the wiki. If people who try the patches
> like it, the people working on the official code (in this case Nathan, I
> think) could pull it into the official distro.
>
> I know the official method is to submit a patch via bugzilla, but that
> seems a bit rigid. Maybe I've got a patch I want folks to be able to
> play with and give me feedback. If they think my patch is worthwhile,
> they might even suggest improvements, and then maybe I'd submit it for
> official consideration.
>
> The wiki seems perfect for this playground to me.
> Timo
>
>
> -----Original Message-----
> From: Eelco Hillenius [mailto:eelco.hillenius@topicus.nl]
> Sent: Wednesday, July 02, 2003 1:24 PM
> To: Velocity Developers List
> Subject: velocity tools playground
>
>
> So, did you (the current maintainers) think about creating something
> like a playground for contributions like earlier mentioned on this list?
> Or do you think the wiki should play that role?
>
> Anyway, I think this is a small but usefull patch. In my opinion it is a
> very common case to work with longs (timestamps) internally where you
> want to display dates.
>
> -- BEGIN
>
> Index: DateTool.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-velocity-tools/src/java/org/apache/velocity/tool
> s/generic/DateTool.java,v
> retrieving revision 1.2
> diff -u -r1.2 DateTool.java
> --- DateTool.java 28 May 2003 00:17:15 -0000 1.2
> +++ DateTool.java 2 Jul 2003 20:18:56 -0000
> @@ -282,6 +282,12 @@
>          {
>              return ((Calendar)obj).getTime();
>          }
> +  if(obj instanceof Long)
> +  {
> +   Date d = new Date();
> +   d.setTime(((Long)obj).longValue());
> +   return d;
> +  }
>          try
>          {
>              //try parsing the obj as String w/a DateFormat
>
> -- END
>
> Eelco
>
>


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


RE: velocity tools playground

Posted by Tim Colson <tc...@cisco.com>.
Eelco -
 
I'm not a maintainer, but I'll give you my opinion, valued at far less
than 2 cents. :-)
 
Personally, I like the idea of folks throwing patches like this one up
on a VelocityPatches page on the wiki. If people who try the patches
like it, the people working on the official code (in this case Nathan, I
think) could pull it into the official distro.
 
I know the official method is to submit a patch via bugzilla, but that
seems a bit rigid. Maybe I've got a patch I want folks to be able to
play with and give me feedback. If they think my patch is worthwhile,
they might even suggest improvements, and then maybe I'd submit it for
official consideration.
 
The wiki seems perfect for this playground to me. 
Timo
 

-----Original Message-----
From: Eelco Hillenius [mailto:eelco.hillenius@topicus.nl] 
Sent: Wednesday, July 02, 2003 1:24 PM
To: Velocity Developers List
Subject: velocity tools playground


So, did you (the current maintainers) think about creating something
like a playground for contributions like earlier mentioned on this list?
Or do you think the wiki should play that role?
 
Anyway, I think this is a small but usefull patch. In my opinion it is a
very common case to work with longs (timestamps) internally where you
want to display dates.
 
-- BEGIN
 
Index: DateTool.java
===================================================================
RCS file:
/home/cvspublic/jakarta-velocity-tools/src/java/org/apache/velocity/tool
s/generic/DateTool.java,v
retrieving revision 1.2
diff -u -r1.2 DateTool.java
--- DateTool.java 28 May 2003 00:17:15 -0000 1.2
+++ DateTool.java 2 Jul 2003 20:18:56 -0000
@@ -282,6 +282,12 @@
         {
             return ((Calendar)obj).getTime();
         }
+  if(obj instanceof Long) 
+  {
+   Date d = new Date();
+   d.setTime(((Long)obj).longValue());
+   return d;
+  }
         try
         {
             //try parsing the obj as String w/a DateFormat

-- END
 
Eelco