You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/08/19 16:04:26 UTC

svn commit: r432837 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java

Author: cziegeler
Date: Sat Aug 19 07:04:26 2006
New Revision: 432837

URL: http://svn.apache.org/viewvc?rev=432837&view=rev
Log:
Fix property loading bug

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java?rev=432837&r1=432836&r2=432837&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java Sat Aug 19 07:04:26 2006
@@ -418,8 +418,8 @@
         }
         // check for sitemap local properties
         Settings settings = (Settings)factory.getCurrentBeanFactory(itsContext).getBean(Settings.ROLE);
-        if ( componentConfig != null && componentConfig.getAttribute("property-dir", null) != null ) {
-            final String propertyDir = componentConfig.getAttribute("property-dir");
+        if ( componentConfig != null ) {
+            final String propertyDir = componentConfig.getAttribute("property-dir", null);
             settings = this.createSettings(settings, propertyDir, useDefaultIncludes, factory.getCurrentBeanFactory(itsContext), globalSitemapVariables);
         } else if ( globalSitemapVariables != null ) {
             MutableSettings s = new MutableSettings(settings);
@@ -1173,10 +1173,12 @@
             this.readProperties(SitemapLanguage.DEFAULT_CONFIG_PROPERTIES + '/' + mode, s, properties);    
         }
 
-        // now read all properties from the properties directory
-        this.readProperties(directory, s, properties);
-        // read all properties from the mode dependent directory
-        this.readProperties(directory + '/' + mode, s, properties);
+        if ( directory != null ) {
+            // now read all properties from the properties directory
+            this.readProperties(directory, s, properties);
+            // read all properties from the mode dependent directory
+            this.readProperties(directory + '/' + mode, s, properties);
+        }
 
         // Next look for a custom property provider in the parent bean factory
         if (parentBeanFactory != null && parentBeanFactory.containsBean(PropertyProvider.ROLE) ) {