You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2024/07/25 15:32:35 UTC
(jackrabbit-filevault) branch JCRVLT-763 created (now e29ba246)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a change to branch JCRVLT-763
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git
at e29ba246 JCRVLT-763: improve documentation about referenceable nodes and IdConflictPolicy
This branch includes the following new commits:
new e29ba246 JCRVLT-763: improve documentation about referenceable nodes and IdConflictPolicy
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(jackrabbit-filevault) 01/01: JCRVLT-763: improve documentation about referenceable nodes and IdConflictPolicy
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch JCRVLT-763
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git
commit e29ba246c038ca6c48b3872062949fb215a07598
Author: Julian Reschke <re...@apache.org>
AuthorDate: Thu Jul 25 16:30:01 2024 +0100
JCRVLT-763: improve documentation about referenceable nodes and IdConflictPolicy
---
src/site/markdown/referenceablenodes.md | 8 +++++---
.../java/org/apache/jackrabbit/vault/fs/api/IdConflictPolicy.java | 5 +++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/site/markdown/referenceablenodes.md b/src/site/markdown/referenceablenodes.md
index 1f75cb12..3b0007c8 100644
--- a/src/site/markdown/referenceablenodes.md
+++ b/src/site/markdown/referenceablenodes.md
@@ -21,7 +21,7 @@
## Overview
-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].
+The JCR 2.0 specification defines [referenceable nodes][1]. Those carry a `jcr:uuid` property which uniquely identifies a node within a repository workspace. FileVault exports will contain this (protected) property `jcr:uuid` (when present) which is important to keep [referential integrity][2].
The import behavior depends on the used FileVault version.
## Import behavior prior FileVault 3.5.2
@@ -33,9 +33,11 @@ In case of conflicts among siblings the existing conflicting node is [removed][5
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 [...]
-### Id Conflict Policies
+### Id Handling Policies
-The import behavior of packages with conflicting ids can be tweaked with `ImportOptions.setIdConflictPolicy(...)` per package or the default can be overridden in the [OSGi Configuration](config.html). For further details refer to the [JavaDoc][3]. The old behavior can be achieved with `IdConflictPolicy.LEGACY`.
+The import behavior of packages with can be tweaked with `ImportOptions.setIdConflictPolicy(...)` per package or the default can be overridden in the [OSGi Configuration](config.html). For further details refer to the [JavaDoc][3]. The old behavior can be achieved with `IdConflictPolicy.LEGACY`.
+
+Note that `CREATE_NEW_ID` will enforce creation of new identifiers, even when no node with conflicting ids.
[1]: https://s.apache.org/jcr-2.0-spec/3_Repository_Model.html#3.8%20Referenceable%20Nodes
[2]: https://s.apache.org/jcr-2.0-spec/3_Repository_Model.html#3.8.2%20Referential%20Integrity
diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/IdConflictPolicy.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/IdConflictPolicy.java
index 9c1b6523..7449607d 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/IdConflictPolicy.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/IdConflictPolicy.java
@@ -18,6 +18,11 @@ package org.apache.jackrabbit.vault.fs.api;
import javax.jcr.ImportUUIDBehavior;
+/**
+ * Defines the handling of IDs on import.
+ * <p>
+ * Note: {@code CREATE_NEW_ID} affects imports of nodes without id conflicts as well.
+ */
public enum IdConflictPolicy {
/** 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. */
FAIL,