cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r171366 - in /cocoon/trunk/src/java/org/apache/cocoon: core/BaseSettings.java core/MutableSettings.java core/Settings.java generation/StatusGenerator.java generation/VirtualPipelineGenerator.java
Date Sun, 22 May 2005 19:50:04 GMT
Author: cziegeler
Date: Sun May 22 12:50:03 2005
New Revision: 171366

URL: http://svn.apache.org/viewcvs?rev=171366&view=rev
Log:
Implement all properties; correct status generator

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/core/BaseSettings.java
    cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java
    cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java
    cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java
    cocoon/trunk/src/java/org/apache/cocoon/generation/VirtualPipelineGenerator.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/BaseSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/BaseSettings.java?rev=171366&r1=171365&r2=171366&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/BaseSettings.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/BaseSettings.java Sun May 22 12:50:03 2005
@@ -33,7 +33,6 @@
     /**
      * This parameter allows to set system properties
      */
-    /** FIXME - implement the support for this key: */
     String KEY_FORCE_PROPERTIES = "system.properties";
 
     /**
@@ -79,7 +78,6 @@
      * be named here. Additional entries may be inserted here during build
      * depending on your build properties.
      */
-    /** FIXME: Implement support for this: */
     String KEY_LOAD_CLASSES = "classloader.load.classes";
 
     /**
@@ -88,7 +86,6 @@
      * Note that absolute pathes are taken as such but relative pathes
      * are rooted at the context root of the Cocoon servlet.
      */
-    /** FIXME: Implement support for this: */
     String KEY_EXTRA_CLASSPATHS = "extra.classpaths";
 
     /**

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java?rev=171366&r1=171365&r2=171366&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java Sun May 22 12:50:03
2005
@@ -101,6 +101,13 @@
                         this.overrideLogLevel = value;
                     } else if ( key.equals(KEY_LAZY_MODE) ) {
                         this.lazyMode = BooleanUtils.toBoolean(value);
+                    } else if ( key.startsWith(KEY_LOAD_CLASSES) ) {
+                        this.addToLoadClasses(value);
+                    } else if ( key.startsWith(KEY_EXTRA_CLASSPATHS) ) {
+                        this.addToExtraClasspaths(value);
+                    } else if ( key.startsWith(KEY_FORCE_PROPERTIES) ) {
+                        key = key.substring(KEY_FORCE_PROPERTIES.length() + 1);
+                        this.addToForceProperties(key, value);
                     }
                 }
             }

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java?rev=171366&r1=171365&r2=171366&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java Sun May 22 12:50:03 2005
@@ -450,9 +450,9 @@
           KEY_CONFIGURATION_RELOAD_DELAY + " : " + this.configurationReloadDelay + '\n' +
           KEY_ALLOW_RELOAD + " : " + this.allowReload + '\n' +
           KEY_INIT_CLASSLOADER + " : " + this.initClassloader + '\n' +
-          KEY_EXTRA_CLASSPATHS + " : " + this.extraClasspaths + '\n' +
-          KEY_LOAD_CLASSES + " : " + this.loadClasses + '\n' +
-          KEY_FORCE_PROPERTIES + " : " + this.forceProperties + '\n' +
+          KEY_EXTRA_CLASSPATHS + " : " + this.toString(this.extraClasspaths) + '\n' +
+          KEY_LOAD_CLASSES + " : " + this.toString(this.loadClasses) + '\n' +
+          KEY_FORCE_PROPERTIES + " : " + this.toString(this.forceProperties) + '\n' +
           KEY_LOGGING_CONFIGURATION + " : " + this.loggingConfiguration + '\n' +
           KEY_LOGGING_ENVIRONMENT_LOGGER + " : " + this.environmentLogger + '\n' +
           KEY_LOGGING_BOOTSTRAP_LOGLEVEL + " : " + this.bootstrapLogLevel + '\n' +
@@ -475,6 +475,46 @@
           KEY_LAZY_MODE + " : " + this.lazyMode + '\n';
     }
 
+    /**
+     * Helper method to make a string out of a list of objects.
+     */
+    protected String toString(List a) {
+        final StringBuffer buffer = new StringBuffer();
+        final Iterator i = a.iterator();
+        boolean first = true;
+        while ( i.hasNext() ) {
+            if ( first ) {
+                first = false;
+            } else {
+                buffer.append(", ");
+            }
+            buffer.append(i.next());
+        }
+        return buffer.toString();        
+    }
+
+    /**
+     * Helper method to make a string out of a map of objects.
+     */
+    protected String toString(Map a) {
+        final StringBuffer buffer = new StringBuffer("{");
+        final Iterator i = a.entrySet().iterator();
+        boolean first = true;
+        while ( i.hasNext() ) {
+            if ( first ) {
+                first = false;
+            } else {
+                buffer.append(", ");
+            }
+            final Map.Entry current = (Map.Entry)i.next();
+            buffer.append(current.getKey());
+            buffer.append("=");
+            buffer.append(current.getValue());
+        }
+        buffer.append("}");
+        return buffer.toString();        
+    }
+
     public String getProperty(String name) {
         return this.getProperty(name, null);
     }
