You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/04/06 16:34:33 UTC

[jira] Updated: (SLING-585) New functionality to resolve scripts by name

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

Carsten Ziegeler updated SLING-585:
-----------------------------------

    Summary: New functionality to resolve scripts by name  (was: Add "scriptSelector" to the sling:include tag)

I think the best way to implement this is to add new functionality to the servlet resolver (the servlet resolver does the usual
script resolution already). This has the benefit of having all script resolution related code in a single service which makes caching, security etc. much easier.

I propose to add two new methods to the servlet resolver interface:

Servlet resolveServlet(Resource, String)
Servlet resolveServlet(ResourceResolver, String)

In both cases, if the provided String is absolut, the resource at that location is tried to be converted to a script.
If the provided string is relativ and the second form is used (ResourceResolver and string) than the specified string is used in the search locations. For example
"my/rt/test" would be searched at /apps/my/rt/test and /libs/my/rt/test
In this case any script (either jsp, js etc) that is found would be used.
If the provided string has an extension like my/rt/test.jsp only a script with that extension would be used.

If the first form is used (resource, string) then the resource type of that resource is used
For example resource with resource type my/rt and script "test" would result in the same as above. However if the script could not be found, the resource type hierarchy is traversed.

> New functionality to resolve scripts by name
> --------------------------------------------
>
>                 Key: SLING-585
>                 URL: https://issues.apache.org/jira/browse/SLING-585
>             Project: Sling
>          Issue Type: Wish
>          Components: Scripting
>            Reporter: Tobias Bocanegra
>
> I'm looking for a way to include a jsp script from within another but
> respecting the resource type hierarchy. so for example:
> + myapp
>  + A
>       + A.jsp
>       + content.jsp
>  + B
>       - sling:resourceSuperType = "A"
>       + B.jsp
> and in my B.jsp i want to include the "content.jsp" but respecting the resource type hierarchy.
> suggest to add: <slng:include scriptSelector="content" /> that internally overwrites the request selector during the script selection phase.
> see http://markmail.org/message/la4rvmcdd6whpvhl

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