You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/markdown/importmode.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,9 @@
17
17
18
18
Import Mode
19
19
===========
20
-
The import mode defines how imported content affects existing content in the repository. It is controlled by the [ImportMode][api.ImportMode] set in the [Workspace Filter](filter.html) and defaults to `REPLACE`.
20
+
The import mode defines how imported content affects existing content in the repository. It is controlled by the [ImportMode][api.ImportMode] set in the [Workspace Filter](filter.html) and defaults to `REPLACE`.
21
+
22
+
Details on how node ids are treated during import are outlined at [Referenceable Nodes](referenceablenodes.html)
Licensed to the Apache Software Foundation (ASF) under one or more
3
+
contributor license agreements. See the NOTICE file distributed with
4
+
this work for additional information regarding copyright ownership.
5
+
The ASF licenses this file to You under the Apache License, Version 2.0
6
+
(the "License"); you may not use this file except in compliance with
7
+
the License. You may obtain a copy of the License at
8
+
9
+
http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+
Unless required by applicable law or agreed to in writing, software
12
+
distributed under the License is distributed on an "AS IS" BASIS,
13
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+
See the License for the specific language governing permissions and
15
+
limitations under the License.
16
+
-->
17
+
18
+
# Referenceable Nodes
19
+
20
+
<!-- MACRO{toc} -->
21
+
22
+
## Overview
23
+
24
+
The JCR 2.0 specification defines [referenceable nodes][1]. Those carry a `jcr:uuid` property which uniquely identifies a node within a repository workspace. Each FileVault export contains this (protected) property `jcr:uuid` as well which is important to keep [referential integrity][2].
25
+
The import behavior depends on the used FileVault version.
26
+
27
+
## Behaviour prior FileVault 3.5.2
28
+
29
+
The ids of referenceable nodes are only kept during import when a node with the same name (independent of its `jcr:uuid` value) does not yet exist in the repository. For existing nodes the ids are never updated with the value from the package. They either get a new id or keep their old one (in case the old node was already a referenceable node). In case of conflicts with nodes at a different path, the existing conflicting node is [removed][5].
30
+
31
+
## Behavior since FileVault 3.5.2
32
+
33
+
Since version 3.5.2 ([JCRVLT-551](https://issues.apache.org/jira/browse/JCRVLT-551)) FileVault tries to use the `jcr:uuid` of the node in the package even if a same named node does already exist. In case this cannot be achieved while keeping referential integrity of old and new nodes an exception is thrown. Existing nodes with conflicting identifiers or reference properties towards conflicting identifiers are removed in advance if they are contained in the [filter rules][4] to reduce the conflict potential.
34
+
35
+
### Id Conflict Policies
36
+
37
+
The import behavior of packages with conflicting ids can be tweaked with `ImportOptions.setIdConflictPolicies(...)`. For further details refer to its [javadoc][3]. The old behavior can be achieved with `IdConflictPolicy.FORCE_REMOVE_CONFLICTING_ID`.
* Licensed to the Apache Software Foundation (ASF) under one or more
3
+
* contributor license agreements. See the NOTICE file distributed with
4
+
* this work for additional information regarding copyright ownership.
5
+
* The ASF licenses this file to You under the Apache License, Version 2.0
6
+
* (the "License"); you may not use this file except in compliance with
7
+
* the License. You may obtain a copy of the License at
8
+
*
9
+
* http://www.apache.org/licenses/LICENSE-2.0
10
+
*
11
+
* Unless required by applicable law or agreed to in writing, software
12
+
* distributed under the License is distributed on an "AS IS" BASIS,
13
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+
* See the License for the specific language governing permissions and
15
+
* limitations under the License.
16
+
*/
17
+
packageorg.apache.jackrabbit.vault.fs.api;
18
+
19
+
importjavax.jcr.ImportUUIDBehavior;
20
+
21
+
publicenumIdConflictPolicy {
22
+
/** Default handling, fail in case of unresolvable conflicts. Conflicts are automatically resolved in case the conflicting UUID and all its references are inside the package filter. */
23
+
FAIL,
24
+
/** Create a new ID for the imported node (for all referenceable nodes), this may break existing references in the package. This fails if a referenced node is overwritten by a node with a different id */
25
+
CREATE_NEW_ID,
26
+
/** Remove the node with the conflicting id along with its references (even if outside the filters). This goes beyond {@link ImportUUIDBehavior#IMPORT_UUID_COLLISION_REMOVE_EXISTING}, as it also does not only resolve UUID collisions but also replacements of referenceable nodes with different ids.
27
+
* Use with care, as this may remove references outside the filter. */
0 commit comments