cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel Action.java AggregateField.java BooleanField.java Field.java Form.java Messages.java MultiValueField.java Output.java Repeater.java Union.java Upload.java
Date Fri, 30 Apr 2004 12:19:01 GMT
bruno       2004/04/30 05:19:01

  Modified:    src/blocks/forms/java/org/apache/cocoon/forms/formmodel
                        Action.java AggregateField.java BooleanField.java
                        Field.java Form.java Messages.java
                        MultiValueField.java Output.java Repeater.java
                        Union.java Upload.java
  Log:
  Drop FormContext from validate method.
  
  Revision  Changes    Path
  1.9       +3 -3      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Action.java
  
  Index: Action.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Action.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Action.java	28 Apr 2004 13:11:10 -0000	1.8
  +++ Action.java	30 Apr 2004 12:19:01 -0000	1.9
  @@ -86,9 +86,9 @@
       /**
        * Always return <code>true</code> (an action has no validation)
        * 
  -     * @todo is there a use case for actions having validators?
  +     * TODO is there a use case for actions having validators?
        */
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           return true;
       }
   
  
  
  
  1.8       +4 -4      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateField.java
  
  Index: AggregateField.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/AggregateField.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AggregateField.java	23 Apr 2004 23:33:48 -0000	1.7
  +++ AggregateField.java	30 Apr 2004 12:19:01 -0000	1.8
  @@ -184,7 +184,7 @@
           }
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           if ((enteredValue != null) != fieldsHaveValues()) {
               XMLizable failMessage = getAggregateFieldDefinition().getSplitFailMessage();
               if (failMessage != null) {
  @@ -200,13 +200,13 @@
           // validate my child fields
           for (Iterator i = fields.iterator(); i.hasNext();) {
               Field field = (Field)i.next();
  -            if (!field.validate(formContext)) {
  +            if (!field.validate()) {
                   validationError = field.getValidationError();
                   return false;
               }
           }
   
  -        return super.validate(formContext);
  +        return super.validate();
       }
   
       private static final String AGGREGATEFIELD_EL = "aggregatefield";
  
  
  
  1.9       +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
  
  Index: BooleanField.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BooleanField.java	28 Apr 2004 13:11:10 -0000	1.8
  +++ BooleanField.java	30 Apr 2004 12:19:01 -0000	1.9
  @@ -71,7 +71,7 @@
        * 
        * TODO is there a use case for boolean fields having validators?
        */
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           // a boolean field is always valid
           return true;
       }
  
  
  
  1.13      +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Field.java	28 Apr 2004 16:34:12 -0000	1.12
  +++ Field.java	30 Apr 2004 12:19:01 -0000	1.13
  @@ -187,7 +187,7 @@
           this.needsValidate = true;
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           // If needed, getValue() will do the validation
           getValue();
           return this.validationError == null;
  
  
  
  1.13      +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java
  
  Index: Form.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Form.java	28 Apr 2004 16:34:12 -0000	1.12
  +++ Form.java	30 Apr 2004 12:19:01 -0000	1.13
  @@ -289,7 +289,7 @@
           super.readFromRequest(formContext); 
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           throw new UnsupportedOperationException("Please use Form.process()");
       }
   
  
  
  
  1.8       +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Messages.java
  
  Index: Messages.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Messages.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Messages.java	22 Apr 2004 14:26:48 -0000	1.7
  +++ Messages.java	30 Apr 2004 12:19:01 -0000	1.8
  @@ -55,7 +55,7 @@
           messages.clear();
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           return messages.size() == 0;
       }
   
  
  
  
  1.9       +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
  
  Index: MultiValueField.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MultiValueField.java	28 Apr 2004 16:34:12 -0000	1.8
  +++ MultiValueField.java	30 Apr 2004 12:19:01 -0000	1.9
  @@ -93,7 +93,7 @@
           }
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           if (values != null)
               validationError = definition.getDatatype().validate(values, new ExpressionContextImpl(this));
           else
  
  
  
  1.8       +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Output.java
  
  Index: Output.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Output.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Output.java	22 Apr 2004 14:26:48 -0000	1.7
  +++ Output.java	30 Apr 2004 12:19:01 -0000	1.8
  @@ -58,7 +58,7 @@
           // do nothing
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           return true;
       }
   
  
  
  
  1.11      +4 -4      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Repeater.java
  
  Index: Repeater.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Repeater.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Repeater.java	28 Apr 2004 16:34:12 -0000	1.10
  +++ Repeater.java	30 Apr 2004 12:19:01 -0000	1.11
  @@ -224,12 +224,12 @@
           }
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           boolean valid = true;
           Iterator rowIt = rows.iterator();
           while (rowIt.hasNext()) {
               RepeaterRow row = (RepeaterRow)rowIt.next();
  -            valid = valid & row.validate(formContext);
  +            valid = valid & row.validate();
           }
           return valid ? super.validate() : false;
       }
  @@ -349,7 +349,7 @@
               throw new RuntimeException("Parent of RepeaterRow is fixed, and cannot be set.");
           }
   
  -        public boolean validate(FormContext formContext) {
  +        public boolean validate() {
               // Validate only child widtgets, as the definition's validators are those of
the parent repeater
               return widgets.validate();
           }
  
  
  
  1.10      +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java
  
  Index: Union.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Union.java	28 Apr 2004 16:34:12 -0000	1.9
  +++ Union.java	30 Apr 2004 12:19:01 -0000	1.10
  @@ -88,7 +88,7 @@
       }
   
       // TODO: Simplify this logic.
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           Widget widget;
           boolean valid = true;
           // Read current case from request
  
  
  
  1.9       +2 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
  
  Index: Upload.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Upload.java	28 Apr 2004 16:34:12 -0000	1.8
  +++ Upload.java	30 Apr 2004 12:19:01 -0000	1.9
  @@ -92,7 +92,7 @@
           // And keep the current state if the parameter doesn't exist or is null
       }
   
  -    public boolean validate(FormContext formContext) {
  +    public boolean validate() {
           if (this.part == null) {
               if (this.uploadDefinition.isRequired()) {
                   this.validationError = new ValidationError(new I18nMessage("general.field-required",
Constants.I18N_CATALOGUE));
  
  
  

Mime
View raw message