jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Kiessler <oliver.kiess...@gmail.com>
Subject Re: Referenceable nodes
Date Fri, 17 Dec 2004 13:08:53 GMT
On Fri, 17 Dec 2004 11:39:43 +0100, Peeter Piegaze
<peeter.piegaze@gmail.com> wrote:
> Yes, referenceable nodes are available. You create one by adding a
> mixin node type to an existing node
> someNode.addMixin("mix:referenceable")
> What you are referring to is an old method no longer available that
> supported "hardlinks" which allowed a node to have more than one
> parent.
> Being referencable was a precondition of being hardlinked, but
> hardlinks have been removed from the spec.
> But referenceable-ness is still significant because it allows a node
> to pointed to by a property of type REFERENCE elsewhere in WS.
> Once you have your node with mixin mix:referenceable you can create a
> REFERENCE property that points to it like this
> someOtherNode.addProperty("myRefProp", someNode)
> Then you can traverse that link like this
> Property myRefProp = someOtherNode.getProperty("myRefProp")
> Node myNode = myRefProp.getNode();
> At this point myNode and someNode are distinct objects that represent
> the same actual node in the repository.
> Hope this helps
> Cheers,
> Peeter

thanks, peeter!
It works fine, this is what the nodes look like:

 ->/global/users/description=Global users node.




View raw message