cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r419821 - /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
Date Fri, 07 Jul 2006 06:15:12 GMT
Author: cziegeler
Date: Thu Jul  6 23:15:12 2006
New Revision: 419821

URL: http://svn.apache.org/viewvc?rev=419821&view=rev
Log:
Lax phase checking

Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java?rev=419821&r1=419820&r2=419821&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
Thu Jul  6 23:15:12 2006
@@ -182,48 +182,36 @@
      * Inform the form that the values will be loaded.
      */
     public void informStartLoadingModel() {
-        if (this.phase != ProcessingPhase.LOAD_MODEL) {
-            throw new IllegalStateException("Cannot load form in phase " + this.phase);
-        }
+        // nothing to do here
+        // TODO - we could remove this method?
     }
 
     /**
      * Inform the form that the values are loaded.
      */
     public void informEndLoadingModel() {
-        // Notify the end of the current phase
+        // Notify the end of the load phase
         if (this.listener != null) {
-            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
+            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.LOAD_MODEL));
         }
-        // TODO - Should we change the phase?
     }
 
     /**
      * Inform the form that the values will be saved.
      */
     public void informStartSavingModel() {
-        if (this.phase != ProcessingPhase.VALIDATE) {
-            throw new IllegalStateException("Cannot save model in phase " + this.phase);
-        }
-        if (!isValid()) {
-            throw new IllegalStateException("Cannot save an invalid form.");
-        }
-        this.phase = ProcessingPhase.SAVE_MODEL;
+        // nothing to do here
+        // TODO - we could remove this method?
     }
 
     /**
      * Inform the form that the values are saved.
      */
     public void informEndSavingModel() {
-        if (this.phase != ProcessingPhase.SAVE_MODEL) {
-            throw new IllegalStateException("Cannot save model in phase " + this.phase);
-        }
-        // Notify the end of the current phase
+        // Notify the end of the save phase
         if (this.listener != null) {
-            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
+            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.SAVE_MODEL));
         }
-        // go back to initial phase
-        this.phase = ProcessingPhase.LOAD_MODEL;
     }
 
     /**



Mime
View raw message