jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1138872 - /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Date Thu, 23 Jun 2011 13:34:39 GMT
Author: mduerig
Date: Thu Jun 23 13:34:39 2011
New Revision: 1138872

URL: http://svn.apache.org/viewvc?rev=1138872&view=rev
Log:
spi2microkernel prototype (WIP)
observation (WIP): setPorperty, removeProperty

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1138872&r1=1138871&r2=1138872&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Thu Jun 23 13:34:39 2011
@@ -302,8 +302,26 @@ public class SubscriptionImpl implements
         }
 
         private void setProperty(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
-            // todo implement setProperty
-            // Event#PROPERTY_REMOVED} Event#PROPERTY_CHANGED}
+            Path path = Paths.stringToPath(jsopTokenizer.readString());
+            NodeId parentId = createNodeId(getParent(path));
+
+            EventTemplate setPropertyEvent = eventTemplate.copy();
+            setPropertyEvent.setPath(path);
+            setPropertyEvent.setParentId(parentId);
+            setPropertyEvent.setItemId(createNodeId(path));
+            // todo set primaryType, mixinTypes this needs context in the journal
+            // fixme it seems type based filtering does not respect the type hierarchy (see
JCR-2542)
+
+            jsopTokenizer.read(':');
+            if (jsopTokenizer.read() == JsopTokenizer.NULL) {
+                setPropertyEvent.setType(Event.PROPERTY_REMOVED);
+            }
+            else {
+                setPropertyEvent.setType(Event.PROPERTY_CHANGED);
+            }
+
+            events.add(setPropertyEvent.buildEvent());
+            // todo consider ways to generate events of (large) sub tree
         }
 
         private void moveNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate, Collection<Event>
events) {



Mime
View raw message