cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/modules/input CollectionMetaModule.java
Date Thu, 30 Jan 2003 05:22:54 GMT
vgritsenko    2003/01/29 21:22:54

  Modified:    src/blocks/databases/java/org/apache/cocoon/acting/modular
                        DatabaseAction.java DatabaseAddAction.java
               src/blocks/databases/java/org/apache/cocoon/components/modules/input
                        CollectionMetaModule.java
  Log:
  cosmetic changes
  
  Revision  Changes    Path
  1.6       +16 -25    xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/modular/DatabaseAction.java
  
  Index: DatabaseAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/modular/DatabaseAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DatabaseAction.java	20 Jan 2003 16:51:10 -0000	1.5
  +++ DatabaseAction.java	30 Jan 2003 05:22:54 -0000	1.6
  @@ -232,9 +232,9 @@
       public void configure(Configuration conf) throws ConfigurationException {
           super.configure(conf);
           if (this.settings != null) {
  -            this.defaultModeNames.put(MODE_OTHERS,   (String) this.settings.get("input",
 inputHint));
  -            this.defaultModeNames.put(MODE_OUTPUT,   (String) this.settings.get("output",
outputHint));
  -            this.defaultModeNames.put(MODE_AUTOINCR, (String) this.settings.get("autoincrement",
databaseHint));
  +            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);
               if (tmp != null) { 
  @@ -257,7 +257,6 @@
        */
       public void compose(ComponentManager manager) throws ComponentException {
           this.dbselector = (ComponentSelector) manager.lookup(DataSourceComponent.ROLE +
"Selector");
  -
           super.compose(manager);
       }
   
  @@ -317,11 +316,10 @@
               }
               output.setAttribute( null, objectModel, key, value );
           } catch (Exception e) {
  -                if (getLogger().isWarnEnabled())
  -                    getLogger()
  -                        .warn( "Could not select output mode "
  -                               + (String) outputMode
  -                               + ":" + e.getMessage() );
  +                if (getLogger().isWarnEnabled()) {
  +                    getLogger().warn("Could not select output mode "
  +                                     + outputMode + ":" + e.getMessage());
  +                }
           } finally {
               if (outputSelector != null) {
                   if (output != null)
  @@ -538,9 +536,6 @@
           throws ConfigurationException {
   
           String setMode = null;
  -        int setMaster = -1;
  -        String setMastersMode = null;
  -        boolean manyrows = false;
           int offset = ( isKey ? 0: set.noOfKeys);
   
           for ( int i = offset; i < conf.length + offset; i++ ) {
  @@ -565,7 +560,6 @@
                   setMode = set.columns[i].modeConf.getAttribute("set", null);
               }
               if ( setMode != null ) {
  -                manyrows = true;
                   set.columns[i].isSet = true;
                   set.isSet = true;
                   if ( setMode.equals("master") ) {
  @@ -671,7 +665,6 @@
               // find tables to work with
               Configuration[] tables = conf.getChildren("table");
               String tablesetname = param.getParameter("table-set", (String) this.settings.get("table-set"));
  -            Map set_tables = null; // default to old behaviour
   
               Map modeTypes = null;
   
  @@ -746,11 +739,10 @@
                   }
                   output.commit( null, objectModel );
               } catch (Exception e) {
  -                if (getLogger().isWarnEnabled())
  -                    getLogger()
  -                        .warn( "Could not select output mode "
  -                               + (String) outputMode
  -                               + ":" + e.getMessage() );
  +                if (getLogger().isWarnEnabled()) {
  +                    getLogger().warn("Could not select output mode "
  +                                     + outputMode + ":" + e.getMessage());
  +                }
               } finally {
                   if (outputSelector != null) {
                       if (output != null)
  @@ -779,11 +771,10 @@
                           }
                           output.rollback( null, objectModel, e);
                       } catch (Exception e2) {
  -                        if (getLogger().isWarnEnabled())
  -                            getLogger()
  -                                .warn( "Could not select output mode "
  -                                       + (String) outputMode
  -                                       + ":" + e2.getMessage() );
  +                        if (getLogger().isWarnEnabled()) {
  +                            getLogger().warn("Could not select output mode "
  +                                       + outputMode + ":" + e2.getMessage());
  +                        }
                       } finally {
                           if (outputSelector != null) {
                               if (output != null)
  
  
  
  1.3       +2 -4      xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/modular/DatabaseAddAction.java
  
  Index: DatabaseAddAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/acting/modular/DatabaseAddAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DatabaseAddAction.java	7 Jan 2003 23:56:08 -0000	1.2
  +++ DatabaseAddAction.java	30 Jan 2003 05:22:54 -0000	1.3
  @@ -74,7 +74,6 @@
    */
   public class DatabaseAddAction extends DatabaseAction {
   
  -
       /**
        * set all necessary ?s and execute the query
        */
  @@ -120,7 +119,7 @@
        * @param statement the insert statement
        * @param objectModel the objectModel object
        * @param outputMode name of the requested output module
  -     * @param result sitemap result object
  +     * @param results sitemap result object
        * @return the number of columns by which to increment the currentIndex
        */
       protected int setKeyAuto ( Configuration table, Column column, int currentIndex, int
rowIndex,
  @@ -255,7 +254,6 @@
   
                   StringBuffer queryBuffer = new StringBuffer("INSERT INTO ");
                   StringBuffer valueBuffer = new StringBuffer(") VALUES (");
  -                AutoIncrementModule dah;
   
                   queryBuffer.append(table.getAttribute("name"));
                   queryBuffer.append(" (");
  
  
  
  1.5       +3 -14     xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/modules/input/CollectionMetaModule.java
  
  Index: CollectionMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/components/modules/input/CollectionMetaModule.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CollectionMetaModule.java	17 Dec 2002 14:53:58 -0000	1.4
  +++ CollectionMetaModule.java	30 Jan 2003 05:22:54 -0000	1.5
  @@ -86,7 +86,6 @@
   
       protected Configuration memberConf = null;
   
  -    
   
       public void configure(Configuration config) throws ConfigurationException {
   
  @@ -96,8 +95,6 @@
       }
   
   
  -
  -
       public Object getAttribute( String name, Configuration modeConf, Map objectModel )

           throws ConfigurationException {
   
  @@ -128,7 +125,6 @@
           // in that case it replaces '*' otherwise it is
           // ignored
           String jType = mConf.getAttribute("type","string");
  -        SortedSet matchset = new TreeSet();
           String pName = mConf.getAttribute("name");
           int index = pName.indexOf("*");
           if (index>-1) {
  @@ -158,10 +154,7 @@
       }
   
   
  -
  -
  -
  -    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
           if (!this.initialized) {
  @@ -187,7 +180,6 @@
               }
           }
   
  -
           Iterator names = getNames(objectModel,
                                     this.input, this.defaultInput, this.inputConf,
                                     null, inputName, inputConfig);
  @@ -233,9 +225,7 @@
       }
   
   
  -
  -
  -    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel
) 
  +    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel
)
           throws ConfigurationException {
   
           Iterator names = this.getAttributeNames( modeConf, objectModel );
  @@ -247,5 +237,4 @@
           return values.toArray();
   
       }
  -
   }
  
  
  

----------------------------------------------------------------------
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