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

Henry Kuijpers commented on SLING-10645:
----------------------------------------

Hi [~bdelacretaz],

Indeed, there is an "overriding" and an "overlaying" way, however, the names of 
the services behind it are quite confusing because they don't correctly explain 
what they do (overriding = Overriding Resource Picker, overlay = Merging 
Resource Picker).

Overriding means *merging* based on the 
sling:resourceType/sling:resourceSuperType properties.
Overlaying means *merging* based on the search path (/libs, /apps, ...)

They both merge. :)

Current set of properties that can be put on nodes (that function as 
instructions to the Resource Merger), already provide a good arsenal of 
functionality.

In terms of controlling properties, it is possible to discard a property, or 
overwrite a property.

That is totally fine for almost all use-cases. With the exception of 
multi-valued properties. 

With multi-valued properties, it could be very nice to have more fine-grained 
control over what happens with the parent's property values.

Some use-cases:
1. Inherit all values, but add a (set of) values at the end, at the beginning, 
or somewhere in-between
2. Inherit no values (can already be done with sling:hideProperties=[x])
3. Inherit no values, but redefine the property (can already be done by just 
specifying the property again, without instructions)
4. Inherit all values, except for 2 specific values
5. Inherit values, exclude some, add some (combination of 1 and 4)

The specific use-case I'm trying to tackle now indeed allows for a simple 
"merge"-mode, where our values can just be appended to the set of values from 
the parent. But I can imagine #5 and #1 could also be desired.

It seems [~JelleBouwmans] also has a requirement for this concept, so at least 
there are 2 use-cases already.

I did notice that my proposal didn't account for inserting a property value 
after a specific value.

> Update Sling Resource Merger with handling for multi-valued properties
> ----------------------------------------------------------------------
>
>                 Key: SLING-10645
>                 URL: https://issues.apache.org/jira/browse/SLING-10645
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>    Affects Versions: Resource Merger 1.4.0
>            Reporter: Henry Kuijpers
>            Priority: Major
>
> Sling Resource Merger is able to handle properties, not individual property 
> values.
> When setting up this node structure (with AEM's extraClientlibs property in 
> TouchUI dialogs):
> + /libs/wcm/basicpage/cq:dialog@extraClientlibs=["a", "b", "c"]
> + /apps/website/components/page@sling:resourceSuperType="wcm/basicpage"
> + /apps/website/components/page/cq:dialog@extraClientlibs=["d", "e"]
> We want to make sure that the extraClientlibs property that is being read in 
> website/components/page/cq:dialog will return ["a", "b", "c", "d", "e"]. 
> Currently, it will just return ["d", "e"], since the extraClientlibs-property 
> is *overwritten*. 
> It would be nice to add additional logic to allow more control over the 
> inheritance of the values that are tied to a parent's 
> extraClientlibs-property.
> Maybe we can come up with some additional properties that can function as 
> instructions to the Resource Merger (next to the ones we already have), so 
> that there can be more fine-grained control over the inheritance/removal of 
> property values in multi-valued scenarios.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to