cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r216005 - in /cocoon: blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/ blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/ blocks/forms/trunk/java/org/apache/cocoon/forms/validation/ blocks/forms/trunk/jav...
Date Tue, 12 Jul 2005 19:25:47 GMT
Author: cziegeler
Date: Tue Jul 12 12:25:46 2005
New Revision: 216005

URL: http://svn.apache.org/viewcvs?rev=216005&view=rev
Log:
Make all WidgetValidatorBuilders ThreadSafe. Reset validation errors
before validating a field.

Modified:
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Field.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/WidgetValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java
    cocoon/trunk/status.xml

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java
Tue Jul 12 12:25:46 2005
@@ -34,10 +34,15 @@
  *
  * @version $Id$
  */
-public abstract class AbstractValidationRuleBuilder implements ValidationRuleBuilder, Serviceable,
Disposable {
+public abstract class AbstractValidationRuleBuilder 
+    implements ValidationRuleBuilder, Serviceable, Disposable {
+
     protected ExpressionManager expressionManager;
     protected ServiceManager serviceManager;
 
+    /**
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     */
     public void service(ServiceManager serviceManager) throws ServiceException {
         this.serviceManager = serviceManager;
         this.expressionManager = (ExpressionManager)serviceManager.lookup(ExpressionManager.ROLE);

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Field.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Field.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Field.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Field.java Tue Jul 12
12:25:46 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -272,6 +272,9 @@
         }
     }
 
+    /**
+     * @see org.apache.cocoon.forms.formmodel.Widget#validate()
+     */
     public boolean validate() {
         if (!getCombinedState().isValidatingValues()) {
             this.wasValid = true;
@@ -350,6 +353,9 @@
 
         // Go to transient validating state
         this.valueState = VALUE_VALIDATING;
+
+        // reset validation errot
+        this.validationError = null;
 
         try {
             if (this.value == null && getFieldDefinition().isRequired()) {

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/WidgetValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/WidgetValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/WidgetValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/WidgetValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -25,7 +25,7 @@
  */
 public interface WidgetValidatorBuilder {
     
-    static final String ROLE = WidgetValidatorBuilder.class.getName();
+    String ROLE = WidgetValidatorBuilder.class.getName();
     
     /**
      * Builds a {@link WidgetValidator} for a particular widget definition.

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.AssertValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,12 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class AssertValidatorBuilder extends AssertValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class AssertValidatorBuilder extends AssertValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }    

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.EmailValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,12 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class EmailValidatorBuilder extends EmailValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class EmailValidatorBuilder extends EmailValidationRuleBuilder 
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -33,7 +33,8 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class JavaScriptValidatorBuilder implements WidgetValidatorBuilder, Contextualizable,
ThreadSafe {
+public class JavaScriptValidatorBuilder 
+    implements WidgetValidatorBuilder, Contextualizable, ThreadSafe {
     
     private Context avalonContext;
     

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.LengthValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,13 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class LengthValidatorBuilder extends LengthValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class LengthValidatorBuilder 
+    extends LengthValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.Mod10ValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,13 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class Mod10ValidatorBuilder extends Mod10ValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class Mod10ValidatorBuilder 
+    extends Mod10ValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.RangeValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,13 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class RangeValidatorBuilder extends RangeValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class RangeValidatorBuilder 
+    extends RangeValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.RegExpValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,13 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class RegExpValidatorBuilder extends RegExpValidationRuleBuilder implements WidgetValidatorBuilder
{
+public class RegExpValidatorBuilder
+    extends RegExpValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java
Tue Jul 12 12:25:46 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.forms.validation.impl;
 
+import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.forms.datatype.validationruleimpl.ValueCountValidationRuleBuilder;
 import org.apache.cocoon.forms.formmodel.WidgetDefinition;
 import org.apache.cocoon.forms.validation.WidgetValidator;
@@ -27,8 +28,13 @@
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-public class ValueCountValidatorBuilder extends ValueCountValidationRuleBuilder implements
WidgetValidatorBuilder {
+public class ValueCountValidatorBuilder
+    extends ValueCountValidationRuleBuilder
+    implements WidgetValidatorBuilder, ThreadSafe {
 
+    /**
+     * @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element,
org.apache.cocoon.forms.formmodel.WidgetDefinition)
+     */
     public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition)
throws Exception {
         return new ValidationRuleValidator(super.build(validationRuleElement));
     }

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Tue Jul 12 12:25:46 2005
@@ -481,6 +481,10 @@
   </release>
   <release version="2.1.8" date="TBD">
     <action dev="CZ" type="add">
+      CForms block: Make all WidgetValidatorBuilders ThreadSafe. Reset validation errors
+                    before validating a field.
+    </action>     
+    <action dev="CZ" type="add">
       Portal block: Add portal manager aspects for more flexible portal processing.
     </action>
     <action dev="CZ" type="add">



Mime
View raw message