7.1.10 Treatment of UUIDs

A number of different methods in the API transfer node state from one location to another. They often differ in how they treat the UUID of the node. Some methods always behave the same way in this regard, others have various options that control their behavior. The following table summarizes the behaviors of the methods.

Method

New UUID

Keep UUID (3 behaviors on conflict)

Comments

Throw

Remove from existing location

Replace at existing location

Workspace.copy
(see 7.1.7 Moving and Copying)

yes

no

no

no

copy (both within and between workspaces) simply creates a new UUID for any referenceable nodes it copies.

Session.save
Item.save
(see 7.1 Writing Repository Content)

no

no

no

yes

save pushes items to the persistent workspace, replacing existing items using UUID matching, wherever they may be in terms of path (non-referenceable nodes are kept bound to their UUID-bearing ancestor, however).

Node.update
(see 7.1.8 Updating and Cloning Nodes across Workspaces)

no

no

no

yes

update pulls the state of this node from another workspace using UUID matching, regardless of where (in terms of path) the source node is in the source workspace.

Workspace.clone
(see 7.1.7 Moving and Copying)

no

yes

yes

no

clone keeps UUIDs. There are two options to deal with cases where this workspace already contains a node with the same UUID as one being cloned over: either throw, or remove the existing node in this workspace.

Node.restore
Node.restoreByLabel
Workspace.restore
(see 8.2 Versioning)

no

yes

yes

no

restore and restoreByLabel keep UUIDs. Similar to clone, there are two options to deal with cases where this workspace already contains a node with the same UUID as being copied in as part of a restored version: either throw, or remove the existing node in this workspace.

Workspace.importXML
Session.importXML

Session.
getImportContentHandler
,
Workspace.
getImportContentHandler

(see 7.3 Importing Repository Content)

yes

yes

yes

yes

All four options are supported.