[jira] [Updated] (SLING-3279) Leverage improved observation support from Oak

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3279?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler updated SLING-3279: Attachment: SLING-3279-combined-7.patch Updated patch with minor chnages (coding style

[jira] [Commented] (SLING-3279) Leverage improved observation support from Oak

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13934751#comment-13934751 ] Carsten Ziegeler commented on SLING-3279: - Thanks, looks good now - I'Ve attached

[RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
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

[jira] [Created] (SLING-3453) Provide an utility method to unwrap a resource object

2014-03-14 Thread Carsten Ziegeler (JIRA)
Carsten Ziegeler created SLING-3453: --- Summary: Provide an utility method to unwrap a resource object Key: SLING-3453 URL: https://issues.apache.org/jira/browse/SLING-3453 Project: Sling

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Bertrand Delacretaz
On Fri, Mar 14, 2014 at 9:19 AM, Carsten Ziegeler cziege...@apache.org wrote: ...The simplest solution would be to enhance ResourceUtil.getValueMap() to return a wrapper of the value map which allows deep reads... Sounds reasonable, but will that also work if I just call

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
2014-03-14 10:58 GMT+01:00 Bertrand Delacretaz bdelacre...@apache.org: On Fri, Mar 14, 2014 at 9:19 AM, Carsten Ziegeler cziege...@apache.org wrote: ...The simplest solution would be to enhance ResourceUtil.getValueMap() to return a wrapper of the value map which allows deep reads...

[jira] [Created] (SLING-3454) Extensions interface of ResourceProvider should be marked as ProviderType

2014-03-14 Thread Carsten Ziegeler (JIRA)
Carsten Ziegeler created SLING-3454: --- Summary: Extensions interface of ResourceProvider should be marked as ProviderType Key: SLING-3454 URL: https://issues.apache.org/jira/browse/SLING-3454

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Bertrand Delacretaz
On Fri, Mar 14, 2014 at 11:03 AM, Carsten Ziegeler cziege...@apache.org wrote: ...Just for rendering code, it is quiet handy to have deep reads - and rendering code is using ResourceUtil.getValueMap()... Why would rendering code use this over Resource.adaptTo? Sling makes the current resource

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Bertrand Delacretaz
On Fri, Mar 14, 2014 at 11:19 AM, Bertrand Delacretaz bdelacre...@apache.org wrote: ...I'm not opposed to changing just ResourceUtil.getValueMap() to provide deep value maps, just trying to understand the reasoning behind it Thinking about it...if we require people to use a utility method,

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Jeff Young
FWIW, there are lots of calls to resource.adaptTo(ValueMap) in rendering code. Cheers, Jeff. On 14/03/2014 10:19, Bertrand Delacretaz bdelacre...@apache.org wrote: On Fri, Mar 14, 2014 at 11:03 AM, Carsten Ziegeler cziege...@apache.org wrote: ...Just for rendering code, it is quiet handy to

RE: [RT] Support for deep reads from a value map

2014-03-14 Thread Amit.. Gupta.
FWIW, there are lots of calls to resource.adaptTo(ValueMap) in rendering code. +1

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
The idea behind ResourceUtil.getValueMap is that it never returns null while resource.adaptTo(ValueMap) can. That's the whole point of this utility method. I assume people who do resource.adaptTo(ValueMap) never check for null which is bound to fail Carsten 2014-03-14 11:30 GMT+01:00 Amit..

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
The only other option I see is to make ValueMap a first class citizen and: a) add a getValueMap() method to Resource - default implementation in AbstractResource does the same as ResourceUtil does today b) clearly state that deep gets are allowed for reading from those maps c) provide utility code

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Bertrand Delacretaz
Hi, On Fri, Mar 14, 2014 at 11:42 AM, Carsten Ziegeler cziege...@apache.org wrote: ...The only other option I see is to make ValueMap a first class citizen and: a) add a getValueMap() method to Resource - default implementation in AbstractResource does the same as ResourceUtil does today b)

ResourceUtil.resourceTypeToPath: String.replaceAll

2014-03-14 Thread Felix Meschberger
Hi I am playing around with performance testing and noticed that the ResourceUtil.resourceTypeToPath method uses String.replaceAll to replace colons with slashes. I have the impression using a regular expression to replace a single character with another character is overkill and replacing

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
All implementations should inherit from AbstractResource for exactly those reasons :) Carsten 2014-03-14 11:48 GMT+01:00 Bertrand Delacretaz bdelacre...@apache.org: Hi, On Fri, Mar 14, 2014 at 11:42 AM, Carsten Ziegeler cziege...@apache.org wrote: ...The only other option I see is to

Re: ResourceUtil.resourceTypeToPath: String.replaceAll

2014-03-14 Thread Carsten Ziegeler
+1 2014-03-14 11:51 GMT+01:00 Felix Meschberger fmesc...@adobe.com: Hi I am playing around with performance testing and noticed that the ResourceUtil.resourceTypeToPath method uses String.replaceAll to replace colons with slashes. I have the impression using a regular expression to

Re: ResourceUtil.resourceTypeToPath: String.replaceAll

2014-03-14 Thread Bertrand Delacretaz
Hi, On Fri, Mar 14, 2014 at 11:51 AM, Felix Meschberger fmesc...@adobe.com wrote: ...I have the impression using a regular expression to replace a single character with another character is overkill and replacing this code with a simple String.replace(':', '/') might be more appropriate

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Bertrand Delacretaz
On Fri, Mar 14, 2014 at 11:53 AM, Carsten Ziegeler cziege...@apache.org wrote: All implementations should inherit from AbstractResource for exactly those reasons :) *in theory*, yes. -Bertrand

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
Well, in practice, bundles implementing a previous version will not resolve anyway 2014-03-14 11:56 GMT+01:00 Bertrand Delacretaz bdelacre...@apache.org: On Fri, Mar 14, 2014 at 11:53 AM, Carsten Ziegeler cziege...@apache.org wrote: All implementations should inherit from AbstractResource

