jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1232549 - in /jackrabbit/branches/2.4: ./ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/ jackrabbit-spi2dav/src/main/java/org/apache...
Date Tue, 17 Jan 2012 19:31:27 GMT
Author: jukka
Date: Tue Jan 17 19:31:26 2012
New Revision: 1232549

URL: http://svn.apache.org/viewvc?rev=1232549&view=rev
Log:
2.4: Merged revisions 1232035 and 1232404 from trunk

Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
    jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
    jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
    jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
    jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
    jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 17 19:31:26 2012
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1231204,1232100
+/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1231204,1232035,1232100,1232404

Modified: jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
Tue Jan 17 19:31:26 2012
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.webdav.jcr.observation;
 
 import org.apache.jackrabbit.commons.webdav.EventUtil;
-import org.apache.jackrabbit.commons.webdav.JcrRemotingConstants;
 import org.apache.jackrabbit.server.SessionProviderImpl;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.AdditionalEventInfo;
@@ -45,12 +44,9 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import com.sun.org.apache.xalan.internal.xsltc.dom.ExtendedSAX;
-
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.Value;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.EventIterator;
 import javax.jcr.observation.EventListener;
@@ -476,8 +472,7 @@ public class SubscriptionImpl implements
                                     .getSessionAttribute(SessionProviderImpl.ATTRIBUTE_SESSION_ID);
                             boolean isLocal = forSessionId
                                     .equals(eventforSessionId);
-                            DomUtil.setAttribute(bundle, XML_EVENT_LOCAL,
-                                    NAMESPACE, Boolean.toString(isLocal));
+                            DomUtil.setAttribute(bundle, XML_EVENT_LOCAL, null, Boolean.toString(isLocal));
                         } catch (UnsupportedRepositoryOperationException ex) {
                             // optional feature
                         }

