[ 
https://issues.apache.org/jira/browse/SLING-198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger updated SLING-198:
------------------------------------

    Description: 
As a result of defining a virtual resource tree (SLING-197) we have a need to 
modify the ResourceResolver API in two respects:

(1) Add ResourceResolver.resolve(String absPath)

This method behaves exactly as ResourceResolver.resolve(HttpServletRequest) 
except, that the latter method may make use of additional request properties, 
such as request headers or parameters while the resolve(String) method only has 
the string to work on.

Currently the resolve(HttpServletRequest) method does nothing more than use the 
HttpServletRequest.getPathInfo() to resolve the resource, thus both 
implementations would actually be equivalent.

The absPath argument is an absolute path. Resolution fails for relative paths.


(2) Support relative paths in ResourceResolver.getResource(String path)

Currently this method is defined to throw a SlingException if the path is 
relative. This should be changed such that the ResourceResolver applies some 
search path logic to find a resource with the given relative path

The search path logic is comparable to how *nix systems use the PATH 
environment variable.

This method may then be used by multiple users such as Servlet/Script 
resolution.


(3) Add ResourceResolver.map(String) method

This method applies the reverse mappings of the ResourceResolver.resolve(String 
absPath) method to return a path suitable for both resolver() methods. This 
allows for the creation of link paths for resources.


  was:
As a result of defining a virtual resource tree (SLING-197) we have a need to 
modify the ResourceResolver API in two respects:

(1) Add ResourceResolver.resolve(String absPath)

This method behaves exactly as ResourceResolver.resolve(HttpServletRequest) 
except, that the latter method may make use of additional request properties, 
such as request headers or parameters while the resolve(String) method only has 
the string to work on.

Currently the resolve(HttpServletRequest) method does nothing more than use the 
HttpServletRequest.getPathInfo() to resolve the resource, thus both 
implementations would actually be equivalent.

The absPath argument is an absolute path. Resolution fails for relative paths.


(2) Support relative paths in ResourceResolver.getResource(String path)

Currently this method is defined to throw a SlingException if the path is 
relative. This should be changed such that the ResourceResolver applies some 
search path logic to find a resource with the given relative path

The search path logic is comparable to how *nix systems use the PATH 
environment variable.

This method may then be used by multiple users such as Servlet/Script 
resolution.


(3) Add ResourceResolver.map(Resource) method

This method applies the reverse mappings of the ResourceResolver.resolve(String 
absPath) method to return a path suitable for both resolver() methods. This 
allows for the creation of link paths for resources.



> Extend ResourceResolver to make it more flexible
> ------------------------------------------------
>
>                 Key: SLING-198
>                 URL: https://issues.apache.org/jira/browse/SLING-198
>             Project: Sling
>          Issue Type: Improvement
>          Components: API, Resource, ServletResolver
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> As a result of defining a virtual resource tree (SLING-197) we have a need to 
> modify the ResourceResolver API in two respects:
> (1) Add ResourceResolver.resolve(String absPath)
> This method behaves exactly as ResourceResolver.resolve(HttpServletRequest) 
> except, that the latter method may make use of additional request properties, 
> such as request headers or parameters while the resolve(String) method only 
> has the string to work on.
> Currently the resolve(HttpServletRequest) method does nothing more than use 
> the HttpServletRequest.getPathInfo() to resolve the resource, thus both 
> implementations would actually be equivalent.
> The absPath argument is an absolute path. Resolution fails for relative paths.
> (2) Support relative paths in ResourceResolver.getResource(String path)
> Currently this method is defined to throw a SlingException if the path is 
> relative. This should be changed such that the ResourceResolver applies some 
> search path logic to find a resource with the given relative path
> The search path logic is comparable to how *nix systems use the PATH 
> environment variable.
> This method may then be used by multiple users such as Servlet/Script 
> resolution.
> (3) Add ResourceResolver.map(String) method
> This method applies the reverse mappings of the 
> ResourceResolver.resolve(String absPath) method to return a path suitable for 
> both resolver() methods. This allows for the creation of link paths for 
> resources.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to