jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdog <pete.ma...@connectyourcare.com>
Subject Importing XML using IMPORT_UUID_COLLISION_REPLACE_EXISTING
Date Tue, 24 Oct 2006 14:10:45 GMT

I am trying to import an xml file into an existing repository.  Just trying
to get a simple example working but when I import the xml it doesn't
overwrite the node that I am trying to replace, but it creates a new node of
the same name in the path specified.  Here is the simple code that I am
using:

Session jcrSession = repository.login(credentials, "default");
File inputFile = new File("C:\\java\\jackrabbit\\xml\\privacypolicy.xml");
FileInputStream in = new FileInputStream(inputFile);
Workspace workspace = jcrSession.getWorkspace();
workspace.importXML("/menu", in,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
jcrSession.save();

It isn't anything complicated as i'm just trying to get an understanding for
Jackrabbit and JCR in general for use with our system.  I'm just not sure
why when setting the uuidBehavior to replace existing on a collision it
wouldn't replace the node that is currently there.  Is there something that
needs to be done on the export of the xml file that I am not doing?  Here is
what I do to export to xml:

File outputFile = new File("C:\\java\\jackrabbit\\xml\\privacypolicy.xml");
FileOutputStream out = new FileOutputStream(outputFile);
jcrSession.exportDocumentView("/menu/privacypolicy", out, true, false);

Thanks for any help.
-- 
View this message in context: http://www.nabble.com/Importing-XML-using-IMPORT_UUID_COLLISION_REPLACE_EXISTING-tf2501558.html#a6973527
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message