Modified: jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/lock/AbstractLockTest.java
Tue Jan 17 19:31:26 2012
@@ -149,7 +149,7 @@ public abstract class AbstractLockTest e
     /**
      * Test {@link javax.jcr.lock.Lock#getNode()}.
      *
-     * @throws RepositoryException If an execption occurs.
+     * @throws RepositoryException If an exception occurs.
      */
     public void testLockHoldingNode() throws RepositoryException {
         assertTrue("Lock.getNode() must be lockholding node.", lock.getNode().isSame(lockedNode));
@@ -158,7 +158,7 @@ public abstract class AbstractLockTest e
     /**
      * Test {@link LockManager#isLocked(String)} and {@link javax.jcr.Node#isLocked()}.
      *
-     * @throws RepositoryException If an execption occurs.
+     * @throws RepositoryException If an exception occurs.
      */
     public void testNodeIsLocked() throws RepositoryException {
         assertTrue("Node must be locked after lock creation.", lockedNode.isLocked());
@@ -168,7 +168,7 @@ public abstract class AbstractLockTest e
     /**
      * Test {@link LockManager#holdsLock(String)} and {@link javax.jcr.Node#holdsLock()}.

      *
-     * @throws RepositoryException If an execption occurs.
+     * @throws RepositoryException If an exception occurs.
      */
     public void testNodeHoldsLocked() throws RepositoryException {
         assertTrue("Node must hold lock after lock creation.", lockedNode.holdsLock());
@@ -201,7 +201,7 @@ public abstract class AbstractLockTest e
     /**
      * Test {@link javax.jcr.lock.Lock#isLockOwningSession()}
      *
-     * @throws RepositoryException If an execption occurs.
+     * @throws RepositoryException If an exception occurs.
      */
     public void testIsLockOwningSession() throws RepositoryException {
         assertTrue("Session must be lock owner", lock.isLockOwningSession());
@@ -429,7 +429,7 @@ public abstract class AbstractLockTest e
             lockedNode.removeMixin(mixLockable);
             lockedNode.save();
 
-            // the mixin got removed -> the lock should implicitely be released
+            // the mixin got removed -> the lock should implicitly be released
             // as well in order not to have inconsistencies
             String msg = "Lock should have been released.";
             assertFalse(msg, lock.isLive());

Modified: jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
Tue Jan 17 19:31:26 2012
@@ -61,11 +61,10 @@ public class EventImpl
             Element eventElement, NamePathResolver resolver, QValueFactory qvFactory) throws
NamespaceException,
             IllegalNameException {
         super(getSpiEventType(eventType), eventPath, eventId, parentId, getNameSafe(
-                DomUtil.getChildTextTrim(eventElement, XML_EVENTPRIMARNODETYPE, NAMESPACE),
resolver), getNames(
-                DomUtil.getChildren(eventElement, XML_EVENTMIXINNODETYPE, NAMESPACE), resolver),
userId, DomUtil
-                .getChildTextTrim(eventElement, XML_EVENTUSERDATA, NAMESPACE), Long.parseLong(DomUtil.getChildTextTrim(
-                eventElement, XML_EVENTDATE, NAMESPACE)), getEventInfo(
-                DomUtil.getChildElement(eventElement, XML_EVENTINFO, NAMESPACE), resolver,
qvFactory));
+                DomUtil.getChildTextTrim(eventElement, N_EVENTPRIMARYNODETYPE), resolver),
getNames(
+                DomUtil.getChildren(eventElement, N_EVENTMIXINNODETYPE), resolver), userId,
DomUtil.getChildTextTrim(
+                eventElement, N_EVENTUSERDATA), Long.parseLong(DomUtil.getChildTextTrim(eventElement,
N_EVENTDATE)),
+                getEventInfo(DomUtil.getChildElement(eventElement, N_EVENTINFO), resolver,
qvFactory));
     }
 
     //--------------------------------------------------------------------------

Modified: jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Tue Jan 17 19:31:26 2012
@@ -2235,14 +2235,12 @@ public class RepositoryServiceImpl imple
             } else {
                 Element discEl = disc.toXml(DomUtil.createDocument());
                 ElementIterator it = DomUtil.getChildren(discEl,
-                        ObservationConstants.XML_EVENTBUNDLE,
-                        ObservationConstants.NAMESPACE);
+                        ObservationConstants.N_EVENTBUNDLE);
                 List<EventBundle> bundles = new ArrayList<EventBundle>();
                 while (it.hasNext()) {
                     Element bundleElement = it.nextElement();
                     String value = DomUtil.getAttribute(bundleElement,
-                            ObservationConstants.XML_EVENT_LOCAL,
-                            ObservationConstants.NAMESPACE);
+                            ObservationConstants.XML_EVENT_LOCAL, null);
                     // check if it matches a batch id recently submitted
                     boolean isLocal = false;
                     if (value != null) {
@@ -2270,7 +2268,7 @@ public class RepositoryServiceImpl imple
 
     private List<Event> buildEventList(Element bundleElement, SessionInfoImpl sessionInfo)
throws IllegalNameException, NamespaceException {
         List<Event> events = new ArrayList<Event>();
-        ElementIterator eventElementIterator = DomUtil.getChildren(bundleElement, ObservationConstants.XML_EVENT,
ObservationConstants.NAMESPACE);
+        ElementIterator eventElementIterator = DomUtil.getChildren(bundleElement, ObservationConstants.N_EVENT);
 
         String userId = null;
 
@@ -2285,7 +2283,7 @@ public class RepositoryServiceImpl imple
 
         while (eventElementIterator.hasNext()) {
             Element evElem = eventElementIterator.nextElement();
-            Element typeEl = DomUtil.getChildElement(evElem, ObservationConstants.XML_EVENTTYPE,
ObservationConstants.NAMESPACE);
+            Element typeEl = DomUtil.getChildElement(evElem, ObservationConstants.N_EVENTTYPE);
             EventType[] et = DefaultEventType.createFromXml(typeEl);
             if (et.length == 0 || et.length > 1) {
                 // should not occur.
@@ -2346,7 +2344,7 @@ public class RepositoryServiceImpl imple
 
             if (userId == null) {
                 // user id not retrieved from container
-                userId = DomUtil.getChildTextTrim(evElem, ObservationConstants.XML_EVENTUSERID,
ObservationConstants.NAMESPACE);
+                userId = DomUtil.getChildTextTrim(evElem, ObservationConstants.N_EVENTUSERID);
             }
 
             events.add(new EventImpl(eventId, eventPath, parentId, type, userId, evElem,

Modified: jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/observation/ObservationConstants.java
Tue Jan 17 19:31:26 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.webdav.observation;
 
+import javax.xml.namespace.QName;
+
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.xml.Namespace;
 
@@ -78,7 +80,18 @@ public interface ObservationConstants {
     public static final String XML_EVENTINFO = "eventinfo";
     public static final String XML_EVENTPRIMARNODETYPE = "eventprimarynodetype";
     public static final String XML_EVENTMIXINNODETYPE = "eventmixinnodetype";
-    
+
+    public static final QName N_EVENT = new QName(NAMESPACE.getURI(), XML_EVENT);
+    public static final QName N_EVENTBUNDLE = new QName(NAMESPACE.getURI(), XML_EVENTBUNDLE);
+    public static final QName N_EVENTDATE = new QName(NAMESPACE.getURI(), XML_EVENTDATE);
+    public static final QName N_EVENTDISCOVERY = new QName(NAMESPACE.getURI(), XML_EVENTDISCOVERY);
+    public static final QName N_EVENTINFO = new QName(NAMESPACE.getURI(), XML_EVENTINFO);
+    public static final QName N_EVENTMIXINNODETYPE = new QName(NAMESPACE.getURI(), XML_EVENTMIXINNODETYPE);
+    public static final QName N_EVENTPRIMARYNODETYPE = new QName(NAMESPACE.getURI(), XML_EVENTPRIMARNODETYPE);
+    public static final QName N_EVENTTYPE = new QName(NAMESPACE.getURI(), XML_EVENTTYPE);
+    public static final QName N_EVENTUSERDATA = new QName(NAMESPACE.getURI(), XML_EVENTUSERDATA);
+    public static final QName N_EVENTUSERID = new QName(NAMESPACE.getURI(), XML_EVENTUSERID);
+
     //---< Property Names >-----------------------------------------------------
     /**
      * The protected subscription discovery property is used to find out about

Modified: jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java?rev=1232549&r1=1232548&r2=1232549&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/xml/DomUtil.java
Tue Jan 17 19:31:26 2012
@@ -253,6 +253,22 @@ public class DomUtil {
     }
 
     /**
+     * Calls {@link #getTextTrim(Element)} on the first child element that matches
+     * the given name.
+     *
+     * @param parent
+     * @param childName
+     * @return text contained in the first child that matches the given name
+     * or <code>null</code>. Note, that leading and trailing whitespace
+     * is removed from the text.
+     * @see #getTextTrim(Element)
+     */
+    public static String getChildTextTrim(Element parent, QName childName) {
+        Element child = getChildElement(parent, childName);
+        return (child == null) ? null : getTextTrim(child);
+    }
+
+    /**
      * Returns true if the given parent node has a child element that matches
      * the specified local name and namespace.
      *



Mime
View raw message