My use case is AEM:
I have an existing page containing some components (each one encapsulated in 
dedicated child resources).
Now the underlying template in AEM is extended (i.e. new fixed components have 
been added). For each of those a child resource is necessary, which does not 
exist yet on older pages (being created at a point in time, where the template 
did not have that component yet).

In Sightly we include those new components via data-sly-use with an explicit 
resourceType. Sightly will first try to get the child resource with that path. 
If it does not exist yet it will create a SyntheticResource with the given 
resource type.
For example to get the cloud service configuration we would need to get the 
(existing) container AEM page for the SyntheticResource. This currently fails, 
because of the issues mentioned.

If this would work, the component would be rendered fine (even acting on a 
SyntheticResource).
Konrad



> On 10 Jun 2016, at 09:48, Carsten Ziegeler <cziege...@apache.org> wrote:
> 
> Konrad Windszus wrote
>> This is complex to solve for the client (and kind of unexpected that this is 
>> not working).
>> So what speaks against supporting this use case properly in Sling.
>> Maybe you can elaborate a bit on 
>>> I think calling resolve() for traversal is totally unexpected.
>> 
>> IMHO the complex cases should be nicely covered by Sling (instead of adding 
>> that burden to each client).
>> Of course calling resolve() would only be done for the NonExistingResource 
>> (and maybe the SyntheticResource). The handling for regular existing 
>> resources should stay exactly as is (i.e. not relying on resolve() at all).
>> 
>> I meanwhile opened https://issues.apache.org/jira/browse/SLING-5773 
>> <https://issues.apache.org/jira/browse/SLING-5773> about this problem.
>> 
> 
> The only place where you get a NonExistingResource is the resolve
> method, getResource returns null. As this is known, whoever is calling
> resolve() can check whether the returned resource is a
> NonExistingResource, then call resolve with the parent path or whatever.
> 
> What is your use case?
> 
> Regards
> Carsten
> -- 
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org

Reply via email to