You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/05/24 16:47:15 UTC

svn commit: r178175 - /lenya/trunk/src/webapp/lenya/usecases/edit-document.js

Author: andreas
Date: Tue May 24 07:47:14 2005
New Revision: 178175

URL: http://svn.apache.org/viewcvs?rev=178175&view=rev
Log:
editDocument.js: added pre-execution error checking

Modified:
    lenya/trunk/src/webapp/lenya/usecases/edit-document.js

Modified: lenya/trunk/src/webapp/lenya/usecases/edit-document.js
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/usecases/edit-document.js?rev=178175&r1=178174&r2=178175&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/usecases/edit-document.js (original)
+++ lenya/trunk/src/webapp/lenya/usecases/edit-document.js Tue May 24 07:47:14 2005
@@ -24,6 +24,12 @@
  * @version $Id$
  */
 
+function checkoutDocument() {
+}
+
+function checkinDocument() {
+}
+
 /**
  * Saves a Source to the document in the current PageEnvelope.
  * TODO: Use nobby's new usecase fw in 1.4 branch. Exception handling e.g. display appropriate error pages.
@@ -59,8 +65,15 @@
 
         usecase.checkPreconditions();
         usecase.lockInvolvedObjects();
-        
-        usecase.execute();
+        if (!usecase.getErrorMessages().isEmpty()) {
+            throw new Exception("Checking pre-conditions or locking failed!");
+        }
+        else {
+            usecase.execute();
+            if (usecase.getErrorMessages().isEmpty()) {
+                // TODO: handle error messages
+            }
+        }
 
         if (cocoon.log.isDebugEnabled()) {
             cocoon.log.debug("edit-document.js::editDocument() after usecase.execute(), hasErrors ? " + usecase.hasErrors());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org