jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Herman" <MHer...@NBME.org>
Subject RE: Problem for move document within folders
Date Thu, 18 Aug 2011 12:04:04 GMT
Not sure if this is the error, but it looks like you call node2.checkout()
twice without any modifications or check-ins?

Also, if you're using a newer version of jackrabbit, you should look into
doing it the JCR2 way which is
session.getWorkspace().getVersionManager().checkout(...);


-----Original Message-----
From: proloyganguly [mailto:proloy.ganguly@wipro.com]
Sent: Thu 8/18/2011 2:16 AM
To: users@jackrabbit.apache.org
Subject: Problem for move document within folders
 
javax.jcr.version.VersionException: /Documents/F2/BC: cannot move a target to
a checked-in node

This exception is coming after checkout the target folder. Please see the
code below.
Code:
Session session = CustomSession.getSession();
        	try
            {
        		Node node2 = session.getRootNode().getNode(path);

        		node2.checkout(); // Destination folder

        		Node node1 =
session.getRootNode().getNode(docPath+"/"+ docName);        		
        		node1.getParent().checkout();//Parent of source
        		node2.checkout(); 
        		node1.getSession().move(node1.getPath()
,node2.getPath()); 
        		node2.getSession().save();
        		node1.getParent().checkin();        		
        		node2.checkin();
        	}
            catch (Exception e)
            {	          
	            e.printStackTrace();
            } 

--
View this message in context:
http://jackrabbit.510166.n4.nabble.com/Problem-for-move-document-within-folde
rs-tp3751867p3751867.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.



Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message