incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1345011 - in /sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl: ResourceResolverImpl.java helper/RootResourceProviderEntry.java
Date Fri, 01 Jun 2012 08:32:09 GMT
Author: cziegeler
Date: Fri Jun  1 08:32:08 2012
New Revision: 1345011

URL: http://svn.apache.org/viewvc?rev=1345011&view=rev
Log:
SLING-2396 : Add new resource provider interfaces (WiP)

Modified:
    sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
    sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java

Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1345011&r1=1345010&r2=1345011&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
(original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
Fri Jun  1 08:32:08 2012
@@ -43,6 +43,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ResourceWrapper;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.resourceresolver.impl.helper.MapEntry;
 import org.apache.sling.resourceresolver.impl.helper.RedirectResource;
@@ -603,6 +604,9 @@ public class ResourceResolverImpl extend
     public Iterator<Resource> listChildren(final Resource parent) {
         checkClosed();
 
+        if (parent instanceof ResourceWrapper) {
+            return listChildren(((ResourceWrapper) parent).getResource());
+        }
         return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
new ResourceIterator(this.context, parent,
                         this.factory.getRootProviderEntry()));
     }
@@ -615,7 +619,9 @@ public class ResourceResolverImpl extend
      */
     public Iterator<Resource> findResources(final String query, final String language)
throws SlingException {
         checkClosed();
-        return this.factory.getRootProviderEntry().findResources(this.context, query, language);
+
+        return new ResourceIteratorDecorator(this.factory.getResourceDecoratorTracker(),
+                        this.factory.getRootProviderEntry().findResources(this.context, this,
query, language));
     }
 
     /**

Modified: sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java?rev=1345011&r1=1345010&r2=1345011&view=diff
==============================================================================
--- sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java
(original)
+++ sling/whiteboard/SLING-2396/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/RootResourceProviderEntry.java
Fri Jun  1 08:32:08 2012
@@ -38,6 +38,7 @@ import org.apache.sling.api.resource.Que
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.osgi.framework.Constants;
@@ -114,13 +115,14 @@ public class RootResourceProviderEntry e
 
     /**
      * Invoke all queriable resource providers.
-     * @see QueriableResourceProvider#findResources(String, String)
+     * @see QueriableResourceProvider#findResources(ResourceResolver, String, String)
      */
-    public Iterator<Resource> findResources(final ResourceResolverContext ctx, final
String query, final String language) {
+    public Iterator<Resource> findResources(final ResourceResolverContext ctx,
+                    final ResourceResolver resolver, final String query, final String language)
{
         final Iterator<QueriableResourceProvider> i = this.queriableProviders.getProviders(ctx);
         while ( i.hasNext() ) {
             final QueriableResourceProvider adap = i.next();
-            final Iterator<Resource> iter = adap.findResources(query, language);
+            final Iterator<Resource> iter = adap.findResources(resolver, query, language);
             if ( iter != null ) {
                 // TODO
             }



Mime
View raw message