jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Edelson <jus...@justinedelson.com>
Subject Re: Need help regarding importXML - IMPORT_UUID_COLLISION_REPLACE_EXISTING!
Date Thu, 10 Feb 2011 13:57:17 GMT
The SAXParseException is self-explanatory.

As for your overall issue, it sounds like you need to specify the UUIDs in the first import.
Or maybe not use importXML and write your own importer (I think that's what the last part
of Jukka's initial response meant)

Justin

On Feb 10, 2011, at 8:40 AM, Ashok <ashok121@gmail.com> wrote:

> As Jukka suggested fwding to users alias.
> 
> Hi everyone,
> 
> Please go through my below email and please suggest.
> 
> ---------- Forwarded message ----------
> From: Ashok <ashok121@gmail.com>
> Date: Thu, Feb 10, 2011 at 7:04 PM
> Subject: Re: Need help regarding importXML -
> IMPORT_UUID_COLLISION_REPLACE_EXISTING!
> To: jzitting@adobe.com
> 
> 
> Hi Jukka,
> 
> Thanks for you reply.
> 
> I tried including jcr:uuid in my sample program which I had attached earlier
> as below:
> **
> *updateConfig*("<configuration jcr:uuid =
> \"58c3f714-f565-45d2-a6a7-24f7b4155367\"><parameter1 jcr:uuid =
> \"420d3d39-f13e-4d06-9e4b-b0d8e683ba41\">50</parameter1><parameter2 jcr:uuid
> = \"bf445036-2926-4bab-a0b4-23018ccefbcc\">100</parameter2></configuration>"
> );
> 
> But I am getting the below exception:
> 
> Caused by: *org.xml.sax.SAXParseException*: The prefix "jcr" for attribute
> "jcr:uuid" associated with an element type "configuration" is not bound.
> 
> Moreover, since this is a sample program I have control of my XML. However
> in my project requirement, xml will be dynamically generated. So is there
> any sample program for explicitly implementing the logic by which the import
> can tell which existing JCR node corresponds to each incoming XML element.
> (which you have mentioned in your earlier mail)
> 
> 
> 
> On Thu, Feb 10, 2011 at 6:21 PM, Jukka Zitting <jzitting@adobe.com> wrote:
> 
>> Hi,
>> 
>> Note that the users@ mailing list is better for questions like these.
>> 
>> 
>> On 02/10/2011 01:24 PM, Ashok wrote:
>> 
>>> 2) If the xml value changes I need to update the changed value in
>>> repository. For this I used:
>>>   session.importXML("/" , xml,
>>>     ImportUUIDBehavior.*IMPORT_UUID_COLLISION_REPLACE_EXISTING*);
>>> *But the above step is adding nodes again rather than replacing the node
>>> with new values.*
>>> 
>> 
>> You need to include the UUIDs also in the XML content you're importing,
>> otherwise there's no way for the repository to tell which nodes you want to
>> overwrite.
>> 
>>   <a jcr:uuid="..."> <b jcr:uuid="..">10</b> <a>
>> 
>> If this is not possible (i.e. you get the XML from some external source),
>> you'll need to explicitly implement the logic by which the import can tell
>> which existing JCR node corresponds to each incoming XML element.
>> 
>> --
>> Jukka Zitting
>> 
> 
> 
> 
> -- 
> Cheers,
> Ashok
> +91-9600117508
> 
> 
> 
> -- 
> Cheers,
> Ashok
> +91-9600117508

Mime
View raw message