lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject svn commit: r178175 - /lenya/trunk/src/webapp/lenya/usecases/edit-document.js
Date Tue, 24 May 2005 14:47:15 GMT
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


Mime
View raw message