You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2006/09/19 12:46:57 UTC

svn commit: r447805 - in /forrest/trunk: main/java/org/apache/forrest/conf/ForrestConfModule.java site-author/status.xml

Author: thorsten
Date: Tue Sep 19 03:46:56 2006
New Revision: 447805

URL: http://svn.apache.org/viewvc?view=rev&rev=447805
Log:
FOR-924
Readding the loading from (default-)forrest.properties which got removed in
r430588 when closing FOR-916. This caused tomcat to fail because
tomcat is not aware of the ant system properties. 

Thanks Martin Stockhammer for pointing it out and providing us with a patch. 

Modified:
    forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java
    forrest/trunk/site-author/status.xml

Modified: forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java
URL: http://svn.apache.org/viewvc/forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java?view=diff&rev=447805&r1=447804&r2=447805
==============================================================================
--- forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java (original)
+++ forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java Tue Sep 19 03:46:56 2006
@@ -196,6 +196,17 @@
                             filteringProperties, forrestPropertiesStringURI);
                 }
             }
+//          get forrest.properties and load the values
+            forrestPropertiesStringURI = projectHome + SystemUtils.FILE_SEPARATOR
+                + "forrest.properties";        
+            filteringProperties = loadAntPropertiesFromURI(filteringProperties,
+                forrestPropertiesStringURI);
+
+        // get default-forrest.properties and load the values
+        String defaultForrestPropertiesStringURI = contextHome + SystemUtils.FILE_SEPARATOR
+                + "default-forrest.properties";
+        filteringProperties = loadAntPropertiesFromURI(filteringProperties,
+                defaultForrestPropertiesStringURI);
         } finally {
             ForrestConfUtils.aliasSkinProperties(filteringProperties);
             if (debugging())
@@ -237,6 +248,46 @@
                 }
             }
         }
+    }
+    
+    /**
+     * @param antPropertiesStringURI
+     * @throws MalformedURLException
+     * @throws IOException
+     * @throws SourceNotFoundException
+     */
+    private AntProperties loadAntPropertiesFromURI(AntProperties precedingProperties,
+            String antPropertiesStringURI) throws MalformedURLException, IOException,
+            SourceNotFoundException {
+
+        Source source = null;
+        InputStream in = null;
+        try {
+            source = m_resolver.resolveURI(antPropertiesStringURI);
+            if (debugging())
+                debug("Searching for forrest.properties in" + source.getURI());
+            if (source.exists()){
+                in = source.getInputStream();
+                filteringProperties = new AntProperties(precedingProperties);
+                filteringProperties.load(in);
+
+                if (debugging())
+                    debug("Loaded:" + antPropertiesStringURI + filteringProperties.toString());
+            }
+
+        } finally {
+            if (source != null) {
+                m_resolver.release(source);
+            }
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+
+        return filteringProperties;
     }
 
     /**

Modified: forrest/trunk/site-author/status.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/site-author/status.xml?view=diff&rev=447805&r1=447804&r2=447805
==============================================================================
--- forrest/trunk/site-author/status.xml (original)
+++ forrest/trunk/site-author/status.xml Tue Sep 19 03:46:56 2006
@@ -139,6 +139,12 @@
         Added document to facilitate
         <link href="site:v0.80//upgrading_08">upgrading to v0.8</link>
       </action>
+<!-- 2006-09 -->
+      <action context="code" type="update" dev="TS" fixes-bug="FOR-924"
+        due-to="Martin Stockhammer"> FOR-924 Readding the loading from
+        (default-)forrest.properties which got removed in r430588 when closing FOR-916.
+        Thanks Martin Stockhammer for pointing it out, providing us with a patch and for your
+        contribution. </action>
 <!-- 2006-08 -->
       <action context="code" type="fix" dev="DC" fixes-bug="FOR-448" due-to="Jim Dixon">
         When using html as source, the "a" elements were not rendered properly if both