cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/acting DatabaseAuthenticatorAction.java SessionValidatorAction.java
Date Fri, 20 Jul 2001 13:35:49 GMT
cziegeler    01/07/20 06:35:49

  Modified:    src/org/apache/cocoon/acting Tag: cocoon_20_branch
                        DatabaseAuthenticatorAction.java
                        SessionValidatorAction.java
  Log:
  Fixed NPE - all examples work now!
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.4   +4 -4      xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java
  
  Index: DatabaseAuthenticatorAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java,v
  retrieving revision 1.3.2.3
  retrieving revision 1.3.2.4
  diff -u -r1.3.2.3 -r1.3.2.4
  --- DatabaseAuthenticatorAction.java	2001/07/19 19:46:25	1.3.2.3
  +++ DatabaseAuthenticatorAction.java	2001/07/20 13:35:49	1.3.2.4
  @@ -1,4 +1,4 @@
  -// $Id: DatabaseAuthenticatorAction.java,v 1.3.2.3 2001/07/19 19:46:25 bloritsch Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.3.2.4 2001/07/20 13:35:49 cziegeler Exp $
   package org.apache.cocoon.acting;
   
   import java.sql.Connection;
  @@ -51,7 +51,7 @@
    * not verified.
    *
    * @author Martin Man <Martin.Man@seznam.cz>
  - * @version CVS $Revision: 1.3.2.3 $ $Date: 2001/07/19 19:46:25 $
  + * @version CVS $Revision: 1.3.2.4 $ $Date: 2001/07/20 13:35:49 $
    */
   public class DatabaseAuthenticatorAction extends AbstractDatabaseAction
   {
  @@ -101,7 +101,7 @@
                   return null;
               }
   
  -            getLogger ().debug ("DBAUTH: quuery is: " + query);
  +            getLogger ().debug ("DBAUTH: query is: " + query);
               st = conn.createStatement ();
               rs = st.executeQuery (query);
   
  @@ -249,5 +249,5 @@
       }
   }
   
  -// $Id: DatabaseAuthenticatorAction.java,v 1.3.2.3 2001/07/19 19:46:25 bloritsch Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.3.2.4 2001/07/20 13:35:49 cziegeler Exp $
   // vim: set et ts=4 sw=4:
  
  
  
  1.3.2.3   +18 -18    xml-cocoon2/src/org/apache/cocoon/acting/SessionValidatorAction.java
  
  Index: SessionValidatorAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/SessionValidatorAction.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- SessionValidatorAction.java	2001/07/13 13:37:50	1.3.2.2
  +++ SessionValidatorAction.java	2001/07/20 13:35:49	1.3.2.3
  @@ -1,4 +1,4 @@
  -// $Id: SessionValidatorAction.java,v 1.3.2.2 2001/07/13 13:37:50 dims Exp $
  +// $Id: SessionValidatorAction.java,v 1.3.2.3 2001/07/20 13:35:49 cziegeler Exp $
   package org.apache.cocoon.acting;
   
   import java.util.Collections;
  @@ -21,7 +21,7 @@
    * This is the action used to validate Session parameters (attributes).
    * The parameters are described via the external xml
    * file (its format is defined in AbstractValidatorAction).
  - * 
  + *
    * <h3>Variant 1</h3>
    * <pre>
    * &lt;map:act type="session-validator"&gt;
  @@ -53,7 +53,7 @@
    * all validated parameters to the sitemap via {name} expression.
    *
    * @author Martin Man &lt;Martin.Man@seznam.cz&gt;
  - * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/07/13 13:37:50 $
  + * @version CVS $Revision: 1.3.2.3 $ $Date: 2001/07/20 13:35:49 $
    */
   public class SessionValidatorAction extends AbstractValidatorAction
   {
  @@ -77,23 +77,23 @@
               return null;
           }
   
  -	// read global parameter settings
  -	boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  -	if (this.settings.containsKey("reloadable"))
  -	    reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  -	String valsetstr = (String) this.settings.get("validate-set");
  -	String valstr = (String) this.settings.get("validate");
  +    // read global parameter settings
  +    boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +    if (this.settings.containsKey("reloadable"))
  +        reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +    String valsetstr = (String) this.settings.get("validate-set");
  +    String valstr = (String) this.settings.get("validate");
   
           try {
               Configuration conf = this.getConfiguration (
  -                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),

  -		    parameters.getParameterAsBoolean("reloadable",reloadable));
  +                    parameters.getParameter ("descriptor", (String) this.settings.get("descriptor")),
  +            parameters.getParameterAsBoolean("reloadable",reloadable));
               valstr = parameters.getParameter ("validate", valstr);
               valsetstr = parameters.getParameter ("validate-set", valsetstr);
               Configuration[] desc = conf.getChildren ("parameter");
               Configuration[] csets = conf.getChildren ("constraint-set");
               HashMap actionMap = new HashMap ();
  -            /* 
  +            /*
                * old obsoleted method
                */
               if (!"".equals (valstr.trim ())) {
  @@ -130,10 +130,10 @@
                       actionMap.put (name, result.getObject());
                   }
               }
  -            /* 
  +            /*
                * new set-based method
                */
  -            if (!"".equals (valsetstr.trim ())) {
  +            if (valsetstr != null && !"".equals (valsetstr.trim ())) {
                   getLogger ().debug ("SESSIONVALIDATOR: validating parameters "
                           + "from given constraint-set " + valsetstr);
                   Configuration cset = null;
  @@ -149,7 +149,7 @@
                   }
                   if (!found) {
                       getLogger ().debug ("SESSIONVALIDATOR: given set "
  -                            + valsetstr 
  +                            + valsetstr
                               + " does not exist in a description file");
                       return null;
                   }
  @@ -162,7 +162,7 @@
                   String name = null;
                   HashMap params = new HashMap (set.length);
                   getLogger ().debug ("SESSIONVALIDATOR: given set "
  -                        + valsetstr 
  +                        + valsetstr
                           + " contains " + set.length + " rules");
                   /* put required params into hash */
                   for (int i = 0; i < set.length; i ++) {
  @@ -177,7 +177,7 @@
                   }
                   for (int i = 0; i < set.length; i ++) {
                       name = set[i].getAttribute ("name", null);
  -                    result = validateParameter (name, set[i], 
  +                    result = validateParameter (name, set[i],
                               desc, params, false);
                       if (!result.isOK()) {
                           getLogger().debug ("SESSIONVALIDATOR: "
  @@ -198,5 +198,5 @@
       }
   }
   
  -// $Id: SessionValidatorAction.java,v 1.3.2.2 2001/07/13 13:37:50 dims Exp $
  +// $Id: SessionValidatorAction.java,v 1.3.2.3 2001/07/20 13:35:49 cziegeler Exp $
   // vim: set et ts=4 sw=4:
  
  
  

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