jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peeter Piegaze <peeter.pieg...@gmail.com>
Subject Re: Referenceable nodes
Date Fri, 17 Dec 2004 10:39:43 GMT
Yes, referenceable nodes are available. You create one by adding a
mixin node type to an existing node

What you are referring to is an old method no longer available that
supported "hardlinks" which allowed a node to have more than one

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


On Fri, 17 Dec 2004 00:57:21 +0100, Oliver Kiessler
<oliver.kiessler@gmail.com> wrote:
> hi,
> are referenceable nodes already available in jackrabbit? I was reading
> the spec and found a method called
> parentNode.addExistingNode("/some/path") but could not find it in
> jackrabbit...
> cheers,
> oliver

View raw message