Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 36036 invoked from network); 26 Oct 2006 00:59:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 00:59:52 -0000 Received: (qmail 62955 invoked by uid 500); 25 Oct 2006 08:52:00 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 62942 invoked by uid 500); 25 Oct 2006 08:52:00 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 62916 invoked by uid 99); 25 Oct 2006 08:52:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 01:52:00 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of stefan.guggisberg@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 01:51:48 -0700 Received: by nf-out-0910.google.com with SMTP id g2so240801nfe for ; Wed, 25 Oct 2006 01:51:26 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=H0JYvlbxEGc9jXZXj/JJMmJL0+L36umrQKY/kPaMY+uF4AobcvW9I4ptUWELw7ApQfCq0O4Q1WfPNBpb0bTTWVrBg28oprCw+/z244V0beG7zrG3pLh/7RUKRZlgvGAkI20dSV0kloHAs0dBraFF2LPhg4rNLMy9RQkC9gpHvV4= Received: by 10.78.193.19 with SMTP id q19mr507962huf; Wed, 25 Oct 2006 01:51:26 -0700 (PDT) Received: by 10.78.160.11 with HTTP; Wed, 25 Oct 2006 01:51:26 -0700 (PDT) Message-ID: <90a8d1c00610250151i1c2bd2e5qba3c69b4849ef119@mail.gmail.com> Date: Wed, 25 Oct 2006 10:51:26 +0200 From: "Stefan Guggisberg" To: users@jackrabbit.apache.org Subject: Re: Importing XML using IMPORT_UUID_COLLISION_REPLACE_EXISTING In-Reply-To: <6975007.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6973527.post@talk.nabble.com> <510143ac0610240718q5dc2ec78xd22952d829cdda51@mail.gmail.com> <6975007.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org hi pete, On 10/24/06, pdog wrote: > > > Jukka Zitting-3 wrote: > > > > Hi, > > > > On 10/24/06, pdog wrote: > >> 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. > > > > Note that the node you are trying to replace needs to be > > referenceable. You can check whether this is true by looking for a > > "jcr:uuid" attribute of the root element of the exported XML document. > > > > If needed, you can make the node referenceable like this: > > > > > > session.getRootNode().getNode("menu/privacypolicy").addMixin("mix:referenceable"); > > session.save(); > > > > BR, > > > > Jukka Zitting > > > > > > Thanks for the respone Jukka. I added on the mix:referenceable to the nodes > and when I import the XML now it overwrites the node which is the action I > was hoping for. I do notice now that if I export the XML it does have the > jcr:uuid in the XML but it doesn't have the mixin property there. > > Here is the steps I am taking: > > 1. Create a node with .addMixin("mix:referenceable") for that node and any > node above it (so the root in my example) > 2. Export the node to XML. This XML has the jcr:uuid in it but does not > have the jcr:mixinTypes in it. > 3. Now import the XML into the repository node. The node that is updated > now doesn't have the jcr:mixinTypes that were there before b/c it wasn't in > the XML. > 4. Now if I export the node to XML it doesn't have the jcr:uuid in it. > > Is this the normal behavior for the export? If so then I will just add the > mixin after the import that I do, but I thought I would ask before hand > anyways if I was doing something odd or could do something to get the > mixinTypes into the xml. you're using document view export. note that document view is not guaranteed to fully roundtrip as some information is lost in the docuemtn view xml mapping, see 6.4 XML Mappings in the jsr 170 specification. to answer you're question: this behaviour is not normal in a sense that you wouldn't expect it but it is in accordance with the specification. if you need to import previously exported content you should use system view export, i.e. Session.exportSystemView(). cheers stefan > > Thanks > -- > View this message in context: http://www.nabble.com/Importing-XML-using-IMPORT_UUID_COLLISION_REPLACE_EXISTING-tf2501558.html#a6975007 > Sent from the Jackrabbit - Users mailing list archive at Nabble.com. > >