incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1245269 - in /sling/trunk/bundles: api/src/main/java/org/apache/sling/api/resource/ jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/
Date Fri, 17 Feb 2012 00:36:24 GMT
Author: justin
Date: Fri Feb 17 00:36:23 2012
New Revision: 1245269

URL: http://svn.apache.org/viewvc?rev=1245269&view=rev
Log:
SLING-2411 - deprecating ResourceDecorator.decorate(Resource, HttpServletRequest) and only
calling ResourceDecorator.decorate(Resource)

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

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java?rev=1245269&r1=1245268&r2=1245269&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java
Fri Feb 17 00:36:23 2012
@@ -52,6 +52,9 @@ public interface ResourceDecorator {
      * @param resource The resource to decorate
      * @param request The current request.
      * @return The decorated resource, the original resource or null.
+     * 
+     * @deprecated since 2.3.0 (and JCR Resource 2.1.0), this method will not be invoked.
      */
+    @Deprecated
     Resource decorate(Resource resource, HttpServletRequest request);
 }

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=1245269&r1=1245268&r2=1245269&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 Feb 17 00:36:23 2012
@@ -399,7 +399,7 @@ public class JcrResourceResolver
                     if (index != -1) {
                         res.getResourceMetadata().setResolutionPathInfo(absPath.substring(index));
                     }
-                    return this.factory.getResourceDecoratorTracker().decorate(res, workspaceName,
request);
+                    return this.factory.getResourceDecoratorTracker().decorate(res, workspaceName);
                 }
 
             }
@@ -441,8 +441,7 @@ public class JcrResourceResolver
                     LOGGER.debug("resolve: Returning external redirect");
                     return this.factory.getResourceDecoratorTracker().decorate(
                             new RedirectResource(this, absPath, mappedPath[0],
-                                   mapEntry.getStatus()), workspaceName,
-                             request);
+                                   mapEntry.getStatus()), workspaceName);
                 }
             }
 
@@ -535,7 +534,7 @@ public class JcrResourceResolver
             LOGGER.debug("resolve: Path {} resolves to Resource {}", absPath, res);
         }
 
-        return this.factory.getResourceDecoratorTracker().decorate(res, workspaceName, request);
+        return this.factory.getResourceDecoratorTracker().decorate(res, workspaceName);
     }
 
     /**
@@ -829,7 +828,7 @@ public class JcrResourceResolver
                     workspacePrefix = getSession().getWorkspace().getName();
                 }
 
-                result = this.factory.getResourceDecoratorTracker().decorate(result, workspacePrefix,
null);
+                result = this.factory.getResourceDecoratorTracker().decorate(result, workspacePrefix);
                 return result;
             }
             return null;

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceDecoratorTracker.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceDecoratorTracker.java?rev=1245269&r1=1245268&r2=1245269&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceDecoratorTracker.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceDecoratorTracker.java
Fri Feb 17 00:36:23 2012
@@ -56,16 +56,12 @@ public class ResourceDecoratorTracker {
     }
 
     /** Decorate a resource.  */
-    public Resource decorate(final Resource resource, String workspaceName, final HttpServletRequest
request) {
+    public Resource decorate(final Resource resource, String workspaceName) {
         Resource result = resource;
         final ResourceDecorator[] decorators = this.resourceDecoratorsArray;
         for(final ResourceDecorator decorator : decorators) {
             final Resource original = result;
-            if ( request == null ) {
-                result = decorator.decorate(original);
-            } else {
-                result = decorator.decorate(original, request);
-            }
+            result = decorator.decorate(original);
             if ( result == null ) {
                 result = original;
             }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceIteratorDecorator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceIteratorDecorator.java?rev=1245269&r1=1245268&r2=1245269&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceIteratorDecorator.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/ResourceIteratorDecorator.java
Fri Feb 17 00:36:23 2012
@@ -46,7 +46,7 @@ public class ResourceIteratorDecorator i
     }
 
     public Resource next() {
-        return this.tracker.decorate(this.iterator.next(), workspaceName, null);
+        return this.tracker.decorate(this.iterator.next(), workspaceName);
     }
 
     public void remove() {



Mime
View raw message