kpiroumian    02/05/30 04:56:46

  Modified:    src/webapp Tag: cocoon_2_0_3_branch sitemap.xmap
               src/java/org/apache/cocoon/i18n Tag: cocoon_2_0_3_branch
                        XMLResourceBundle.java
                        XMLResourceBundleFactory.java
  Log:
  Fixed a bug that prevented normal 'cache-at-startup' functioning.
  Changed log message for not found dictionaries to 'info'.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.46.2.1  +1 -0      xml-cocoon2/src/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/sitemap.xmap,v
  retrieving revision 1.46
  retrieving revision 1.46.2.1
  diff -u -r1.46 -r1.46.2.1
  --- sitemap.xmap      6 Apr 2002 06:30:35 -0000       1.46
  +++ sitemap.xmap      30 May 2002 11:56:46 -0000      1.46.2.1
  @@ -124,6 +124,7 @@
                       src="org.apache.cocoon.transformation.I18nTransformer">
       <catalogue-name>messages</catalogue-name>
       <catalogue-location>translations</catalogue-location>
  +    <cache-at-startup>true</cache-at-startup>
      </map:transformer>
   
      <map:transformer name="filter"          logger="sitemap.transformer.filter"
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +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.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- XMLResourceBundle.java    13 Mar 2002 16:28:02 -0000      1.7
  +++ XMLResourceBundle.java    30 May 2002 11:56:46 -0000      1.7.2.1
  @@ -74,7 +74,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Mike Engelhart</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Neeme Praks</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundle.java,v 1.7 2002/03/13 16:28:02 cziegeler Exp $
  + * @version $Id: XMLResourceBundle.java,v 1.7.2.1 2002/05/30 11:56:46 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.5.2.1   +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.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- XMLResourceBundleFactory.java     22 Feb 2002 07:03:52 -0000      1.5
  +++ XMLResourceBundleFactory.java     30 May 2002 11:56:46 -0000      1.5.2.1
  @@ -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:[EMAIL PROTECTED]";>Mike Engelhart</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Neeme Praks</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundleFactory.java,v 1.5 2002/02/22 07:03:52 cziegeler 
Exp $
  + * @version $Id: XMLResourceBundleFactory.java,v 1.5.2.1 2002/05/30 11:56:46 
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 (Exception e) {
  +            logger.error("Resource loading failed", e);
           }
           return null;
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to