[
https://issues.apache.org/jira/browse/SLING-6327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15695418#comment-15695418
]
Julian Sedding commented on SLING-6327:
---------------------------------------
TL;DR: I think always stripping off any search-path prefixes is consistent and
easy to understand. In practice it probably makes no big difference.
On a very theoretical level, I think it could be argued that a resource-type is
an abstract concept, represented by an opaque string.
On a less theoretical level, when resolving resource-types to rendering
scripts, Sling's interprets this opaque string as a path, with relative paths
being resolved by prefixing them with the search paths.
IMHO any opaque string is a valid resource-type. For rendering, however, all
that matters in the end is that a suitable script is found by interpreting the
resource-type as a relative path. This can fail whether the resource-type is a
relative path or not (well, I guess every string that isn't an absolute path
could be viewed as a relative path).
> ResourceResolverImpl.isResourceType() should consider resource resolver's
> search path
> -------------------------------------------------------------------------------------
>
> Key: SLING-6327
> URL: https://issues.apache.org/jira/browse/SLING-6327
> Project: Sling
> Issue Type: Improvement
> Components: ResourceResolver
> Affects Versions: API 2.15.0, Resource Resolver 1.5.2
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Attachments: SLING-6327-v01.patch
>
>
> Currently the following two expressions return false
> {{ResourceResolverImpl.isResourceType(<Resource with
> resourceType="sling/some/type">, "/libs/sling/some/type"}}
> {{ResourceResolverImpl.isResourceType(<Resource with
> resourceType="/libs/sling/some/type">, "sling/some/type"}}
> Since it cannot always be influenced whether the given resource is absolute
> or relative (because both usually works from a rendering perspective when you
> talk about the current request's resource), both cases should actually return
> {{true}}.
> See also the related discussion at
> http://www.mail-archive.com/[email protected]/msg62351.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)