incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r619855 - in /incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax: ChangeLog.java UjaxPostProcessor.java
Date Fri, 08 Feb 2008 12:11:07 GMT
Author: fmeschbe
Date: Fri Feb  8 04:11:05 2008
New Revision: 619855

URL: http://svn.apache.org/viewvc?rev=619855&view=rev
Log:
SLING-239 committing provided patch as temporary fix, see issue for discussion

Modified:
    incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/ChangeLog.java
    incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/UjaxPostProcessor.java

Modified: incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/ChangeLog.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/ChangeLog.java?rev=619855&r1=619854&r2=619855&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/ChangeLog.java
(original)
+++ incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/ChangeLog.java
Fri Feb  8 04:11:05 2008
@@ -80,4 +80,24 @@
             out.append(lf);
         }
     }
+
+    /**
+     * Look if item is prepared for deletion.
+     *
+     * @param path item path
+     * @return true if prepared for deletion
+     */
+    public boolean isDeleted(String path) {
+        for (Change c: changes) {
+            if (c.getType() == Change.Type.DELETED) {
+                if (c.getArguments().length > 0) {
+                    String delPath = c.getArguments()[0];
+                    if (delPath.equals(path)) {
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
 }

Modified: incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/UjaxPostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/UjaxPostProcessor.java?rev=619855&r1=619854&r2=619855&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/UjaxPostProcessor.java
(original)
+++ incubator/sling/trunk/launchpad/launchpad-servlets/src/main/java/org/apache/sling/ujax/UjaxPostProcessor.java
Fri Feb  8 04:11:05 2008
@@ -399,6 +399,10 @@
 
         }
         // create or get node
+        if (changeLog.isDeleted(nodePath)) {
+            // TODO: correct?
+            return;
+        }
         currentNode = deepGetOrCreateNode(null, nodePath);
         currentPath = currentNode.getPath();
 



Mime
View raw message