jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From François Cassistat...@maya-systems.com>
Subject Re: Backup/Copy selected nodes
Date Tue, 01 Jun 2010 14:42:03 GMT
Hi,

To copy on the same repository, simply use Workspace.copy :
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Workspace.html#copy%28java.lang.String,%20java.lang.String,%20java.lang.String%29

To copy to another repository, you need to export the nodes into an intermediary format, Jackrabbit
supports exporting and importing in XML. Use Session.exportSystemView and Session.importXML
to export/import nodes one by one.
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html#exportDocumentView%28java.lang.String,%20java.io.OutputStream,%20boolean,%20boolean%29
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/Session.html#importXML%28java.lang.String,%20java.io.InputStream,%20int%29

You can use PipedOutputStream and PipedInputStream to pass directly the XML from one repository
to another or use temporary files. Also, you may want to put different locks on nodes when
exporting if you allow concurrent accesses to your repositories.


Frank


Le 2010-06-01 à 2:56 AM, Shahbaz a écrit :

> 
> Hi,
> 
> I have a repository of persisted email contents. for which user have the
> option to archive his specific (by date) emails . Can I backup/copy specific
> nodes to same or different repository? If yes then how? I will be please
> with the an immediate response..
> 
> 
> -- 
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Backup-Copy-selected-nodes-tp2238086p2238086.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message