[
https://issues.apache.org/jira/browse/SLING-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carsten Ziegeler updated SLING-3451:
------------------------------------
Fix Version/s: JCR Resource 2.3.6
> Support for deep reads from a value map
> ---------------------------------------
>
> Key: SLING-3451
> URL: https://issues.apache.org/jira/browse/SLING-3451
> Project: Sling
> Issue Type: Improvement
> Components: API
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Fix For: JCR Resource 2.3.6, API 2.7.0, Mongo Resource Provider
> 1.0.0, JMX Resource Provider 1.0.2, Resource Merger 1.1.2
>
>
> When writing rendering code, a commonly used shortcut is to do deep reads to
> get properties from a child resource, like:
> ValueMap vm = ResourceUtil.getValueMap(resource);
> vm.get("jcr:content/jcr:title", "No title found");
> While this works with jcr backed resources, this doesn't work in the general
> case and a value map returned by a resource should not support this. In
> addition, the implementation in the jcr resource bundle is wrong as it
> bypasses all resource mechanisms, e.g. in the above case
> resource.getChild("jcr:content") might return a resource from a different
> resource provider etc.
> Adding the same code over and over again in each ValueMap implementation
> doesn't look like a good solution either.
> The simplest solution would be to enhance ResourceUtil.getValueMap() to
> return a wrapper of the value map which allows deep reads.
--
This message was sent by Atlassian JIRA
(v6.2#6252)