jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r781299 - in /jackrabbit/trunk/jackrabbit-spi2jcr: pom.xml src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java
Date Wed, 03 Jun 2009 08:29:31 GMT
Author: angela
Date: Wed Jun  3 08:29:31 2009
New Revision: 781299

URL: http://svn.apache.org/viewvc?rev=781299&view=rev
Log:
JCR-2108: JSR 283 Observation   (work in progress)

- properly handle null value in Event info
- use proper value type (Path)

Modified:
    jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
    jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml?rev=781299&r1=781298&r2=781299&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/pom.xml Wed Jun  3 08:29:31 2009
@@ -69,7 +69,6 @@
               <value>
                 org.apache.jackrabbit.jcr2spi.name.NamespaceRegistryTest#testReRegisteredNamespaceVisibility
                 org.apache.jackrabbit.jcr2spi.name.NamespaceRegistryTest#testRegisteredNamespaceVisibility
-                org.apache.jackrabbit.test.api.observation.NodeReorderTest
                 org.apache.jackrabbit.test.api.observation.EventJournalTest
               </value>
             </property>

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java?rev=781299&r1=781298&r2=781299&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java
Wed Jun  3 08:29:31 2009
@@ -30,6 +30,7 @@
 import org.apache.jackrabbit.spi.commons.EventImpl;
 import org.apache.jackrabbit.spi.commons.EventBundleImpl;
 import org.apache.jackrabbit.spi.commons.EventFilterImpl;
+import org.apache.jackrabbit.spi.commons.value.ValueFormat;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
 import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
@@ -289,11 +290,17 @@
                 Map jcrInfo = e.getInfo();
                 for (Iterator it = jcrInfo.keySet().iterator(); it.hasNext();) {
                     String key = it.next().toString();
-                    Name name = resolver.getQName(key);
-                    // TODO: review again. how to determine value type?
-                    QValue v = qValueFactory.create(jcrInfo.get(key).toString(), PropertyType.STRING);
-                    info.put(name, v);
+                    Object value = jcrInfo.get(key);
 
+                    Name name = resolver.getQName(key);
+                    if (value != null) {
+                        // event information is generated for NODE_MOVED only in which
+                        // case all values are of type PATH.
+                        QValue v = ValueFormat.getQValue(value.toString(), PropertyType.PATH,
resolver, qValueFactory);
+                        info.put(name, v);
+                    } else {
+                        info.put(name, null);
+                    }
                 }
                 Event spiEvent = new EventImpl(e.getType(), p, itemId, parentId,
                         nodeTypeName, mixinTypes, e.getUserID(), e.getUserData(), e.getDate(),
info);



Mime
View raw message