You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gc...@apache.org on 2004/04/04 14:09:02 UTC

cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/generation TraversableGenerator.java

gcasper     2004/04/04 05:09:02

  Modified:    src/blocks/webdav/samples/davmap sitemap.xmap
               src/blocks/repository/java/org/apache/cocoon/generation
                        TraversableGenerator.java
  Log:
  Added locale configuration to davmap sample
  
  Revision  Changes    Path
  1.19      +1 -0      cocoon-2.1/src/blocks/webdav/samples/davmap/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/webdav/samples/davmap/sitemap.xmap,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- sitemap.xmap	4 Apr 2004 09:46:33 -0000	1.18
  +++ sitemap.xmap	4 Apr 2004 12:09:02 -0000	1.19
  @@ -164,6 +164,7 @@
           <map:generate type="traverse" src="{global:staging}{1}">
             <map:parameter name="depth" value="{request-header:Depth}" />
             <map:parameter name="dateFormat" value="EEE, d MMM yyyy HH:mm:ss z" />
  +          <map:parameter name="locale" value="en" />
             <map:parameter name="timeZone" value="GMT" />
             <map:parameter name="properties" value="false" />
             <map:parameter name="locks" value="false" />
  
  
  
  1.13      +8 -2      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TraversableGenerator.java	25 Mar 2004 13:21:14 -0000	1.12
  +++ TraversableGenerator.java	4 Apr 2004 12:09:02 -0000	1.13
  @@ -34,6 +34,7 @@
   import java.io.IOException;
   import java.io.Serializable;
   import java.text.SimpleDateFormat;
  +import java.util.Locale;
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Date;
  @@ -190,7 +191,12 @@
           String dateFormatString = par.getParameter("dateFormat", null);
           this.cacheKeyParList.add(dateFormatString);
           if (dateFormatString != null) {
  -            this.dateFormatter = new SimpleDateFormat(dateFormatString);
  +            String locale = par.getParameter("locale", null);
  +            if (locale != null) {
  +                this.dateFormatter = new SimpleDateFormat(dateFormatString, new Locale(locale));
  +            } else {
  +                this.dateFormatter = new SimpleDateFormat(dateFormatString);
  +            }
           } else {
               this.dateFormatter = new SimpleDateFormat();
           }