You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ChadDavis <ch...@gmail.com> on 2010/02/03 20:31:20 UTC

nuances of importing XML data

I would like my app to import some data from system view XML at
startup.  It's a sort of configuration file.  To import my file, I'm
using the following code:

	session.importXML( "/", fileInputStream ,
ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING );

This import occurs, as expected, and the data is imported into my
repository tree.

When I restart my app a second time, the same data is imported and
get's placed as a SNS.  I understand this behavour as well.  However,
my goals are different.  I would like to be able to have the import
act as an "update" to the previously imported data.  In other words, I
want the import to note whether there was any difference in my data,
and, if so, update the existing data with those changes.

Does the API support this?  Perhaps this task is left to me.

Re: nuances of importing XML data

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Feb 4, 2010 at 13:45, Alexander Klimetschek <ak...@day.com> wrote:
> Yes, an "update" must be done by the application. When using the
> import, your only option is to remove the subtree before running the
> import.

Oh, or have all nodes referenceable, but I wouldn't recommend this.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: nuances of importing XML data

Posted by Alexander Klimetschek <ak...@day.com>.
On Wed, Feb 3, 2010 at 18:31, ChadDavis <ch...@gmail.com> wrote:
> In other words, I
> want the import to note whether there was any difference in my data,
> and, if so, update the existing data with those changes.
>
> Does the API support this?  Perhaps this task is left to me.

Yes, an "update" must be done by the application. When using the
import, your only option is to remove the subtree before running the
import.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com