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/webapp/stylesheets/page simple-page2html.xsl
Date Tue, 04 Feb 2003 15:44:16 GMT
haul        2003/02/04 07:44:16

  Modified:    .        Tag: cocoon_2_0_3_branch changes.xml
               src/java/org/apache/cocoon/acting/modular Tag:
                        cocoon_2_0_3_branch DatabaseAction.java
                        DatabaseAddAction.java DatabaseDeleteAction.java
                        DatabaseQueryAction.java DatabaseSelectAction.java
                        DatabaseUpdateAction.java
               src/java/org/apache/cocoon/components/language/markup/xsp/javascript
                        Tag: cocoon_2_0_3_branch javascript.xpipe
               src/java/org/apache/cocoon/components/modules Tag:
                        cocoon_2_0_3_branch modules.xconf
               src/java/org/apache/cocoon/components/modules/input Tag:
                        cocoon_2_0_3_branch AbstractInputModule.java
                        AbstractJXPathModule.java AbstractMetaModule.java
                        ChainMetaModule.java CollectionMetaModule.java
                        DateInputModule.java DateMetaInputModule.java
                        DefaultsMetaModule.java DigestMetaModule.java
                        HeaderAttributeModule.java InputModule.java
                        IteratorHelper.java JXPathMetaModule.java
                        MapMetaModule.java NullInputModule.java
                        RandomNumberModule.java RequestAttributeModule.java
                        RequestModule.java RequestParameterModule.java
                        RequestURIModule.java SessionAttributeModule.java
                        SessionModule.java SimpleMappingMetaModule.java
                        StringConstantModule.java
               src/java/org/apache/cocoon/components/modules/output Tag:
                        cocoon_2_0_3_branch AbstractOutputModule.java
                        OutputModule.java RequestAttributeOutputModule.java
                        SessionAttributeOutputModule.java
               src/java/org/apache/cocoon/components/request Tag:
                        cocoon_2_0_3_branch
                        MultipartRequestFactoryImpl.java
               src/java/org/apache/cocoon/components/request/multipart Tag:
                        cocoon_2_0_3_branch FilePart.java
                        FilePartArray.java FilePartFile.java
                        MultipartParser.java MultipartRequestWrapper.java
               src/java/org/apache/cocoon/reading Tag: cocoon_2_0_3_branch
                        DatabaseReader.java
               src/java/org/apache/cocoon/transformation Tag:
                        cocoon_2_0_3_branch AbstractDOMTransformer.java
                        SimpleFormTransformer.java
               src/java/org/apache/cocoon/util Tag: cocoon_2_0_3_branch
                        BlobHelper.java ClobHelper.java
                        JDBCTypeConversions.java JDBCxlobHelper.java
               src/webapp Tag: cocoon_2_0_3_branch sitemap.xmap
               src/webapp/WEB-INF/db Tag: cocoon_2_0_3_branch
                        cocoondb.script
               src/webapp/samples/common/style/xsl/html Tag:
                        cocoon_2_0_3_branch simple-samples2html.xsl
               src/webapp/search Tag: cocoon_2_0_3_branch sitemap.xmap
               src/webapp/stylesheets/page Tag: cocoon_2_0_3_branch
                        simple-page2html.xsl
  Added:       src/java/org/apache/cocoon/components/modules/input Tag:
                        cocoon_2_0_3_branch RawRequestParameterModule.java
               src/java/org/apache/cocoon/components/modules/output Tag:
                        cocoon_2_0_3_branch RequestAttributeMap.java
               src/java/org/apache/cocoon/matching/modular Tag:
                        cocoon_2_0_3_branch CachingRegexpMatcher.java
               src/webapp/mount/databases Tag: cocoon_2_0_3_branch
                        samples.xml sitemap.xmap
               src/webapp/mount/databases/mod-db Tag: cocoon_2_0_3_branch
                        database.xml edit-groups.xsp file-upload-blob.xsp
                        schema.sql sitemap.xmap stupid.xsl user-list.xsp
               src/webapp/mount/databases/org-db Tag: cocoon_2_0_3_branch
                        add-department.xsp add-employee.xsp employee.xml
                        employee.xsp process-department.xsp
                        process-employee.xsp sitemap.xmap
               src/webapp/mount/databases/transform Tag:
                        cocoon_2_0_3_branch sitemap.xmap sql-page.xml
                        sql-page.xml.sql
               src/webapp/mount/databases/tutorial Tag: cocoon_2_0_3_branch
                        menu.xml sitemap.xmap
               src/webapp/mount/databases/tutorial/docs Tag:
                        cocoon_2_0_3_branch confirm-dept.xsp
                        confirm-empl.xsp create-dept.xsp create-empl.xsp
                        department-form.xml edit-dept.xsp edit-empl.xsp
                        employee-form.xml home.xml results-dept.xsp
                        results-empl.xsp search-dept.xsp search-empl.xsp
               src/webapp/mount/databases/tutorial/resources/images Tag:
                        cocoon_2_0_3_branch bar-border-bottom.gif
                        bar-border-left.gif bar-border-right.gif
                        bar-border-top.gif bar-bottom-left.gif
                        bar-bottom-right.gif bar-top-left.gif
                        bar-top-right.gif bottom.gif button-asf-hi.gif
                        button-asf-lo.gif button-w3c-hi.gif
                        button-w3c-lo.gif button-xml-hi.gif
                        button-xml-lo.gif close.gif dot.gif join.gif
                        line.gif logo.gif note.gif right.gif separator.gif
                        void.gif
               src/webapp/mount/databases/tutorial/stylesheets Tag:
                        cocoon_2_0_3_branch apache.xsl
               src/webapp/mount/databases/tutorial/stylesheets/system Tag:
                        cocoon_2_0_3_branch error2document.xsl
               src/webapp/mount/databases/xsp Tag: cocoon_2_0_3_branch
                        esql.xsd esql.xsp sitemap.xmap
               src/webapp/samples/common/style/css Tag: cocoon_2_0_3_branch
                        samples.css
  Log:
  sync with HEAD
   - input modules
   - output modules
   - modular database actions
   - database reader
      - not using Blob
      - mimetype from DB
   - file upload using modular database actions
      - sample
   - (part of) sample cosmetics
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.138.2.85 +34 -1     xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.138.2.84
  retrieving revision 1.138.2.85
  diff -u -r1.138.2.84 -r1.138.2.85
  --- changes.xml	1 Feb 2003 04:07:22 -0000	1.138.2.84
  +++ changes.xml	4 Feb 2003 15:44:04 -0000	1.138.2.85
  @@ -40,11 +40,44 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="CH" type="add">
  +    DatabaseReader: optionally read mimetype from database
  +  </action>
  +  <action dev="CH" type="add" due-to="Geoff Howard" due-to-email="cocoon@leverageweb.com">
  +    modular.DatabaseActions: added ability to store FileParts from uploads to
  +    "ascii", "clob", "blob", and "binary" columns. Added getSize() method to FilePart.
  +  </action>
  +  <action dev="CH" type="add">
  +    (modular) DatabaseAction: added ability to use arbitrary path separators
  +    instead of "." (e.g. "/"), added ability to count rows from 1, added
  +    documentation.
  +  </action>
  +  <action dev="CH" type="add">
  +    Created additional isolation level for some OutputModules.
  +  </action>
     <action dev="VG" type="fix" fixes-bug="16240">
       Modify DeltaTimeCacheValidity toString method so it returns same value during some time
       (approximately equal to timeInCache parameter). This makes it possible to cache sources
       with delta validity. Note: 2.1 replaces it with Excalibur's TimeStampValidity.
     </action> 
  +  <action dev="CH" type="fix" due-to-email="michael.enke@wincor-nixdorf.com"
  +   due-to="Michael Enke" fixes-bug="15064">
  +   Postgresql 7.3: LIMIT x,y no longer supported. postgresql-old limit method 
  +   still uses LIMIT x,y while postgresql uses the LIMIT x OFFSET y syntax 
  +   which has been used by postgresql for some time now.
  +  </action>
  +  <action dev="CH" type="fix" due-to-email="frank.ridderbusch@gmx.de"
  +   due-to="Frank Ridderbusch" fixes-bug="15005">
  +   Extension to sendmail.xsp: lists for sendmail:cc
  +  </action>
  +  <action dev="CH" type="fix" due-to-email="artur@digitalfairway.com"
  +   due-to="Artur Bialecki" fixes-bug="14835">
  +   Added container/form-encoding init-params to web.xml
  +  </action>
  +  <action dev="CH" type="fix" due-to-email="stuart.roebuck@adolos.co.uk"
  +   due-to="Stuart Roebuck" fixes-bug="15136">
  +   Fixing various inefficient logging calls.
  +  </action>
     <action dev="SW" type="update">
       The "mime-type" attribute on &lt;map:read&gt; and &lt;map:serialize&gt; is now
       expanded if it contains sitemap variables.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.5   +39 -31    xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseAction.java
  
  Index: DatabaseAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseAction.java,v
  retrieving revision 1.8.2.4
  retrieving revision 1.8.2.5
  diff -u -r1.8.2.4 -r1.8.2.5
  --- DatabaseAction.java	30 Jan 2003 16:20:15 -0000	1.8.2.4
  +++ DatabaseAction.java	4 Feb 2003 15:44:05 -0000	1.8.2.5
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -98,8 +98,12 @@
    *
    * <table>
    * <tr><td colspan="2">Configuration options (setup):</td></tr>
  - * <tr><td>input            </td><td>default mode name for reading values</td></tr>
  - * <tr><td>autoincrement    </td><td>default mode name for obtaining values from autoincrement columns</td></tr>
  + * <tr><td>input            </td><td>default mode name for reading values (request-param)</td></tr>
  + * <tr><td>autoincrement    </td><td>default mode name for obtaining values from autoincrement columns (auto)</td></tr>
  + * <tr><td>append-row       </td><td>append row number in square brackets to column name for output (yes)</td></tr>
  + * <tr><td>append-table-name</td><td>add table name to column name for both in- and output (yes)</td></tr>
  + * <tr><td>first-row        </td><td>row index of first row (0)</td></tr>
  + * <tr><td>path-separator   </td><td>string to separate table name from column name (.)</td></tr>
    * </table>
    *
    * <table>
  @@ -107,7 +111,7 @@
    * <tr><td>throw-exception  </td><td>throw an exception when an error occurs (default: false)</td></tr>
    * <tr><td>descriptor       </td><td>file containing database description</td></tr>
    * <tr><td>table-set        </td><td>table-set name to work with         </td></tr>
  - * <tr><td>output           </td><td>mode name for writing values        </td></tr>
  + * <tr><td>output           </td><td>mode name for writing values (request-attr)</td></tr>
    * <tr><td>reloadable       </td><td>dynamically reload descriptor file if change is detected</td></tr>
    * <tr><td>use-transactions </td><td>defaults to yes</td></tr>
    * <tr><td>connection       </td><td>configured datasource connection to use (overrides value from descriptor file)</td></tr>
  @@ -149,7 +153,8 @@
       protected ComponentSelector dbselector;
       protected Map defaultModeNames = new HashMap( 3 );
       protected final HashMap cachedQueryData = new HashMap();
  -
  +    protected String pathSeparator = ".";
  +    protected int firstRow = 0;
   
       // ========================================================================
       // inner helper classes
  @@ -227,9 +232,19 @@
       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) { 
  +                try {
  +                        this.firstRow = Integer.parseInt(tmp);
  +                } catch (NumberFormatException nfe) {
  +                    if (getLogger().isWarnEnabled())
  +                        getLogger().warn("problem parsing first row option "+tmp+" using default instead.");
  +                };
  +            }
           }
       }
   
  @@ -242,7 +257,6 @@
        */
       public void compose(ComponentManager manager) throws ComponentException {
           this.dbselector = (ComponentSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");
  -
           super.compose(manager);
       }
   
  @@ -302,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)
  @@ -438,6 +451,8 @@
                (this.settings.get("append-row").toString().equalsIgnoreCase("false") || 
                 this.settings.get("append-row").toString().equalsIgnoreCase("0")) ) {
               rowIndex = -1;
  +        } else {
  +            rowIndex = rowIndex + this.firstRow;
           }
           if ( this.settings.containsKey("append-table-name") && 
                (this.settings.get("append-table-name").toString().equalsIgnoreCase("false") || 
  @@ -449,7 +464,7 @@
           else
               {
                   return ( tableConf.getAttribute("alias", tableConf.getAttribute("name", null) )
  -                         + "." + columnConf.getAttribute("name",null)
  +                         + this.pathSeparator + columnConf.getAttribute("name",null)
                            + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
               }
       }
  @@ -521,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++ ) {
  @@ -548,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") ) {
  @@ -654,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;
   
  @@ -729,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)
  @@ -762,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.5.2.2   +4 -5      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseAddAction.java
  
  Index: DatabaseAddAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseAddAction.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- DatabaseAddAction.java	30 Jan 2003 16:20:15 -0000	1.5.2.1
  +++ DatabaseAddAction.java	4 Feb 2003 15:44:05 -0000	1.5.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -61,6 +61,7 @@
   import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +
   import org.apache.cocoon.components.modules.database.AutoIncrementModule;
   
   /**
  @@ -73,7 +74,6 @@
    */
   public class DatabaseAddAction extends DatabaseAction {
   
  -
       /**
        * set all necessary ?s and execute the query
        */
  @@ -119,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,
  @@ -254,7 +254,6 @@
   
                   StringBuffer queryBuffer = new StringBuffer("INSERT INTO ");
                   StringBuffer valueBuffer = new StringBuffer(") VALUES (");
  -                AutoIncrementModule dah;
   
                   queryBuffer.append(table.getAttribute("name"));
                   queryBuffer.append(" (");
  
  
  
  1.3.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseDeleteAction.java
  
  Index: DatabaseDeleteAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseDeleteAction.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- DatabaseDeleteAction.java	30 Jan 2003 16:20:15 -0000	1.3.2.1
  +++ DatabaseDeleteAction.java	4 Feb 2003 15:44:05 -0000	1.3.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.2.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseQueryAction.java
  
  Index: DatabaseQueryAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseQueryAction.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- DatabaseQueryAction.java	30 Jan 2003 16:20:15 -0000	1.2.2.1
  +++ DatabaseQueryAction.java	4 Feb 2003 15:44:05 -0000	1.2.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.5.2.2   +3 -2      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseSelectAction.java
  
  Index: DatabaseSelectAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseSelectAction.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- DatabaseSelectAction.java	30 Jan 2003 16:20:15 -0000	1.5.2.1
  +++ DatabaseSelectAction.java	4 Feb 2003 15:44:05 -0000	1.5.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -60,6 +60,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  +
   import org.apache.cocoon.util.JDBCTypeConversions;
   
   /**
  
  
  
  1.3.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseUpdateAction.java
  
  Index: DatabaseUpdateAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/Attic/DatabaseUpdateAction.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- DatabaseUpdateAction.java	30 Jan 2003 16:20:15 -0000	1.3.2.1
  +++ DatabaseUpdateAction.java	4 Feb 2003 15:44:05 -0000	1.3.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +6 -2      xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/Attic/javascript.xpipe
  
  Index: javascript.xpipe
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/Attic/javascript.xpipe,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- javascript.xpipe	10 Mar 2002 03:09:17 -0000	1.1
  +++ javascript.xpipe	4 Feb 2003 15:44:05 -0000	1.1.2.1
  @@ -8,8 +8,12 @@
         <map:generate type="serverpages" src="docs/samples/xsp-js/{1}.xsp">
           <map:parameter name="programming-language" value="js"/>
         </map:generate>
  -      <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <map:parameter name="view-source" value="docs/samples/xsp-js/{1}.xsp"/>
  +      <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +          <map:parameter name="servletPath" value="{request:servletPath}"/>
  +          <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +          <map:parameter name="contextPath" value="{request:contextPath}"/>
  +          <map:parameter name="file" value="docs/samples/{0}.xsp"/>
  +          <map:parameter name="remove" value="{0}"/>
         </map:transform>
         <map:serialize/>
       </map:match>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.3   +36 -27    xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf
  
  Index: modules.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/modules.xconf,v
  retrieving revision 1.5.2.2
  retrieving revision 1.5.2.3
  diff -u -r1.5.2.2 -r1.5.2.3
  --- modules.xconf	17 Dec 2002 08:45:06 -0000	1.5.2.2
  +++ modules.xconf	4 Feb 2003 15:44:05 -0000	1.5.2.3
  @@ -4,36 +4,45 @@
      <!-- =============== Sitemap In/Out/Database Modules ==================== -->
      
      <input-modules>
  -      <component-instance logger="core.modules.input" name="request"       	class="org.apache.cocoon.components.modules.input.RequestModule"/>
  -      <component-instance logger="core.modules.input" name="session"       	class="org.apache.cocoon.components.modules.input.SessionModule"/>
  -      <component-instance logger="core.modules.input" name="request-param"   	class="org.apache.cocoon.components.modules.input.RequestParameterModule"/>
  -      <component-instance logger="core.modules.input" name="request-attr" 	class="org.apache.cocoon.components.modules.input.RequestAttributeModule"/>
  -      <component-instance logger="core.modules.input" name="request-header"    	class="org.apache.cocoon.components.modules.input.HeaderAttributeModule"/>
  -      <component-instance logger="core.modules.input" name="session-attr"   	class="org.apache.cocoon.components.modules.input.SessionAttributeModule"/>
  -      <component-instance logger="core.modules.input" name="constant"  		class="org.apache.cocoon.components.modules.input.StringConstantModule"/>
  -      <component-instance logger="core.modules.input" name="random"    		class="org.apache.cocoon.components.modules.input.RandomNumberModule"/>
  -      <component-instance logger="core.modules.input" name="digest"     	class="org.apache.cocoon.components.modules.input.DigestMetaModule"/>
  -      <component-instance logger="core.modules.input" name="date"       	class="org.apache.cocoon.components.modules.input.DateInputModule"/>
  -      <component-instance logger="core.modules.input" name="nullinput"  	class="org.apache.cocoon.components.modules.input.NullInputModule"/>
  -      <component-instance logger="core.modules.input" name="xmlmeta"    	class="org.apache.cocoon.components.modules.input.XMLMetaModule"/>
  -      <component-instance logger="core.modules.input" name="mapmeta"    	class="org.apache.cocoon.components.modules.input.MapMetaModule"/>
  -      <component-instance logger="core.modules.input" name="defaults"   	class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
  -		 <values>
  -			<skin>defaultSkin</skin>
  -			<base-url>http://localhost:8080/cocoon</base-url>
  -		 </values>
  -	  </component-instance>
  -      <component-instance logger="core.modules.input" name="chain"   	class="org.apache.cocoon.components.modules.input.ChainMetaModule">
  -	     <input-module name="request-param"/>
  -	     <input-module name="request-attr"/>
  -	     <input-module name="session-attr"/>
  -	     <input-module name="defaults"/>
  -	  </component-instance>
  +      <component-instance logger="core.modules.input" name="request"           class="org.apache.cocoon.components.modules.input.RequestModule"/>
  +      <component-instance logger="core.modules.input" name="session"           class="org.apache.cocoon.components.modules.input.SessionModule"/>
  +      <component-instance logger="core.modules.input" name="request-param"     class="org.apache.cocoon.components.modules.input.RequestParameterModule"/>
  +      <component-instance logger="core.modules.input" name="raw-request-param" class="org.apache.cocoon.components.modules.input.RawRequestParameterModule"/>
  +      <component-instance logger="core.modules.input" name="request-attr"      class="org.apache.cocoon.components.modules.input.RequestAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="request-header"    class="org.apache.cocoon.components.modules.input.HeaderAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="session-attr"      class="org.apache.cocoon.components.modules.input.SessionAttributeModule"/>
  +      <component-instance logger="core.modules.input" name="system-property"   class="org.apache.cocoon.components.modules.input.SystemPropertyModule"/>
  +      <component-instance logger="core.modules.input" name="constant"          class="org.apache.cocoon.components.modules.input.StringConstantModule"/>
  +      <component-instance logger="core.modules.input" name="random"            class="org.apache.cocoon.components.modules.input.RandomNumberModule"/>
  +      <component-instance logger="core.modules.input" name="digest"            class="org.apache.cocoon.components.modules.input.DigestMetaModule"/>
  +      <component-instance logger="core.modules.input" name="date"              class="org.apache.cocoon.components.modules.input.DateInputModule">
  +        <!-- <format>EEE, d MMM yyyy HH:mm:ss Z</format> -->
  +        <!--Eg: Mon, 28 Oct 2002 03:08:49 +1100 -->
  +      </component-instance>
  +      <component-instance logger="core.modules.input" name="nullinput"         class="org.apache.cocoon.components.modules.input.NullInputModule"/>
  +      <component-instance logger="core.modules.input" name="xmlmeta"           class="org.apache.cocoon.components.modules.input.XMLMetaModule"/>
  +      <component-instance logger="core.modules.input" name="mapmeta"           class="org.apache.cocoon.components.modules.input.MapMetaModule"/>
  +      <component-instance logger="core.modules.input" name="datemeta"          class="org.apache.cocoon.components.modules.input.DateMetaInputModule"/>
  +      <component-instance logger="core.modules.input" name="jxpath"            class="org.apache.cocoon.components.modules.input.JXPathMetaModule"/>
  +      <component-instance logger="core.modules.input" name="simplemap"         class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule"/>
  +      <component-instance logger="core.modules.input" name="chain"             class="org.apache.cocoon.components.modules.input.ChainMetaModule">
  +         <input-module name="request-param"/>
  +         <input-module name="request-attr"/>
  +         <input-module name="session-attr"/>
  +         <input-module name="defaults"/>
  +      </component-instance>
  +      <component-instance logger="core.modules.input" name="defaults"          class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
  +         <values>
  +            <skin>defaultSkin</skin>
  +            <base-url>http://localhost:8080/cocoon</base-url>
  +         </values>
  +      </component-instance>
      </input-modules>
   
      <output-modules>
  -      <component-instance logger="core.modules.output" name="request-attr" class="org.apache.cocoon.components.modules.output.RequestAttributeOutputModule"/>
  -      <component-instance logger="core.modules.output" name="session-attr"   class="org.apache.cocoon.components.modules.output.SessionAttributeOutputModule"/>
  +      <component-instance logger="core.modules.output" name="request-attr"     class="org.apache.cocoon.components.modules.output.RequestAttributeOutputModule"/>
  +      <component-instance logger="core.modules.output" name="request-attr-map" class="org.apache.cocoon.components.modules.output.RequestAttributeMap"/>
  +      <component-instance logger="core.modules.output" name="session-attr"     class="org.apache.cocoon.components.modules.output.SessionAttributeOutputModule"/>
      </output-modules>
   
      <autoincrement-modules>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.2   +8 -14     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java
  
  Index: AbstractInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractInputModule.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- AbstractInputModule.java	17 Nov 2002 19:12:49 -0000	1.2.4.1
  +++ AbstractInputModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -87,18 +87,12 @@
        * For nested configurations override this function.
        * */
       public void configure(Configuration conf) throws ConfigurationException {
  -
  -        if (conf != null) {
  -            String key = null;
  -            String val = null;
  -            Configuration[] parameters = conf.getChildren();
  -            this.settings = new HashMap(parameters.length);
  -            for ( int i = 0; i < parameters.length; i++) {
  -                key = parameters[i].getName();
  -                val = parameters[i].getValue();
  -                if ( key != null )
  -                    this.settings.put(key, val);
  -            }
  +        Configuration[] parameters = conf.getChildren();
  +        this.settings = new HashMap(parameters.length);
  +        for (int i = 0; i < parameters.length; i++) {
  +            String key = parameters[i].getName();
  +            String val = parameters[i].getValue();
  +            this.settings.put (key, val);
           }
       }
   
  
  
  
  1.3.2.6   +15 -4     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractJXPathModule.java
  
  Index: AbstractJXPathModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractJXPathModule.java,v
  retrieving revision 1.3.2.5
  retrieving revision 1.3.2.6
  diff -u -r1.3.2.5 -r1.3.2.6
  --- AbstractJXPathModule.java	15 Jan 2003 16:15:35 -0000	1.3.2.5
  +++ AbstractJXPathModule.java	4 Feb 2003 15:44:06 -0000	1.3.2.6
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -74,6 +74,9 @@
    * <td>When set to true, non-existing attributes return null, when set to false,
    *     an exception is thrown. Default is true.</td> 
    *</tr>
  + * <tr><td><code>&lt;parameter&gt;foo&lt;/parameter&gt;</td>
  + * <td>When set overrides attribute name passed to module.</td> 
  + *</tr>
    * <tr><td><code>&lt;function name="java.lang.String" prefix="str"/&gt;</td>
    * <td>Imports the class "String" as extension class to the JXPathContext using 
    * the prefix "str". Thus "str:length(xpath)" would apply the method "length" to 
  @@ -105,12 +108,14 @@
        */
       protected boolean lenient = true;
   
  +    /** override attribute name */
  +    protected String parameter = null;
   
       /**
        * Configure component. Preprocess list of packages and functions
        * to add to JXPath context later.
        *
  -     * @param conf a <code>Configuration</code> value
  +     * @param config a <code>Configuration</code> value
        * @exception ConfigurationException if an error occurs
        */
       public void configure(Configuration config) throws ConfigurationException {
  @@ -220,6 +225,9 @@
   
           Object contextObj = getContextObject(modeConf, objectModel);
           if (contextObj == null) return null;
  +        if (modeConf != null) { 
  +            name = modeConf.getChild("parameter").getValue(this.parameter != null ? this.parameter : name); 
  +        }
           try {
               JXPathContext jxContext = JXPathContext.newContext(contextObj);
               setupExtensions(jxContext, modeConf);
  @@ -247,7 +255,7 @@
               for (int i = 0; i < properties.length; i++) {
                   names.add(properties[i].getName());
               }
  -            return (java.util.Iterator) names.listIterator();
  +            return names.listIterator();
           } catch (Exception e) {
               throw new ConfigurationException(
                   "Error retrieving attribute names for class: "
  @@ -263,6 +271,9 @@
   
           Object contextObj = getContextObject(modeConf, objectModel);
           if (contextObj == null) return null;
  +        if (modeConf != null) { 
  +            name = modeConf.getChild("parameter").getValue(this.parameter != null ? this.parameter : name); 
  +        }
           try {
               JXPathContext jxContext = JXPathContext.newContext(contextObj);
               List values = new LinkedList();
  
  
  
  1.3.2.5   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractMetaModule.java
  
  Index: AbstractMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/AbstractMetaModule.java,v
  retrieving revision 1.3.2.4
  retrieving revision 1.3.2.5
  diff -u -r1.3.2.4 -r1.3.2.5
  --- AbstractMetaModule.java	15 Jan 2003 16:15:35 -0000	1.3.2.4
  +++ AbstractMetaModule.java	4 Feb 2003 15:44:06 -0000	1.3.2.5
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.3.2.4   +8 -7      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java
  
  Index: ChainMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/ChainMetaModule.java,v
  retrieving revision 1.3.2.3
  retrieving revision 1.3.2.4
  diff -u -r1.3.2.3 -r1.3.2.4
  --- ChainMetaModule.java	19 Dec 2002 11:24:29 -0000	1.3.2.3
  +++ ChainMetaModule.java	4 Feb 2003 15:44:06 -0000	1.3.2.4
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -61,6 +61,7 @@
   import java.util.Arrays;
   import java.util.Collection;
   import java.util.Iterator;
  +
   /**
    * This modules allows to "chain" several other modules. If a module
    * returns "null" as attribute value, the next module in the chain is
  @@ -113,7 +114,7 @@
       public void configure(Configuration config) throws ConfigurationException {
   
           Configuration[] confs = config.getChildren("input-module");
  -        if (confs.length>0) {
  +        if (confs.length > 0) {
               this.inputs = new ModuleHolder[confs.length];
               int j = 0;
               for (int i=0; i<confs.length; i++) {
  @@ -189,7 +190,7 @@
           boolean allValues = this.allValues;
           boolean emptyAsNull = this.emptyAsNull;
           if (modeConf!=null) {
  -            inputConfigs = modeConf.getChildren("input-modules");
  +            inputConfigs = modeConf.getChildren("input-module");
               emptyAsNull = modeConf.getChild("empty-as-null").getValueAsBoolean(emptyAsNull);
               allValues = modeConf.getChild("all-values").getValueAsBoolean(allValues);
               if (inputConfigs.length == 0) inputConfigs = null;
  @@ -208,7 +209,7 @@
                       value = getValues(attr, objectModel, this.inputs[i].input, this.inputs[i].name, this.inputs[i].config);
                       if (emptyAsNull && value != null && value.length == 0) value = null;
                       if (emptyAsNull && value != null && value.length == 1 && 
  -                        value[0] instanceof String && ((String)value[0]).equals("")) value = null;
  +                        value[0] instanceof String && value[0].equals("")) value = null;
                       if (debug) getLogger().debug("read from "+this.inputs[i].name+" attribute "+attr+" as "+value);
                       if (allValues && value != null) values.addAll(Arrays.asList(value));
                   }
  @@ -223,7 +224,7 @@
                       value = getValues(attr, objectModel, null, name, inputConfigs[i]);
                       if (emptyAsNull && value != null && value.length == 0) value = null;
                       if (emptyAsNull && value != null && value.length == 1 && 
  -                        value[0] instanceof String && ((String)value[0]).equals("")) value = null;
  +                        value[0] instanceof String && value[0].equals("")) value = null;
                       if (debug) getLogger().debug("read from "+name+" attribute "+attr+" as "+value);
                       if (allValues && value != null) values.addAll(Arrays.asList(value));
                   }
  @@ -253,7 +254,7 @@
           boolean emptyAsNull = this.emptyAsNull;
           boolean allNames = this.allNames;
           if (modeConf!=null) {
  -            inputConfigs = modeConf.getChildren("input-modules");
  +            inputConfigs = modeConf.getChildren("input-module");
               emptyAsNull = modeConf.getChild("empty-as-null").getValueAsBoolean(emptyAsNull);
               allNames = modeConf.getChild("all-names").getValueAsBoolean(allNames);
               if (inputConfigs.length == 0) inputConfigs = null;
  
  
  
  1.4.4.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/Attic/CollectionMetaModule.java
  
  Index: CollectionMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/Attic/CollectionMetaModule.java,v
  retrieving revision 1.4.4.2
  retrieving revision 1.4.4.3
  diff -u -r1.4.4.2 -r1.4.4.3
  --- CollectionMetaModule.java	19 Dec 2002 11:24:29 -0000	1.4.4.2
  +++ CollectionMetaModule.java	4 Feb 2003 15:44:06 -0000	1.4.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.3.4.3   +8 -6      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateInputModule.java
  
  Index: DateInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateInputModule.java,v
  retrieving revision 1.3.4.2
  retrieving revision 1.3.4.3
  diff -u -r1.3.4.2 -r1.3.4.3
  --- DateInputModule.java	19 Dec 2002 11:24:29 -0000	1.3.4.2
  +++ DateInputModule.java	4 Feb 2003 15:44:06 -0000	1.3.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -78,10 +78,12 @@
   
       public Object getAttribute( String name, Configuration modeConf, Map objectModel ) throws ConfigurationException {
           
  -        String format = (modeConf != null? 
  -                         modeConf.getAttribute("format", (String) this.settings.get("format",null)) 
  -                         : 
  -                         (String) this.settings.get("format",null));
  +        String format = null;
  +        if (modeConf != null) {
  +            format = modeConf.getAttribute("format", (String) this.settings.get("format",null));
  +            // this is preferred:
  +            format = modeConf.getChild("format").getAttribute(format);
  +        }
   
           if (format==null) {
               return new Date();
  
  
  
  1.3.2.3   +8 -6      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java
  
  Index: DateMetaInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- DateMetaInputModule.java	19 Dec 2002 11:24:29 -0000	1.3.2.2
  +++ DateMetaInputModule.java	4 Feb 2003 15:44:06 -0000	1.3.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -62,10 +62,9 @@
   
   /**
    * Parses a date string according to a given format and returns a date
  - * object. Configuration options: child element "input-module" holds
  - * InputModule to obtain the string from, attribute "format" to
  - * "input-module" that holds ajava.text.SimpleDateFormat format
  - * string.
  + * object. Configuration options: element "format" to hold a {@link
  + * java.text.SimpleDateFormat} format string, child element
  + * "input-module" holds InputModule to obtain the string from.
    *
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
  @@ -110,6 +109,9 @@
               inputName   = modeConf.getChild("input-module").getAttribute("name",null);
               parameter   = modeConf.getAttribute("parameter",parameter);
               format      = modeConf.getAttribute("format",this.defaultFormat);
  +            // preferred:
  +            parameter   = modeConf.getChild("parameter").getAttribute(parameter);
  +            format      = modeConf.getChild("format").getAttribute(format);
           }
           if (this.defaultFormat.equals(format)) {
               formatter = this.defaultFormatter;
  
  
  
  1.3.4.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java
  
  Index: DefaultsMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DefaultsMetaModule.java,v
  retrieving revision 1.3.4.2
  retrieving revision 1.3.4.3
  diff -u -r1.3.4.2 -r1.3.4.3
  --- DefaultsMetaModule.java	19 Dec 2002 11:24:29 -0000	1.3.4.2
  +++ DefaultsMetaModule.java	4 Feb 2003 15:44:06 -0000	1.3.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.4.4.6   +40 -28    xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java
  
  Index: DigestMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/DigestMetaModule.java,v
  retrieving revision 1.4.4.5
  retrieving revision 1.4.4.6
  diff -u -r1.4.4.5 -r1.4.4.6
  --- DigestMetaModule.java	31 Jan 2003 07:00:56 -0000	1.4.4.5
  +++ DigestMetaModule.java	4 Feb 2003 15:44:06 -0000	1.4.4.6
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -50,29 +50,29 @@
   */
   package org.apache.cocoon.components.modules.input;
   
  -import java.io.UnsupportedEncodingException;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.thread.ThreadSafe;
  +
  +import org.apache.cocoon.util.HashMap;
  +
   import java.net.URLEncoder;
   import java.security.MessageDigest;
   import java.security.NoSuchAlgorithmException;
   import java.security.NoSuchProviderException;
   import java.util.Iterator;
   import java.util.Map;
  -
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.thread.ThreadSafe;
  -import org.apache.cocoon.util.HashMap;
  +import java.io.UnsupportedEncodingException;
   
   /** Meta module that obtains values from other module and returns
    * message digest of value. Very useful for storing and checking
    * passwords. Input module configured through nested element
    * "input-module", message digest algorithm, security provider, salt,
  - * and URL encoded output configurable through attributes "algorithm",
  - * "provider", "salt", "encode" of configuration root
  - * element. Defaults are "sha", null, "salt", and "false". Available
  - * value for encode are "none" (returns byte[]), "string" (return hash
  - * as string), "url" (returns url encoded string), "hex" (returns
  - * string of hex values).
  + * and URL encoded output configurable through elements "algorithm",
  + * "provider", "salt", "encode". Defaults are "sha", null, "salt", and
  + * "false". Available value for encode are "none" (returns byte[]),
  + * "string" (return hash as string), "url" (returns url encoded
  + * string), "hex" (returns string of hex values).
    *
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
    * @version CVS $Id$
  @@ -113,10 +113,18 @@
   
           this.inputConf = config.getChild("input-module");
           this.defaultInput = this.inputConf.getAttribute("name", this.defaultInput);
  +
           this.defaultAlgorithm = this.inputConf.getAttribute("algorithm",this.defaultAlgorithm);
           this.defaultProvider = this.inputConf.getAttribute("provider",this.defaultProvider);
           this.defaultSalt = this.inputConf.getAttribute("salt",this.defaultSalt);
           this.defaultEncode = this.inputConf.getAttribute("encode","false");
  +
  +        // preferred
  +        this.defaultAlgorithm = config.getChild("algorithm").getValue(this.defaultAlgorithm);
  +        this.defaultProvider = config.getChild("provider").getValue(this.defaultProvider);
  +        this.defaultSalt = config.getChild("salt").getValue(this.defaultSalt);
  +        this.defaultEncode = config.getChild("encode").getValue(this.defaultEncode);
  +
           if (encodingNames.get(this.defaultEncode) == null) {
               if (getLogger().isErrorEnabled())
                   getLogger().error("Requested encoding is unknown: "+this.defaultEncode);
  @@ -152,15 +160,18 @@
               }
               // read necessary parameters
               algorithm = modeConf.getAttribute("algorithm", algorithm);
  -            provider  = modeConf.getAttribute("provider" , provider );
  -            salt  = modeConf.getAttribute("salt" , salt );
  -            encode = ((Integer) encodingNames.get(modeConf.getAttribute("encode" , this.defaultEncode))).intValue();
  +            provider  = modeConf.getAttribute("provider", provider);
  +            salt  = modeConf.getAttribute("salt", salt);
  +            encode = ((Integer) encodingNames.get(modeConf.getAttribute("encode", this.defaultEncode))).intValue();
  +
  +            // preferred
  +            algorithm = modeConf.getChild("algorithm").getValue(algorithm);
  +            provider  = modeConf.getChild("provider").getValue(provider);
  +            salt  = modeConf.getChild("salt").getValue(salt);
  +            encode = ((Integer) encodingNames.get(modeConf.getChild("encode").getValue(this.defaultEncode))).intValue();
           }
   
   
  -
  -
  -        Object result = null;
           Object value = getValue(name, objectModel,
                                   this.input, this.defaultInput, this.inputConf,
                                   null, inputName, inputConfig);
  @@ -187,10 +198,7 @@
       }
   
   
  -
  -
  -
  -    public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
  +    public Iterator getAttributeNames( Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
            if (!this.initialized) {
  @@ -222,9 +230,7 @@
      }
   
   
  -
  -
  -    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel ) 
  +    public Object[] getAttributeValues( String name, Configuration modeConf, Map objectModel )
           throws ConfigurationException {
   
           if (!this.initialized) {
  @@ -254,6 +260,12 @@
               provider  = modeConf.getAttribute("provider" , provider );
               salt  = modeConf.getAttribute("salt" , salt );
               encode = ((Integer) encodingNames.get(modeConf.getAttribute("encode" , this.defaultEncode))).intValue();
  +
  +            // preferred
  +            algorithm = modeConf.getChild("algorithm").getValue(algorithm);
  +            provider  = modeConf.getChild("provider").getValue(provider);
  +            salt  = modeConf.getChild("salt").getValue(salt);
  +            encode = ((Integer) encodingNames.get(modeConf.getChild("encode").getValue(this.defaultEncode))).intValue();
           }
   
           Object[] values = getValues(name, objectModel, 
  @@ -290,7 +302,7 @@
       /**
        * Create the output representation.
        * @param b a <code>byte[]</code>
  -     * @param encode an <code>int</code>, one of {@link ENCODING_NONE},{@link ENCODING_URL},{@link ENCODING_HEX}
  +     * @param encode an <code>int</code>, one of {@link #ENCODING_NONE},{@link #ENCODING_URL},{@link #ENCODING_HEX}
        * @return an <code>Object</code>
        */
       Object encodeByteArray(byte[] b, int encode) {
  
  
  
  1.2.4.3   +6 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/HeaderAttributeModule.java
  
  Index: HeaderAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/HeaderAttributeModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- HeaderAttributeModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ HeaderAttributeModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -80,6 +80,8 @@
           String pname = name;
           if ( modeConf != null ) {
               pname = modeConf.getAttribute( "parameter", pname );
  +            // preferred
  +            pname = modeConf.getChild("parameter").getValue(pname);
           }
           return ObjectModelHelper.getRequest(objectModel).getHeader( pname );
       }
  @@ -99,6 +101,8 @@
           String wildcard = name;
           if ( modeConf != null ) {
               wildcard = modeConf.getAttribute( "parameter", wildcard );
  +            // preferred
  +            wildcard = modeConf.getChild("parameter").getValue(wildcard);
           }
           int wildcardIndex = wildcard.indexOf( "*" );
           if ( wildcardIndex != -1 ) {
  
  
  
  1.4.4.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/InputModule.java
  
  Index: InputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/InputModule.java,v
  retrieving revision 1.4.4.2
  retrieving revision 1.4.4.3
  diff -u -r1.4.4.2 -r1.4.4.3
  --- InputModule.java	19 Dec 2002 11:24:29 -0000	1.4.4.2
  +++ InputModule.java	4 Feb 2003 15:44:06 -0000	1.4.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.1.2.2   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java
  
  Index: IteratorHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- IteratorHelper.java	17 Nov 2002 19:12:49 -0000	1.1.2.1
  +++ IteratorHelper.java	4 Feb 2003 15:44:06 -0000	1.1.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.1.2.6   +26 -9     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/JXPathMetaModule.java
  
  Index: JXPathMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/JXPathMetaModule.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- JXPathMetaModule.java	15 Jan 2003 16:15:35 -0000	1.1.2.5
  +++ JXPathMetaModule.java	4 Feb 2003 15:44:06 -0000	1.1.2.6
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -76,8 +76,14 @@
    * <td>When set to true, non-existing attributes return null, when set to false,
    *     an exception is thrown. Default is true.</td> 
    *</tr>
  - * <tr><td><code>&lt;input-module name="request-attr" parameter="foo"/&gt;</td>
  - * <td>Uses the "request-attr" input module to obtain parameter named "foo" and 
  + * <tr><td><code>&lt;parameter&gt;false&lt;/lenient&gt;</td>
  + * <td>Attribute name to be used instead of passed attribute name.</td> 
  + *</tr>
  + * <tr><td><code>&lt;from-parameter&gt;false&lt;/lenient&gt;</td>
  + * <td>Attribute name to pass to configured input module</td> 
  + *</tr>
  + * <tr><td><code>&lt;input-module name="request-attr"/&gt;</td>
  + * <td>Uses the "request-attr" input module to obtain a value and 
    *     applies the given JXPath expression to it.</td> 
    *</tr>
    * <tr><td><code>&lt;function name="java.lang.String" prefix="str"/&gt;</td>
  @@ -92,6 +98,10 @@
    * new java.util.Date object.</td> 
    * </tr></table>
    *
  + * <p>In addition, it accepts the attributes "parameter" to override
  + * the attribute name and "from-parameter" to pass as attribute name
  + * to the configured input module.</p>
  + *
    * @author <a href="mailto:kpiroumian@apache.org">Konstantin Piroumian</a>
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version $Id$
  @@ -124,14 +134,14 @@
        * Configure component. Preprocess list of packages and functions
        * to add to JXPath context later.
        *
  -     * @param conf a <code>Configuration</code> value
  +     * @param config a <code>Configuration</code> value
        * @exception ConfigurationException if an error occurs
        */
       public void configure(Configuration config) throws ConfigurationException {
   
           this.inputConf = config.getChild("input-module");
           this.defaultInput = this.inputConf.getAttribute("name",this.defaultInput);
  -        this.parameter = this.inputConf.getAttribute("parameter", this.parameter);
  +        this.parameter = config.getChild("parameter").getValue(this.parameter);
   
           // start verbatim copy of AbstractJXPathModule
           // please keep both in sync.
  @@ -239,6 +249,9 @@
   
           Object contextObj = getContextObject(modeConf, objectModel);
           if (contextObj == null) return null;
  +        if (modeConf != null) {
  +            name = modeConf.getChild("parameter").getValue(name);
  +        }
           try {
               JXPathContext jxContext = JXPathContext.newContext(contextObj);
               setupExtensions(jxContext, modeConf);
  @@ -268,7 +281,7 @@
               for (int i = 0; i < properties.length; i++) {
                   names.add(properties[i].getName());
               }
  -            return (java.util.Iterator) names.listIterator();
  +            return names.listIterator();
           } catch (Exception e) {
               throw new ConfigurationException(
                   "Error retrieving attribute names for class: "
  @@ -284,12 +297,16 @@
   
           Object contextObj = getContextObject(modeConf, objectModel);
           if (contextObj == null) return null;
  +        if (modeConf != null) {
  +            name = modeConf.getChild("parameter").getValue(name);
  +        }
           try {
               JXPathContext jxContext = JXPathContext.newContext(contextObj);
  -            List values = new LinkedList();
  +            List values = null;
               setupExtensions(jxContext, modeConf);
               if (this.lenient) jxContext.setLenient(true); // return null insted of exception on non existing property
               Iterator i = jxContext.iterate(name);
  +            if (i.hasNext()) { values = new LinkedList(); } 
               while (i.hasNext()) {
                   values.add(i.next());
               }
  @@ -327,7 +344,7 @@
           if (modeConf!=null) {
               mConf   = modeConf.getChild("input-module");
               inputName   = mConf.getAttribute("name",null);
  -            parameter   = modeConf.getAttribute("parameter",parameter);
  +            parameter   = modeConf.getChild("from-parameter").getValue(parameter);
           }
   
           if (getLogger().isDebugEnabled())
  
  
  
  1.1.4.3   +15 -8     xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java
  
  Index: MapMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/MapMetaModule.java,v
  retrieving revision 1.1.4.2
  retrieving revision 1.1.4.3
  diff -u -r1.1.4.2 -r1.1.4.3
  --- MapMetaModule.java	19 Dec 2002 11:24:29 -0000	1.1.4.2
  +++ MapMetaModule.java	4 Feb 2003 15:44:06 -0000	1.1.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -62,6 +62,7 @@
    * that this Object implements the java.util.Map interface, and gives
    * access to the map contents. Possible use is to propagate data from
    * flow through request attributes to database actions.
  + * The same can be achieved by using the {@link JXPathMetaModule}.
    *
    * <p>Configuration: "input-module", "object", "parameter"</p>
    *
  @@ -80,6 +81,10 @@
           this.defaultInput = this.inputConf.getAttribute("name", this.defaultInput);
           this.objectName = this.inputConf.getAttribute("object",this.objectName);
           this.parameter = this.inputConf.getAttribute("parameter",this.parameter);
  +
  +        // preferred
  +        this.objectName = config.getChild("object").getValue(this.objectName);
  +        this.parameter = config.getChild("parameter").getValue(this.parameter);
       }
   
   
  @@ -97,17 +102,17 @@
   
           // obtain correct configuration objects
           // default vs dynamic
  -        Configuration inputConfig = this.inputConf;
           String inputName=null;
           String objectName = this.objectName;
           String parameter = this.parameter;
  -        if (modeConf!=null) {
  +        if (modeConf != null) {
               inputName  = modeConf.getChild("input-module").getAttribute("name",null);
               objectName = modeConf.getAttribute("object",objectName);
               parameter  = modeConf.getAttribute("parameter",parameter);
  -            if (inputName != null) {
  -                inputConfig = modeConf.getChild("input-module");
  -            }
  +
  +            // preferred
  +            objectName = modeConf.getChild("object").getValue(objectName);
  +            parameter  = modeConf.getChild("parameter").getValue(parameter);
           }
           parameter = (parameter != null? parameter : name);
   
  @@ -123,7 +128,6 @@
   
   
   
  -
       public Iterator getAttributeNames( Configuration modeConf, Map objectModel ) 
           throws ConfigurationException {
   
  @@ -144,6 +148,9 @@
           if (modeConf!=null) {
               inputName   = modeConf.getChild("input-module").getAttribute("name",null);
               objectName = modeConf.getAttribute("object",this.objectName);
  +
  +            // preferred
  +            objectName = modeConf.getChild("object").getValue(objectName);
               if (inputName != null) {
                   inputConfig = modeConf.getChild("input-module");
               }
  
  
  
  1.2.4.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/NullInputModule.java
  
  Index: NullInputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/NullInputModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- NullInputModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ NullInputModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.2.4.3   +7 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java
  
  Index: RandomNumberModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RandomNumberModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- RandomNumberModule.java	15 Jan 2003 16:15:35 -0000	1.2.4.2
  +++ RandomNumberModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -63,7 +63,7 @@
   
   /**
    * RandomNumberModule returns a random number as string.
  - * Configuration through attributes of root node: "min", "max" setting
  + * Configuration through child elements: "min", "max" setting
    * range of random number. Defaults to "0" and "9999999999"
    * respectively.
    *
  @@ -86,6 +86,10 @@
           if (modeConf != null) {
               min = Long.parseLong(modeConf.getAttribute("min","0"));
               max = Long.parseLong(modeConf.getAttribute("max",String.valueOf(max)));
  +            
  +            //preferred
  +            min = Long.parseLong(modeConf.getChild("min").getValue("0"));
  +            max = Long.parseLong(modeConf.getChild("max").getValue(String.valueOf(max)));
           }
           return Long.toString(java.lang.Math.round(java.lang.Math.random()*(max-min)));
   
  
  
  
  1.2.4.3   +6 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestAttributeModule.java
  
  Index: RequestAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestAttributeModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- RequestAttributeModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ RequestAttributeModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -81,6 +81,8 @@
           String pname = name;
           if ( modeConf != null ) {
               pname = modeConf.getAttribute( "parameter", pname );
  +            // preferred
  +            pname = modeConf.getChild("parameter").getValue(pname);
           }
           return ObjectModelHelper.getRequest(objectModel).getAttribute( pname );
       }
  @@ -100,6 +102,8 @@
           String wildcard = name;
           if ( modeConf != null ) {
               wildcard = modeConf.getAttribute( "parameter", wildcard );
  +            // preferred
  +            wildcard = modeConf.getChild("parameter").getValue(wildcard);
           }
           int wildcardIndex = wildcard.indexOf( "*" );
           if ( wildcardIndex != -1 ) {
  
  
  
  1.1.2.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestModule.java
  
  Index: RequestModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestModule.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- RequestModule.java	19 Dec 2002 11:24:29 -0000	1.1.2.2
  +++ RequestModule.java	4 Feb 2003 15:44:06 -0000	1.1.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.2.4.3   +6 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestParameterModule.java
  
  Index: RequestParameterModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestParameterModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- RequestParameterModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ RequestParameterModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -82,6 +82,8 @@
           String pname = name;
           if ( modeConf != null ) {
               pname = modeConf.getAttribute( "parameter", pname );
  +            // preferred
  +            pname = modeConf.getChild("parameter").getValue(pname);
           }
           return ObjectModelHelper.getRequest(objectModel).getParameter( pname );
       }
  @@ -100,6 +102,8 @@
           String wildcard = name;
           if ( modeConf != null ) {
               wildcard = modeConf.getAttribute( "parameter", wildcard );
  +            // preferred
  +            wildcard = modeConf.getChild("parameter").getValue(wildcard);
           }
           int wildcardIndex = wildcard.indexOf( "*" );
           if ( wildcardIndex != -1 ) {
  
  
  
  1.2.4.3   +4 -3      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java
  
  Index: RequestURIModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RequestURIModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- RequestURIModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ RequestURIModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -63,7 +63,8 @@
   import java.util.Vector;
   
   /**
  - * RequestURIModule accesses the request URI. If the
  + * RequestURIModule accesses the request URI. The {@link
  + * RequestModule} provides similar functionality based on JXPath.
    *
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version CVS $Id$
  
  
  
  1.2.4.3   +6 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionAttributeModule.java
  
  Index: SessionAttributeModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionAttributeModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- SessionAttributeModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ SessionAttributeModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -81,6 +81,8 @@
           String pname = name;
           if ( modeConf != null ) {
               pname = modeConf.getAttribute( "parameter", pname );
  +            // preferred
  +            pname = modeConf.getChild("parameter").getValue(pname);
           }
           return ObjectModelHelper.getRequest(objectModel).getSession().getAttribute( pname );
       }
  @@ -100,6 +102,8 @@
           String wildcard = name;
           if ( modeConf != null ) {
               wildcard = modeConf.getAttribute( "parameter", wildcard );
  +            // preferred
  +            wildcard = modeConf.getChild("parameter").getValue(wildcard);
           }
           int wildcardIndex = wildcard.indexOf( "*" );
           if ( wildcardIndex != -1 ) {
  
  
  
  1.1.2.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionModule.java
  
  Index: SessionModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SessionModule.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- SessionModule.java	19 Dec 2002 11:24:29 -0000	1.1.2.2
  +++ SessionModule.java	4 Feb 2003 15:44:06 -0000	1.1.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.1.2.5   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SimpleMappingMetaModule.java
  
  Index: SimpleMappingMetaModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/SimpleMappingMetaModule.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- SimpleMappingMetaModule.java	19 Dec 2002 11:24:29 -0000	1.1.2.4
  +++ SimpleMappingMetaModule.java	4 Feb 2003 15:44:06 -0000	1.1.2.5
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.2.4.3   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/StringConstantModule.java
  
  Index: StringConstantModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/StringConstantModule.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- StringConstantModule.java	19 Dec 2002 11:24:29 -0000	1.2.4.2
  +++ StringConstantModule.java	4 Feb 2003 15:44:06 -0000	1.2.4.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RawRequestParameterModule.java
  
  Index: RawRequestParameterModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/input/RawRequestParameterModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +87 -15    xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/AbstractOutputModule.java
  
  Index: AbstractOutputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/AbstractOutputModule.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- AbstractOutputModule.java	31 Jul 2002 13:13:24 -0000	1.2
  +++ AbstractOutputModule.java	4 Feb 2003 15:44:07 -0000	1.2.4.1
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -51,13 +51,17 @@
   
   package org.apache.cocoon.components.modules.output;
   
  +import java.util.Map;
  +
   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;
  -
  +import org.apache.cocoon.environment.ObjectModelHelper;
  +import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.util.HashMap;
  +//import java.util.HashMap;
   
   /**
    * AbstractOutputModule gives you the infrastructure for easily
  @@ -87,18 +91,12 @@
        * For nested configurations override this function.
        * */
       public void configure(Configuration conf) throws ConfigurationException {
  -
  -        if (conf != null) {
  -            String key = null;
  -            String val = null;
  -            Configuration[] parameters = conf.getChildren();
  -            this.settings = new HashMap(parameters.length);
  -            for ( int i = 0; i < parameters.length; i++) {
  -                key = parameters[i].getName();
  -                val = parameters[i].getValue();
  -                if ( key != null )
  -                    this.settings.put(key, val);
  -            }
  +        Configuration[] parameters = conf.getChildren();
  +        this.settings = new HashMap(parameters.length);
  +        for (int i = 0; i < parameters.length; i++) {
  +            String key = parameters[i].getName();
  +            String val = parameters[i].getValue();
  +            this.settings.put(key, val);
           }
       }
   
  @@ -109,4 +107,78 @@
           // Purposely empty so that we don't need to implement it in every
           // class.
       }
  +
  +    /**
  +     * Utility method to store parameters in a map as request attribute until 
  +     * either {@link #rollback rollback} or {@link #prepareCommit prepareCommit}
  +     * is called.
  +     * @param objectModel - the objectModel
  +     * @param trans_place - request attribute name used for the transient data
  +     * @param name - name of the attribute to set
  +     * @param value - attribute value
  +     */    
  +    protected void transientSetAttribute( Map objectModel, String trans_place, String name, Object value ) {
  +
  +        Request request = ObjectModelHelper.getRequest(objectModel);
  +        Object temp = request.getAttribute(trans_place);
  +        Map aMap = null;
  +
  +        if (temp == null) {           
  +            aMap = new java.util.HashMap();
  +            // need java.util.HashMap here since JXPath does not like the extended version...
  +        } else {
  +            aMap = (Map) temp;
  +        }
  +
  +        aMap.put(name,value);
  +
  +        request.setAttribute(trans_place, aMap);
  +    }
  +
  +    /**
  +     * Clears all uncommitted transient attributes.
  +     * @param objectModel - the objectModel
  +     * @param trans_place - request attribute name used for the transient data
  +     */    
  +    protected void rollback( Map objectModel, String trans_place) {
  +        ObjectModelHelper.getRequest(objectModel).setAttribute(trans_place, null);
  +    }
  +
  +    /**
  +     * Returns a whether an transient attribute already exists.
  +     * {@link #transientSetAttribute transientSetAttribute} since the last call to 
  +     * {@link #rollback rollback} or {@link #prepareCommit prepareCommit}
  +     * @param objectModel - the objectModel
  +     * @param trans_place - request attribute name used for the transient data
  +     */    
  +    protected boolean attributeExists( Map objectModel, String trans_place, String name )
  +    {
  +        Request request = ObjectModelHelper.getRequest(objectModel);
  +        Object temp = request.getAttribute(trans_place);
  +        if (temp == null) {
  +            return false;
  +        } else {
  +            return ((Map) temp).containsKey(name);
  +        }
  +    }
  +
  +    /**
  +     * Returns a map containing all transient attributes and remove them i.e. attributes set with 
  +     * {@link #transientSetAttribute transientSetAttribute} since the last call to 
  +     * {@link #rollback rollback} or {@link #prepareCommit prepareCommit}
  +     * @param objectModel - the objectModel
  +     * @param trans_place - request attribute name used for the transient data
  +     */    
  +    protected Map prepareCommit( Map objectModel, String trans_place )
  +    {
  +        Request request = ObjectModelHelper.getRequest(objectModel);
  +        Object temp = request.getAttribute(trans_place);
  +        request.setAttribute(trans_place, null);
  +        if (temp == null) {
  +            return null;
  +        } else {
  +            return (Map) temp;
  +        }
  +    }
  +
   }
  
  
  
  1.4.4.2   +8 -4      xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/OutputModule.java
  
  Index: OutputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/OutputModule.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- OutputModule.java	17 Nov 2002 19:12:49 -0000	1.4.4.1
  +++ OutputModule.java	4 Feb 2003 15:44:07 -0000	1.4.4.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -51,9 +51,10 @@
   
   package org.apache.cocoon.components.modules.output;
   
  +import java.util.Map;
  +
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.configuration.Configuration;
  -import java.util.Map;
   
   /**
    * Communicate results to other components. This could be done via
  @@ -70,7 +71,10 @@
       String ROLE = OutputModule.class.getName();
   
       /**
  -     * communicate an attribute value to further processing logic.
  +     * communicate an attribute value to further processing logic. OutputModules
  +     * work in implicit transaction mode, thus setting an attribute starts an
  +     * transaction and sttributes are only visible after the transaction is
  +     * successfully completed with a call to commit
        * @param modeConf column's mode configuration from resource
        * description. This argument is optional.
        * @param objectModel The objectModel
  
  
  
  1.4.4.2   +133 -37   xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/RequestAttributeOutputModule.java
  
  Index: RequestAttributeOutputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/RequestAttributeOutputModule.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- RequestAttributeOutputModule.java	31 Jan 2003 07:00:56 -0000	1.4.4.1
  +++ RequestAttributeOutputModule.java	4 Feb 2003 15:44:07 -0000	1.4.4.2
  @@ -1,36 +1,36 @@
   /*
  -
  + 
    ============================================================================
                      The Apache Software License, Version 1.1
    ============================================================================
  -
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  -
  + 
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + 
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  -
  + 
    1. Redistributions of  source code must  retain the above copyright  notice,
       this list of conditions and the following disclaimer.
  -
  + 
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
  -
  + 
    3. The end-user documentation included with the redistribution, if any, must
       include  the following  acknowledgment:  "This product includes  software
       developed  by the  Apache Software Foundation  (http://www.apache.org/)."
       Alternately, this  acknowledgment may  appear in the software itself,  if
       and wherever such third-party acknowledgments normally appear.
  -
  + 
    4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
       used to  endorse or promote  products derived from  this software without
       prior written permission. For written permission, please contact
       apache@apache.org.
  -
  + 
    5. Products  derived from this software may not  be called "Apache", nor may
       "Apache" appear  in their name,  without prior written permission  of the
       Apache Software Foundation.
  -
  + 
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  @@ -41,31 +41,44 @@
    ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
    (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -
  + 
    This software  consists of voluntary contributions made  by many individuals
    on  behalf of the Apache Software  Foundation and was  originally created by
    Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
    Software Foundation, please see <http://www.apache.org/>.
  -
  -*/
  + 
  + */
   
   package org.apache.cocoon.components.modules.output;
   
  +import java.util.Iterator;
   import java.util.Map;
   
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.cocoon.environment.ObjectModelHelper;
  +import org.apache.cocoon.environment.Request;
   
   /**
    * Abstraction layer to encapsulate different output
    * destinations. Configuration option &lt;key-prefix&gt; defaults to
    * "org.apache.cocoon.components.modules.output.OutputModule"+":"
    *
  + * Can be used with different isolation-level: default is "0" being
  + * no isolation at all, values are immediately visible but are removed
  + * on a rollback; "1" keeps the values at a save place until either
  + * rollback or commit is called. Then values are either discarded or
  + * copied to the final destination.
  + *
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version CVS $Id$
    */
   public class RequestAttributeOutputModule extends AbstractOutputModule implements OutputModule {
  -
  +    
  +    public final String PREFIX = "org.apache.cocoon.components.modules.output.OutputModule";
  +    public final String TRANS_PREFIX = "org.apache.cocoon.components.modules.output.OutputModule.RequestAttributeOutputModule.transient";
  +    public final String ROLLBACK_LIST = "org.apache.cocoon.components.modules.output.OutputModule.RequestAttributeOutputModule.rollback";
  +    
       /**
        * communicate an attribute value to further processing logic.
        * @param modeConf column's mode configuration from resource
  @@ -77,16 +90,30 @@
        * @param value The attriute's value.
        * */
       public void setAttribute( Configuration modeConf, Map objectModel, String name, Object value ) {
  -
  -        String prefix = (String) this.settings.get("key-prefix", "org.apache.cocoon.components.modules.output.OutputModule" );
  -        if (prefix != "") {
  -            ObjectModelHelper.getRequest(objectModel).setAttribute(prefix+":"+name, value);
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("setting transient ['"+name+"'] to ['"+value+"']");
  +            this.transientSetAttribute(objectModel, TRANS_PREFIX, name, value);
           } else {
  -            ObjectModelHelper.getRequest(objectModel).setAttribute(name, value);
  -        }
  -    }
  +            // use read uncommitted isolation level
   
  +            Request request = ObjectModelHelper.getRequest(objectModel);
   
  +            name = getName(name);
  +
  +            if (!this.attributeExists(objectModel, ROLLBACK_LIST, name)) { 
  +                Object tmp = request.getAttribute(name);
  +                this.transientSetAttribute(objectModel, ROLLBACK_LIST, name, tmp);
  +            }
  +
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("setting ['"+name+"'] to ['"+value+"']");
  +            request.setAttribute(name, value);
  +        }
  +    }
  +    
  +    
  +    
       /**
        * If a database transaction needs to rollback, this is called to
        * inform the further processing logic about this fact. All
  @@ -97,31 +124,100 @@
        * in data corruption!</em>
        * */
       public void rollback( Configuration modeConf, Map objectModel, Exception e ) {
  -        /*
  -          Enumeration attributes = request.getAttributeNames();
  -          while ( attributes.hasMoreElements() ) {
  -              String name = (String) attributes.nextElement();
  -              if ( name.startsWith("org.apache.cocoon.acting.ModularDatabaseAccess.OutputModule:") ) {
  -                  request.removeAttribute(name);
  -              }
  -          }
  -        */
  -        String prefix = (String) this.settings.get("key-prefix", "org.apache.cocoon.components.modules.output.OutputModule" );
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("rolling back");
  +            this.rollback(objectModel, TRANS_PREFIX);
  +        } else {
  +
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("start rolling back");
  +            
  +            Request request = ObjectModelHelper.getRequest(objectModel);
  +            Object tmp = this.prepareCommit(objectModel,ROLLBACK_LIST);
  +            if (tmp != null) {
  +                Map rollbackList = (Map) tmp;
  +                Iterator iter = rollbackList.keySet().iterator();
  +                while(iter.hasNext()) {
  +                    String key = (String) iter.next();
  +                    Object val = rollbackList.get(key);
  +                    if (val != null) {
  +                        if (getLogger().isDebugEnabled())
  +                            getLogger().debug("rolling back ['"+key+"'] to ['"+val+"']");
  +                        request.setAttribute(key, val);
  +                    } else {
  +                        if (getLogger().isDebugEnabled())
  +                            getLogger().debug("rolling back ['"+key+"']");
  +                        request.removeAttribute(key);
  +                    }
  +                }
  +            }
  +        }
  +
  +        if (getLogger().isDebugEnabled())
  +            getLogger().debug("done rolling back");
  +
  +        String prefix = (String) this.settings.get("key-prefix", PREFIX );
           if (prefix!="") {
               ObjectModelHelper.getRequest(objectModel).setAttribute(prefix+":",e.getMessage());
           } else {
               ObjectModelHelper.getRequest(objectModel).setAttribute("errorMessage",e.getMessage());
           }
       }
  -
  -
  +    
  +    
       /**
        * Signal that the database transaction completed
        * successfully. See notes on @link{rollback}.
        * */
  -    public void commit( Configuration modeConf, Map objectModel )
  -    {
  -        // empty method
  +    public void commit( Configuration modeConf, Map objectModel ) {
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +            
  +            Logger logger = getLogger();
  +            if (logger.isDebugEnabled())
  +                logger.debug("prepare commit");
  +
  +            Map aMap = this.prepareCommit(objectModel, TRANS_PREFIX);
  +            if (aMap == null) {
  +                return;
  +            }
  +        
  +            Iterator iter = aMap.keySet().iterator();
  +            if (!iter.hasNext()){
  +                return;
  +            }
  +            
  +            String prefix = (String) this.settings.get("key-prefix", PREFIX );
  +            if (prefix != "") {
  +                prefix = prefix+":";
  +            } else {
  +                prefix = null;
  +            }
  +            Request request = ObjectModelHelper.getRequest(objectModel);
  +            while (iter.hasNext()) {
  +                String key = (String) iter.next();
  +                Object value = aMap.get(key);
  +                if (prefix != null) { key = prefix + key; }
  +                if (logger.isDebugEnabled())
  +                    logger.debug("committing ['"+key+"'] to ['"+value+"']");
  +                request.setAttribute(key, value);
  +            }
  +
  +            if (logger.isDebugEnabled())
  +                logger.debug("done commit");
  +
  +        } else {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("commit");
  +            this.prepareCommit(objectModel, ROLLBACK_LIST);
  +        }
  +        
  +        
       }
   
  +    protected String getName( String name ) {
  +        String prefix = (String) this.settings.get("key-prefix", PREFIX );
  +        return (prefix == "" ? name : prefix+":"+name);
  +    }
  +    
   }
  
  
  
  1.4.4.1   +134 -48   xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java
  
  Index: SessionAttributeOutputModule.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- SessionAttributeOutputModule.java	9 Aug 2002 08:32:10 -0000	1.4
  +++ SessionAttributeOutputModule.java	4 Feb 2003 15:44:07 -0000	1.4.4.1
  @@ -1,36 +1,36 @@
   /*
  -
  + 
    ============================================================================
                      The Apache Software License, Version 1.1
    ============================================================================
  -
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  -
  + 
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + 
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  -
  + 
    1. Redistributions of  source code must  retain the above copyright  notice,
       this list of conditions and the following disclaimer.
  -
  + 
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
  -
  + 
    3. The end-user documentation included with the redistribution, if any, must
       include  the following  acknowledgment:  "This product includes  software
       developed  by the  Apache Software Foundation  (http://www.apache.org/)."
       Alternately, this  acknowledgment may  appear in the software itself,  if
       and wherever such third-party acknowledgments normally appear.
  -
  + 
    4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
       used to  endorse or promote  products derived from  this software without
       prior written permission. For written permission, please contact
       apache@apache.org.
  -
  + 
    5. Products  derived from this software may not  be called "Apache", nor may
       "Apache" appear  in their name,  without prior written permission  of the
       Apache Software Foundation.
  -
  + 
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  @@ -41,35 +41,46 @@
    ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
    (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -
  + 
    This software  consists of voluntary contributions made  by many individuals
    on  behalf of the Apache Software  Foundation and was  originally created by
    Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
    Software Foundation, please see <http://www.apache.org/>.
  -
  -*/
  + 
  + */
   
   package org.apache.cocoon.components.modules.output;
   
  -import java.util.Enumeration;
  +import java.util.Iterator;
   import java.util.Map;
  -import org.apache.cocoon.environment.Request;
  -import org.apache.cocoon.environment.Session;
  -import org.apache.cocoon.environment.ObjectModelHelper;
  +
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.logger.Logger;
  +import org.apache.cocoon.environment.ObjectModelHelper;
  +import org.apache.cocoon.environment.Session;
   
   /**
    * Abstraction layer to encapsulate different output
    * destinations. Configuration option &lt;key-prefix&gt; defaults to
    * "org.apache.cocoon.components.modules.output.OutputModule"+":"
    *
  + * Can be used with different isolation-level: default is "0" being
  + * no isolation at all, values are immediately visible but are removed
  + * on a rollback; "1" keeps the values at a save place until either
  + * rollback or commit is called. Then values are either discarded or
  + * copied to the final destination.
  + *
    * @author <a href="mailto:haul@apache.org">Christian Haul</a>
    * @version CVS $Id$
    * */
   public class SessionAttributeOutputModule extends AbstractOutputModule implements OutputModule {
       
  +    public final String PREFIX = "org.apache.cocoon.components.modules.output.OutputModule";
  +    public final String TRANS_PREFIX = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.transient";
  +    public final String ROLLBACK_LIST = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.rollback";
  +    
       /**
  -     * communicate an attribute value to further processing logic. 
  +     * communicate an attribute value to further processing logic.
        * @param modeConf column's mode configuration from resource
        * description. This argument is optional.
        * @param request The request object
  @@ -79,19 +90,31 @@
        * @param value The attriute's value.
        * */
       public void setAttribute( Configuration modeConf, Map objectModel, String name, Object value ) {
  -
  -        String prefix = (String) this.settings.get("key-prefix", "org.apache.cocoon.components.modules.output.OutputModule" );
  -        Request req = ObjectModelHelper.getRequest(objectModel);
  -        Session ses = req.getSession();
  -        if (ses == null || !req.isRequestedSessionIdValid()) ses = req.getSession(true);
  -        if (prefix!="") {
  -            ses.setAttribute(prefix + ":" + name, value);
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("setting transient ['"+name+"'] to ['"+value+"']");
  +            this.transientSetAttribute(objectModel, TRANS_PREFIX, name, value);
           } else {
  -            ses.setAttribute(name, value);
  -        }
  -    }
  +            // use read uncommitted isolation level
   
  +            Session session = ObjectModelHelper.getRequest(objectModel).getSession();
  +
  +            name = getName(name);
  +
  +            if (!this.attributeExists(objectModel, ROLLBACK_LIST, name)) {
  +                Object tmp = session.getAttribute(name);
  +                this.transientSetAttribute(objectModel, ROLLBACK_LIST, name, tmp);
  +            }
   
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("setting ['"+name+"'] to ['"+value+"']");
  +            session.setAttribute(name, value);
  +        }
  +
  +    }
  +    
  +    
  +    
       /**
        * If a database transaction needs to rollback, this is called to
        * inform the further processing logic about this fact. All
  @@ -102,36 +125,99 @@
        * in data corruption!</em>
        * */
       public void rollback( Configuration modeConf, Map objectModel, Exception e ) {
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("rolling back");
  +            this.rollback(objectModel, TRANS_PREFIX);
  +        } else {
   
  -        Request request = ObjectModelHelper.getRequest(objectModel);
  -        Enumeration attributes = request.getSession().getAttributeNames();
  -        String prefix = (String) this.settings.get("key-prefix",
  -                                                   "org.apache.cocoon.components.modules.output.OutputModule");
  -        while ( attributes.hasMoreElements() ) {
  -            String name = (String) attributes.nextElement();
  -            if ( name.startsWith(prefix) ) {
  -                request.getSession().removeAttribute(name);
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("start rolling back");
  +            
  +            Session session = ObjectModelHelper.getRequest(objectModel).getSession();
  +            Object tmp = this.prepareCommit(objectModel,ROLLBACK_LIST);
  +            if (tmp != null) {
  +                Map rollbackList = (Map) tmp;
  +                Iterator iter = rollbackList.keySet().iterator();
  +                while(iter.hasNext()) {
  +                    String key = (String) iter.next();
  +                    Object val = rollbackList.get(key);
  +                    if (val != null) {
  +                        if (getLogger().isDebugEnabled())
  +                            getLogger().debug("rolling back ['"+key+"'] to ['"+val+"']");
  +                        session.setAttribute(key, val);
  +                    } else {
  +                        if (getLogger().isDebugEnabled())
  +                            getLogger().debug("rolling back ['"+key+"']");
  +                        session.removeAttribute(key);
  +                    }
  +                }
               }
           }
  +
  +        if (getLogger().isDebugEnabled())
  +            getLogger().debug("done rolling back");
  +
  +        String prefix = (String) this.settings.get("key-prefix", PREFIX );
           if (prefix!="") {
  -            request
  -                .getSession()
  -                .setAttribute(prefix + ":", e.getMessage());
  +            ObjectModelHelper.getRequest(objectModel).getSession().setAttribute(prefix+":",e.getMessage());
           } else {
  -            request
  -                .getSession()
  -                .setAttribute("errorMessage", e.getMessage());
  +            ObjectModelHelper.getRequest(objectModel).getSession().setAttribute("errorMessage",e.getMessage());
           }
       }
  -
  -
  +    
  +    
       /**
        * Signal that the database transaction completed
        * successfully. See notes on @link{rollback}.
        * */
  -    public void commit( Configuration modeConf, Map objectModel )
  -    {
  -        // empty method
  +    public void commit( Configuration modeConf, Map objectModel ) {
  +        if (this.settings.get("isolation-level","0").equals("1")) {
  +
  +            Logger logger = getLogger();
  +            if (logger.isDebugEnabled())
  +                logger.debug("prepare commit");
  +
  +            Map aMap = this.prepareCommit(objectModel, TRANS_PREFIX);
  +            if (aMap == null) {
  +                return;
  +            }
  +            
  +            Iterator iter = aMap.keySet().iterator();
  +            if (!iter.hasNext()){
  +                return;
  +            }
  +            
  +            String prefix = (String) this.settings.get("key-prefix", PREFIX );
  +            if (prefix != "") {
  +                prefix = prefix+":";
  +            } else {
  +                prefix = null;
  +            }
  +            Session session = ObjectModelHelper.getRequest(objectModel).getSession();
  +            while (iter.hasNext()) {
  +                String key = (String) iter.next();
  +                Object value = aMap.get(key);
  +                if (prefix != null) { key = prefix + key; }
  +                if (logger.isDebugEnabled())
  +                    logger.debug("committing ['"+key+"'] to ['"+value+"']");
  +                session.setAttribute(key, value);
  +            }
  +
  +            if (logger.isDebugEnabled())
  +                logger.debug("done commit");
  +
  +        } else {
  +            if (getLogger().isDebugEnabled())
  +                getLogger().debug("commit");
  +            this.prepareCommit(objectModel, ROLLBACK_LIST);
  +        }
  +        
  +    }
  +    
  +    protected String getName( String name ) {
  +        String prefix = (String) this.settings.get("key-prefix", PREFIX );
  +        return (prefix == "" ? name : prefix+":"+name);
       }
   
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/RequestAttributeMap.java
  
  Index: RequestAttributeMap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/modules/output/RequestAttributeMap.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/request/MultipartRequestFactoryImpl.java
  
  Index: MultipartRequestFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/MultipartRequestFactoryImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- MultipartRequestFactoryImpl.java	15 Jul 2002 14:10:35 -0000	1.1.2.1
  +++ MultipartRequestFactoryImpl.java	4 Feb 2003 15:44:09 -0000	1.1.2.2
  @@ -4,7 +4,7 @@
    *                  The Apache Software License, Version 1.1
    * ============================================================================
    *
  - * Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without modifica-
    * tion, are permitted provided that the following conditions are met:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +9 -2      xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePart.java
  
  Index: FilePart.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePart.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- FilePart.java	15 Jul 2002 14:10:35 -0000	1.1.2.2
  +++ FilePart.java	4 Feb 2003 15:44:09 -0000	1.1.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -53,6 +53,7 @@
   import java.io.InputStream;
   import java.util.Map;
   
  +
   /**
    * This (abstract) class represents a file part parsed from a http post stream.
    * It is subclassed by FilePartFile (which is a file allready written to disk) and
  @@ -83,6 +84,12 @@
        *
        */
       public abstract String getFileName();
  +    
  +    /**
  +     * Returns the length of the file content
  +     * 
  +     */
  +    public abstract int getSize();
   
       /**
        * Returns the filepath
  
  
  
  1.1.2.4   +10 -3     xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePartArray.java
  
  Index: FilePartArray.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePartArray.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- FilePartArray.java	17 Sep 2002 15:54:04 -0000	1.1.2.3
  +++ FilePartArray.java	4 Feb 2003 15:44:09 -0000	1.1.2.4
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -64,16 +64,19 @@
   
       /** Field in           */
       private InputStream in = null;
  +    private int size;
   
       /**
        * Constructor FilePartArray
        *
        * @param headers
        * @param in
  +     * @param size
        */
  -    protected FilePartArray(Map headers, InputStream in) {
  +    protected FilePartArray(Map headers, InputStream in, int size) {
           super(headers);
           this.in = in;
  +        this.size = size;
       }
   
       /**
  @@ -83,6 +86,10 @@
       public String getFileName() {
           File f = new File((String) headers.get("filename"));
           return f.getName();
  +    }
  +
  +    public int getSize() {
  +        return this.size;
       }
   
       /**
  
  
  
  1.1.2.5   +8 -2      xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePartFile.java
  
  Index: FilePartFile.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/FilePartFile.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FilePartFile.java	3 Oct 2002 04:18:23 -0000	1.1.2.4
  +++ FilePartFile.java	4 Feb 2003 15:44:09 -0000	1.1.2.5
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -65,6 +65,7 @@
   
       /** Field file           */
       private File file = null;
  +    private int size;
   
       /**
        * Constructor FilePartFile
  @@ -75,6 +76,7 @@
       protected FilePartFile(Map headers, File file) {
           super(headers);
           this.file = file;
  +        this.size = (int) file.length();
       }
   
       /**
  @@ -82,6 +84,10 @@
        */
       public String getFileName() {
           return file.getName();
  +    }
  +
  +    public int getSize() {
  +        return this.size;
       }
   
       /**
  
  
  
  1.1.2.4   +23 -25    xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartParser.java
  
  Index: MultipartParser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartParser.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- MultipartParser.java	21 Sep 2002 16:29:32 -0000	1.1.2.3
  +++ MultipartParser.java	4 Feb 2003 15:44:09 -0000	1.1.2.4
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -97,18 +97,15 @@
       /** Field silentlyRename           */
       private boolean silentlyRename;
   
  -    /** Field maxUploadSize           */
  -    private int maxUploadSize;
  -
       /** Field characterEncoding       */
       private String characterEncoding;
       /**
        * Constructor, parses given request
        *
        * @param request The servlet request.
  -     * @param saveUploadFilesToDisk Write fileparts to the uploadDirectory. If true the corresponding object
  +     * @param saveUploadedFilesToDisk Write fileparts to the uploadDirectory. If true the corresponding object
        *              in the hashtable will contain a FilePartFile, if false a FilePartArray
  -     * @param File uploadDirectory The directory to write to if saveUploadedFilesToDisk is true.
  +     * @param uploadDirectory The directory to write to if saveUploadedFilesToDisk is true.
        * @param saveUploadedFilesToDisk
        * @param uploadDirectory
        * @param allowOverwrite Allow existing files to be overwritten.
  @@ -126,9 +123,10 @@
           this.uploadDirectory = uploadDirectory;
           this.allowOverwrite = allowOverwrite;
           this.silentlyRename = silentlyRename;
  -        this.maxUploadSize = maxUploadSize;
           this.characterEncoding = request.getCharacterEncoding();
  -        if (this.characterEncoding == null) this.characterEncoding = "ISO-8859-1";
  +        if (this.characterEncoding == null) {
  +            this.characterEncoding = "ISO-8859-1";
  +        }
   
           if (request.getContentLength() > maxUploadSize) {
               throw new IOException("Content length exceeds maximum upload size");
  @@ -182,15 +180,15 @@
           headers = readHeaders(ts);
           try {
               if (headers.containsKey("filename")) {
  -                if (!"".equals(headers.get("filename"))) {
  -                    parseFilePart(ts, headers);
  -                } else {
  -                    // IE6 sends an empty part with filename="" for
  -                    // empty upload fields. Just parse away the part
  -                    byte[] buf = new byte[32];
  -                    while(ts.getState() == TokenStream.STATE_READING)
  -                        ts.read(buf);  
  -                }
  +		        if (!"".equals(headers.get("filename"))) {
  +                	parseFilePart(ts, headers);
  +		        } else {
  +        			// IE6 sends an empty part with filename="" for
  +        			// empty upload fields. Just parse away the part
  +        			byte[] buf = new byte[32];
  +        			while(ts.getState() == TokenStream.STATE_READING)
  +        				ts.read(buf);  
  +        		}
               } else if (((String) headers.get("content-disposition"))
                       .toLowerCase().equals("form-data")) {
                   parseInlinePart(ts, headers);
  @@ -270,7 +268,7 @@
               byte[] bytes = ((ByteArrayOutputStream) out).toByteArray();
   
               put(headers.get("name"),
  -                    new FilePartArray(headers, new ByteArrayInputStream(bytes)));
  +                    new FilePartArray(headers, new ByteArrayInputStream(bytes),bytes.length));
           } else {
               put(headers.get("name"), new FilePartFile(headers, file));
           }
  @@ -288,7 +286,6 @@
               throws IOException {
   
           byte[] buf = new byte[INLINE_BUFFER_SIZE];
  -        ByteArrayOutputStream out = new ByteArrayOutputStream();
           StringBuffer value = new StringBuffer();
   
           while (in.getState() == TokenStream.STATE_READING) {
  @@ -325,15 +322,16 @@
               StringTokenizer tokenizer = new StringTokenizer(hdrline);
   
               headers.put(tokenizer.nextToken(" :").toLowerCase(),
  -                        tokenizer.nextToken(" :;"));
  +                    tokenizer.nextToken(" :;"));
   
  -            // The extra tokenizer.hasMoreTokens() in headers.put
  -            // handles the filename="" case IE6 submits for an empty
  -            // upload field.
  +	        // The extra tokenizer.hasMoreTokens() in headers.put
  +	        // handles the filename="" case IE6 submits for an empty
  +	        // upload field.
               while (tokenizer.hasMoreTokens()) {
                   headers.put(tokenizer.nextToken(" ;=\""),
  -                            tokenizer.hasMoreTokens() ? tokenizer.nextToken("=\"") : "");
  +                        tokenizer.hasMoreTokens()?tokenizer.nextToken("=\""):"");
               }
  +
               hdrline = readln(in);
           }
   
  
  
  
  1.2.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartRequestWrapper.java
  
  Index: MultipartRequestWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/request/multipart/MultipartRequestWrapper.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- MultipartRequestWrapper.java	15 Jul 2002 14:10:35 -0000	1.2.2.1
  +++ MultipartRequestWrapper.java	4 Feb 2003 15:44:09 -0000	1.2.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/matching/modular/CachingRegexpMatcher.java
  
  Index: CachingRegexpMatcher.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/matching/modular/CachingRegexpMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.2   +27 -7     xml-cocoon2/src/java/org/apache/cocoon/reading/Attic/DatabaseReader.java
  
  Index: DatabaseReader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/reading/Attic/DatabaseReader.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- DatabaseReader.java	31 Jan 2003 07:51:14 -0000	1.8.2.1
  +++ DatabaseReader.java	4 Feb 2003 15:44:10 -0000	1.8.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -53,7 +53,6 @@
   import java.io.BufferedInputStream;
   import java.io.IOException;
   import java.io.InputStream;
  -import java.sql.Blob;
   import java.sql.Connection;
   import java.sql.PreparedStatement;
   import java.sql.ResultSet;
  @@ -97,9 +96,11 @@
       private ComponentSelector dbselector;
       private String dsn;
       private long lastModified = System.currentTimeMillis();
  -    private Blob resource = null;
  +    private InputStream resource = null; // because HSQL doesn't yet implement getBlob()
       private Connection con = null;
       private DataSourceComponent datasource = null;
  +    private String mimeType = null;
  +    private int typeColumn = 0;
       private boolean doCommit = false;
       private boolean defaultCache = true;
   
  @@ -148,7 +149,10 @@
               Request request = ObjectModelHelper.getRequest(objectModel);
   
               if (this.modifiedSince(set, request, response)) {
  -                this.resource = set.getBlob(1);
  +                this.resource = set.getBinaryStream(1);
  +                if (this.typeColumn != 0) {
  +                    this.mimeType = set.getString(this.typeColumn);
  +                }
   
                   if (this.resource == null) {
                       throw new ResourceNotFoundException("There is no resource with that key");
  @@ -185,6 +189,7 @@
        * <pre>
        *   &lt;parameter name="last-modified" value="database_timestamp_column_name"/&gt;
        *   &lt;parameter name="content-type" value="content_mime_type"/&gt;
  +     *   &lt;parameter name="type-column" value="database_content_mime_type_column"/&gt;
        *   &lt;parameter name="expires" value="number_of_millis_before_refresh"/&gt;
        *   &lt;parameter name="where" value="alternate_key = 'foo'"/&gt;
        *   &lt;parameter name="order-by" value="alternate_key DESC"/&gt;
  @@ -221,6 +226,8 @@
           String key = this.parameters.getParameter("key", null);
           String where = this.parameters.getParameter("where", null);
           String orderBy = this.parameters.getParameter("order-by", null);
  +        String typeColumn = this.parameters.getParameter("type-column", null);
  +        int columnNo = 1;
   
           if (table == null || column == null || key==null) {
               throw new ProcessingException("We are missing a required parameter.  Please include 'table', 'image', and 'key'");
  @@ -230,9 +237,11 @@
           StringBuffer query = new StringBuffer("SELECT ");
   
           query.append(column);
  +        columnNo++;
   
           if (date != null) {
               query.append(", ").append(date);
  +            columnNo++;
           }
   
           if (null != orderBy) {
  @@ -243,6 +252,13 @@
               } else {
                   query.append(orderBy);
               }
  +            columnNo++;
  +        }
  +
  +        if (null != typeColumn) {
  +            query.append(", ").append(typeColumn);
  +            this.typeColumn = columnNo;
  +            columnNo++;
           }
   
           query.append(" FROM ").append(table);
  @@ -302,7 +318,7 @@
               throw new SQLException("The Blob is empty!");
           }
   
  -        InputStream is = new BufferedInputStream(this.resource.getBinaryStream());
  +        InputStream is = new BufferedInputStream(this.resource);
   
           long expires = parameters.getParameterAsInteger("expires", -1);
   
  @@ -354,6 +370,8 @@
           super.recycle();
           this.resource = null;
           this.lastModified = 0;
  +        this.mimeType = null;
  +        this.typeColumn = 0;
   
           if (this.con != null) {
               try {
  @@ -390,7 +408,9 @@
       }
   
       public String getMimeType() {
  -        return this.parameters.getParameter("content-type", super.getMimeType());
  +        return (this.mimeType != null ? 
  +                this.mimeType : 
  +                this.parameters.getParameter("content-type", super.getMimeType()));
       }
   
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.2   +2 -2      xml-cocoon2/src/java/org/apache/cocoon/transformation/AbstractDOMTransformer.java
  
  Index: AbstractDOMTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/AbstractDOMTransformer.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- AbstractDOMTransformer.java	15 Jul 2002 14:42:50 -0000	1.6.2.1
  +++ AbstractDOMTransformer.java	4 Feb 2003 15:44:10 -0000	1.6.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.1.2.5   +7 -4      xml-cocoon2/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java
  
  Index: SimpleFormTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- SimpleFormTransformer.java	16 Dec 2002 14:57:22 -0000	1.1.2.4
  +++ SimpleFormTransformer.java	4 Feb 2003 15:44:10 -0000	1.1.2.5
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -697,8 +697,11 @@
                       this.ignoreCount--;
                   }
               }
  -            if (this.ignoreCount > 0 || (this.ignoreCount == 0 && this.ignoreThis)) {
  -                this.ignoreThis = false;
  +            if (this.ignoreCount == 0 && this.ignoreThis) {
  +               this.ignoreThis = false;
  +               // skip event 
  +            } else if (this.ignoreCount > 0 ) {
  +               // skip event 
               } else {
                   switch (((Integer)elementNames.get(name,defaultElement)).intValue()) {
                   case ELEMENT_INPUT:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/util/Attic/BlobHelper.java
  
  Index: BlobHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/Attic/BlobHelper.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- BlobHelper.java	2 Jan 2003 11:02:12 -0000	1.1.2.2
  +++ BlobHelper.java	4 Feb 2003 15:44:10 -0000	1.1.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.1.2.3   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/util/Attic/ClobHelper.java
  
  Index: ClobHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/Attic/ClobHelper.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- ClobHelper.java	2 Jan 2003 11:02:12 -0000	1.1.2.2
  +++ ClobHelper.java	4 Feb 2003 15:44:10 -0000	1.1.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  1.3.2.3   +30 -12    xml-cocoon2/src/java/org/apache/cocoon/util/Attic/JDBCTypeConversions.java
  
  Index: JDBCTypeConversions.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/Attic/JDBCTypeConversions.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- JDBCTypeConversions.java	17 Nov 2002 19:13:52 -0000	1.3.2.2
  +++ JDBCTypeConversions.java	4 Feb 2003 15:44:10 -0000	1.3.2.3
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  @@ -68,6 +68,7 @@
   import java.util.HashMap;
   import java.util.Collections;
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.cocoon.components.request.multipart.FilePart;
   import org.apache.excalibur.source.Source;
   
   
  @@ -90,7 +91,7 @@
    * <tr><td>big-decimal</td><td>BigDecimal  </td><td>        </td><td>BigDecimal   </td></tr>
    * <tr><td>binary     </td><td>            </td><td>        </td><td>BinaryStream </td></tr>
    * <tr><td>blob       </td><td>            </td><td>        </td><td>Blob         </td></tr>
  - * <tr><td>boolean    </td><td>Bit         </td><td>Integer </td><td>Boolean      </td></tr>
  + * <tr><td>boolean    </td><td>Boolean  </td><td>Boolean </td><td>Boolean      </td></tr>
    * <tr><td>byte       </td><td>Byte        </td><td>Byte    </td><td>Byte         </td></tr>
    * <tr><td>string     </td><td>String      </td><td>        </td><td>String       </td></tr>
    * <tr><td>date       </td><td>Date        </td><td>        </td><td>Date         </td></tr>
  @@ -234,7 +235,7 @@
               value = set.getArray(dbcol); // new Integer(set.getInt(dbcol));
               break;
           case Types.BIT:
  -            value = new Integer(set.getInt(dbcol));
  +            value = new Boolean(set.getBoolean(dbcol));
               break;
           case Types.STRUCT:
               value = (Struct) set.getObject(dbcol);
  @@ -305,6 +306,11 @@
                   asciiStream = new BufferedInputStream(new FileInputStream(asciiFile));
                   length = (int) asciiFile.length();
                   clob = new ClobHelper(asciiStream, length);
  +            } else if (value instanceof FilePart) {
  +                FilePart anyFile = (FilePart) value;
  +                asciiStream = new BufferedInputStream(anyFile.getInputStream());
  +                length = (int) anyFile.getSize();
  +                clob = new ClobHelper(asciiStream, length);
               } else if (value instanceof JDBCxlobHelper) {
                   asciiStream = ((JDBCxlobHelper) value).inputStream;
                   length = ((JDBCxlobHelper) value).length;
  @@ -336,6 +342,11 @@
               } else if (value instanceof Source) {
                   asciiStream = ((Source) value).getInputStream();
                   length = (int)((Source) value).getContentLength();
  +            } else if (value instanceof FilePart) {
  +                FilePart anyFile = (FilePart) value;
  +                asciiStream = new BufferedInputStream(anyFile.getInputStream());
  +                length = (int) anyFile.getSize();
  +                clob = new ClobHelper(asciiStream, length);
               } else {
                   String asciiText = (String) value;
                   asciiStream = new BufferedInputStream(new ByteArrayInputStream(asciiText.getBytes()));
  @@ -382,6 +393,8 @@
                   d = new Date(((java.util.Date) value).getTime());
               } else if (value instanceof Calendar) {
                   d = new Date(((Calendar) value).getTime().getTime());
  +            } else {
  +                d = Date.valueOf(String.valueOf(value));
               }
               
               statement.setDate(position, d);
  @@ -496,6 +509,9 @@
                   } else if (value instanceof String) {
                       file = new File((String)value);
                       blob = new BlobHelper(new FileInputStream(file), (int) file.length());
  +                } else if (value instanceof FilePart) {
  +                    FilePart anyFile = (FilePart) value;
  +                    blob = new BlobHelper(new BufferedInputStream(anyFile.getInputStream()), anyFile.getSize());
                   } else {
                       throw new SQLException("Invalid type for blob: "+value.getClass().getName());
                   }
  @@ -509,17 +525,19 @@
                   statement.setBinaryStream(position, ((JDBCxlobHelper)value).inputStream, ((JDBCxlobHelper)value).length);
               } else if (value instanceof Source){
                   statement.setBinaryStream(position, ((Source)value).getInputStream(), (int)((Source)value).getContentLength());
  +            } else if (value instanceof FilePart) {
  +                statement.setBinaryStream(position, ((FilePart)value).getInputStream(), ((FilePart)value).getSize());
               } else {
  -                if (value instanceof File) {
  -                    file = (File)value;
  -                } else if (value instanceof String) {
  -                    file = new File((String)value);
  -                } else {
  -                    throw new SQLException("Invalid type for blob: "+value.getClass().getName());
  +                if (value instanceof File) {           
  +                   file = (File)value;
  +               } else if (value instanceof String) {
  +                   file = new File((String)value);
  +               } else {
  +                   throw new SQLException("Invalid type for blob: "+value.getClass().getName());
                   }
  -                //InputStream input = new BufferedInputStream(new FileInputStream(file));
  -                FileInputStream input = new FileInputStream(file);
  -                statement.setBinaryStream(position, input, (int)file.length());
  +                 //InputStream input = new BufferedInputStream(new FileInputStream(file));
  +                 FileInputStream input = new FileInputStream(file);
  +                 statement.setBinaryStream(position, input, (int)file.length());
               }
               break;
           case Types.INTEGER:
  
  
  
  1.1.2.2   +1 -1      xml-cocoon2/src/java/org/apache/cocoon/util/Attic/JDBCxlobHelper.java
  
  Index: JDBCxlobHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/Attic/JDBCxlobHelper.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- JDBCxlobHelper.java	11 Aug 2002 20:04:26 -0000	1.1.2.1
  +++ JDBCxlobHelper.java	4 Feb 2003 15:44:10 -0000	1.1.2.2
  @@ -4,7 +4,7 @@
                      The Apache Software License, Version 1.1
    ============================================================================
   
  - Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
   
    Redistribution and use in source and binary forms, with or without modifica-
    tion, are permitted provided that the following conditions are met:
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.46.2.6  +108 -23   xml-cocoon2/src/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/sitemap.xmap,v
  retrieving revision 1.46.2.5
  retrieving revision 1.46.2.6
  diff -u -r1.46.2.5 -r1.46.2.6
  --- sitemap.xmap	31 Oct 2002 03:21:13 -0000	1.46.2.5
  +++ sitemap.xmap	4 Feb 2003 15:44:10 -0000	1.46.2.6
  @@ -245,6 +245,13 @@
                   src="org.apache.cocoon.matching.WildcardHeaderMatcher">
         <header-name>referer</header-name>
      </map:matcher>
  +
  +   <map:matcher logger="sitemap.matcher.header" name="filename" src="org.apache.cocoon.matching.modular.CachingRegexpMatcher">
  +      <input-module name="request-param">
  +         <parameter>filename</parameter>
  +      </input-module>
  +   </map:matcher>
  +
     </map:matchers>
   
   <!--
  @@ -401,9 +408,13 @@
     </map:resource>
   
     <map:resource name="dynamic-page">
  -     <map:generate type="serverpages" src="{target}.xsp"/>
  -     <map:transform src="stylesheets/dynamic-page2html.xsl">
  -       <map:parameter name="view-source" value="{target}.xsp"/>
  +     <map:generate src="{target}.xsp" type="serverpages"/>
  +     <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +        <map:parameter name="servletPath" value="{request:servletPath}"/>
  +        <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="file" value="{target}.xsp"/>
  +        <map:parameter name="remove" value="{remove}"/>
        </map:transform>
        <map:serialize/>
     </map:resource>
  @@ -411,7 +422,7 @@
     <map:resource name="dynamic-page1">
        <!-- print all current sitemap parameters to log -->
        <map:act type="session-state">
  -        <map:parameter name="new-state" value="{../0}" />
  +        <map:parameter name="new-state" value="{../0}"/>
           <!-- 
              use the complete string that was matched as a parameter. Compare
              this with the target parameter below. There the third
  @@ -423,6 +434,7 @@
           -->
           <map:call resource="dynamic-page">
              <map:parameter name="target" value="{../target}/state{../../../0}{../../0}"/>
  +           <map:parameter name="remove" value="{../remove}"/>
           </map:call>
        </map:act>
     </map:resource>
  @@ -432,14 +444,19 @@
           <map:parameter name="new-state" value="1"/>
           <map:call resource="dynamic-page">
              <map:parameter name="target" value="{../target}1"/>
  +           <map:parameter name="remove" value="{../remove}"/>
           </map:call>
        </map:act>
     </map:resource>
   
     <map:resource name="simple-page">
  -     <map:generate type="file" src="{target}.xml"/>
  -     <map:transform src="stylesheets/page/simple-page2html.xsl">
  -        <map:parameter name="view-source" value="{target}.xml"/>
  +     <map:generate src="{target}.xml" type="file"/>
  +     <map:transform src="context://stylesheets/page/simple-page2html.xsl">
  +        <map:parameter name="servletPath" value="{request:servletPath}"/>
  +        <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="file" value="{target}.xml"/>
  +        <map:parameter name="remove" value="{remove}"/>
        </map:transform>
        <map:serialize/>
     </map:resource>
  @@ -730,7 +747,13 @@
   
      <map:match pattern="hello.html">
       <map:generate src="docs/samples/hello-page.xml"/>
  -    <map:transform src="stylesheets/page/simple-page2html.xsl"/>
  +    <map:transform src="context://stylesheets/page/simple-page2html.xsl">
  +       <map:parameter name="servletPath" value="{request:servletPath}"/>
  +       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       <map:parameter name="file" value="docs/samples/hello-page.xml"/>
  +       <map:parameter name="remove" value="{0}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  @@ -895,7 +918,13 @@
   
      <map:match pattern="scripts/*">
       <map:generate type="script" src="docs/samples/scripts/{1}"/>
  -    <map:transform src="stylesheets/page/simple-page2html.xsl"/>
  +    <map:transform src="context://stylesheets/page/simple-page2html.xsl">
  +       <map:parameter name="servletPath" value="{request:servletPath}"/>
  +       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       <map:parameter name="file" value="docs/samples/scripts/{1}"/>
  +       <map:parameter name="remove" value="{0}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  @@ -905,7 +934,13 @@
   
      <map:match pattern="jsp/*">
       <map:generate type="jsp" src="/docs/samples/jsp/{1}.jsp"/>
  -    <map:transform src="stylesheets/page/simple-page2html.xsl"/>
  +    <map:transform src="context://stylesheets/page/simple-page2html.xsl">
  +       <map:parameter name="servletPath" value="{request:servletPath}"/>
  +       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +       <map:parameter name="file" value="docs/samples/jsp/{1}.jsp"/>
  +       <map:parameter name="remove" value="{0}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  @@ -914,7 +949,11 @@
       <map:parameter name="name" value="Velocity"/>
       <map:parameter name="project" value="Cocoon"/>
       </map:generate>
  -    <map:transform src="stylesheets/page/simple-page2html.xsl"/>
  +    <map:transform src="context://stylesheets/page/simple-page2html.xsl">
  +       <map:parameter name="servletPath" value="{request:servletPath}"/>
  +       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +       <map:parameter name="contextPath" value="{request:contextPath}"/>
  +    </map:transform>
       <map:serialize type="html"/>
      </map:match>
   
  @@ -955,8 +994,12 @@
      <!-- =========================== Dynamic ================================ -->
      <map:match pattern="xsp/*">
       <map:generate type="serverpages" src="docs/samples/xsp/{1}.xsp"/>
  -    <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <map:parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/>
  +    <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +        <map:parameter name="servletPath" value="{request:servletPath}"/>
  +        <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="file" value="docs/samples/xsp/{1}.xsp"/>
  +        <map:parameter name="remove" value="{0}"/>
       <!--
          Run-time configuration is done through these
          <map:parameter/> elements. Again, let's have a look at the
  @@ -1003,8 +1046,12 @@
         successfully.
          -->
          <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
  -       <map:transform src="stylesheets/dynamic-page2html.xsl">
  -          <map:parameter name="view-source" value="docs/samples/forms/employee.xsp"/>
  +       <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +           <map:parameter name="servletPath" value="{request:servletPath}"/>
  +           <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +           <map:parameter name="contextPath" value="{request:contextPath}"/>
  +           <map:parameter name="file" value="docs/samples/{0}.xsp"/>
  +           <map:parameter name="remove" value="{0}"/>
          </map:transform>
          <map:serialize/>
        </map:act>
  @@ -1012,9 +1059,13 @@
   
      <map:match pattern="forms/*">
        <map:generate type="serverpages" src="docs/samples/forms/{1}.xsp"/>
  -     <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <map:parameter name="view-source" value="docs/samples/forms/{1}.xsp"/>
  -     </map:transform>
  +       <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +           <map:parameter name="servletPath" value="{request:servletPath}"/>
  +           <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +           <map:parameter name="contextPath" value="{request:contextPath}"/>
  +           <map:parameter name="file" value="docs/samples/{0}.xsp"/>
  +           <map:parameter name="remove" value="{0}"/>
  +       </map:transform>
        <map:serialize/>
      </map:match>
   
  @@ -1026,10 +1077,12 @@
           <map:parameter name="validate-set" value="car-reservation"/>
           <map:call resource="dynamic-page">
              <map:parameter name="target" value="docs/samples/formvalidation/OK"/>
  +           <map:parameter name="remove" value="{../0}"/>
           </map:call>
        </map:act>
        <map:call resource="dynamic-page">
           <map:parameter name="target" value="docs/samples/formvalidation/ERROR"/>
  +        <map:parameter name="remove" value="{0}"/>
        </map:call>
      </map:match>
   
  @@ -1052,12 +1105,14 @@
              <map:match type="next-page" pattern="1">
                 <map:call resource="dynamic-page1">
                    <map:parameter name="target" value="docs/samples/session-state"/>
  +                 <map:parameter name="remove" value="session-state/example"/>
                 </map:call>
                 <!-- by calling this resource, the rest of this fragment here is irrelevant -->
              </map:match>
              <map:match type="next-page" pattern="2">
                 <map:call resource="dynamic-page1">
                    <map:parameter name="target" value="docs/samples/session-state"/>
  +                 <map:parameter name="remove" value="session-state/example"/>
                 </map:call>
              </map:match>
           </map:match>
  @@ -1066,23 +1121,27 @@
              <map:match type="next-page" pattern="1">
                 <map:call resource="dynamic-page1">
                    <map:parameter name="target" value="docs/samples/session-state"/>
  +                 <map:parameter name="remove" value="session-state/example"/>
                 </map:call>
              </map:match>
              <map:match type="next-page" pattern="2">
                 <map:call resource="dynamic-page1">
                    <map:parameter name="target" value="docs/samples/session-state"/>
  +                 <map:parameter name="remove" value="session-state/example"/>
                 </map:call>
              </map:match>
           </map:match>
   
           <map:call resource="dynamic-page2">
              <map:parameter name="target" value="docs/samples/session-state/state0"/>
  +           <map:parameter name="remove" value="session-state/example"/>
           </map:call>
         </map:act>
         <!-- end if session is valid -->
   
         <map:call resource="dynamic-page">
            <map:parameter name="target" value="docs/samples/session-state/start"/>
  +         <map:parameter name="remove" value="session-state/example"/>
         </map:call>
     </map:match>
   
  @@ -1092,16 +1151,19 @@
        <map:match type="referer-match" pattern="http://*/cocoon/referer/a">
           <map:call resource="simple-page">
              <map:parameter name="target" value="docs/samples/referer/a/{../1}"/>
  +           <map:parameter name="remove" value="{../0}"/>
           </map:call>
        </map:match>
        <map:match type="referer-match" pattern="http://*/cocoon/referer/b">
           <map:call resource="simple-page">
              <map:parameter name="target" value="docs/samples/referer/b/{../1}"/>
  +           <map:parameter name="remove" value="{../0}"/>
           </map:call>
        </map:match>
   
        <map:call resource="simple-page">
           <map:parameter name="target" value="docs/samples/referer/a/a"/>
  +        <map:parameter name="remove" value="{0}"/>
        </map:call>
     </map:match>
   
  @@ -1115,7 +1177,13 @@
   
      <map:match pattern="Order">
        <map:generate src="docs/samples/stream/OrderPage.xml"/>
  -     <map:transform src="stylesheets/dynamic-page2html.xsl"/>
  +     <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +         <map:parameter name="servletPath" value="{request:servletPath}"/>
  +         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +         <map:parameter name="contextPath" value="{request:contextPath}"/>
  +         <map:parameter name="file" value="docs/samples/stream/OrderPage.xml"/>
  +         <map:parameter name="remove" value="{0}"/>
  +     </map:transform>
        <map:serialize type="html"/>
      </map:match>
   
  @@ -1129,6 +1197,15 @@
       <map:serialize/>
      </map:match>
   
  +   <map:match pattern="view-file">
  +    <!-- colourize files that are known to be XML -->
  +    <map:match type="filename" pattern="((xml)|(xsp)|(xmap)|(xconf))$">
  +       <map:generate src="docs/samples/slides/view-source.xsp" type="serverpages"/>
  +       <map:serialize/>
  +    </map:match>
  +    <!-- all other files are just send as text -->
  +    <map:read mime-type="text/plain" src="./{request-param:filename}"/>
  +   </map:match>
   
      <!-- ========================== SOAP ============================== -->
      <map:match pattern="soap/*">
  @@ -1140,16 +1217,24 @@
      <map:match pattern="xscript/soap-getquote1">
        <map:generate type="serverpages" src="docs/samples/xscript/soap-getquote1.xsp"/>
        <map:transform src="docs/samples/xscript/soap-getquote1.xsl"/>
  -     <map:transform src="stylesheets/dynamic-page2html.xsl">
  -       <map:parameter name="view-source" value="docs/samples/xscript/soap-getquote1.xsp"/>
  +     <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +        <map:parameter name="servletPath" value="{request:servletPath}"/>
  +        <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="file" value="docs/samples/{0}.xsp"/>
  +        <map:parameter name="remove" value="{0}"/>
        </map:transform>
        <map:serialize/>
      </map:match>
   
      <map:match pattern="xscript/*">
        <map:generate type="serverpages" src="docs/samples/xscript/{1}.xsp"/>
  -     <map:transform src="stylesheets/dynamic-page2html.xsl">
  -       <map:parameter name="view-source" value="docs/samples/xscript/{1}.xsp"/>
  +     <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +        <map:parameter name="servletPath" value="{request:servletPath}"/>
  +        <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +        <map:parameter name="contextPath" value="{request:contextPath}"/>
  +        <map:parameter name="file" value="docs/samples/{0}.xsp"/>
  +        <map:parameter name="remove" value="{0}"/>
        </map:transform>
        <map:serialize/>
      </map:match>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +46 -6     xml-cocoon2/src/webapp/WEB-INF/db/cocoondb.script
  
  Index: cocoondb.script
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/WEB-INF/db/cocoondb.script,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- cocoondb.script	19 May 2002 07:38:58 -0000	1.1.2.1
  +++ cocoondb.script	4 Feb 2003 15:44:10 -0000	1.1.2.2
  @@ -3,6 +3,8 @@
   CREATE TABLE USER(UID INTEGER IDENTITY PRIMARY KEY,NAME VARCHAR,FIRSTNAME VARCHAR,UNAME VARCHAR,UNIQUE(UNAME))
   CREATE TABLE GROUPS(GID INTEGER IDENTITY PRIMARY KEY,GNAME VARCHAR,UNIQUE(GNAME))
   CREATE TABLE USER_GROUPS(UID INTEGER,GID INTEGER,UNIQUE(UID,GID),FOREIGN KEY(UID)REFERENCES USER(UID),FOREIGN KEY(GID)REFERENCES GROUPS(GID))
  +CREATE TABLE STATE_TAX(CATEGORY VARCHAR NOT NULL,GROSSTAX_COLLECTED DOUBLE NOT NULL,NETTAX_COLLECTED DOUBLE NOT NULL,YEAR INTEGER NOT NULL)
  +CREATE TABLE MEDIA(ID INTEGER IDENTITY PRIMARY KEY,IMAGE BINARY,MIMETYPE VARCHAR)
   GRANT ALL ON CLASS "org.hsqldb.Library" TO PUBLIC
   GRANT ALL ON CLASS "java.lang.Math" TO PUBLIC
   CREATE USER SA PASSWORD "" ADMIN
  @@ -76,9 +78,47 @@
   INSERT INTO DEPARTMENT VALUES(2,'Management')
   INSERT INTO DEPARTMENT VALUES(3,'Testers')
   INSERT INTO EMPLOYEE VALUES(1,1,'Donald Ball')
  -INSERT INTO EMPLOYEE VALUES(2,1,'Stefano Mazzocchi')
  -INSERT INTO EMPLOYEE VALUES(3,2,'Pierpaolo Fumagalli')
  -INSERT INTO EMPLOYEE VALUES(4,3,'Torsten Curdt')
  -INSERT INTO EMPLOYEE VALUES(5,2,'Davanum Srinivas')
  -/*C3*/CONNECT USER sa PASSWORD ""
  -/*C4*/CONNECT USER sa PASSWORD ""
  +INSERT INTO EMPLOYEE VALUES(2,1,'Sylvain Wallez ')
  +INSERT INTO EMPLOYEE VALUES(3,1,'Carsten Ziegeler ')
  +INSERT INTO EMPLOYEE VALUES(4,1,'Torsten Curdt')
  +INSERT INTO EMPLOYEE VALUES(5,1,'Marcus Crafter')
  +INSERT INTO EMPLOYEE VALUES(6,1,'Ovidiu Predescu')
  +INSERT INTO EMPLOYEE VALUES(7,1,'Christian Haul')
  +INSERT INTO EMPLOYEE VALUES(8,2,'Stefano Mazzocchi')
  +INSERT INTO EMPLOYEE VALUES(9,3,'Pierpaolo Fumagalli')
  +INSERT INTO EMPLOYEE VALUES(10,3,'Davanum Srinivas')
  +
  +INSERT INTO STATE_TAX VALUES('State Sales And Use',6.263250997E9,6.213961851E9,2000)
  +INSERT INTO STATE_TAX VALUES('Local Sales And Use',1.321129345E9,1.321129345E9,2000)
  +INSERT INTO STATE_TAX VALUES('Resort Area Excise',718624.0,718624.0,2000)
  +INSERT INTO STATE_TAX VALUES('State Personal Income',8.983891961E9,8.084576329E9,2000)
  +INSERT INTO STATE_TAX VALUES('Corporation Franchise',1.219484766E9,1.029883951E9,2000)
  +INSERT INTO STATE_TAX VALUES('Motor Vehicle Fuel',1.418996649E9,1.404945725E9,2000)
  +INSERT INTO STATE_TAX VALUES('Public Utility Excise',7.04245493E8,6.75339746E8,2000)
  +INSERT INTO STATE_TAX VALUES('Kilowatt-Hour Excise',0.0,0.0,2000)
  +INSERT INTO STATE_TAX VALUES('Cigarette Excise',2.89795508E8,2.87710095E8,2000)
  +INSERT INTO STATE_TAX VALUES('Dealers in Intangibles',5055311.0,2.2333722E7,2000)
  +INSERT INTO STATE_TAX VALUES('Motor Fuel Use',2.2615436E7,6.6889345E7,2000)
  +INSERT INTO STATE_TAX VALUES('Alchoholic Beverage Excise',5.6125329E7,5.5993783E7,2000)
  +INSERT INTO STATE_TAX VALUES('Replacement Tire Fee',3339367.0,3339367.0,2000)
  +INSERT INTO STATE_TAX VALUES('Local Alchoholic Beverage',6284465.0,5851787.0,2000)
  +INSERT INTO STATE_TAX VALUES('Horse Racing',1.6582056E7,1.7321198E7,2000)
  +INSERT INTO STATE_TAX VALUES('Severance',8295336.0,7981539.0,2000)
  +INSERT INTO STATE_TAX VALUES('School District Income',1.50083042E8,1.61257059E8,2000)
  +INSERT INTO STATE_TAX VALUES('State Sales And Use',6.287758244E9,6.23711041E9,2001)
  +INSERT INTO STATE_TAX VALUES('Local Sales And Use',1.352436625E9,1.352436625E9,2001)
  +INSERT INTO STATE_TAX VALUES('Resort Area Excise',719420.0,719420.0,2001)
  +INSERT INTO STATE_TAX VALUES('State Personal Income',9.221429278E9,8.119314587E9,2001)
  +INSERT INTO STATE_TAX VALUES('Corporation Franchise',1.158910767E9,9.72967198E8,2001)
  +INSERT INTO STATE_TAX VALUES('Motor Vehicle Fuel',1.325132798E9,1.307275001E9,2001)
  +INSERT INTO STATE_TAX VALUES('Public Utility Excise',6.91925015E8,6.7431469E8,2001)
  +INSERT INTO STATE_TAX VALUES('Kilowatt-Hour Excise',3.8026261E7,3.8026261E7,2001)
  +INSERT INTO STATE_TAX VALUES('Cigarette Excise',2.83978172E8,2.82481419E8,2001)
  +INSERT INTO STATE_TAX VALUES('Dealers in Intangibles',2.4913075E7,2.4881108E7,2001)
  +INSERT INTO STATE_TAX VALUES('Motor Fuel Use',7.5662992E7,7.5311561E7,2001)
  +INSERT INTO STATE_TAX VALUES('Alchoholic Beverage Excise',5.5862063E7,5.5740722E7,2001)
  +INSERT INTO STATE_TAX VALUES('Replacement Tire Fee',3470795.0,3470795.0,2001)
  +INSERT INTO STATE_TAX VALUES('Local Alchoholic Beverage',5851787.0,5851787.0,2001)
  +INSERT INTO STATE_TAX VALUES('Horse Racing',1.7921198E7,1.7321198E7,2001)
  +INSERT INTO STATE_TAX VALUES('Severance',7981539.0,7967438.0,2001)
  +INSERT INTO STATE_TAX VALUES('School District Income',1.61257059E8,1.53238001E8,2001)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +76 -0     xml-cocoon2/src/webapp/mount/databases/Attic/samples.xml
  
  
  
  
  1.1.2.1   +71 -0     xml-cocoon2/src/webapp/mount/databases/Attic/sitemap.xmap
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +162 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/database.xml
  
  
  
  
  1.1.2.1   +241 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/edit-groups.xsp
  
  
  
  
  1.1.2.1   +126 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/file-upload-blob.xsp
  
  
  
  
  1.1.2.1   +35 -0     xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/schema.sql
  
  
  
  
  1.1.2.1   +222 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/sitemap.xmap
  
  
  
  
  1.1.2.1   +138 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/stupid.xsl
  
  
  
  
  1.1.2.1   +260 -0    xml-cocoon2/src/webapp/mount/databases/mod-db/Attic/user-list.xsp
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +27 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/add-department.xsp
  
  
  
  
  1.1.2.1   +44 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/add-employee.xsp
  
  
  
  
  1.1.2.1   +14 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/employee.xml
  
  
  
  
  1.1.2.1   +100 -0    xml-cocoon2/src/webapp/mount/databases/org-db/Attic/employee.xsp
  
  
  
  
  1.1.2.1   +57 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/process-department.xsp
  
  
  
  
  1.1.2.1   +59 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/process-employee.xsp
  
  
  
  
  1.1.2.1   +89 -0     xml-cocoon2/src/webapp/mount/databases/org-db/Attic/sitemap.xmap
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +52 -0     xml-cocoon2/src/webapp/mount/databases/transform/Attic/sitemap.xmap
  
  
  
  
  1.1.2.1   +26 -0     xml-cocoon2/src/webapp/mount/databases/transform/Attic/sql-page.xml
  
  
  
  
  1.1.2.1   +39 -0     xml-cocoon2/src/webapp/mount/databases/transform/Attic/sql-page.xml.sql
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +22 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/Attic/menu.xml
  
  
  
  
  1.1.2.1   +163 -0    xml-cocoon2/src/webapp/mount/databases/tutorial/Attic/sitemap.xmap
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +14 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/confirm-dept.xsp
  
  
  
  
  1.1.2.1   +14 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/confirm-empl.xsp
  
  
  
  
  1.1.2.1   +33 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/create-dept.xsp
  
  
  
  
  1.1.2.1   +85 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/create-empl.xsp
  
  
  
  
  1.1.2.1   +23 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/department-form.xml
  
  
  
  
  1.1.2.1   +53 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/edit-dept.xsp
  
  
  
  
  1.1.2.1   +103 -0    xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/edit-empl.xsp
  
  
  
  
  1.1.2.1   +27 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/employee-form.xml
  
  
  
  
  1.1.2.1   +19 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/home.xml
  
  
  
  
  1.1.2.1   +53 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/results-dept.xsp
  
  
  
  
  1.1.2.1   +53 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/results-empl.xsp
  
  
  
  
  1.1.2.1   +25 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/search-dept.xsp
  
  
  
  
  1.1.2.1   +25 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/docs/Attic/search-empl.xsp
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-border-bottom.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-border-left.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-border-right.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-border-top.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-bottom-left.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +2 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-bottom-right.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +2 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-top-left.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bar-top-right.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +3 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/bottom.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +10 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-asf-hi.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +11 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-asf-lo.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +6 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-w3c-hi.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +8 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-w3c-lo.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +8 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-xml-hi.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +8 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/button-xml-lo.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +2 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/close.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/dot.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +5 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/join.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +3 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/line.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +21 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/logo.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/note.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +5 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/right.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/separator.gif
  
  	<<Binary file>>
  
  
  1.1.2.1   +1 -0      xml-cocoon2/src/webapp/mount/databases/tutorial/resources/images/Attic/void.gif
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +498 -0    xml-cocoon2/src/webapp/mount/databases/tutorial/stylesheets/Attic/apache.xsl
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +47 -0     xml-cocoon2/src/webapp/mount/databases/tutorial/stylesheets/system/Attic/error2document.xsl
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +221 -0    xml-cocoon2/src/webapp/mount/databases/xsp/Attic/esql.xsd
  
  
  
  
  1.1.2.1   +117 -0    xml-cocoon2/src/webapp/mount/databases/xsp/Attic/esql.xsp
  
  
  
  
  1.1.2.1   +41 -0     xml-cocoon2/src/webapp/mount/databases/xsp/Attic/sitemap.xmap
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/webapp/samples/common/style/css/samples.css
  
  Index: samples.css
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/common/style/css/samples.css,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +74 -52    xml-cocoon2/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl
  
  Index: simple-samples2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- simple-samples2html.xsl	29 Nov 2002 17:21:38 -0000	1.1.2.1
  +++ simple-samples2html.xsl	4 Feb 2003 15:44:15 -0000	1.1.2.2
  @@ -1,8 +1,11 @@
   <?xml version="1.0"?>
   <!-- Author: Nicola Ken Barozzi "nicolaken@apache.org" -->
   <!-- Author: Vadim Gritsenko "vgritsenko@apache.org" -->
  +<!-- Author: Christian Haul "haul@apache.org" -->
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
   
  +  <xsl:param name="contextPath" select="string('/cocoon')"/>
  +
    <xsl:template match="/">
     <html>
      <head>
  @@ -13,13 +16,16 @@
       <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
        <tr>
         <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
  -      <td width="40%" align="center"><img border="0" src="images/cocoon.gif"/></td>
  +      <td width="40%" align="center"><img border="0" src="{concat($contextPath,'/samples/images/cocoon.gif')}"/></td>
         <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
        </tr>
        <tr>
          <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
            <tr>
  -            <td width="90%" align="right" bgcolor="#0086b2"><i>orthogonal views: </i></td>
  +            <td width="60%" bgcolor="#0086b2">
  +              <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="samples/@name"/></font>
  +            </td>
  +            <td align="right" bgcolor="#0086b2"><i>orthogonal views: </i></td>
               <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=content"><i>content</i></a></td>
               <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=pretty-content"><i>pretty content</i></a></td>
               <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=links"><i>links</i></a></td>
  @@ -32,7 +38,7 @@
   
       <p align="center">
        <font size="-1">
  -      Copyright &#169; 1999-2002 <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
  +      Copyright &#169; @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
         All rights reserved.
        </font>
       </p>
  @@ -41,51 +47,57 @@
    </xsl:template>
   
    <xsl:template match="samples">
  -  <xsl:variable name="all-samples" select="count(group/sample)"/>
  +  <xsl:variable name="gc" select="4"/><!-- group correction -->
  +  <xsl:variable name="all-groups" select="$gc * count(group)"/>
  +  <xsl:variable name="all-samples" select="count(group/sample)+count(group/note)+$all-groups"/>
     <xsl:variable name="half-samples" select="round($all-samples div 2)"/>
  -
     <xsl:variable name="half-possibilities">
  -    <xsl:for-each select="group">
  -      <xsl:if test="position() &lt; last() and position() &gt;= 1">
  -        <xsl:variable name="group-position" select="position()"/>
  -        <xsl:variable name="prev-sample" select="count(../group[position() &lt;= $group-position - 1]/sample)"/>
  -        <xsl:variable name="curr-sample" select="count(../group[position() &lt;= $group-position]/sample)"/>
  -        <xsl:variable name="next-sample" select="count(../group[position() &lt;= $group-position + 1]/sample)"/>
  -        <xsl:variable name="prev-deviation">
  -          <xsl:choose>
  -            <xsl:when test="$prev-sample &gt; $half-samples">
  -              <xsl:value-of select="$prev-sample - $half-samples"/>
  -            </xsl:when>
  -            <xsl:otherwise>
  -              <xsl:value-of select="$half-samples - $prev-sample"/>
  -            </xsl:otherwise>
  -          </xsl:choose>
  -        </xsl:variable>
  -        <xsl:variable name="curr-deviation">
  -          <xsl:choose>
  -            <xsl:when test="$curr-sample &gt; $half-samples">
  -              <xsl:value-of select="$curr-sample - $half-samples"/>
  -            </xsl:when>
  -            <xsl:otherwise>
  -              <xsl:value-of select="$half-samples - $curr-sample"/>
  -            </xsl:otherwise>
  -          </xsl:choose>
  -        </xsl:variable>
  -        <xsl:variable name="next-deviation">
  -          <xsl:choose>
  -            <xsl:when test="$next-sample &gt; $half-samples">
  -              <xsl:value-of select="$next-sample - $half-samples"/>
  -            </xsl:when>
  -            <xsl:otherwise>
  -              <xsl:value-of select="$half-samples - $next-sample"/>
  -            </xsl:otherwise>
  -          </xsl:choose>
  -        </xsl:variable>
  -        <xsl:if test="$prev-deviation &gt;= $curr-deviation and $curr-deviation &lt;= $next-deviation">
  -          <xsl:value-of select="$group-position"/><xsl:text> </xsl:text>
  -        </xsl:if>
  -      </xsl:if>
  -    </xsl:for-each>
  +    <xsl:choose>
  +      <xsl:when test="count(group) = 1">1 </xsl:when><!-- single group sample.xml -->
  +      <xsl:otherwise>
  +        <xsl:for-each select="group">
  +          <xsl:if test="position() &lt; last() and position() &gt;= 1">
  +            <xsl:variable name="group-position" select="position()"/>
  +            <xsl:variable name="prev-sample" select="count(../group[position() &lt;= $group-position - 1]/sample) + count(../group[position() &lt;= $group-position - 1]/note) + position() * $gc - $gc"/>
  +            <xsl:variable name="curr-sample" select="count(../group[position() &lt;= $group-position]/sample) + count(../group[position() &lt;= $group-position]/note) + position() * $gc"/>
  +            <xsl:variable name="next-sample" select="count(../group[position() &lt;= $group-position + 1]/sample) + count(../group[position() &lt;= $group-position + 1]/note) + position() * $gc + $gc"/>
  +            <xsl:variable name="prev-deviation">
  +              <xsl:choose>
  +                <xsl:when test="$prev-sample &gt; $half-samples">
  +                  <xsl:value-of select="$prev-sample - $half-samples"/>
  +                </xsl:when>
  +                <xsl:otherwise>
  +                  <xsl:value-of select="$half-samples - $prev-sample"/>
  +                </xsl:otherwise>
  +              </xsl:choose>
  +            </xsl:variable>
  +            <xsl:variable name="curr-deviation">
  +              <xsl:choose>
  +                <xsl:when test="$curr-sample &gt; $half-samples">
  +                  <xsl:value-of select="$curr-sample - $half-samples"/>
  +                </xsl:when>
  +                <xsl:otherwise>
  +                  <xsl:value-of select="$half-samples - $curr-sample"/>
  +                </xsl:otherwise>
  +              </xsl:choose>
  +            </xsl:variable>
  +            <xsl:variable name="next-deviation">
  +              <xsl:choose>
  +                <xsl:when test="$next-sample &gt; $half-samples">
  +                  <xsl:value-of select="$next-sample - $half-samples"/>
  +                </xsl:when>
  +                <xsl:otherwise>
  +                  <xsl:value-of select="$half-samples - $next-sample"/>
  +                </xsl:otherwise>
  +              </xsl:choose>
  +            </xsl:variable>
  +            <xsl:if test="$prev-deviation &gt;= $curr-deviation and $curr-deviation &lt;= $next-deviation">
  +              <xsl:value-of select="$group-position"/><xsl:text> </xsl:text>
  +            </xsl:if>
  +          </xsl:if>
  +        </xsl:for-each>
  +      </xsl:otherwise>
  +    </xsl:choose>
     </xsl:variable>
     <xsl:variable name="half">
       <xsl:value-of select="substring-before($half-possibilities, ' ')"/>
  @@ -169,12 +181,22 @@
    </xsl:template>
    
    <xsl:template match="sample">
  -  <tr>
  -   <td width="100%" bgcolor="#ffffff" align="left">
  -    <font size="+0" face="arial,helvetica,sanserif" color="#000000">    
  -      <a href="{@href}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
  -      <xsl:value-of select="."/>
  -    </font>
  +   <xsl:variable name="link">
  +     <xsl:choose>
  +       <xsl:when test="starts-with(@href,'/')">
  +         <xsl:value-of select="concat($contextPath,@href)"/>
  +       </xsl:when>
  +       <xsl:otherwise>
  +         <xsl:value-of select="@href"/>
  +       </xsl:otherwise>
  +     </xsl:choose>
  +   </xsl:variable>
  +   <tr>
  +     <td width="100%" bgcolor="#ffffff" align="left">
  +       <font size="+0" face="arial,helvetica,sanserif" color="#000000">    
  +       <a href="{$link}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
  +       <xsl:value-of select="."/>
  +     </font>
      </td>
     </tr>
    </xsl:template>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.3   +6 -3      xml-cocoon2/src/webapp/search/Attic/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/search/Attic/sitemap.xmap,v
  retrieving revision 1.5.2.2
  retrieving revision 1.5.2.3
  diff -u -r1.5.2.2 -r1.5.2.3
  --- sitemap.xmap	13 Aug 2002 15:16:33 -0000	1.5.2.2
  +++ sitemap.xmap	4 Feb 2003 15:44:15 -0000	1.5.2.3
  @@ -56,9 +56,12 @@
       
         <map:match pattern="**">
           <map:generate type="serverpages" src="{1}-index.xsp"/>
  -        <map:transform src="context://stylesheets/dynamic-page2html.xsl">
  -          <map:parameter name="view-source" value="search/{1}-index.xsp"/>
  -        </map:transform>
  +      	<map:transform src="context://stylesheets/dynamic-page2html.xsl">
  +      	   <map:parameter name="servletPath" value="{request:servletPath}"/>
  +      	   <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
  +      	   <map:parameter name="contextPath" value="{request:contextPath}"/>
  +      	   <map:parameter name="file" value="-index.xsp"/>
  +      	</map:transform>
           <map:serialize/>
         </map:match>
       </map:pipeline>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +84 -17    xml-cocoon2/src/webapp/stylesheets/page/Attic/simple-page2html.xsl
  
  Index: simple-page2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/stylesheets/page/Attic/simple-page2html.xsl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- simple-page2html.xsl	11 Aug 2002 20:14:30 -0000	1.1.2.1
  +++ simple-page2html.xsl	4 Feb 2003 15:44:15 -0000	1.1.2.2
  @@ -2,34 +2,101 @@
   
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
  -  <xsl:param name="view-source"/>
  -  <xsl:param name="path">../</xsl:param>
  +  <xsl:param name="servletPath" select="string('/samples')"/>
  +  <xsl:param name="sitemapURI"/>
  +  <xsl:param name="file"/><!-- relative path to file or file suffix -->
  +  <xsl:param name="remove"/><!-- path to remove from servletPath -->
  +  <xsl:param name="contextPath" select="string('/cocoon')"/>
  +
  +  <xsl:variable name="realpath">
  +    <xsl:choose>
  +      <xsl:when test="$remove=''">
  +        <xsl:value-of select="$servletPath"/>        
  +      </xsl:when>
  +      <xsl:otherwise>
  +        <xsl:value-of select="substring-before($servletPath,$remove)"/>        
  +      </xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:variable>
  +  <xsl:variable name="path" select="concat($contextPath,'/view-file?filename=')"/>
  +  <xsl:variable name="view-source" select="concat($realpath,$file)"/>
  +  <xsl:variable name="directory" select="substring-before($servletPath,$sitemapURI)"/>
  +  <!-- assume that sitemapURIs don't occur in servletPath more than once -->
  +  <xsl:variable name="sitemap" select="concat($directory,'sitemap.xmap')"/>
   
     <xsl:template match="page">
      <html>
  +     <link rel="stylesheet" href="{concat($contextPath,'/samples/samples.css')}" title="Default Style"/>
       <head>
        <title>
         <xsl:value-of select="title"/>
        </title>
       </head>
  -    <body bgcolor="white" alink="red" link="blue" vlink="blue">
  -     <xsl:apply-templates/>
  +    <body>
  +      <xsl:call-template name="resources"/>
  +      <xsl:apply-templates/>
  +      <xsl:call-template name="footer"/>
       </body>
      </html>
     </xsl:template>
   
  +  <xsl:template name="footer">
  +    <div class="footer">
  +      <table>
  +        <tbody>
  +          <tr><td>Source:  </td><td>$COCOON<xsl:value-of select="$view-source"/></td></tr>
  +          <tr><td>Sitemap: </td><td>$COCOON<xsl:value-of select="$sitemap"/></td></tr>
  +        </tbody>
  +      </table>
  +    </div>
  +  </xsl:template>
  +
  +  <xsl:template name="resources">
  +    <div class="resources">
  +      <table width="100%">
  +        <tbody>
  +          <tr>
  +            <td>
  +              <a target="_blank" href="{concat($contextPath,$servletPath,'?cocoon-view=content')}">Content</a>
  +            </td>
  +            <td>
  +              <a target="_blank" href="{concat($path,$view-source)}">Source</a>
  +            </td>
  +            <td>
  +              <a target="_blank" href="{concat($path,$sitemap)}">Sitemap</a>
  +            </td>
  +            <xsl:for-each select="resources/resource">
  +              <td class="{@type}">
  +                <xsl:choose>
  +                  <xsl:when test="@type='file'">
  +                    <a target="_blank" href="{concat($path,$directory,@href)}">
  +                      <xsl:apply-templates/>
  +                    </a>
  +                  </xsl:when>
  +                  <xsl:when test="@type='doc'">
  +                    <a target="_blank" href="{concat($contextPath,'/documents/',@href)}">
  +                      <xsl:apply-templates/>
  +                    </a>
  +                  </xsl:when>
  +                  <xsl:otherwise>
  +                    <a target="_blank" href="{concat($contextPath,'/',@href)}">
  +                      <xsl:apply-templates/>
  +                    </a>
  +                  </xsl:otherwise>
  +                </xsl:choose>
  +              </td>
  +            </xsl:for-each>
  +          </tr>
  +        </tbody>
  +      </table>
  +    </div>
  +  </xsl:template>
  +
  +  <xsl:template match="resources"/>
  +
     <xsl:template match="title">
  -   <h2 style="color: navy; text-align: center">
  -      <xsl:if test="not($view-source)">
  -         <xsl:apply-templates/>
  -      </xsl:if>     
  -      <xsl:if test="$view-source">
  -      <A>
  -        <xsl:attribute name="HREF"><xsl:value-of select="$path"/>view-source?filename=/<xsl:value-of select="$view-source"/></xsl:attribute>
  - 		 <xsl:attribute name="TARGET">_blank</xsl:attribute>
  -         <xsl:apply-templates/>
  -      </A>
  -      </xsl:if>     
  +   <h2>
  +     <xsl:apply-templates/>
      </h2>
     </xsl:template>
     
  @@ -38,8 +105,8 @@
     </xsl:template>
   
     <xsl:template match="para">
  -   <p align="left">
  -    <i><xsl:apply-templates/></i>
  +   <p>
  +     <xsl:apply-templates/>
      </p>
     </xsl:template>
   
  
  
  

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