Jukka,

What I don't understand is I find the code in the WorkspaceImporter in the
protected NodeState resolveUUIDConflict method.

Here is an excerpt:
   itemOps.checkRemoveNode(conflicting,
                   BatchedItemOperations.CHECK_ACCESS
                   | BatchedItemOperations.CHECK_LOCK
                   | BatchedItemOperations.CHECK_VERSIONING
                   | BatchedItemOperations.CHECK_CONSTRAINTS);
           // do remove conflicting (recursive)
           itemOps.removeNodeState(conflicting););

Nicolas

On 8/9/06, Jukka Zitting <[EMAIL PROTECTED]> wrote:

Hi,

On 8/9/06, Stefan Guggisberg <[EMAIL PROTECTED]> wrote:
> we should IMO support IMPORT_UUID_COLLISION_REPLACE_EXISTING
> for jcr:root properly rather than doing shortterm hacks.

Agreed. I think the correct implementation would be something like the
following:

    if (REPLACE_EXISTING and jcr:uuid matches an existing node) {
        find the target node
        foreach (target property and child node) {
            if (!protected) {
                remove();
            }
        }
        import to target
    }

This would also take care of the jcr:system case quite naturally.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - [EMAIL PROTECTED]
Software craftsmanship, JCR consulting, and Java development




--
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Reply via email to