Define PathResolver and PathMapper API
--------------------------------------
Key: SLING-198
URL: https://issues.apache.org/jira/browse/SLING-198
Project: Sling
Issue Type: Improvement
Components: API, Resource, Scripting
Reporter: Felix Meschberger
Assignee: Felix Meschberger
As a result of defining a virtual resource tree (SLING-197) we have a need to
codify in the API two additional interfaces:
(1) PathResolver
Given a relative path a path resolution algorithm is applied to find a
resource. The idea is to have a path configuration like the Java CLASSPATH or
the *nix PATH environment variable list a series of absolute path prefixes
which are applied to the relative path in turn to find an existing resource.
Currently this mechanism is implemented in the sling/servlet-resolver project
in a combination of the SlingServletResolver and the PathSupport class. This
implementation must be cleaned up, such that this path searching may also be
used for other use cases.
(2) PathMapper
The jcr/resource project currently has an interface called PathResolver. This
interface defines an API to resolve an absolute path (technically this would be
the path part of an URI) into a Resource and to convert a resource path back to
a string which may be used as (part) of path part of an URI. Ideally the
methods should support roundtripping.
The use of such a mapper would be for scripts to be able to create uniform URIs
from resource paths and likewise some helper functionality may be built to
verify any path of an URI may correctly be resolved to a Resource.
To make this interface a real part of the Sling API and to prevent a naming
collision with the PathResolver, which resolves relative paths, the existing
PathResolver interface of the jcr/resource project is moved to the Sling API
and renamed to PathMapper.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.