cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/acting/modular DatabaseAddAction.java DatabaseSelectAction.java DatabaseAction.java
Date Sun, 25 Aug 2002 08:54:29 GMT
haul        2002/08/25 01:54:29

  Modified:    src/java/org/apache/cocoon/acting/modular
                        DatabaseAddAction.java DatabaseSelectAction.java
                        DatabaseAction.java
  Log:
  Replace Boolean.getBoolean(s) with Boolean.valueOf(s).booleanValue()
  spotted by Per Kreipke
  Minor additions
  
  Revision  Changes    Path
  1.5       +20 -12    xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAddAction.java
  
  Index: DatabaseAddAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAddAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatabaseAddAction.java	7 Aug 2002 10:52:13 -0000	1.4
  +++ DatabaseAddAction.java	25 Aug 2002 08:54:29 -0000	1.5
  @@ -275,18 +275,26 @@
                               autoincrSelector=(ComponentSelector) this.manager.lookup(DATABASE_MODULE_SELECTOR);

                               if (queryData.columns[i].mode != null && autoincrSelector
!= null && autoincrSelector.hasComponent(queryData.columns[i].mode)){
                                   autoincr = (AutoIncrementModule) autoincrSelector.select(queryData.columns[i].mode);
  -                            }
  -
  -                            if ( autoincr.includeInQuery() ) {
  -                                actualColumns++;
  -                                queryBuffer.append( queryData.columns[i].columnConf.getAttribute(
"name" ) );
  -                                if ( autoincr.includeAsValue() ) {
  -                                    valueBuffer.append( "?" );
  -                                } else {
  -                                    valueBuffer.append(
  -                                                       autoincr.getSubquery( table, queryData.columns[i].columnConf,
  -                                                                             queryData.columns[i].modeConf
) );
  +                                
  +                                if ( autoincr.includeInQuery() ) {
  +                                    actualColumns++;
  +                                    queryBuffer.append( queryData.columns[i].columnConf.getAttribute(
"name" ) );
  +                                    if ( autoincr.includeAsValue() ) {
  +                                        valueBuffer.append( "?" );
  +                                    } else {
  +                                        valueBuffer.append(
  +                                                           autoincr.getSubquery( table,
queryData.columns[i].columnConf,
  +                                                                                 queryData.columns[i].modeConf
) );
  +                                    }
                                   }
  +                            } else {
  +                                if (getLogger().isErrorEnabled())
  +                                    getLogger().error("Could not find mode description
" 
  +                                                      + queryData.columns[i].mode + " for
column #"+i);
  +                                if (getLogger().isDebugEnabled()) {
  +                                    getLogger().debug("Column data "+queryData.columns[i]);
  +                                }
  +                                throw new ConfigurationException("Could not find mode description
"+queryData.columns[i].mode+" for column "+i);
                               }
                               
                           } finally {
  
  
  
  1.5       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseSelectAction.java
  
  Index: DatabaseSelectAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseSelectAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatabaseSelectAction.java	9 Aug 2002 08:25:29 -0000	1.4
  +++ DatabaseSelectAction.java	25 Aug 2002 08:54:29 -0000	1.5
  @@ -194,7 +194,7 @@
           for (int i = 0; i < queryData.columns.length; i++) {
               Column col = queryData.columns[i];
               if ( col.isKey ) {
  -                this.setColumn(objectModel, outputMode, null, table, col.columnConf, rowIndex,
  +                this.setColumn(objectModel, outputMode, results, table, col.columnConf,
rowIndex,
                                  columnValues[ i ][ ( col.isSet ? rowIndex : 0 ) ], statement,
currentIndex );
                   currentIndex++;
               }
  @@ -210,8 +210,9 @@
                       this.setOutput(objectModel, outputMode, results, table, queryData.columns[i].columnConf,
rowIndex, value);
                   }
               }
  -			rowIndex++;
  +            rowIndex++;
           }
  +        if (rowIndex == 0) { results = EMPTY_MAP;}
           return rowIndex;
       }
   
  
  
  
  1.8       +4 -3      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAction.java
  
  Index: DatabaseAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAction.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DatabaseAction.java	9 Aug 2002 08:25:29 -0000	1.7
  +++ DatabaseAction.java	25 Aug 2002 08:54:29 -0000	1.8
  @@ -634,7 +634,7 @@
           String outputMode = param.getParameter("output", (String) defaultModeNames.get(MODE_OUTPUT));
   
           if (this.settings.containsKey("reloadable"))
  -            reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +            reloadable = Boolean.valueOf((String) this.settings.get("reloadable")).booleanValue();
   
           // read local parameter settings
           try {
  @@ -755,6 +755,7 @@
                   try {
                       if (getLogger().isDebugEnabled()) {
                           getLogger().debug( "Rolling back transaction. Caused by " + e.getMessage()
);
  +                        e.printStackTrace();
                       }
                       conn.rollback();
                       results = null;
  @@ -823,7 +824,7 @@
               }
           }
   
  -        return (results == null? results : Collections.unmodifiableMap(results));
  +        return results; // (results == null? results : Collections.unmodifiableMap(results));
       }
   
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message