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 2009/09/09 20:37:57 UTC

[jira] Resolved: (SLING-1104) Resource resolver sets resolution path and resolution path info wrong when resolving resources with sling:alias

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

Felix Meschberger resolved SLING-1104.
--------------------------------------

    Resolution: Fixed

Implemented a fix in Rev. 813069.

Thing was that the JcrResourceResovler2.resolveInternal method does not correctly set the resolutionPath for multi-level sling:alias-ed paths. As a consequence the calculation of the resolutionPathInfo fails.

Now, the resolutionPath is constructed while walking down the resource tree resolving sling:alias and at the end setting the resolutionPathInfo from the constructed resolutionPath and the original absolute path.

> Resource resolver sets resolution path and resolution path info wrong when resolving resources with sling:alias
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1104
>                 URL: https://issues.apache.org/jira/browse/SLING-1104
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR Resource
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.6
>
>
> If resources use the sling:alias property to alias its name, the resource resolver sets the resolution path and resolution path info resource metadata wrong:
>    * resolution path is not the part of the path leading to the resolution but the path of the actual resource
>    * resolution path info is wrong if more than one alias is along the resource path (and the alias names do not have the same length)
> For example:
>     ..../child
>           +- sling:alias = kind  // shorter than node name
>           +- grandchild
>                    +- sling:alias = enkel // shorter than node name
> Now resolving ".../kind.html" to a resource sets the meta data as follows:
>          resolution path = ".../child"        -- expected ".../kind"
>          resolution path info = ".html"    -- correct
> Resolving ".../kind/enkel.html" to a resource breaks things up completely:
>          resolution path = ".../child/grandchild"        -- expected ".../kind/enkel"
>          resolution path info = "html"                          -- expected ".html"
> The bug is in the path calculation of the JcrResourceResolver2.resolveInternal(String) method where aliases are handled.

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