You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Daglian, Michael (IT)" <Mi...@morganstanley.com> on 2006/10/16 18:12:03 UTC
Using importXML with existing content
Hi everyone,
Apologies if this has been answered somewhere before but I couldn't find
anything via my searching. I was wondering how I could go about using
the import xml mechanisms to update the state of one repository into
another. My scenario is pretty simple: two Jackrabbit instances each
with the same content. When one gets updated I would like to ship out
system-view xml to the other and keep it in sync. I would have assumed
that the UUID collision behavior could be used to remove/replace the
existing content in the backup but
org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
ItemExistsException if content of the same name is imported without
consulting the UUID behavior flag. Does the spec outline the behavior in
this scenario? Is there a recommended in approach for this sort of use
case? Thanks in advance!
Best Regards,
-- Mike
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Using importXML with existing content
Posted by Tobias Bocanegra <to...@day.com>.
can't you just delete /test/foo before importing the xml?
regards, toby
--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---
Re: Using importXML with existing content
Posted by Nicolas <nt...@gmail.com>.
Michael,
It depends. Will you in all case update all children node of an updated
parent node?
If yes, you can simply delete them (with the initial parent node: both will
be recreated).
If no, well it will become tricky ;)
Best Regards,
Nico
my blog! http://www.deviant-abstraction.net !!
On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
wrote:
>
> Hi Nico,
>
> Thanks for the detailed explanation! I believe the line number may be
> due to an older version of Jackrabbit being used (I got the trace from a
> colleague) so my apologies for sending you mixed information. I believe
> your assessment of the situation is correct: /test/foo has some children
> that do not allow same name siblings and are not autocreated. I also
> missed the line in the spec but I believe that it does validate the
> behavior I am seeing. All that being said, what is the workaround you
> suggest, assuming your description of the scenario?
>
> Best Regards,
>
> -- Mike
>
>
>
RE: Using importXML with existing content
Posted by "Daglian, Michael (IT)" <Mi...@morganstanley.com>.
Hi Nico,
Thanks for the detailed explanation! I believe the line number may be
due to an older version of Jackrabbit being used (I got the trace from a
colleague) so my apologies for sending you mixed information. I believe
your assessment of the situation is correct: /test/foo has some children
that do not allow same name siblings and are not autocreated. I also
missed the line in the spec but I believe that it does validate the
behavior I am seeing. All that being said, what is the workaround you
suggest, assuming your description of the scenario?
Best Regards,
-- Mike
> -----Original Message-----
> From: Nicolas [mailto:ntoper@gmail.com]
> Sent: Monday, October 16, 2006 3:27 PM
> To: users@jackrabbit.apache.org
> Subject: Re: Using importXML with existing content
>
> Michael,
>
> Actually it do both. This has to do with the node creation
> system: if you create a node, its children set on autocreate
> will be created with the node and children nodes will not be
> recreated. The UC you have is supposed to be handled by this
> version and my refactoring takes care of it too (the issue
> with this class is it is really hard to understand).
>
> The exception is on l 405 according to your stack trace. But
> the current version of the importer cannot raise an exception
> at this line (it is a commentary). I don't see any other
> ItemExistsException than the one I have sent you in this class.
>
> Since you are not using the flag
> ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, it can only
> comes from here unless you are using an older version of
> Jackrabbit. Besides, the resolveUUIDConflict method is called
> only from l 465 so the flag is not used yet.
>
> Rereading the code, I understand what is happening. Please
> confirm those
> assertions:
>
> - /test/foo has some children
> - as you said, allowSameNameSiblings is set to false
> - as you said, autoCreate is set to false
>
> Now the JCR specs states (p 226):
> "An ItemExistsException will be thrown if the top- most
> element of the incoming XML would deserialize to a node with
> the same name as an existing child of parentAbsPath and that
> child does not allow same- name siblings."
>
> (NB parentAbsPath is the string parameter in importXML method)
>
> Is this what happens to you?
>
> If yes, we will find a workaround :)
>
> BR,
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>
> On 10/16/06, Daglian, Michael (IT) <
> Michael.Daglian@morganstanley.com>
> wrote:
> >
> > Hi Nicolas,
> >
> > Pardon if I am mistaken, but doesn't the check there examine the
> > definition of the conflicting child node as opposed to any of its
> > properties? Regardless, the nodes themselves are not autocreated
> > children, have no autocreated properties, and do not allow for
> > same-named siblings - thus the exception occurs. Not quite sure if
> > there's a way round this with the existing importer. Does your
> > refactored importer allow for this use case? Again, thanks for all
> > your help.
> >
> > Best Regards,
> >
> > -- Mike
> >
>
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Using importXML with existing content
Posted by Nicolas <nt...@gmail.com>.
Michael,
Actually it do both. This has to do with the node creation system: if you
create a node, its children set on autocreate will be created with the node
and children nodes will not be recreated. The UC you have is supposed to be
handled by this version and my refactoring takes care of it too (the issue
with this class is it is really hard to understand).
The exception is on l 405 according to your stack trace. But the current
version of the importer cannot raise an exception at this line (it is a
commentary). I don't see any other ItemExistsException than the one I have
sent you in this class.
Since you are not using the flag
ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, it can only comes from here
unless you are using an older version of Jackrabbit. Besides, the
resolveUUIDConflict method is called only from l 465 so the flag is not used
yet.
Rereading the code, I understand what is happening. Please confirm those
assertions:
- /test/foo has some children
- as you said, allowSameNameSiblings is set to false
- as you said, autoCreate is set to false
Now the JCR specs states (p 226):
"An ItemExistsException will be thrown if the top-
most element of the incoming XML would deserialize
to a node with the same name as an existing child of
parentAbsPath and that child does not allow same-
name siblings."
(NB parentAbsPath is the string parameter in importXML method)
Is this what happens to you?
If yes, we will find a workaround :)
BR,
Nico
my blog! http://www.deviant-abstraction.net !!
On 10/16/06, Daglian, Michael (IT) < Michael.Daglian@morganstanley.com>
wrote:
>
> Hi Nicolas,
>
> Pardon if I am mistaken, but doesn't the check there examine the
> definition of the conflicting child node as opposed to any of its
> properties? Regardless, the nodes themselves are not autocreated
> children, have no autocreated properties, and do not allow for
> same-named siblings - thus the exception occurs. Not quite sure if
> there's a way round this with the existing importer. Does your
> refactored importer allow for this use case? Again, thanks for all your
> help.
>
> Best Regards,
>
> -- Mike
>
RE: Using importXML with existing content
Posted by "Daglian, Michael (IT)" <Mi...@morganstanley.com>.
Hi Nicolas,
Pardon if I am mistaken, but doesn't the check there examine the
definition of the conflicting child node as opposed to any of its
properties? Regardless, the nodes themselves are not autocreated
children, have no autocreated properties, and do not allow for
same-named siblings - thus the exception occurs. Not quite sure if
there's a way round this with the existing importer. Does your
refactored importer allow for this use case? Again, thanks for all your
help.
Best Regards,
-- Mike
> -----Original Message-----
> From: Nicolas [mailto:ntoper@gmail.com]
> Sent: Monday, October 16, 2006 12:56 PM
> To: users@jackrabbit.apache.org
> Subject: Re: Using importXML with existing content
>
> Hi,
>
> I guess this comes from this code snippets:
>
> if (def.isAutoCreated() && entExisting.includesNodeType(ntName)) {
> // this node has already been auto-created,
> // no need to create it
> node = existing;
> } else {
> throw new
> ItemExistsException(itemOps.safeGetJCRPath
> (existing.getNodeId()));
> }
>
> Basically, you have some children properties on auto create.
> Can you confirm this please?
>
> Nico
>
> On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
> wrote:
> >
> > Hi Nicolas,
> >
> > We do want to overwrite the existing nodes. I believe we
> will be using
> > replace existing as it reads within the spec. The
> concurrency will be
> > handled by other means (serialized updates for all intents and
> > purposes). The trace is as follows:
> >
> > javax.jcr.ItemExistsException: /test/foo
> > at
> >
> org.apache.jackrabbit.core.xml.WorkspaceImporter.startNode(WorkspaceIm
> > po
> > rter.java:405)
> > at
> >
> org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(SysVie
> > wI
> > mportHandler.java:84)
> > at
> >
> org.apache.jackrabbit.core.xml.SysViewImportHandler.endElement(SysView
> > Im
> > portHandler.java:237)
> > at
> >
> org.apache.jackrabbit.core.xml.ImportHandler.endElement(ImportHandler.
> > ja
> > va:254)
> > at
> >
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> > at
> >
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> > Source)
> > at
> >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD
> > is
> > patcher.dispatch(Unknown Source)
> > at
> >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk
> > no
> > wn Source)
> > at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > at
> >
> org.apache.jackrabbit.core.WorkspaceImpl.importXML(WorkspaceImpl.java:
> > 73
> > 1)
> > ...
> >
> > Thanks again,
> >
> > -- Mike
> >
> > > -----Original Message-----
> > > From: Nicolas [mailto:ntoper@gmail.com]
> > > Sent: Monday, October 16, 2006 12:28 PM
> > > To: users@jackrabbit.apache.org
> > > Subject: Re: Using importXML with existing content
> > >
> > > Hi Mike,
> > >
> > > So you want overwrite the nodes? Which flag did you put on:
> > > replace existing or remove existing?
> > >
> > > How would you manage concurrent updates (if there are any)?
> > >
> > > I have worked on a refactoring of the WorkspaceImporter
> (waiting to
> > > be
> > > reviewed) and the current version does consult the UUID behavior
> > > flag. Can you please send me the exception stack you have?
> > >
> > > Another solution is to use the backup tool :) but it would export
> > > all of your workspace which might not be a good idea
> (depending on
> > > the size)
> > >
> > > BR
> > > Nico
> > > my blog! http://www.deviant-abstraction.net !!
> > >
> > > On 10/16/06, Daglian, Michael (IT)
> > > <Mi...@morganstanley.com>
> > > wrote:
> > > >
> > > > Hi Nicolas,
> > > >
> > > > Versioning won't be part of the picture (at least for now).
> > > The export
> > > > only consists of the modified node(s) and their
> properties, so the
> > > > import will also be limited in scope. Of course I am
> > > willing to relax
> > > > these constraints if required.
> > > >
> > > > Thanks for the quick response!
> > > >
> > > > -- Mike
> > > >
> > > > > -----Original Message-----
> > > > > From: Nicolas [mailto:ntoper@gmail.com]
> > > > > Sent: Monday, October 16, 2006 12:14 PM
> > > > > To: users@jackrabbit.apache.org
> > > > > Subject: Re: Using importXML with existing content
> > > > >
> > > > > Hi,
> > > > >
> > > > > A first issue is versioning?
> > > > >
> > > > > Are you exporting your workspace from the root node?
> > > > >
> > > > > On 10/16/06, Daglian, Michael (IT)
> > > > > <Mi...@morganstanley.com>
> > > > > wrote:
> > > > > >
> > > > > > Hi everyone,
> > > > > >
> > > > > > Apologies if this has been answered somewhere before but I
> > > > > > couldn't find anything via my searching. I was
> wondering how I
> > > > > > could
> > > > > go about
> > > > > > using the import xml mechanisms to update the state of one
> > > > > repository
> > > > > > into another. My scenario is pretty simple: two Jackrabbit
> > > > > instances
> > > > > > each with the same content. When one gets updated I would
> > > > > like to ship
> > > > > > out system-view xml to the other and keep it in sync. I
> > > would have
> > > > > > assumed that the UUID collision behavior could be used to
> > > > > > remove/replace the existing content in the backup but
> > > > > > org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> > > > > > ItemExistsException if content of the same name is imported
> > > > > > without consulting the UUID behavior flag. Does the spec
> > > > > > outline
> > > > > the behavior
> > > > > > in this scenario? Is there a recommended in approach for
> > > > > this sort of
> > > > > > use case? Thanks in advance!
> > > > > >
> > > > > > Best Regards,
> > > > > >
> > > > > > -- Mike
> > > > > > --------------------------------------------------------
> > > > > >
> > > > > > NOTICE: If received in error, please destroy and notify
> > > > > sender. Sender
> > > > > > does not intend to waive confidentiality or privilege.
> > > Use of this
> > > > > > email is prohibited when received in error.
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > a+
> > > > > Nico
> > > > > my blog! http://www.deviant-abstraction.net !!
> > > > >
> > > > --------------------------------------------------------
> > > >
> > > > NOTICE: If received in error, please destroy and notify
> > > sender. Sender
> > > > does not intend to waive confidentiality or privilege.
> Use of this
> > > > email is prohibited when received in error.
> > > >
> > >
> > --------------------------------------------------------
> >
> > NOTICE: If received in error, please destroy and notify
> sender. Sender
> > does not intend to waive confidentiality or privilege. Use of this
> > email is prohibited when received in error.
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Using importXML with existing content
Posted by Nicolas <nt...@gmail.com>.
Hi,
I guess this comes from this code snippets:
if (def.isAutoCreated() && entExisting.includesNodeType(ntName)) {
// this node has already been auto-created,
// no need to create it
node = existing;
} else {
throw new ItemExistsException(itemOps.safeGetJCRPath
(existing.getNodeId()));
}
Basically, you have some children properties on auto create. Can you confirm
this please?
Nico
On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
wrote:
>
> Hi Nicolas,
>
> We do want to overwrite the existing nodes. I believe we will be using
> replace existing as it reads within the spec. The concurrency will be
> handled by other means (serialized updates for all intents and
> purposes). The trace is as follows:
>
> javax.jcr.ItemExistsException: /test/foo
> at
> org.apache.jackrabbit.core.xml.WorkspaceImporter.startNode(WorkspaceImpo
> rter.java:405)
> at
> org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(SysViewI
> mportHandler.java:84)
> at
> org.apache.jackrabbit.core.xml.SysViewImportHandler.endElement(SysViewIm
> portHandler.java:237)
> at
> org.apache.jackrabbit.core.xml.ImportHandler.endElement(ImportHandler.ja
> va:254)
> at
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
> patcher.dispatch(Unknown Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
> wn Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at
> org.apache.jackrabbit.core.WorkspaceImpl.importXML(WorkspaceImpl.java:73
> 1)
> ...
>
> Thanks again,
>
> -- Mike
>
> > -----Original Message-----
> > From: Nicolas [mailto:ntoper@gmail.com]
> > Sent: Monday, October 16, 2006 12:28 PM
> > To: users@jackrabbit.apache.org
> > Subject: Re: Using importXML with existing content
> >
> > Hi Mike,
> >
> > So you want overwrite the nodes? Which flag did you put on:
> > replace existing or remove existing?
> >
> > How would you manage concurrent updates (if there are any)?
> >
> > I have worked on a refactoring of the WorkspaceImporter (waiting to be
> > reviewed) and the current version does consult the UUID
> > behavior flag. Can you please send me the exception stack you have?
> >
> > Another solution is to use the backup tool :) but it would
> > export all of your workspace which might not be a good idea
> > (depending on the size)
> >
> > BR
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> > On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
> > wrote:
> > >
> > > Hi Nicolas,
> > >
> > > Versioning won't be part of the picture (at least for now).
> > The export
> > > only consists of the modified node(s) and their properties, so the
> > > import will also be limited in scope. Of course I am
> > willing to relax
> > > these constraints if required.
> > >
> > > Thanks for the quick response!
> > >
> > > -- Mike
> > >
> > > > -----Original Message-----
> > > > From: Nicolas [mailto:ntoper@gmail.com]
> > > > Sent: Monday, October 16, 2006 12:14 PM
> > > > To: users@jackrabbit.apache.org
> > > > Subject: Re: Using importXML with existing content
> > > >
> > > > Hi,
> > > >
> > > > A first issue is versioning?
> > > >
> > > > Are you exporting your workspace from the root node?
> > > >
> > > > On 10/16/06, Daglian, Michael (IT)
> > > > <Mi...@morganstanley.com>
> > > > wrote:
> > > > >
> > > > > Hi everyone,
> > > > >
> > > > > Apologies if this has been answered somewhere before but I
> > > > > couldn't find anything via my searching. I was wondering how I
> > > > > could
> > > > go about
> > > > > using the import xml mechanisms to update the state of one
> > > > repository
> > > > > into another. My scenario is pretty simple: two Jackrabbit
> > > > instances
> > > > > each with the same content. When one gets updated I would
> > > > like to ship
> > > > > out system-view xml to the other and keep it in sync. I
> > would have
> > > > > assumed that the UUID collision behavior could be used to
> > > > > remove/replace the existing content in the backup but
> > > > > org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> > > > > ItemExistsException if content of the same name is imported
> > > > > without consulting the UUID behavior flag. Does the spec outline
> > > > the behavior
> > > > > in this scenario? Is there a recommended in approach for
> > > > this sort of
> > > > > use case? Thanks in advance!
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > -- Mike
> > > > > --------------------------------------------------------
> > > > >
> > > > > NOTICE: If received in error, please destroy and notify
> > > > sender. Sender
> > > > > does not intend to waive confidentiality or privilege.
> > Use of this
> > > > > email is prohibited when received in error.
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > a+
> > > > Nico
> > > > my blog! http://www.deviant-abstraction.net !!
> > > >
> > > --------------------------------------------------------
> > >
> > > NOTICE: If received in error, please destroy and notify
> > sender. Sender
> > > does not intend to waive confidentiality or privilege. Use of this
> > > email is prohibited when received in error.
> > >
> >
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.
>
--
a+
Nico
my blog! http://www.deviant-abstraction.net !!
RE: Using importXML with existing content
Posted by "Daglian, Michael (IT)" <Mi...@morganstanley.com>.
Hi Nicolas,
We do want to overwrite the existing nodes. I believe we will be using
replace existing as it reads within the spec. The concurrency will be
handled by other means (serialized updates for all intents and
purposes). The trace is as follows:
javax.jcr.ItemExistsException: /test/foo
at
org.apache.jackrabbit.core.xml.WorkspaceImporter.startNode(WorkspaceImpo
rter.java:405)
at
org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(SysViewI
mportHandler.java:84)
at
org.apache.jackrabbit.core.xml.SysViewImportHandler.endElement(SysViewIm
portHandler.java:237)
at
org.apache.jackrabbit.core.xml.ImportHandler.endElement(ImportHandler.ja
va:254)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.jackrabbit.core.WorkspaceImpl.importXML(WorkspaceImpl.java:73
1)
...
Thanks again,
-- Mike
> -----Original Message-----
> From: Nicolas [mailto:ntoper@gmail.com]
> Sent: Monday, October 16, 2006 12:28 PM
> To: users@jackrabbit.apache.org
> Subject: Re: Using importXML with existing content
>
> Hi Mike,
>
> So you want overwrite the nodes? Which flag did you put on:
> replace existing or remove existing?
>
> How would you manage concurrent updates (if there are any)?
>
> I have worked on a refactoring of the WorkspaceImporter (waiting to be
> reviewed) and the current version does consult the UUID
> behavior flag. Can you please send me the exception stack you have?
>
> Another solution is to use the backup tool :) but it would
> export all of your workspace which might not be a good idea
> (depending on the size)
>
> BR
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
> On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
> wrote:
> >
> > Hi Nicolas,
> >
> > Versioning won't be part of the picture (at least for now).
> The export
> > only consists of the modified node(s) and their properties, so the
> > import will also be limited in scope. Of course I am
> willing to relax
> > these constraints if required.
> >
> > Thanks for the quick response!
> >
> > -- Mike
> >
> > > -----Original Message-----
> > > From: Nicolas [mailto:ntoper@gmail.com]
> > > Sent: Monday, October 16, 2006 12:14 PM
> > > To: users@jackrabbit.apache.org
> > > Subject: Re: Using importXML with existing content
> > >
> > > Hi,
> > >
> > > A first issue is versioning?
> > >
> > > Are you exporting your workspace from the root node?
> > >
> > > On 10/16/06, Daglian, Michael (IT)
> > > <Mi...@morganstanley.com>
> > > wrote:
> > > >
> > > > Hi everyone,
> > > >
> > > > Apologies if this has been answered somewhere before but I
> > > > couldn't find anything via my searching. I was wondering how I
> > > > could
> > > go about
> > > > using the import xml mechanisms to update the state of one
> > > repository
> > > > into another. My scenario is pretty simple: two Jackrabbit
> > > instances
> > > > each with the same content. When one gets updated I would
> > > like to ship
> > > > out system-view xml to the other and keep it in sync. I
> would have
> > > > assumed that the UUID collision behavior could be used to
> > > > remove/replace the existing content in the backup but
> > > > org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> > > > ItemExistsException if content of the same name is imported
> > > > without consulting the UUID behavior flag. Does the spec outline
> > > the behavior
> > > > in this scenario? Is there a recommended in approach for
> > > this sort of
> > > > use case? Thanks in advance!
> > > >
> > > > Best Regards,
> > > >
> > > > -- Mike
> > > > --------------------------------------------------------
> > > >
> > > > NOTICE: If received in error, please destroy and notify
> > > sender. Sender
> > > > does not intend to waive confidentiality or privilege.
> Use of this
> > > > email is prohibited when received in error.
> > > >
> > >
> > >
> > >
> > > --
> > > a+
> > > Nico
> > > my blog! http://www.deviant-abstraction.net !!
> > >
> > --------------------------------------------------------
> >
> > NOTICE: If received in error, please destroy and notify
> sender. Sender
> > does not intend to waive confidentiality or privilege. Use of this
> > email is prohibited when received in error.
> >
>
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Using importXML with existing content
Posted by Nicolas <nt...@gmail.com>.
Hi Mike,
So you want overwrite the nodes? Which flag did you put on: replace existing
or remove existing?
How would you manage concurrent updates (if there are any)?
I have worked on a refactoring of the WorkspaceImporter (waiting to be
reviewed) and the current version does consult the UUID behavior flag. Can
you please send me the exception stack you have?
Another solution is to use the backup tool :) but it would export all of
your workspace which might not be a good idea (depending on the size)
BR
Nico
my blog! http://www.deviant-abstraction.net !!
On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
wrote:
>
> Hi Nicolas,
>
> Versioning won't be part of the picture (at least for now). The export
> only consists of the modified node(s) and their properties, so the
> import will also be limited in scope. Of course I am willing to relax
> these constraints if required.
>
> Thanks for the quick response!
>
> -- Mike
>
> > -----Original Message-----
> > From: Nicolas [mailto:ntoper@gmail.com]
> > Sent: Monday, October 16, 2006 12:14 PM
> > To: users@jackrabbit.apache.org
> > Subject: Re: Using importXML with existing content
> >
> > Hi,
> >
> > A first issue is versioning?
> >
> > Are you exporting your workspace from the root node?
> >
> > On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
> > wrote:
> > >
> > > Hi everyone,
> > >
> > > Apologies if this has been answered somewhere before but I couldn't
> > > find anything via my searching. I was wondering how I could
> > go about
> > > using the import xml mechanisms to update the state of one
> > repository
> > > into another. My scenario is pretty simple: two Jackrabbit
> > instances
> > > each with the same content. When one gets updated I would
> > like to ship
> > > out system-view xml to the other and keep it in sync. I would have
> > > assumed that the UUID collision behavior could be used to
> > > remove/replace the existing content in the backup but
> > > org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> > > ItemExistsException if content of the same name is imported without
> > > consulting the UUID behavior flag. Does the spec outline
> > the behavior
> > > in this scenario? Is there a recommended in approach for
> > this sort of
> > > use case? Thanks in advance!
> > >
> > > Best Regards,
> > >
> > > -- Mike
> > > --------------------------------------------------------
> > >
> > > NOTICE: If received in error, please destroy and notify
> > sender. Sender
> > > does not intend to waive confidentiality or privilege. Use of this
> > > email is prohibited when received in error.
> > >
> >
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.
>
RE: Using importXML with existing content
Posted by "Daglian, Michael (IT)" <Mi...@morganstanley.com>.
Hi Nicolas,
Versioning won't be part of the picture (at least for now). The export
only consists of the modified node(s) and their properties, so the
import will also be limited in scope. Of course I am willing to relax
these constraints if required.
Thanks for the quick response!
-- Mike
> -----Original Message-----
> From: Nicolas [mailto:ntoper@gmail.com]
> Sent: Monday, October 16, 2006 12:14 PM
> To: users@jackrabbit.apache.org
> Subject: Re: Using importXML with existing content
>
> Hi,
>
> A first issue is versioning?
>
> Are you exporting your workspace from the root node?
>
> On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
> wrote:
> >
> > Hi everyone,
> >
> > Apologies if this has been answered somewhere before but I couldn't
> > find anything via my searching. I was wondering how I could
> go about
> > using the import xml mechanisms to update the state of one
> repository
> > into another. My scenario is pretty simple: two Jackrabbit
> instances
> > each with the same content. When one gets updated I would
> like to ship
> > out system-view xml to the other and keep it in sync. I would have
> > assumed that the UUID collision behavior could be used to
> > remove/replace the existing content in the backup but
> > org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> > ItemExistsException if content of the same name is imported without
> > consulting the UUID behavior flag. Does the spec outline
> the behavior
> > in this scenario? Is there a recommended in approach for
> this sort of
> > use case? Thanks in advance!
> >
> > Best Regards,
> >
> > -- Mike
> > --------------------------------------------------------
> >
> > NOTICE: If received in error, please destroy and notify
> sender. Sender
> > does not intend to waive confidentiality or privilege. Use of this
> > email is prohibited when received in error.
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Using importXML with existing content
Posted by Nicolas <nt...@gmail.com>.
Hi,
A first issue is versioning?
Are you exporting your workspace from the root node?
On 10/16/06, Daglian, Michael (IT) <Mi...@morganstanley.com>
wrote:
>
> Hi everyone,
>
> Apologies if this has been answered somewhere before but I couldn't find
> anything via my searching. I was wondering how I could go about using
> the import xml mechanisms to update the state of one repository into
> another. My scenario is pretty simple: two Jackrabbit instances each
> with the same content. When one gets updated I would like to ship out
> system-view xml to the other and keep it in sync. I would have assumed
> that the UUID collision behavior could be used to remove/replace the
> existing content in the backup but
> org.apache.jackrabbit.core.xml.WorkspaceImporter throws an
> ItemExistsException if content of the same name is imported without
> consulting the UUID behavior flag. Does the spec outline the behavior in
> this scenario? Is there a recommended in approach for this sort of use
> case? Thanks in advance!
>
> Best Regards,
>
> -- Mike
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.
>
--
a+
Nico
my blog! http://www.deviant-abstraction.net !!