jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kazim_ssuet@yahoo.com" <kazim_ss...@yahoo.com>
Subject copying content from one resource node to another
Date Thu, 10 Feb 2011 18:18:55 GMT


We have a scenario that requires copying documents from one entity to
I understand that by setting the "DataStore" in configuration you can have
only one copy of the document pointed by multiple resource nodes.

But I would like to avoid reading data from one resource node and setting it
to a new one since this requires extra time and memory. Is there a way that
I can set the content hash of the existing document on new resource node and
not read contents while copying?

Basically I would like to avoid this peice of code:

Property contentProperty = fromNode.getProperty(JcrConstants.JCR_DATA);
Binary contentBinary = contentProperty.getBinary();
byte content[]=new byte[(int)contentBinary.getSize()];

Instead I would like to somehow get pointer to existing content and set it
to new resource node, Since there might be 100s of document being transfered
from one entity to another, which would be costly in terms of time and
memory to do it this way.

Second question, if I use references (not recommended according to David's
model http://wiki.apache.org/jackrabbit/DavidsModel) does removing original
node make the references invalid? or you can't remove original node if
references to that node exist?


View this message in context: http://jackrabbit.510166.n4.nabble.com/copying-content-from-one-resource-node-to-another-tp3299707p3299707.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

View raw message