You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Matthew Fulford <ma...@pfiks.com> on 2007/11/01 10:46:45 UTC

Import UUID Behavior

Hi,
I'm developing a utility that can perform export and import tasks on
content repositories, the main purposes being backup/restore and
migrating content from dev>staging>production.

The export task exports a node called Content (mix:referenceable) at the
repository root using system view, and the import task imports the
Content node from the exported XML file into the root node. The import
task uses ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING and
everything seems to be working as expected.

My question is: what if the Content node already exists but has a
different UUID to the incoming Content node? Will the existing node
still be removed by the import prior to adding the incoming version?

Also, out of interest, is item UUID generation based on anything
specific or is it random? Will a node called Content at the root always
have the same UUID?

Thanks,
Matt

RE: Import UUID Behavior

Posted by Matthew Fulford <ma...@pfiks.com>.
Hi Stefan,

> -----Original Message-----
> From: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com]
> Sent: 01 November 2007 10:33
> To: users@jackrabbit.apache.org
> Subject: Re: Import UUID Behavior
> 
> hi matt
> 
> On 11/1/07, Matthew Fulford <ma...@pfiks.com> wrote:
> > Hi,
> > I'm developing a utility that can perform export and import tasks on
> > content repositories, the main purposes being backup/restore and
> > migrating content from dev>staging>production.
> >
> > The export task exports a node called Content (mix:referenceable) at
the
> > repository root using system view, and the import task imports the
> > Content node from the exported XML file into the root node. The
import
> > task uses ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING
and
> > everything seems to be working as expected.
> >
> > My question is: what if the Content node already exists but has a
> > different UUID to the incoming Content node? Will the existing node
> > still be removed by the import prior to adding the incoming version?
> 
> no, since they have different UUID's and the specified behaviour is
> based on equality of UUID's. so, if the oarent node allows same name
> siblings
> you'll end up with 2 Content nodes; otherwise you'll get an exception.
> 

Ok, so I need to delete the Content node first if it already exists, as
the parent node (root - nt:unstructured) does allow same name siblings.

> >
> > Also, out of interest, is item UUID generation based on anything
> > specific or is it random? Will a node called Content at the root
always
> > have the same UUID?
> 
> no, UUID generation is random.
> 
> cheers
> stefan
> 
> >
> > Thanks,
> > Matt
> >

Thanks for the info.
Matt

Re: Import UUID Behavior

Posted by Stefan Guggisberg <st...@gmail.com>.
hi matt

On 11/1/07, Matthew Fulford <ma...@pfiks.com> wrote:
> Hi,
> I'm developing a utility that can perform export and import tasks on
> content repositories, the main purposes being backup/restore and
> migrating content from dev>staging>production.
>
> The export task exports a node called Content (mix:referenceable) at the
> repository root using system view, and the import task imports the
> Content node from the exported XML file into the root node. The import
> task uses ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING and
> everything seems to be working as expected.
>
> My question is: what if the Content node already exists but has a
> different UUID to the incoming Content node? Will the existing node
> still be removed by the import prior to adding the incoming version?

no, since they have different UUID's and the specified behaviour is
based on equality of UUID's. so, if the oarent node allows same name siblings
you'll end up with 2 Content nodes; otherwise you'll get an exception.

>
> Also, out of interest, is item UUID generation based on anything
> specific or is it random? Will a node called Content at the root always
> have the same UUID?

no, UUID generation is random.

cheers
stefan

>
> Thanks,
> Matt
>