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

Alexander Klimetschek commented on SLING-3909:
----------------------------------------------

The difference is between putting those write operations in the Resource API 
(the resource implementation returned by the merged provider) vs. a separate 
utility where applications could specify where they want to write.

Current approach in the resources, not allowing to specify where you want to 
write (e.g. /apps2, /apps, /libs...):
{code}
Resource resource = resolver.getResource("/mnt/overlay/myproject/config");
ModifiableValueMap map = resource.adaptTo(ModifiableValueMap.class);
map.put("setting", "foo");
{code}

Separate utility (just a sketch to point out that you could pass /libs and not 
be constrained to the default impl going to the most significant resource such 
as /apps2):
{code}
Resource resource = resolver.getResource("/mnt/overlay/myproject/config");
// ResourceMergerWriteService writer;
ModifiableValueMap map = writer.getMap(resource, "/libs");
map.put("setting", "foo");
{code}


> Merged ResourceProviders should be optionally modifiable
> --------------------------------------------------------
>
>                 Key: SLING-3909
>                 URL: https://issues.apache.org/jira/browse/SLING-3909
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Justin Edelson
>            Assignee: Carsten Ziegeler
>             Fix For: Resource Merger 1.2.0
>
>
> This is a continuation of the work originally started in SLING-3420.
> Modification are always done on the "most significant" resource (i.e. 
> /apps/foo instead of /libs/foo) as determined by the MergedResourcePicker.
> The algorithm for modification is as follows:
> * Create - if the most significant resource doesn't exist, one is created at 
> that path; otherwise an exception is thrown.
> * Delete - if the most significat resource doesn't exist, the hide children 
> property is set on the most signfiicant resource's parent. if it does exist, 
> it is deleted and the hide children property is set.
> * Property Modifications - most significant resource is created as necessary.
> ** Create - created on most significant resource
> ** Modify - created/updated on most significant resource
> ** Delete - deleted if necessary on most significant resource and hidden.



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

Reply via email to