incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r953550 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Date Fri, 11 Jun 2010 03:17:35 GMT
Author: justin
Date: Fri Jun 11 03:17:35 2010
New Revision: 953550

URL: http://svn.apache.org/viewvc?rev=953550&view=rev
Log:
SLING-1553 - properly wraping results of findResources() with workspace paths

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=953550&r1=953549&r2=953550&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Fri Jun 11 03:17:35 2010
@@ -675,8 +675,16 @@ public class JcrResourceResolver
     throws SlingException {
         checkClosed();
         try {
-            final QueryResult res = JcrResourceUtil.query(adaptTo(Session.class), query,
language);
-            return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
null,
+            Session session = null;
+            String workspaceName = null;
+            if (requestBoundResolver != null) {
+                session = requestBoundResolver.adaptTo(Session.class);
+                workspaceName = session.getWorkspace().getName();
+            } else {
+                session = getSession();
+            }
+            final QueryResult res = JcrResourceUtil.query(session, query, language);
+            return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
workspaceName,
                     new JcrNodeResourceIterator(this, res.getNodes(), factory.getDynamicClassLoader()));
         } catch (javax.jcr.query.InvalidQueryException iqe) {
             throw new QuerySyntaxException(iqe.getMessage(), query, language, iqe);



Mime
View raw message