@@ -534,6 +574,12 @@
                 value = this.overrideLogLevel;
             } else if ( sKey.equals(KEY_LAZY_MODE) ) {
                 value = String.valueOf(this.lazyMode);
+            } else if ( key.equals(KEY_LOAD_CLASSES) ) {
+                value = this.toString(this.loadClasses);
+            } else if ( key.equals(KEY_EXTRA_CLASSPATHS) ) {
+                this.toString(this.extraClasspaths);
+            } else if ( key.equals(KEY_FORCE_PROPERTIES) ) {
+                this.toString(this.forceProperties);
             }
         }
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java?rev=171366&r1=171365&r2=171366&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java Sun May 22 12:50:03
2005
@@ -150,13 +150,16 @@
         }        
     }
 
+    /**
+     * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver,
java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
+     */
     public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)

         throws ProcessingException, SAXException, IOException {
         super.setup(resolver, objectModel, src, parameters);
         this.showContinuationsInformation = parameters.getParameterAsBoolean(SHOW_CONTINUATIONS_INFO,
false);
     }   
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
@@ -387,24 +390,29 @@
             throw new RuntimeException("Unable to lookup Cocoon core.");
         }
         final Settings s = core.getSettings();
-        this.startGroup("Settings");
+        this.startGroup("Base Settings");
         
         this.addValue(Settings.KEY_CONFIGURATION, s.getConfiguration());
-        this.addValue(Settings.KEY_CONFIGURATION_RELOAD_DELAY, s.getConfigurationReloadDelay());
-        this.addValue(Settings.KEY_ALLOW_RELOAD, s.isAllowReload());
-        this.addValue(Settings.KEY_INIT_CLASSLOADER, s.isInitClassloader());
         this.addValue(Settings.KEY_EXTRA_CLASSPATHS, s.getExtraClasspaths());
         this.addValue(Settings.KEY_LOAD_CLASSES, s.getLoadClasses());
         this.addValue(Settings.KEY_FORCE_PROPERTIES, s.getForceProperties());
         this.addValue(Settings.KEY_LOGGING_CONFIGURATION, s.getLoggingConfiguration());
-        this.addValue(Settings.KEY_LOGGING_ENVIRONMENT_LOGGER, s.getEnvironmentLogger());
         this.addValue(Settings.KEY_LOGGING_BOOTSTRAP_LOGLEVEL, s.getBootstrapLogLevel());
-        this.addValue(Settings.KEY_LOGGING_COCOON_LOGGER, s.getCocoonLogger());
         this.addValue(Settings.KEY_LOGGING_LOG4J_CONFIGURATION, s.getLog4jConfiguration());
         this.addValue(Settings.KEY_LOGGING_MANAGER_CLASS, s.getLoggerManagerClassName());
+        this.addValue(Settings.KEY_PARENT_SERVICE_MANAGER, s.getParentServiceManagerClassName());
+        
+        this.endGroup();
+
+        this.startGroup("Dynamic Settings");
+
+        this.addValue(Settings.KEY_CONFIGURATION_RELOAD_DELAY, s.getConfigurationReloadDelay());
+        this.addValue(Settings.KEY_LOGGING_COCOON_LOGGER, s.getCocoonLogger());
+        this.addValue(Settings.KEY_ALLOW_RELOAD, s.isAllowReload());
+        this.addValue(Settings.KEY_INIT_CLASSLOADER, s.isInitClassloader());
+        this.addValue(Settings.KEY_LOGGING_ENVIRONMENT_LOGGER, s.getEnvironmentLogger());
         this.addValue(Settings.KEY_LOGGING_OVERRIDE_LOGLEVEL, s.getOverrideLogLevel());
         this.addValue(Settings.KEY_MANAGE_EXCEPTIONS, s.isManageExceptions());
-        this.addValue(Settings.KEY_PARENT_SERVICE_MANAGER, s.getParentServiceManagerClassName());
         this.addValue(Settings.KEY_UPLOADS_DIRECTORY, s.getUploadDirectory());
         this.addValue(Settings.KEY_UPLOADS_AUTOSAVE, s.isAutosaveUploads());
         this.addValue(Settings.KEY_UPLOADS_ENABLE, s.isEnableUploads());
@@ -416,6 +424,8 @@
         this.addValue(Settings.KEY_SHOWTIME, s.isShowTime());
         this.addValue(Settings.KEY_HIDE_SHOWTIME, s.isHideShowTime());
         this.addValue(Settings.KEY_LAZY_MODE, s.isLazyMode());
+
+        this.endGroup();
     }
 
     private void genProperties() throws SAXException {

Modified: cocoon/trunk/src/java/org/apache/cocoon/generation/VirtualPipelineGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/generation/VirtualPipelineGenerator.java?rev=171366&r1=171365&r2=171366&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/generation/VirtualPipelineGenerator.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/generation/VirtualPipelineGenerator.java Sun May
22 12:50:03 2005
@@ -30,6 +30,9 @@
         return "generator";
     }
 
+    /**
+     * @see org.apache.cocoon.generation.Generator#generate()
+     */
     public void generate()
     throws IOException, SAXException, ProcessingException {
 



Mime
View raw message