incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r610324 - in /incubator/sling/trunk: api/src/main/java/org/apache/sling/api/resource/ jcr/resource/src/main/java/org/apache/sling/jcr/resource/ jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/ jcr/resource/sr...
Date Wed, 09 Jan 2008 09:45:19 GMT
Author: cziegeler
Date: Wed Jan  9 01:45:18 2008
New Revision: 610324

URL: http://svn.apache.org/viewvc?rev=610324&view=rev
Log:
issue SLING-146: Replace Resource.getURI() by Resource.getPath() 
https://issues.apache.org/jira/browse/SLING-146

Modified:
    incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
    incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/Resource.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResource.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrNodeResource.java
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrPropertyResource.java
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/SyntheticResource.java
    incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
    incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/scripting/helpers/ScriptSearchPathsBuilderTest.java
    incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
    incubator/sling/trunk/sling/core/src/test/java/org/apache/sling/core/impl/request/SlingRequestPathInfoTest.java

Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
(original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
Wed Jan  9 01:45:18 2008
@@ -34,7 +34,7 @@
         resourceMetadata.put(ResourceMetadata.RESOLUTION_PATH, resourceURI);
     }
 
-    public String getURI() {
+    public String getPath() {
         return resourceURI;
     }
 

Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/Resource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/Resource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/Resource.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/Resource.java Wed
Jan  9 01:45:18 2008
@@ -31,10 +31,10 @@
     static final String RESOURCE_TYPE_NON_EXISTING = "sling:nonexisting";
 
     /**
-     * This resource's URI - for now that could be a JCR path, but having an URI
-     * makes it possible to use other data sources.
+     * This resource's path - for now that could be a JCR path. It's also
+     * possible to have an URI for other data sources.
      */
-    String getURI();
+    String getPath();
 
     /**
      * The resource type is meant to point to rendering/processing scripts,

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
Wed Jan  9 01:45:18 2008
@@ -56,7 +56,7 @@
         this.resourceMetadata.put(ResourceMetadata.RESOLUTION_PATH, path);
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResource.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/bundle/BundleResource.java
Wed Jan  9 01:45:18 2008
@@ -85,7 +85,7 @@
         metadata.put(MODIFICATION_TIME, bundle.getLastModified());
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Wed Jan  9 01:45:18 2008
@@ -96,7 +96,7 @@
         setMetaData(node, metadata);
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrNodeResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrNodeResource.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrNodeResource.java
Wed Jan  9 01:45:18 2008
@@ -43,10 +43,10 @@
 
 /** A Resource that wraps a JCR Node */
 public class JcrNodeResource implements Resource {
-    
+
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
+
     private final Node node;
     private final String path;
     private final String resourceType;
@@ -74,7 +74,7 @@
         return getClass().getSimpleName() + ", type=" + resourceType + ", path=" + path;
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 
@@ -93,16 +93,16 @@
                 log.error("adaptTo: Error getting input stream for " + this, ioe);
             }
         }
-        
+
         return null;
     }
-    
+
     public ResourceMetadata getResourceMetadata() {
         return metadata;
     }
 
     // --- helpers, public for scripting ----
-    
+
     public Node getNode() {
         return node;
     }

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrPropertyResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrPropertyResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrPropertyResource.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/JcrPropertyResource.java
Wed Jan  9 01:45:18 2008
@@ -31,12 +31,12 @@
      *  for all Resources of this class.
      */
     public static final String DEFAULT_RESOURCE_TYPE = "";
-    
+
     private final Property property;
     private final String path;
     private final ResourceMetadata metadata;
     private final String resourceType;
-    
+
     JcrPropertyResource(Property p) throws RepositoryException {
         property = p;
         path = p.getPath();
@@ -44,7 +44,7 @@
         metadata.put(RESOLUTION_PATH, path);
         resourceType = DEFAULT_RESOURCE_TYPE;
     }
-    
+
     @Override
     public String toString() {
         return getClass().getSimpleName() + ", type=" + resourceType + ", path=" + path;
@@ -66,7 +66,7 @@
         return resourceType;
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 }

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/SyntheticResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/SyntheticResource.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/SyntheticResource.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/resource/SyntheticResource.java
Wed Jan  9 01:45:18 2008
@@ -41,7 +41,7 @@
 
     /** The metadata of this resource, contains just the resource path */
     private ResourceMetadata resourceMetadata;
-    
+
     /** default resource type for these resources */
     public static String DEFAULT_RESOURCE_TYPE = "sling/synthetic-resource";
 
@@ -58,13 +58,13 @@
         this.resourceMetadata = new ResourceMetadata();
         this.resourceMetadata.put(ResourceMetadata.RESOLUTION_PATH, path);
     }
-    
+
     @Override
     public String toString() {
         return getClass().getSimpleName() + ", path=" + path + ", resourceType=" + resourceType;
     }
 
-    public String getURI() {
+    public String getPath() {
         return path;
     }
 

Modified: incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/request/helpers/MicroslingRequestPathInfoTest.java
Wed Jan  9 01:45:18 2008
@@ -254,14 +254,14 @@
             throw new Error("MockResource does not implement this method");
         }
 
