[ 
https://issues.apache.org/jira/browse/SLING-4340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14286739#comment-14286739
 ] 

Carsten Ziegeler commented on SLING-4340:
-----------------------------------------

[~justinedelson] With your change, as soon as any resource has a 
sling:resourceType property that is used, no matter where in the hierarchy or 
list of merged resources this resource is. For your example it works, but I'm 
pretty sure it is easy to find a counter example where it does not work.
The questions is really how the resource type should be computed - the change 
in SLING-4247 was for a use case where actually no resource had a 
sling:resourceType property but of course the resources returned one. Which 
still would work with your change.
Looking at your use case: you have resource a1 with a resource type of 
"nt:unstructed", a resource super type of "a2" and a2 has the resource type 
foo/bar - now you're requesting the merged a1 resource. Which resource type 
does it have? I would assume the one from the lowest resource in the tree which 
is a1. Or is it the highest in the tree which would be foo/bar?

> SLING-4247 created odd side-effects
> -----------------------------------
>
>                 Key: SLING-4340
>                 URL: https://issues.apache.org/jira/browse/SLING-4340
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Justin Edelson
>            Assignee: Justin Edelson
>             Fix For: Resource Merger 1.2.4
>
>
> The change made in SLING-4247 created an unfortunate side effect for this 
> scenario:
> /apps/a/1/a - nt:unstructured node, no sling:resourceType property
> /apps/a/2/a - sling:resourceType set to foo/bar
> /apps/a/1 has sling:resourceSuperType set to /apps/a/2
> Then
> resourceResolver.getResource("/mnt/override/apps/a/1/a").getResourceType() 
> will be nt:unstructured
> This strikes me as wrong. And in fact screws up what is for me the main usage 
> of this feature because it shouldn't be necessary to set the 
> sling:resourceType all the time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to