Details
-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
None
Description
The JCR API doesn't provide a way to go from a multivalued REFERENCE property to the Nodes. The current approach seems to be, e.g.:
p = Property.getValues Value[] values = p.getValues session.getNodeByIdentifier(values[0])
If you have a single-valued Property, you can just do, e.g.:
Property#getNode
Here are a couple API extensions we could add:
Node Value#getNode(Session)
Value doesn't have a session available, so we have to send one in. It's a new pattern, but maybe the most consistent with normal usage.
NodeIterator Property#getNodes and/or
Node Property#getNode(int index)
Property does have a Session member. None of the other JCR methods support multivalued field access, which makes this a little weird too.
I think the first option would be easier for me to work with (and adapt into existing code), because we're already passing Values around for processing, but welcome other suggestions.