cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r396225 - in /cocoon/trunk: blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/ blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/ bloc...
Date Sun, 23 Apr 2006 06:55:19 GMT
Author: antonio
Date: Sat Apr 22 23:55:18 2006
New Revision: 396225

URL: http://svn.apache.org/viewcvs?rev=396225&view=rev
Log:
Merging from branch 2.1.

Modified:
    cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/AbstractDatabaseAction.java
    cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAction.java
    cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
    cocoon/trunk/blocks/cocoon-session-fw/cocoon-session-fw-impl/src/main/java/org/apache/cocoon/webapps/session/acting/SessionFormAction.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java
    cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptLanguage.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/LocateResource.java

Modified: cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/AbstractDatabaseAction.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/AbstractDatabaseAction.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/AbstractDatabaseAction.java
(original)
+++ cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/AbstractDatabaseAction.java
Sat Apr 22 23:55:18 2006
@@ -38,7 +38,6 @@
 
 import org.apache.avalon.excalibur.datasource.DataSourceComponent;
 import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.parameters.Parameters;
@@ -169,7 +168,7 @@
  *
  * @version $Id$
  */
-public abstract class AbstractDatabaseAction extends AbstractComplementaryConfigurableAction
implements Configurable, Disposable {
+public abstract class AbstractDatabaseAction extends AbstractComplementaryConfigurableAction
implements Disposable {
     protected Map files = new HashMap();
     protected static final Map typeConstants;
     protected ServiceSelector dbselector;

Modified: cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAction.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAction.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAction.java
(original)
+++ cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/acting/modular/DatabaseAction.java
Sat Apr 22 23:55:18 2006
@@ -24,7 +24,6 @@
 
 import org.apache.avalon.excalibur.datasource.DataSourceComponent;
 import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.parameters.Parameters;
@@ -92,15 +91,15 @@
  * @see org.apache.cocoon.components.modules.database
  * @see org.apache.cocoon.util.JDBCTypeConversions
  */
-public abstract class DatabaseAction  extends AbstractComplementaryConfigurableAction implements
Configurable, Disposable, ThreadSafe {
+public abstract class DatabaseAction extends AbstractComplementaryConfigurableAction implements
Disposable, ThreadSafe {
 
     // ========================================================================
     // constants
     // ========================================================================
 
-    static final Integer MODE_AUTOINCR = new Integer( 0 );
-    static final Integer MODE_OTHERS = new Integer( 1 );
-    static final Integer MODE_OUTPUT = new Integer( 2 );
+    static final Integer MODE_AUTOINCR = new Integer(0);
+    static final Integer MODE_OTHERS = new Integer(1);
+    static final Integer MODE_OUTPUT = new Integer(2);
 
     static final String ATTRIBUTE_KEY = "org.apache.cocoon.action.modular.DatabaseAction.outputModeName";
 
@@ -132,7 +131,7 @@
     /**
      * Structure that takes all processed data for one column.
      */
-    protected class Column {
+    protected static class Column {
         boolean isKey = false;
         boolean isSet = false;
         boolean isAutoIncrement = false;
@@ -141,12 +140,11 @@
         Configuration columnConf = null;
     }
 
-
     /**
      * Structure that takes all processed data for a table depending
      * on current default modes
      */
-    protected class CacheHelper {
+    protected static class CacheHelper {
         /**
          * Generated query string
          */
@@ -173,13 +171,12 @@
         }
     }
 
-
     /**
      * Structure that takes up both current mode types for database
      * operations and table configuration data. Used to access parsed
      * configuration data.
      */
-    protected class LookUpKey {
+    protected static class LookUpKey {
         public Configuration tableConf = null;
         public Map modeTypes = null;
 
@@ -215,8 +212,6 @@
 		}
     }
 
-
-
     // set up default modes
     // <input/>
     // <output/>
@@ -230,8 +225,8 @@
             this.defaultModeNames.put(MODE_OTHERS,   this.settings.get("input",  inputHint));
             this.defaultModeNames.put(MODE_OUTPUT,   this.settings.get("output", outputHint));
             this.defaultModeNames.put(MODE_AUTOINCR, this.settings.get("autoincrement", databaseHint));
-            this.pathSeparator = (String) this.settings.get("path-separator", this.pathSeparator);
-            String tmp = (String) this.settings.get("first-row",null);
+            this.pathSeparator = (String)this.settings.get("path-separator", this.pathSeparator);
+            String tmp = (String)this.settings.get("first-row",null);
             if (tmp != null) { 
                 try {
                         this.firstRow = Integer.parseInt(tmp);
@@ -257,7 +252,6 @@
         this.dbselector = (ServiceSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");
     }
 
-
     /**
      *  dispose
      */
@@ -265,7 +259,6 @@
         this.manager.release(dbselector);
     }
 
-
     // ========================================================================
     // protected utility methods
     // ========================================================================
@@ -294,7 +287,6 @@
         if ("ascii".equals(type)) return true;
         if ("binary".equals(type)) return true;
         if ("image".equals(type)) return true;
-
         return false;
     }
 
@@ -308,14 +300,17 @@
         OutputModule output = null;
         try {
             outputSelector = (ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR);
-            if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
+            if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode))
{
                 output = (OutputModule) outputSelector.select(outputMode);
             }
-            output.setAttribute( null, objectModel, key, value );
+            if (output != null) {
+                output.setAttribute(null, objectModel, key, value);
+            } else if (getLogger().isWarnEnabled()) {
+                getLogger().warn("Could not select output mode " + outputMode);
+            }
         } catch (Exception e) {
                 if (getLogger().isWarnEnabled()) {
-                    getLogger().warn("Could not select output mode "
-                                     + outputMode + ":" + e.getMessage());
+                    getLogger().warn("Could not select output mode " + outputMode + ":" +
e.getMessage());
                 }
         } finally {
             if (outputSelector != null) {
@@ -326,8 +321,6 @@
          }
     }
 
-
-
     /**
      * Inserts a row or a set of rows into the given table based on the
      * request parameters
@@ -377,11 +370,11 @@
             }
 
             for ( int rowIndex = 0; rowIndex < setLength; rowIndex++ ) {
-                if (getLogger().isDebugEnabled())
+                if (getLogger().isDebugEnabled()) {
                     getLogger().debug( "====> row no. " + rowIndex );
+                }
                 rows += processRow( objectModel, conn, statement, (String) modeTypes.get(MODE_OUTPUT),
table, queryData, columnValues, rowIndex, results );
             }
-
         } finally {
             try {
                 if (statement != null) {
@@ -392,7 +385,6 @@
         return rows;
     }
 
-
     /**
      * Choose a mode configuration based on its name.
      * @param conf Configuration (i.e. a column's configuration) that might have
@@ -418,11 +410,9 @@
                 break;
             }
         }
-
         return modeConfig;
     }
 
-
     /**
      * compose name for output a long the lines of "table.column"
      */
@@ -431,7 +421,6 @@
         return getOutputName( tableConf, columnConf, -1 );
     }
 
-
     /**
      * compose name for output a long the lines of "table.column[row]" or
      * "table.column" if rowIndex is -1.
@@ -457,16 +446,13 @@
             {
                 return ( columnConf.getAttribute("name",null)
                          + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
-            }
-        else
-            {
+        } else {
                 return ( tableConf.getAttribute("alias", tableConf.getAttribute("name", null)
)
                          + this.pathSeparator + columnConf.getAttribute("name",null)
                          + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
             }
     }
 
-
     /*
      * Read all values for a column from an InputModule
      *
@@ -476,10 +462,10 @@
      * a set.
      *
      */
-    protected Object[] getColumnValue( Configuration tableConf, Column column, Map objectModel
)
+    protected Object[] getColumnValue(Configuration tableConf, Column column, Map objectModel)
         throws ConfigurationException, ServiceException {
 
-        if ( column.isAutoIncrement ) {
+        if (column.isAutoIncrement) {
             return new Object[1];
         } else {
             Object[] values;
@@ -495,36 +481,37 @@
                 }
 
                 if (column.isSet) {
-                    if (getLogger().isDebugEnabled())
-                        getLogger().debug( "Trying to set column " + cname +" from "+column.mode+"
using getAttributeValues method");
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().debug( "Trying to set column " + cname + " from " + column.mode
+ " using getAttributeValues method");
+                    }
                     values = input.getAttributeValues( cname, column.modeConf, objectModel
);
                 } else {
-                    if (getLogger().isDebugEnabled())
-                        getLogger().debug( "Trying to set column " + cname +" from "+column.mode+"
using getAttribute method");
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().debug( "Trying to set column " + cname + " from " + column.mode
+ " using getAttribute method");
+                    }
                     values = new Object[1];
                     values[0] = input.getAttribute( cname, column.modeConf, objectModel );
                 }
 
-                if ( values != null ) {
+                if (values != null) {
                     for ( int i = 0; i < values.length; i++ ) {
-                        if (getLogger().isDebugEnabled())
+                        if (getLogger().isDebugEnabled()) {
                             getLogger().debug( "Setting column " + cname + " [" + i + "]
" + values[i] );
+                        }
                     }
                 }
-
             } finally {
                 if (inputSelector != null) {
-                    if (input != null)
+                    if (input != null) {
                         inputSelector.release(input);
+                    }
                     this.manager.release(inputSelector);
                 }
             }
-
             return values;
         }
     }
 
-
     /**
      * Setup parsed attribute configuration object
      */
@@ -533,33 +520,34 @@
         throws ConfigurationException {
 
         String setMode = null;
-        int offset = ( isKey ? 0: set.noOfKeys);
+        int offset = (isKey ? 0: set.noOfKeys);
 
-        for ( int i = offset; i < conf.length + offset; i++ ) {
-            if (getLogger().isDebugEnabled())
-                getLogger().debug("i="+i);
+        for (int i = offset; i < conf.length + offset; i++) {
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("i=" + i);
+            }
             set.columns[i].columnConf =  conf[ i - offset ];
             set.columns[i].isSet = false;
             set.columns[i].isKey = isKey;
             set.columns[i].isAutoIncrement = false;
-            if ( isKey & this.honourAutoIncrement() ) 
+            if (isKey & this.honourAutoIncrement()) { 
                 set.columns[i].isAutoIncrement = set.columns[i].columnConf.getAttributeAsBoolean("autoincrement",false);
-            
-            set.columns[i].modeConf = getMode( set.columns[i].columnConf,
-                                               selectMode( set.columns[i].isAutoIncrement,
modeTypes ) );
-            set.columns[i].mode = ( set.columns[i].modeConf != null ?
-                                    set.columns[i].modeConf.getAttribute( "name", selectMode(
isKey, defaultModeNames ) ) :
-                                    selectMode( isKey, defaultModeNames ) );
+            }
+            set.columns[i].modeConf = getMode(set.columns[i].columnConf,
+                                               selectMode(set.columns[i].isAutoIncrement,
modeTypes));
+            set.columns[i].mode = (set.columns[i].modeConf != null ?
+                                   set.columns[i].modeConf.getAttribute("name", selectMode(isKey,
defaultModeNames)) :
+                                   selectMode(isKey, defaultModeNames));
             // Determine set mode for a whole column ...
             setMode = set.columns[i].columnConf.getAttribute("set", null);  // master vs
slave vs null
-            if ( setMode == null && set.columns[i].modeConf != null ) {
+            if (setMode == null && set.columns[i].modeConf != null) {
                 // ... or for each mode individually
                 setMode = set.columns[i].modeConf.getAttribute("set", null);
             }
-            if ( setMode != null ) {
+            if (setMode != null) {
                 set.columns[i].isSet = true;
                 set.isSet = true;
-                if ( setMode.equals("master") ) {
+                if (setMode.equals("master")) {
                     set.setMaster = i;
                 }
             }
@@ -575,23 +563,24 @@
                          Configuration table, Configuration column, int rowIndex, Object
value ) {
 
         String param = this.getOutputName( table, column, rowIndex );
-        if (getLogger().isDebugEnabled())
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug( "Setting column " + param + " to " + value );
+        }
         this.setOutputAttribute(objectModel, outputMode, param, value);
-        if (results != null)
+        if (results != null) {
             results.put( param, String.valueOf( value ) );
+        }
     }
 
     /**
      * set a column in a statement using the appropriate JDBC setXXX method.
      *
      */
-    protected void setColumn ( PreparedStatement statement, int position, Configuration entry,
Object value ) throws Exception {
-
-        JDBCTypeConversions.setColumn(statement, position, value, (Integer) JDBCTypeConversions.typeConstants.get(entry.getAttribute("type")));
+    protected void setColumn (PreparedStatement statement, int position, Configuration entry,
Object value) throws Exception {
+        JDBCTypeConversions.setColumn(statement, position, value,
+                (Integer)JDBCTypeConversions.typeConstants.get(entry.getAttribute("type")));
     }
 
-
     /**
      * set a column in a statement using the appropriate JDBC setXXX
      * method and propagate the value to the output module and results
@@ -599,27 +588,27 @@
      * setOutput.
      *
      */
-    protected void setColumn ( Map objectModel, String outputMode, Map results,
+    protected void setColumn (Map objectModel, String outputMode, Map results,
                                Configuration table, Configuration column, int rowIndex, 
-                               Object value, PreparedStatement statement, int position )
throws Exception {
+                               Object value, PreparedStatement statement, int position) throws
Exception {
 
-        if (results!=null) this.setOutput( objectModel, outputMode, results, table, column,
rowIndex, value );
+        if (results != null) {
+            this.setOutput(objectModel, outputMode, results, table, column, rowIndex, value);
+        }
         this.setColumn( statement, position, column, value );
     }
 
-
     // ========================================================================
     // main method
     // ========================================================================
 
-
     /**
      * Add a record to the database.  This action assumes that
      * the file referenced by the "descriptor" parameter conforms
      * to the AbstractDatabaseAction specifications.
      */
-    public Map act( Redirector redirector, SourceResolver resolver, Map objectModel,
-                    String source, Parameters param ) throws Exception {
+    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel,
+                    String source, Parameters param) throws Exception {
 
         DataSourceComponent datasource = null;
         Connection conn = null;
@@ -634,9 +623,9 @@
         // set request attribute
         String outputMode = param.getParameter("output", (String) defaultModeNames.get(MODE_OUTPUT));
 
-        if (this.settings.containsKey("reloadable"))
+        if (this.settings.containsKey("reloadable")) {
             reloadable = Boolean.valueOf((String) this.settings.get("reloadable")).booleanValue();
-
+        }
         // read local parameter settings
         try {
             Configuration conf =
@@ -671,8 +660,8 @@
                 modeTypes.put( MODE_AUTOINCR, "autoincr" );
                 modeTypes.put( MODE_OTHERS, "others" );
                 modeTypes.put( MODE_OUTPUT, outputMode );
-                for (int i=0; i<tables.length; i++) {
-                    rows += processTable( tables[i], conn, objectModel, results, modeTypes
);
+                for (int i = 0; i < tables.length; i++) {
+                    rows += processTable(tables[i], conn, objectModel, results, modeTypes);
                 }
             } else {
                 // new set based behaviour
@@ -695,7 +684,7 @@
 
                 // find tables contained in tableset
                 int j = 0;
-                for (j=0; j<tablesets.length; j++) {
+                for (j = 0; j < tablesets.length; j++) {
                     setname = tablesets[j].getAttribute ("name", "");
                     if (tablesetname.trim().equals (setname.trim ())) {
                         found = true;
@@ -708,7 +697,7 @@
 
                 Configuration[] set = tablesets[j].getChildren("table");
 
-                for (int i=0; i<set.length; i++) {
+                for (int i = 0; i < set.length; i++) {
                     // look for alternative mode types
                     modeTypes = new HashMap(6);
                     modeTypes.put( MODE_AUTOINCR, set[i].getAttribute( "autoincr-mode", "autoincr"
) );
@@ -724,8 +713,9 @@
                 }
             }
 
-            if (conn.getAutoCommit()==false)
+            if (conn.getAutoCommit() == false) {
                 conn.commit();
+            }
 
             // obtain output mode module and rollback output
             ServiceSelector outputSelector = null;
@@ -735,20 +725,23 @@
                 if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
                     output = (OutputModule) outputSelector.select(outputMode);
                 }
-                output.commit(null, objectModel);
-            } catch (Exception e) {
+                if (output != null) {
+                    output.commit(null, objectModel);
+                } else if (getLogger().isWarnEnabled()) {
+                    getLogger().warn("Could not select output mode " + outputMode);
+                }
+            } catch (ServiceException e) {
                 if (getLogger().isWarnEnabled()) {
-                    getLogger().warn("Could not select output mode "
-                                     + outputMode + ":" + e.getMessage());
+                    getLogger().warn("Could not select output mode " + outputMode + ":" +
e.getMessage());
                 }
             } finally {
                 if (outputSelector != null) {
-                    if (output != null)
+                    if (output != null) {
                         outputSelector.release(output);
+                    }
                     this.manager.release(outputSelector);
                 }
             }
-
         } catch (Exception e) {
             failed = true;
             if ( conn != null ) {
@@ -768,20 +761,23 @@
                         if (outputMode != null && outputSelector != null &&
outputSelector.isSelectable(outputMode)){
                             output = (OutputModule) outputSelector.select(outputMode);
                         }
-                        output.rollback( null, objectModel, e);
-                    } catch (Exception e2) {
+                        if (output != null) {
+                            output.rollback( null, objectModel, e);
+                        } else if (getLogger().isWarnEnabled()) {
+                            getLogger().warn("Could not select output mode " + outputMode);
+                        }
+                    } catch (ServiceException e2) {
                         if (getLogger().isWarnEnabled()) {
-                            getLogger().warn("Could not select output mode "
-                                       + outputMode + ":" + e2.getMessage());
+                            getLogger().warn("Could not select output mode " + outputMode
+ ":" + e2.getMessage());
                         }
                     } finally {
                         if (outputSelector != null) {
-                            if (output != null)
+                            if (output != null) {
                                 outputSelector.release(output);
+                            }
                             this.manager.release(outputSelector);
                         }
                     }
-
                 } catch (SQLException se) {
                     if (getLogger().isDebugEnabled())
                         getLogger().debug("There was an error rolling back the transaction",
se);
@@ -825,13 +821,10 @@
         return results; // (results == null? results : Collections.unmodifiableMap(results));
     }
 
-
-
     // ========================================================================
     // abstract methods
     // ========================================================================
 
-
     /**
      * set all necessary ?s and execute the query
      * return number of rows processed
@@ -852,7 +845,6 @@
      */
     protected abstract String selectMode( boolean isAutoIncrement, Map modes );
 
-
     /**
      * determine whether autoincrement columns should be honoured by
      * this operation. This is usually snsible only for INSERTs.
@@ -861,7 +853,6 @@
      * implement other operations e.g. delete
      */
     protected abstract boolean honourAutoIncrement();
-
 
     /**
      * Fetch all values for all columns that are needed to do the

Modified: cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
(original)
+++ cocoon/trunk/blocks-tobeconverted/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
Sat Apr 22 23:55:18 2006
@@ -35,8 +35,6 @@
 import java.util.ArrayList;
 
 import org.apache.avalon.excalibur.datasource.DataSourceComponent;
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
@@ -148,8 +146,7 @@
  * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  * @version $Id$
  */
-public class SQLTransformer extends AbstractSAXTransformer
-                            implements Disposable, Configurable {
+public class SQLTransformer extends AbstractSAXTransformer {
 
     /** The SQL transformer namespace */
     public static final String NAMESPACE = "http://apache.org/cocoon/SQL/2.0";
@@ -839,23 +836,23 @@
      * Attempt to parse string value
      */
     private void stream(String value) throws ServiceException, SAXException, IOException
{
-        // Strip off the XML Declaration if there is one!
-        if (value.startsWith("<?xml ")) {
-            value = value.substring(value.indexOf("?>") + 2);
-        }
+            // Strip off the XML Declaration if there is one!
+            if (value.startsWith("<?xml ")) {
+                value = value.substring(value.indexOf("?>") + 2);
+            }
 
-        // Lookup components
-        if (this.parser == null) {
-            this.parser = (SAXParser) manager.lookup(SAXParser.ROLE);
-        }
+            // Lookup components
+            if (this.parser == null) {
+                this.parser = (SAXParser) manager.lookup(SAXParser.ROLE);
+            }
         XMLByteStreamCompiler compiler = new XMLByteStreamCompiler();
         XMLByteStreamInterpreter interpreter = new XMLByteStreamInterpreter();
 
-        this.parser.parse(new InputSource(new StringReader("<root>" + value + "</root>")),
+            this.parser.parse(new InputSource(new StringReader("<root>" + value + "</root>")),
                           compiler);
 
-        IncludeXMLConsumer filter = new IncludeXMLConsumer(this, this);
-        filter.setIgnoreRootElement(true);
+            IncludeXMLConsumer filter = new IncludeXMLConsumer(this, this);
+            filter.setIgnoreRootElement(true);
 
         interpreter.setConsumer(filter);
         interpreter.deserialize(compiler.getSAXFragment());

Modified: cocoon/trunk/blocks/cocoon-session-fw/cocoon-session-fw-impl/src/main/java/org/apache/cocoon/webapps/session/acting/SessionFormAction.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-session-fw/cocoon-session-fw-impl/src/main/java/org/apache/cocoon/webapps/session/acting/SessionFormAction.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-session-fw/cocoon-session-fw-impl/src/main/java/org/apache/cocoon/webapps/session/acting/SessionFormAction.java
(original)
+++ cocoon/trunk/blocks/cocoon-session-fw/cocoon-session-fw-impl/src/main/java/org/apache/cocoon/webapps/session/acting/SessionFormAction.java
Sat Apr 22 23:55:18 2006
@@ -17,7 +17,6 @@
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
 
 import org.apache.cocoon.acting.FormValidatorAction;
 import org.apache.cocoon.environment.ObjectModelHelper;
@@ -92,8 +91,8 @@
  * @see org.apache.cocoon.acting.AbstractValidatorAction
  * 
  * @version $Id$
- */
-public class SessionFormAction extends FormValidatorAction implements ThreadSafe {
+*/
+public class SessionFormAction extends FormValidatorAction {
 
     /* (non-Javadoc)
      * @see org.apache.cocoon.acting.AbstractValidatorAction#getDescriptor(org.apache.cocoon.environment.SourceResolver,
org.apache.avalon.framework.parameters.Parameters)
@@ -108,5 +107,4 @@
             ObjectModelHelper.getRequest(objectModel).getParameter(
                 SessionConstants.SESSION_FORM_PARAMETER));
     }
-
 }

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java
(original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java
Sat Apr 22 23:55:18 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.components.language.markup;
 
-import org.apache.avalon.framework.logger.LogEnabled;
 import org.apache.avalon.framework.logger.Logger;
 
 import org.apache.cocoon.ProcessingException;
@@ -153,7 +152,7 @@
      *
      * @see org.xml.sax.ContentHandler
      */
-    public class PreProcessFilter extends AbstractXMLPipe implements LogEnabled {
+    public class PreProcessFilter extends AbstractXMLPipe {
         protected Logger log;
 
         protected AbstractXMLPipe filter;
@@ -269,8 +268,7 @@
      * @see org.xml.sax.ContentHandler
      */
     public class CocoonTransformerChainBuilderFilter
-            extends TransformerChainBuilderFilter
-            implements LogEnabled {
+            extends TransformerChainBuilderFilter {
 
         protected Logger log;
 

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java
(original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPGenerator.java
Sat Apr 22 23:55:18 2006
@@ -18,7 +18,6 @@
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.generation.AbstractServerPage;
 import org.xml.sax.SAXException;
 
@@ -27,9 +26,7 @@
  *
  * @version $Id$
  */
-public abstract class XSPGenerator 
-extends AbstractServerPage
-implements CompiledComponent, Contextualizable {
+public abstract class XSPGenerator extends AbstractServerPage implements Contextualizable
{
     
     protected Context avalonContext;
 
@@ -67,5 +64,4 @@
     public void xspExpr(Object v) throws SAXException {
         XSPObjectHelper.xspExpr(this.contentHandler, v);
     }
-
 }

Modified: cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptLanguage.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptLanguage.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptLanguage.java
(original)
+++ cocoon/trunk/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/javascript/JavascriptLanguage.java
Sat Apr 22 23:55:18 2006
@@ -20,7 +20,6 @@
 import org.apache.cocoon.components.language.markup.xsp.XSLTExtension;
 import org.apache.cocoon.components.language.programming.AbstractProgrammingLanguage;
 import org.apache.cocoon.components.language.programming.Program;
-import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.IOUtils;
 
@@ -40,7 +39,7 @@
  *
  * @version $Id$
  */
-public class JavascriptLanguage extends AbstractProgrammingLanguage implements ProgrammingLanguage
{
+public class JavascriptLanguage extends AbstractProgrammingLanguage {
 
     public Program preload(String filename, File baseDirectory, String encoding) throws LanguageException
{
         return load(filename, baseDirectory, encoding);

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/LocateResource.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/LocateResource.java?rev=396225&r1=396224&r2=396225&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/LocateResource.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/modules/input/LocateResource.java
Sat Apr 22 23:55:18 2006
@@ -172,12 +172,14 @@
         String urlstring = name;
         String filename = extractFilename(urlstring);
         int minLen = calculateMinLen(name);
-        if (filename != "") {
+        if (filename.length() > 0) {
             urlstring = shortenURI(urlstring, minLen);
         }
 
         String result = locateResource(urlstring, filename, minLen);
-        result = (result == null? result : result + filename);
+        if (result != null) {
+            result += filename;
+        }
         if (this.getLogger().isDebugEnabled())
             this.getLogger().debug(
                 "located " + name + " @ " + result);
@@ -203,7 +205,7 @@
         String urlstring = name;
         String filename = extractFilename(urlstring);
         int minLen = calculateMinLen(name);
-        if (filename != "") {
+        if (filename.length() > 0) {
             urlstring = shortenURI(urlstring, minLen);
         }
 
@@ -220,5 +222,4 @@
         }
         return (uris == null ? null : uris.toArray());
     }
-
 }



Mime
View raw message