haul        01/07/11 01:48:11

  Modified:    src/org/apache/cocoon Constants.java
               src/org/apache/cocoon/acting AbstractAction.java
                        AbstractComplementaryConfigurableAction.java
                        DatabaseAddAction.java
                        DatabaseAuthenticatorAction.java
                        DatabaseDeleteAction.java DatabaseUpdateAction.java
                        FormValidatorAction.java
                        SessionValidatorAction.java
                        ValidatorActionResult.java
  Log:
  Let AbstractAction implement generic code to store global configurarion
  parameters (i.e. those specified in <map:actions>) in a instance variable
  
  Let AbstractComplementaryConfigurableAction check whether it needs
  to reload a descriptior resource after a change
  
  Let involved actions use these new facilities.
  
  Revision  Changes    Path
  1.7       +4 -1      xml-cocoon2/src/org/apache/cocoon/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Constants.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Constants.java    2001/06/15 11:49:18     1.6
  +++ Constants.java    2001/07/11 08:47:41     1.7
  @@ -10,7 +10,7 @@
   
   /**
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.6 $ $Date: 2001/06/15 11:49:18 $
  + * @version CVS $Revision: 1.7 $ $Date: 2001/07/11 08:47:41 $
    */
   
   public interface Constants {
  @@ -70,4 +70,7 @@
       String CONTEXT_CLASSPATH       = "classpath";
       String CONTEXT_CONFIG_URL      = "config-url";
       String CONTEXT_LOG_DIR         = "log-directory";
  +
  +    boolean DESCRIPTOR_RELOADABLE_DEFAULT = true;
  +
   }
  
  
  
  1.3       +31 -4     xml-cocoon2/src/org/apache/cocoon/acting/AbstractAction.java
  
  Index: AbstractAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/AbstractAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractAction.java       2001/05/31 15:38:53     1.2
  +++ AbstractAction.java       2001/07/11 08:47:47     1.3
  @@ -13,22 +13,49 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLoggable;
   
  +import java.util.HashMap;
  +
   /**
    * AbstractAction gives you the infrastructure for easily deploying more
    * Actions.  In order to get at the Logger, use getLogger().
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/31 15:38:53 $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  + * @version CVS $Revision: 1.3 $ $Date: 2001/07/11 08:47:47 $
    */
   public abstract class AbstractAction extends AbstractLoggable
   implements Action, Configurable, Disposable {
   
  +    /**
  +     * Stores (global) configuration parameters as <code>key</code> /
  +     * <code>value</code> pairs.
  +     */
  +    protected HashMap settings = null;
  +
       /**
  -     * Configures the Action.  This implementation currently does nothing.
  +     * Configures the Action.
  +     *
  +     * Takes <code><map:parameter/></code> from action declaration and stores
  +     * them as key (<code>name</code>) and value (<code>value</code>)
  +     * in <code>settings</code>. This way global configuration options
  +     * can be used with actions.
  +     *
  +     * For nested configurations override this function in your
  +     * action.
        */
       public void configure(Configuration conf) throws ConfigurationException {
  -        // Purposely empty so that we don't need to implement it in every
  -        // class.
  +        if (conf != null) {
  +         String key = null;
  +         String val = null;
  +         Configuration[] parameters = conf.getChildren("map:parameter");
  +         this.settings = new HashMap(parameters.length);
  +         for ( int i = 0; i < parameters.length; i++) {
  +             key = parameters[i].getAttribute("name");
  +             val = parameters[i].getAttribute("value");
  +             if ( key != null )
  +                 this.settings.put(key, val);
  +         }
  +     }
       }
   
       /**
  
  
  
  1.6       +50 -17    
xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java
  
  Index: AbstractComplementaryConfigurableAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractComplementaryConfigurableAction.java      2001/07/07 11:43:11     1.5
  +++ AbstractComplementaryConfigurableAction.java      2001/07/11 08:47:48     1.6
  @@ -15,7 +15,14 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
   import org.apache.cocoon.components.source.SourceHandler;
  +import org.apache.cocoon.Roles;
  +import org.apache.cocoon.Constants;
  +import org.apache.cocoon.acting.ConfigurationHelper;
  +import org.apache.cocoon.components.parser.Parser;
  +import org.apache.cocoon.components.url.URLFactory;
   import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.components.source.URLSource;
  +import org.xml.sax.InputSource;
   
   /**
    * Set up environment for configurable form handling data.  This group
  @@ -25,7 +32,7 @@
    * effective.  The name of the root configuration element is irrelevant.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
  - * @version CVS $Revision: 1.5 $ $Date: 2001/07/07 11:43:11 $
  + * @version CVS $Revision: 1.6 $ $Date: 2001/07/11 08:47:48 $
    */
   public abstract class AbstractComplementaryConfigurableAction extends 
ComposerAction {
       private static Map configurations = new HashMap();
  @@ -35,47 +42,73 @@
        * multiple Actions can share the same configurations.  By using
        * this approach, we can limit the number of config files.
        * Also note that the configuration file does not have to be a file.
  +     *
  +     * Defaults to reload configuration file it has changed.
        */
       protected Configuration getConfiguration(String descriptor) throws 
ConfigurationException {
  -        Configuration conf = null;
  +     boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +     if (this.settings.containsKey("reloadable"))
  +         reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +     return this.getConfiguration(descriptor, reloadable);
  +    }
   
  +    /**
  +     * Set up the complementary configuration file.  Please note that
  +     * multiple Actions can share the same configurations.  By using
  +     * this approach, we can limit the number of config files.
  +     * Also note that the configuration file does not have to be a file.
  +     */
  +    protected Configuration getConfiguration(String descriptor, boolean reloadable) 
throws ConfigurationException {
  +        ConfigurationHelper conf = null;
  +
           if (descriptor == null) {
               throw new ConfigurationException("The form descriptor is not set!");
           }
   
           synchronized (AbstractComplementaryConfigurableAction.configurations) {
  -            conf = (Configuration) 
AbstractComplementaryConfigurableAction.configurations.get(descriptor);
  +            conf = (ConfigurationHelper) 
AbstractComplementaryConfigurableAction.configurations.get(descriptor);
   
  -            if (conf == null) {
  +            if (reloadable || conf == null) {
                   SourceHandler sourceHandler = null;
                   Source resource = null;
   
                   try {
                       sourceHandler = (SourceHandler) 
this.manager.lookup(SourceHandler.ROLE);
                       resource = sourceHandler.getSource(null, descriptor);
  -
  -                    SAXConfigurationHandler builder = new SAXConfigurationHandler();
  -                    resource.stream(builder);
   
  -                    conf = builder.getConfiguration();
  -                } catch (Exception e) {
  -                    getLogger().error("Could not configure Database mapping 
environment", e);
  +                 if (conf == null || conf.lastModified < 
resource.getLastModified()) {
  +                     getLogger().debug("(Re)Loading " + descriptor);
  +                     if (conf == null) 
  +                         conf = new ConfigurationHelper();
  +                     
  +                     SAXConfigurationHandler builder = new 
SAXConfigurationHandler();
  +                     resource.stream(builder);
  +                     
  +                     conf.lastModified = resource.getLastModified();
  +                     conf.configuration = builder.getConfiguration();
  +                     
  +                     this.cacheConfiguration(descriptor, conf);
  +                 } else {
  +                     getLogger().debug("Using cached configuration for " + 
descriptor);
  +                 }
  +             } catch (Exception e) {
  +                 getLogger().error("Could not configure Database mapping 
environment", e);
                       throw new ConfigurationException("Error trying to load 
configurations for resource: " + (resource == null ? "null" : resource.getSystemId()));
                   } finally {
                       if (sourceHandler != null) this.manager.release((Component) 
sourceHandler);
  -                }
  -
  -                this.cacheConfiguration(descriptor, conf);
  -            }
  +             }
  +         } else {
  +             getLogger().debug("Using fixed cached configuration for " + 
descriptor);
  +         }
           }
  -
  -        return conf;
  +     
  +        return conf.configuration;
       }
   
       /**
        * Cache the configuration so that we can use it later.
        */
  -    private void cacheConfiguration(String descriptor, Configuration conf) {
  +    private void cacheConfiguration(String descriptor, ConfigurationHelper conf) {
           synchronized (AbstractComplementaryConfigurableAction.configurations) {
               AbstractComplementaryConfigurableAction.configurations.put(descriptor, 
conf);
           }
  
  
  
  1.8       +9 -2      xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAddAction.java
  
  Index: DatabaseAddAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAddAction.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DatabaseAddAction.java    2001/07/07 11:43:12     1.7
  +++ DatabaseAddAction.java    2001/07/11 08:47:49     1.8
  @@ -43,7 +43,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Donald Ball</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2001/07/07 11:43:12 $
  + * @version CVS $Revision: 1.8 $ $Date: 2001/07/11 08:47:49 $
    */
   public class DatabaseAddAction extends AbstractDatabaseAction {
       protected static final Map addStatements = new HashMap();
  @@ -59,8 +59,15 @@
           Connection conn = null;
           Map results = new HashMap();
   
  +     // read global parameter settings
  +     boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +     if (this.settings.containsKey("reloadable"))
  +         reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +     // read local parameter settings
           try {
  -            Configuration conf = 
this.getConfiguration(param.getParameter("form-descriptor", null));
  +            Configuration conf = 
  +             this.getConfiguration(param.getParameter("form-descriptor", (String) 
this.settings.get("descriptor")), 
  +                                   
param.getParameterAsBoolean("reloadable",reloadable));
   
               datasource = this.getDataSource(conf);
               conn = datasource.getConnection();
  
  
  
  1.4       +12 -5     
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
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DatabaseAuthenticatorAction.java  2001/06/05 21:36:20     1.3
  +++ DatabaseAuthenticatorAction.java  2001/07/11 08:47:50     1.4
  @@ -1,4 +1,4 @@
  -// $Id: DatabaseAuthenticatorAction.java,v 1.3 2001/06/05 21:36:20 dims Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.4 2001/07/11 08:47:50 haul Exp $
   package org.apache.cocoon.acting;
   
   import java.sql.Connection;
  @@ -51,7 +51,7 @@
    * not verified.
    *
    * @author Martin Man &lt;[EMAIL PROTECTED]&gt;
  - * @version CVS $Revision: 1.3 $ $Date: 2001/06/05 21:36:20 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/07/11 08:47:50 $
    */
   public class DatabaseAuthenticatorAction extends AbstractDatabaseAction
   {
  @@ -63,11 +63,18 @@
           DataSourceComponent datasource = null;
           Connection conn = null;
   
  +     // read global parameter settings
  +     boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +     if (this.settings.containsKey("reloadable"))
  +         reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +     // read local settings
           try {
               Configuration conf = this.getConfiguration (
  -                    parameters.getParameter ("descriptor", null));
  +                    parameters.getParameter ("descriptor", (String) 
this.settings.get("descriptor")), 
  +                 parameters.getParameterAsBoolean("reloadable",reloadable));
               boolean cs = true;
  -            String create_session = parameters.getParameter ("create-session", 
null);
  +            String create_session = parameters.getParameter ("create-session", 
  +                                                          (String) 
this.settings.get("create-session"));
               if (create_session != null &&
                       ("no".equals (create_session.trim ()) || "false".equals 
(create_session.trim ()))) {
                   cs = false;
  @@ -224,5 +231,5 @@
       }
   }
   
  -// $Id: DatabaseAuthenticatorAction.java,v 1.3 2001/06/05 21:36:20 dims Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.4 2001/07/11 08:47:50 haul Exp $
   // vim: set et ts=4 sw=4:
  
  
  
  1.5       +10 -2     
xml-cocoon2/src/org/apache/cocoon/acting/DatabaseDeleteAction.java
  
  Index: DatabaseDeleteAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseDeleteAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatabaseDeleteAction.java 2001/07/07 11:43:12     1.4
  +++ DatabaseDeleteAction.java 2001/07/11 08:47:52     1.5
  @@ -38,7 +38,7 @@
    * the keys.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
  - * @version CVS $Revision: 1.4 $ $Date: 2001/07/07 11:43:12 $
  + * @version CVS $Revision: 1.5 $ $Date: 2001/07/11 08:47:52 $
    */
   public final class DatabaseDeleteAction extends AbstractDatabaseAction {
       private static final Map deleteStatements = new HashMap();
  @@ -53,8 +53,16 @@
           Connection conn = null;
           int currentIndex = 0;
   
  +     // read global parameter settings
  +     boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +     if (this.settings.containsKey("reloadable"))
  +         reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +     // read local parameter settings
           try {
  -            Configuration conf = 
this.getConfiguration(param.getParameter("form-descriptor", null));
  +            Configuration conf = 
  +             this.getConfiguration(param.getParameter("form-descriptor", (String) 
this.settings.get("descriptor")), 
  +                                   
param.getParameterAsBoolean("reloadable",reloadable));
  +
               String query = this.getDeleteQuery(conf);
               datasource = this.getDataSource(conf);
               conn = datasource.getConnection();
  
  
  
  1.5       +10 -2     
xml-cocoon2/src/org/apache/cocoon/acting/DatabaseUpdateAction.java
  
  Index: DatabaseUpdateAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseUpdateAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DatabaseUpdateAction.java 2001/07/07 11:43:12     1.4
  +++ DatabaseUpdateAction.java 2001/07/11 08:47:53     1.5
  @@ -35,7 +35,7 @@
    * only one table at a time to update.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Berin Loritsch</a>
  - * @version CVS $Revision: 1.4 $ $Date: 2001/07/07 11:43:12 $
  + * @version CVS $Revision: 1.5 $ $Date: 2001/07/11 08:47:53 $
    */
   public class DatabaseUpdateAction extends AbstractDatabaseAction {
       private static final Map updateStatements = new HashMap();
  @@ -50,8 +50,16 @@
           Connection conn = null;
           int currentIndex = 0;
   
  +     // read global parameter settings
  +     boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT;
  +     if (this.settings.containsKey("reloadable"))
  +         reloadable = Boolean.getBoolean((String) this.settings.get("reloadable"));
  +     // read local parameter settings
           try {
  -            Configuration conf = 
this.getConfiguration(param.getParameter("form-descriptor", null));
  +            Configuration conf = 
  +             this.getConfiguration(param.getParameter("form-descriptor", (String) 
this.settings.get("descriptor")), 
  +                                   
param.getParameterAsBoolean("reloadable",reloadable));
  +
               String query = this.getUpdateQuery(conf);
               datasource = this.getDataSource(conf);
               conn = datasource.getConnection();
  
  
  
  1.7       +12 -4     
xml-cocoon2/src/org/apache/cocoon/acting/FormValidatorAction.java
  
  Index: FormValidatorAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/FormValidatorAction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FormValidatorAction.java  2001/07/07 11:43:12     1.6
  +++ FormValidatorAction.java  2001/07/11 08:47:55     1.7
  @@ -1,4 +1,4 @@
  -// $Id: FormValidatorAction.java,v 1.6 2001/07/07 11:43:12 giacomo Exp $
  +// $Id: FormValidatorAction.java,v 1.7 2001/07/11 08:47:55 haul Exp $
   package org.apache.cocoon.acting;
   
   import java.util.Collections;
  @@ -57,7 +57,8 @@
    * the result is not available for the target page.
    *
    * @author Martin Man &lt;[EMAIL PROTECTED]&gt;
  - * @version CVS $Revision: 1.6 $ $Date: 2001/07/07 11:43:12 $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Christian Haul</a>
  + * @version CVS $Revision: 1.7 $ $Date: 2001/07/11 08:47:55 $
    */
   public class FormValidatorAction extends AbstractValidatorAction
   {
  @@ -75,9 +76,16 @@
               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 constraints = (String) this.settings.get("constraint-set");
  +     // read local settings
           try {
               Configuration conf = this.getConfiguration (
  -                    parameters.getParameter ("descriptor", null));
  +                    parameters.getParameter ("descriptor", (String) 
this.settings.get("descriptor")), 
  +                 parameters.getParameterAsBoolean("reloadable", reloadable));
               String valstr = parameters.getParameter ("validate", "");
               String valsetstr = parameters.getParameter ("validate-set", "");
               Configuration[] desc = conf.getChildren ("parameter");
  @@ -200,5 +208,5 @@
       }
   }
   
  -// $Id: FormValidatorAction.java,v 1.6 2001/07/07 11:43:12 giacomo Exp $
  +// $Id: FormValidatorAction.java,v 1.7 2001/07/11 08:47:55 haul Exp $
   // vim: set et ts=4 sw=4:
  
  
  
  1.5       +14 -6     
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SessionValidatorAction.java       2001/06/15 11:49:20     1.4
  +++ SessionValidatorAction.java       2001/07/11 08:47:56     1.5
  @@ -1,4 +1,4 @@
  -// $Id: SessionValidatorAction.java,v 1.4 2001/06/15 11:49:20 dims Exp $
  +// $Id: SessionValidatorAction.java,v 1.5 2001/07/11 08:47:56 haul Exp $
   package org.apache.cocoon.acting;
   
   import java.util.Collections;
  @@ -53,7 +53,7 @@
    * all validated parameters to the sitemap via {name} expression.
    *
    * @author Martin Man &lt;[EMAIL PROTECTED]&gt;
  - * @version CVS $Revision: 1.4 $ $Date: 2001/06/15 11:49:20 $
  + * @version CVS $Revision: 1.5 $ $Date: 2001/07/11 08:47:56 $
    */
   public class SessionValidatorAction extends AbstractValidatorAction
   {
  @@ -77,11 +77,19 @@
               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");
  +
           try {
               Configuration conf = this.getConfiguration (
  -                    parameters.getParameter ("descriptor", null));
  -            String valstr = parameters.getParameter ("validate", "");
  -            String valsetstr = parameters.getParameter ("validate-set", "");
  +                    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 ();
  @@ -190,5 +198,5 @@
       }
   }
   
  -// $Id: SessionValidatorAction.java,v 1.4 2001/06/15 11:49:20 dims Exp $
  +// $Id: SessionValidatorAction.java,v 1.5 2001/07/11 08:47:56 haul Exp $
   // vim: set et ts=4 sw=4:
  
  
  
  1.3       +58 -35    
xml-cocoon2/src/org/apache/cocoon/acting/ValidatorActionResult.java
  
  Index: ValidatorActionResult.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/ValidatorActionResult.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ValidatorActionResult.java        2001/06/15 11:49:20     1.2
  +++ ValidatorActionResult.java        2001/07/11 08:47:58     1.3
  @@ -12,44 +12,67 @@
    * A number of constants to represent the possible outcomes of a
    * validation.
    *
  - * <table>
  - * <tr><td>OK</td><td>no error occurred, parameter successfully checked</td></tr>
  - * <tr><td>ERROR</td><td>some error occurred, this is a result that is never set
  - *                       but serves as a comparison target</td></tr>
  - * <tr><td>ISNULL</td><td>the parameter is null but isn't allowed to</td></tr>
  - * <tr><td>TOOSMALL</td><td>either value or length in case of a string is less 
  - *                          than the specified minimum</td></tr>
  - * <tr><td>TOOLARGE</td><td>either value or length in case of a string is greater 
  - *                          than the specified maximum</td></tr>
  - * <tr><td>NOMATCH</td><td>a string parameter's value is not matched by the 
specified
  - *                         regular expression</td></tr>
  - * <tr><td>NOTPRESENT</td><td>this is returned when the result of a validation is 
  - *                            requested but no such result is found in the request 
attribute
  - *                   </td></tr>
  - * </table>
  - *
    * @author Christian Haul &lt;[EMAIL PROTECTED]&gt;
  - * @version CVS $Revision: 1.2 $ $Date: 2001/06/15 11:49:20 $ 
  + * @version CVS $Revision: 1.3 $ $Date: 2001/07/11 08:47:58 $ 
    */
   
   public class ValidatorActionResult extends EnumerationFactory {
   
  -  public static final ValidatorActionResult
  -    OK         = new ValidatorActionResult ("OK"),          // 0
  -    ERROR      = new ValidatorActionResult ("ERROR"),       // 1
  -    ISNULL     = new ValidatorActionResult ("ISNULL"),      // 2
  -    TOOSMALL   = new ValidatorActionResult ("TOOSMALL"),    // 3
  -    TOOLARGE   = new ValidatorActionResult ("TOOLARGE"),    // 4
  -    NOMATCH    = new ValidatorActionResult ("NOMATCH"),     // 5
  -    NOTPRESENT = new ValidatorActionResult ("NOTPRESENT");  // 6
  -
  -  /**
  -   * Make constructor private to inhibit creation outside.
  -   */
  -  private ValidatorActionResult (String image) {
  -    super (image);
  -  }
  -  private ValidatorActionResult () {
  -    super ();
  -  }
  +     /**
  +      * no error occurred, parameter successfully checked.
  +      */
  +    public static final ValidatorActionResult
  +     OK         = new ValidatorActionResult ("OK");          // 0
  +    
  +     /**
  +      * some error occurred, this is a result that is never set but
  +      * serves as a comparison target. 
  +      */
  +    public static final ValidatorActionResult
  +     ERROR      = new ValidatorActionResult ("ERROR");       // 1
  +
  +     /**
  +      * the parameter is null but isn't allowed to.
  +      */
  +    public static final ValidatorActionResult
  +     ISNULL     = new ValidatorActionResult ("ISNULL");      // 2
  +
  +     /**
  +      * either value or length in case of a string is less than the
  +      * specified minimum.
  +      */
  +    public static final ValidatorActionResult
  +     TOOSMALL   = new ValidatorActionResult ("TOOSMALL");    // 3
  +
  +     /**
  +      * either value or length in case of a string is greater than
  +      * the specified maximum.
  +      */
  +    public static final ValidatorActionResult
  +     TOOLARGE   = new ValidatorActionResult ("TOOLARGE");    // 4
  +
  +     /**
  +      * a string parameter's value is not matched by the specified
  +      * regular expression.
  +      */
  +    public static final ValidatorActionResult
  +     NOMATCH    = new ValidatorActionResult ("NOMATCH");     // 5
  +
  +     /**
  +      * this is returned when the result of a validation is
  +      * requested but no such result is found in the request
  +      * attribute.
  +      */
  +    public static final ValidatorActionResult
  +     NOTPRESENT = new ValidatorActionResult ("NOTPRESENT");  // 6
  +
  +    /**
  +     * Make constructor private to inhibit creation outside.
  +     */
  +    private ValidatorActionResult (String image) {
  +     super (image);
  +    }
  +    private ValidatorActionResult () {
  +     super ();
  +    }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to