You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2013/04/19 17:45:27 UTC
svn commit: r1469912 - in /jackrabbit/branches/2.6: ./
jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Author: reschke
Date: Fri Apr 19 15:45:27 2013
New Revision: 1469912
URL: http://svn.apache.org/r1469912
Log:
JCR-3576: handle absolute paths in observation response bodies (ported to 2.6)
Modified:
jackrabbit/branches/2.6/ (props changed)
jackrabbit/branches/2.6/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
Merged /jackrabbit/trunk:r1469892
Modified: jackrabbit/branches/2.6/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=1469912&r1=1469911&r2=1469912&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java (original)
+++ jackrabbit/branches/2.6/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java Fri Apr 19 15:45:27 2013
@@ -2101,7 +2101,7 @@ public class RepositoryServiceImpl imple
Element contentElem = DomUtil.getChildElement(entryElem, AtomFeedConstants.N_CONTENT);
if (contentElem != null
&& "application/vnd.apache.jackrabbit.event+xml".equals(contentElem.getAttribute("type"))) {
- List<Event> el = buildEventList(contentElem, (SessionInfoImpl) sessionInfo);
+ List<Event> el = buildEventList(contentElem, (SessionInfoImpl) sessionInfo, rootUri);
for (Event e : el) {
if (e.getDate() > after && (filter == null || filter.accept(e, false))) {
events.add(e);
@@ -2272,7 +2272,7 @@ public class RepositoryServiceImpl imple
isLocal = Boolean.parseBoolean(value);
}
bundles.add(new EventBundleImpl(
- buildEventList(bundleElement, sessionInfo),
+ buildEventList(bundleElement, sessionInfo, uri),
isLocal));
}
events = bundles.toArray(new EventBundle[bundles.size()]);
@@ -2291,7 +2291,8 @@ public class RepositoryServiceImpl imple
}
}
- private List<Event> buildEventList(Element bundleElement, SessionInfoImpl sessionInfo) throws IllegalNameException, NamespaceException {
+ private List<Event> buildEventList(Element bundleElement, SessionInfoImpl sessionInfo, String baseUri)
+ throws IllegalNameException, NamespaceException, RepositoryException {
List<Event> events = new ArrayList<Event>();
ElementIterator eventElementIterator = DomUtil.getChildren(bundleElement, ObservationConstants.N_EVENT);
@@ -2324,6 +2325,7 @@ public class RepositoryServiceImpl imple
NodeId parentId = null;
if (href != null) {
+ href = resolve(baseUri, href);
try {
eventPath = uriResolver.getQPath(href, sessionInfo);
} catch (RepositoryException e) {
@@ -2334,7 +2336,7 @@ public class RepositoryServiceImpl imple
boolean isForNode = (type == Event.NODE_ADDED
|| type == Event.NODE_REMOVED || type == Event.NODE_MOVED);
-
+
try {
if (isForNode) {
eventId = uriResolver.getNodeIdAfterEvent(href,