On 10/19/06, Sridhar Raman <[EMAIL PROTECTED]> wrote:
I am using the Jackrabbit implementation of JCR. I am facing a problem while
importing contents into a repository.

These are the specifics:
The node has a property that is of type REFERENCE. This means that the value
of this property would be the UUID of the node I want it to reference. (this
I can do programmatically) The problem is during importing.

I have created an XML file in the Document View mode. It looks like this -
<tx:book tx:name="ABC" jcr:primaryType="tx:BookType" tx:author="">

tx:author is the property of type REFERENCE. It should refer to a node. How
do I show that in the document view?

I know that if I do it programmatically, and then export that repository, I
see the tx:author property having a UUID value. But that is only because the
uuid has already been generated...and the system knows it.

In my case, right at the beginning, when I import, I have no idea about the
UUID. Intuitively I want the tx:author to point to a node of type
tx:AuthType. How do I
do this???

you can't. you have to create the references programmatically.


Could someone kindly help me? It's very urgent.
If someone can tell me how to do it in the System View...I would still be
happy. I can make that switch.

Thanks,
Sridhar

PS: If at all this can be done, I have another doubt. Can this linking be
only backward referencing? Or can I even set the value of the property to
nodes that haven't been created yet.

references in JCR are always symmetric, i.e. Property.getNode() returns
the target node of a REFERENCE property and Node.getReferences()
returns the properties refering to this mix:referenceable node.

cheers
stefan



Reply via email to