On Thu, Feb 11, 2010 at 9:49 PM, Julian Sedding <jsedd...@day.com> wrote: > As Carsten mentioned, it starts getting tricky when the > write-capabilities of the Sling API are mixed with those of JCR. AFAIU > the JcrModifiablePropertyMap is for convenience and thus optimized and > limited for the use-case of setting properties on a single node. > > Would your problem be solved by a static helper method, accepting a > Node and a Map/ValueMap to achieve the same thing, similar convenience > and purely on the JCR API? I suppose this could go into the > JcrResourceUtil. I.e. something like > JcrResourceUtil.setProperties(Node, Map<String, Object>), which does > not execute session.save().
That wouldn't help in my case, I think. The problem is not that JcrModifiablePropertyMap calls session.save() (it doesn't), but it calls node.save() which makes a session.refresh() useless. I admit the problem *is* a bit far-fetched, but I'd like to have a completely resource-agnostic method of updating properties. So that any resource that adapts to ModifiablePropertyMap can be updated. -- Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no Sommerrogata 13-15, N-0255 Oslo, Norway + 47 22 00 84 00 / +47 21 531941, ext 2070