Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 12564 invoked from network); 3 Nov 2003 17:13:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Nov 2003 17:13:35 -0000 Received: (qmail 73247 invoked by uid 500); 3 Nov 2003 17:13:28 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 73075 invoked by uid 500); 3 Nov 2003 17:13:27 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 73064 invoked by uid 500); 3 Nov 2003 17:13:27 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 73061 invoked from network); 3 Nov 2003 17:13:26 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 3 Nov 2003 17:13:26 -0000 Received: (qmail 12456 invoked by uid 1758); 3 Nov 2003 17:13:33 -0000 Date: 3 Nov 2003 17:13:33 -0000 Message-ID: <20031103171333.12455.qmail@minotaur.apache.org> From: unico@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/generation TraversableGenerator.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N unico 2003/11/03 09:13:33 Modified: src/blocks/repository/java/org/apache/cocoon/generation TraversableGenerator.java Log: add timeZone configuration option in order to produce proper rfc2068 dates Revision Changes Path 1.4 +12 -1 cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/generation/TraversableGenerator.java Index: TraversableGenerator.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/generation/TraversableGenerator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TraversableGenerator.java 28 Oct 2003 16:46:52 -0000 1.3 +++ TraversableGenerator.java 3 Nov 2003 17:13:33 -0000 1.4 @@ -76,6 +76,7 @@ import java.util.Stack; import java.util.Arrays; import java.util.Comparator; +import java.util.TimeZone; /** * Generates an XML source hierarchy listing from a Traversable Source. @@ -115,6 +116,10 @@ *
Sets the format for the date attribute of each node, as * described in java.text.SimpleDateFormat. If unset, the default * format for the current locale will be used. + *
timeZone (optional) + *
Sets the time zone offset ID for the date attribute, as + * described in java.util.TimeZone. If unset, the default + * system time zone will be used. *
refreshDelay (optional) *
Sets the delay (in seconds) between checks on the source hierarchy * for changed content. Defaults to 1 second. @@ -220,6 +225,11 @@ } else { this.dateFormatter = new SimpleDateFormat(); } + + String timeZone = par.getParameter("timeZone",null); + if (timeZone != null) { + this.dateFormatter.setTimeZone(TimeZone.getTimeZone(timeZone)); + } this.sort = par.getParameter("sort", "name"); this.cacheKeyParList.add(this.sort); @@ -233,6 +243,7 @@ if (this.getLogger().isDebugEnabled()) { this.getLogger().debug("depth: " + this.depth); this.getLogger().debug("dateFormat: " + this.dateFormatter.toPattern()); + this.getLogger().debug("timeZone: " + timeZone); this.getLogger().debug("sort: " + this.sort); this.getLogger().debug("reverse: " + this.reverse); this.getLogger().debug("refreshDelay: " + this.refreshDelay);