You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2007/10/04 10:23:50 UTC

[jira] Created: (SLING-37) Better default handling for script selection

Better default handling for script selection
--------------------------------------------

                 Key: SLING-37
                 URL: https://issues.apache.org/jira/browse/SLING-37
             Project: Sling
          Issue Type: New Feature
          Components: Scripting
    Affects Versions: 2.0.0
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: 2.0.0


Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:

    - First apply all registered Script mappings of the ScriptedComponent
    - Next use the request selectors to find a script below the scripted component node
    - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node

The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.

Example: 

(1) request for sample.html

No selectors exist, the start.jsp script below the component is used

(2) request for sample.image.gif

Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.

(3) request for sample.image.80x80.gif

The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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


[jira] Commented: (SLING-37) Better default handling for script selection

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532398 ] 

Felix Meschberger commented on SLING-37:
----------------------------------------

Thanks for the hint. I was not happy with the name either, but could not come up with a better one. Thinking about it, I do not particularly like index.jsp either.

How about render.jsp or service.jsp or draw.jsp or paint.jsp ?

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted component node
>     - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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


[jira] Commented: (SLING-37) Better default handling for script selection

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532425 ] 

Felix Meschberger commented on SLING-37:
----------------------------------------

Thanks. I think I go for default.jsp.

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted component node
>     - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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


[jira] Commented: (SLING-37) Better default handling for script selection

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532394 ] 

Tobias Bocanegra commented on SLING-37:
---------------------------------------

i think 'index.jsp' would be a more standardized name

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted component node
>     - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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


[jira] Closed: (SLING-37) Better default handling for script selection

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed SLING-37.
----------------------------------

    Resolution: Fixed

Redone the script selection in the ScriptedComponent to apply the request selectors to the default script selection. In addtion, modified the default name to be "default.jsp" and not looking in a jsp folder any more.

Also clarified the ScriptHandler.getComponentRenderer method to return null if the script cannot be handled by the script handler because it is missing. Not returning null does not prevent any errors from being thrown at the time of calling the script of course. This is just a simple upfront check.

Fixed in Rev. 581895.

Adapted the JSP handler to return null in case the requested script is not available in the repository.

Fixed in Rev. 581898.

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted component node
>     - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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


[jira] Commented: (SLING-37) Better default handling for script selection

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532417 ] 

Bertrand Delacretaz commented on SLING-37:
------------------------------------------

My favorite would be "default.jsp" as it is the default rendering script.

> Better default handling for script selection
> --------------------------------------------
>
>                 Key: SLING-37
>                 URL: https://issues.apache.org/jira/browse/SLING-37
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: 2.0.0
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> Currently the ScriptedComponent analyzes the registered scripts and just falls back to a default script called jsp/start.jsp. This default selection should be extended such, that request selectors (see ComponentRequest.getSelectors()) contrubute to the script selection as follows:
>     - First apply all registered Script mappings of the ScriptedComponent
>     - Next use the request selectors to find a script below the scripted component node
>     - If the second step does not resolve a script (or if no selectors exist) just use the start.jsp script below the component node
> The second step needs some more explanations: The selectors of the request are joined with interleaving slashes to form a relative path. This path is appended to the path of the scripted component and the name of script is assumed to be start.jsp. If the path does not exist, trailing elements are just removed and such a longest match is tried to be found.
> Example: 
> (1) request for sample.html
> No selectors exist, the start.jsp script below the component is used
> (2) request for sample.image.gif
> Selector is a single entry list [ image ]. First the script image/start.jsp is checked, if that does not exist, the start.jsp is used.
> (3) request for sample.image.80x80.gif
> The selectors is a two-entry list [ image, 80x80 ]. The following scripts are tested in order: image/80x80/start.jsp, image/start.jsp, start.jsp.

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