-        public String getURI() {
+        public String getPath() {
             throw new Error("MockResource does not implement this method");
         }
 
         public ResourceMetadata getResourceMetadata() {
             return metadata;
         }
-        
+
         public <Type> Type adaptTo(Class<Type> type) {
             return null;
         }

Modified: incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/scripting/helpers/ScriptSearchPathsBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/scripting/helpers/ScriptSearchPathsBuilderTest.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/scripting/helpers/ScriptSearchPathsBuilderTest.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/scripting/helpers/ScriptSearchPathsBuilderTest.java
Wed Jan  9 01:45:18 2008
@@ -29,14 +29,14 @@
 
 /** Test the ScriptSearchPathsBuilder class */
 public class ScriptSearchPathsBuilderTest extends TestCase {
-    
+
     private final ScriptSearchPathsBuilder builder = new ScriptSearchPathsBuilder();
-    
+
     private void testBuilder(String resourceType,String resourcePath, String [] selectors,
String [] paths) throws SlingException {
         final Resource r = new MockResource(resourceType,resourcePath);
-        
+
         final List<String> actual = builder.getScriptSearchPaths(r, selectors);
-        
+
         final List<String> expected = new LinkedList<String>();
         if(paths != null) {
             for(String path : paths) {
@@ -45,44 +45,44 @@
         }
         assertEquals(expected,actual);
     }
-    
+
     public void testNoSelectorsA() throws SlingException {
         final String [] selectors = null;
-        final String [] expected = { "/sling/scripts/rt", "/apps/rt", "/apps/blog" }; 
+        final String [] expected = { "/sling/scripts/rt", "/apps/rt", "/apps/blog" };
         testBuilder("rt", "/content/blog", selectors, expected);
     }
-    
+
     public void testNoSelectorsB() throws SlingException {
         final String [] selectors = null;
-        final String [] expected = { "/sling/scripts/rt/something", "/apps/rt/something",
"/apps/blog" }; 
+        final String [] expected = { "/sling/scripts/rt/something", "/apps/rt/something",
"/apps/blog" };
         testBuilder("rt/something", "/content/blog/a/b/c", selectors, expected);
     }
-    
+
     public void testWithSelectorsA() throws SlingException {
         final String [] selectors = { "a4" };
-        final String [] expected = { 
-                "/sling/scripts/rt/a4", "/sling/scripts/rt", 
-                "/apps/rt/a4", "/apps/rt", 
-                "/apps/blog/a4", "/apps/blog", 
-                }; 
+        final String [] expected = {
+                "/sling/scripts/rt/a4", "/sling/scripts/rt",
+                "/apps/rt/a4", "/apps/rt",
+                "/apps/blog/a4", "/apps/blog",
+                };
         testBuilder("rt", "/content/blog", selectors, expected);
     }
-    
+
     public void testWithSelectorsB() throws SlingException {
         final String [] selectors = { "a4", "print" };
-        final String [] expected = { 
-                "/sling/scripts/rt/x/a4/print", "/sling/scripts/rt/x/a4", "/sling/scripts/rt/x",

-                "/apps/rt/x/a4/print", "/apps/rt/x/a4", "/apps/rt/x", 
-                "/apps/banking/a4/print", "/apps/banking/a4", "/apps/banking", 
-        }; 
+        final String [] expected = {
+                "/sling/scripts/rt/x/a4/print", "/sling/scripts/rt/x/a4", "/sling/scripts/rt/x",
+                "/apps/rt/x/a4/print", "/apps/rt/x/a4", "/apps/rt/x",
+                "/apps/banking/a4/print", "/apps/banking/a4", "/apps/banking",
+        };
         testBuilder("rt/x", "/somewhere/banking/blog", selectors, expected);
     }
-    
+
     static class MockResource implements Resource {
 
         private final String resourceType;
         private final String path;
-        
+
         MockResource(String resourceType, String path) {
             this.resourceType = resourceType;
             this.path = path;
@@ -92,14 +92,14 @@
             return resourceType;
         }
 
-        public String getURI() {
+        public String getPath() {
             return path;
         }
 
         public ResourceMetadata getResourceMetadata() {
             throw new Error("MockResource does not implement this method");
         }
-        
+
         public <Type> Type adaptTo(Class<Type> type) {
             throw new Error("MockResource does not implement this method");
         }

Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
(original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
Wed Jan  9 01:45:18 2008
@@ -133,8 +133,8 @@
             return delegatee.getResourceMetadata();
         }
 
-        public String getURI() {
-            return delegatee.getURI();
+        public String getPath() {
+            return delegatee.getPath();
         }
 
         public <Type> Type adaptTo(Class<Type> type) {

Modified: incubator/sling/trunk/sling/core/src/test/java/org/apache/sling/core/impl/request/SlingRequestPathInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/test/java/org/apache/sling/core/impl/request/SlingRequestPathInfoTest.java?rev=610324&r1=610323&r2=610324&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/test/java/org/apache/sling/core/impl/request/SlingRequestPathInfoTest.java
(original)
+++ incubator/sling/trunk/sling/core/src/test/java/org/apache/sling/core/impl/request/SlingRequestPathInfoTest.java
Wed Jan  9 01:45:18 2008
@@ -254,7 +254,7 @@
             throw new Error("MockResource does not implement this method");
         }
 
-        public String getURI() {
+        public String getPath() {
             throw new Error("MockResource does not implement this method");
         }
 



Mime
View raw message