[jira] [Comment Edited] (SLING-11506) Streamline and document resource (super) type merging

2023-02-15 Thread Carsten Ziegeler (Jira)


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

Carsten Ziegeler edited comment on SLING-11506 at 2/15/23 1:10 PM:
---

Reverted setting the properties for resource and resource super type. 
https://github.com/apache/sling-org-apache-sling-resourcemerger/commit/b58f734bb43ee7a6f173bed12793695af5ee2eba

And updated the docs to reflect this.


was (Author: cziegeler):
Reverted setting the properties for resource and resource super type. 
https://github.com/apache/sling-org-apache-sling-resourcemerger/commit/b58f734bb43ee7a6f173bed12793695af5ee2eba

> Streamline and document resource (super) type merging
> -
>
> Key: SLING-11506
> URL: https://issues.apache.org/jira/browse/SLING-11506
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Resource Merger 1.4.0
>Reporter: Konrad Windszus
>Assignee: Carsten Ziegeler
>Priority: Major
> Fix For: Resource Merger 1.4.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> In SLING-4340 the merging of resource types has been changed so that it gives 
> the resourceType property precedence over {{Resource.getResourceType()}} 
> (https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/f821f844ba675e3850189debf8e45239026c5709/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java#L74-L92).
> This change is questionable and kind of unexpected from the user's side and 
> also leads to undesired side effects like outlined in SLING-11504.
> So in the best case the merging of resource types doesn't rely on properties 
> (which are implementation details of the underlying resolvers) but clearly 
> derives from either the lowest or highest resource without breaking the use 
> cases outlined in SLING-4340.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (SLING-11506) Streamline and document resource (super) type merging

2022-08-02 Thread Carsten Ziegeler (Jira)


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

Carsten Ziegeler edited comment on SLING-11506 at 8/2/22 8:58 AM:
--

I think I read the code initially wrong. The resource type is actually set by 
inspecting the resources' getResourceType (unless all of them return null, 
which is not allowed). The resource super type is then set, if a 
sling:resourceType exists and has a different value than the previously 
calculated resource type.
Looking at it again, that sounds reasonable. Although the question arises what 
happens if more than one resource has that property set. Shouldn't that also be 
evaluated?

But I think what is missing is the update of the sling:resourceType property to 
whatever is returned via getResourceType().


was (Author: cziegeler):
I think I read the code initially wrong. The resource type is actually set by 
inspecting the resources' getResourceType (unless all of them return null, 
which is not allowed). The resource super type is then set, if a 
sling:resourceType exists and has a different value than the previously 
calculated resource type.
Looking at it again, that sounds reasonable. 
I think what is missing is the update of the sling:resourceType property to 
whatever is returned via getResourceType().

> Streamline and document resource (super) type merging
> -
>
> Key: SLING-11506
> URL: https://issues.apache.org/jira/browse/SLING-11506
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Resource Merger 1.4.0
>Reporter: Konrad Windszus
>Priority: Major
>
> In SLING-4340 the merging of resource types has been changed so that it gives 
> the resourceType property precedence over {{Resource.getResourceType()}} 
> (https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/f821f844ba675e3850189debf8e45239026c5709/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java#L74-L92).
> This change is questionable and kind of unexpected from the user's side and 
> also leads to undesired side effects like outlined in SLING-11504.
> So in the best case the merging of resource types doesn't rely on properties 
> (which are implementation details of the underlying resolvers) but clearly 
> derives from either the lowest or highest resource without breaking the use 
> cases outlined in SLING-4340.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)