cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kpiroum...@apache.org
Subject cvs commit: xml-cocoon2/src/webapp/samples/i18n sitemap.xmap
Date Thu, 30 May 2002 10:13:15 GMT
kpiroumian    02/05/30 03:13:14

  Modified:    src/java/org/apache/cocoon/i18n
                        XMLResourceBundleFactory.java
                        XMLResourceBundle.java
               src/webapp/samples/i18n sitemap.xmap
  Log:
  Fixed a bug that prevented normal 'cache-at-startup' functioning.
  Changed log message for not found dictionaries to 'info'.
  
  Revision  Changes    Path
  1.6       +12 -5     xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java
  
  Index: XMLResourceBundleFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundleFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLResourceBundleFactory.java	22 Feb 2002 07:03:52 -0000	1.5
  +++ XMLResourceBundleFactory.java	30 May 2002 10:13:14 -0000	1.6
  @@ -70,6 +70,9 @@
   import java.util.Locale;
   import java.util.Map;
   
  +import java.io.FileNotFoundException;
  +import java.io.IOException;
  +
   /**
    * This is the XMLResourceBundleFactory, the method for getting and
    * creating XMLResourceBundles.
  @@ -77,7 +80,7 @@
    * @author <a href="mailto:mengelhart@earthtrip.com">Mike Engelhart</a>
    * @author <a href="mailto:neeme@one.lv">Neeme Praks</a>
    * @author <a href="mailto:oleg@one.lv">Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundleFactory.java,v 1.5 2002/02/22 07:03:52 cziegeler Exp
$
  + * @version $Id: XMLResourceBundleFactory.java,v 1.6 2002/05/30 10:13:14 kpiroumian Exp
$
    */
   
   public class XMLResourceBundleFactory
  @@ -347,13 +350,17 @@
               bundle.init(name, fileName, loc, parentBundle, cacheAtStartup);
               return bundle;
           }
  -        catch (SAXParseException e)
  +        catch (FileNotFoundException fe)
           {
  -            if (logger.isInfoEnabled()) logger.info("Resource loading failed: " + e.getMessage());
  +            logger.info("Resource not found: " + name + ", locale " + loc
  +                + ", bundleName " + fileName + ". Exception: " + fe.getMessage());
           }
  -        catch (Exception e)
  +        catch (SAXParseException se)
           {
  -            logger.error("Error while loading resource: " + name + ", locale " + loc +
", bundleName " + fileName, e);
  +            logger.error("Incorrect resource format", se);
  +        }
  +        catch (IOException ioe) {
  +            logger.error("Resource loading failed", ioe);
           }
           return null;
       }
  
  
  
  1.8       +5 -3      xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundle.java
  
  Index: XMLResourceBundle.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/i18n/XMLResourceBundle.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLResourceBundle.java	13 Mar 2002 16:28:02 -0000	1.7
  +++ XMLResourceBundle.java	30 May 2002 10:13:14 -0000	1.8
  @@ -74,7 +74,7 @@
    * @author <a href="mailto:mengelhart@earthtrip.com">Mike Engelhart</a>
    * @author <a href="mailto:neeme@one.lv">Neeme Praks</a>
    * @author <a href="mailto:oleg@one.lv">Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundle.java,v 1.7 2002/03/13 16:28:02 cziegeler Exp $
  + * @version $Id: XMLResourceBundle.java,v 1.8 2002/05/30 10:13:14 kpiroumian Exp $
    */
   public class XMLResourceBundle
       extends ResourceBundle
  @@ -146,8 +146,10 @@
           this.doc = loadResourceBundle(fileName);
           this.locale = locale;
           this.parent = parent;
  -        if (cacheAtStartup)
  -            cacheAll(doc.getDocumentElement(), "");
  +        if (cacheAtStartup) {
  +            Node root = doc.getDocumentElement();
  +            cacheAll(root, "/" + root.getNodeName());
  +        }
       }
   
       /**
  
  
  
  1.4       +1 -0      xml-cocoon2/src/webapp/samples/i18n/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/i18n/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	26 Apr 2002 16:17:37 -0000	1.3
  +++ sitemap.xmap	30 May 2002 10:13:14 -0000	1.4
  @@ -12,6 +12,7 @@
                   <catalogue-name>messages</catalogue-name>
                   <!-- This parameter sets the path where dictionaries are placed-->
                   <catalogue-location>translations</catalogue-location>     
          
  +                <cache-at-startup>true</cache-at-startup>
               </map:transformer>
           </map:transformers>
           
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message