[jira] [Updated] (SLING-3454) Extensions interface of ResourceProvider should be marked as ProviderType

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler updated SLING-3454: Fix Version/s: (was: API 2.6.2) Extensions interface of ResourceProvider should be

Re: ResourceUtil.resourceTypeToPath: String.replaceAll

2014-03-14 Thread Felix Meschberger
Hi Am 14.03.2014 um 11:56 schrieb Bertrand Delacretaz bdelacre...@apache.org: Hi, On Fri, Mar 14, 2014 at 11:51 AM, Felix Meschberger fmesc...@adobe.com wrote: ...I have the impression using a regular expression to replace a single character with another character is overkill and

Re: ResourceUtil.resourceTypeToPath: String.replaceAll

2014-03-14 Thread Bertrand Delacretaz
On Fri, Mar 14, 2014 at 1:17 PM, Felix Meschberger fmesc...@adobe.com wrote: ..just for the fun of it created a stupid microbenchmark indicating the char String.replace(char, char) based implementation to be almost 6x times faster than the old one ;-)... Way to go! Thanks for tackling this.

[jira] [Created] (SLING-3455) Adaptation of injected objects does not work on classes

2014-03-14 Thread Justin Edelson (JIRA)
Justin Edelson created SLING-3455: - Summary: Adaptation of injected objects does not work on classes Key: SLING-3455 URL: https://issues.apache.org/jira/browse/SLING-3455 Project: Sling

[jira] [Updated] (SLING-3451) Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ 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: Resource Merger 1.1.2 JMX Resource Provider 1.0.2

[jira] [Commented] (SLING-3451) Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13935011#comment-13935011 ] Carsten Ziegeler commented on SLING-3451: - As discussed in the mailing list, this

[jira] [Resolved] (SLING-3455) Adaptation of injected objects does not work on classes

2014-03-14 Thread Justin Edelson (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Justin Edelson resolved SLING-3455. --- Resolution: Fixed Assignee: Justin Edelson fixed in r1577534. Was an unfortunate typo.

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
I've commited a first version based on this. The good news is that only a few bundles are affected. Apart from API, we need to update the JMX Resource Provider, the Merge Resource Provider and the Mongo DB Resource Provider. The JCR Resource Provider has already an implementation - while this is

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Felix Meschberger
Hi Am 14.03.2014 um 11:42 schrieb Carsten Ziegeler cziege...@apache.org: The only other option I see is to make ValueMap a first class citizen and: I think this makes sense independently of deep reads or not — and maybe we should have done this right when we introduced the ValueMap... a)

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
Hi Felix, yes, the changes I just committed in fact deprecate ResourceUtil.getValueMap() and let that method call resource.getValueMap() (if resource is not null of course). The utility code is an implementation of the value map which supports the deep read methods. See the new

[jira] [Resolved] (SLING-3453) Provide an utility method to unwrap a resource object

2014-03-14 Thread Carsten Ziegeler (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Carsten Ziegeler resolved SLING-3453. - Resolution: Fixed Provide an utility method to unwrap a resource object

[jira] [Created] (SLING-3456) Create project and sample integration tests for replication

2014-03-14 Thread Marius Petria (JIRA)
Marius Petria created SLING-3456: Summary: Create project and sample integration tests for replication Key: SLING-3456 URL: https://issues.apache.org/jira/browse/SLING-3456 Project: Sling

[jira] [Updated] (SLING-3456) Create project and sample integration tests for replication

2014-03-14 Thread Marius Petria (JIRA)
[ https://issues.apache.org/jira/browse/SLING-3456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marius Petria updated SLING-3456: - Attachment: SLING-3456.patch I moved the replication source code to

Re: [VOTE] Release Apache Sling JCR Resource 2.3.4

2014-03-14 Thread Carsten Ziegeler
Anyone else? 2014-03-11 19:34 GMT+01:00 Oliver Lietz apa...@oliverlietz.de: On Tuesday 11 March 2014 09:32:26 Carsten Ziegeler wrote: Hi, this vote is about the release of Apache Sling JCR Resource 2.3.4 which contains an important bug fix:

Re: [VOTE] Release Apache Sling Engine 2.3.2

2014-03-14 Thread Carsten Ziegeler
Anyone else? 2014-03-12 8:34 GMT+01:00 Carsten Ziegeler cziege...@apache.org: +1 2014-03-11 11:35 GMT-07:00 Oliver Lietz apa...@oliverlietz.de: On Tuesday 11 March 2014 14:38:43 Carsten Ziegeler wrote: Hi, this vote is about the release of Apache Sling Engine 2.3.2 which

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Carsten Ziegeler
I just found out that we have to change our idea a little bit, we can't demand that Resource#adaptTo(ValueMap.class) always returns a value map. The nice exception is the JcrPropertyResource... Regards Carsten 2014-03-14 15:08 GMT+01:00 Carsten Ziegeler cziege...@apache.org: Hi Felix, yes,

Re: [RT] Support for deep reads from a value map

2014-03-14 Thread Alexander Klimetschek
IIUC, a deep read is now done generically by fetching sub resources first and each value map will from now on only read their local values. I think this introduces overhead for a lot of common operations. For every descendant node you now have to read and instantiate a resource and value map.