From version 10.1
edited by Marius Dumitru Florea
on 2019/07/22 12:38
To version 11.1
edited by Simon Urli
on 2019/08/12 09:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.mflorea
1 +xwiki:XWiki.surli
EXOExtensionCode.ExtensionClass[0]
Bundled With
... ... @@ -1,0 +1,1 @@
1 +XWiki Standard
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -1,6 +1,6 @@
1 1  Since there is no real standard API for it and that most of the existing library are not very active enough or very tied to various EDIs we decided to write our own API for XWiki ecosystem which would be independent from the actual implementation.
2 2  
3 -= List Diff =
3 += List Diff & Merge =
4 4  
5 5  == Base API module ==
6 6  
... ... @@ -15,7 +15,7 @@
15 15  {
16 16   /**
17 17   * Produce a diff between the two provided versions.
18 - *
18 + *
19 19   * @param <E> the type of compared elements
20 20   * @param previous the previous version of the content to compare
21 21   * @param next the next version of the content to compare
... ... @@ -27,7 +27,24 @@
27 27  
28 28   /**
29 29   * Execute a 3-way merge on provided versions.
30 - *
30 + * If a conflict is detected during the merge, no error is triggered and the returned {@link MergeResult} object
31 + * always has a result (see {@link MergeResult#getMerged()}): the conflict is automatically fixed with a fallback
32 + * defined by the {@link MergeConfiguration}.
33 + *
34 + * If the {@link MergeConfiguration} instance contains some {@link ConflictDecision}
35 + * (see {@link MergeConfiguration#setConflictDecisionList(List)}), then those decisions are taken into account
36 + * to solve the conflict. The decision linked to the conflict is retrieved and applied, unless the decision state
37 + * is still {@link org.xwiki.diff.ConflictDecision.DecisionType#UNDECIDED}. When a decision is used to solve a
38 + * conflict, the conflict is not recorded in the {@link MergeResult}.
39 + *
40 + * If the decision is {@link org.xwiki.diff.ConflictDecision.DecisionType#UNDECIDED}, or if no decision is available
41 + * for this conflict, then the fallback version defined in the {@link MergeConfiguration}
42 + * (see {@link MergeConfiguration#setFallbackOnConflict(MergeConfiguration.Version)}) is used to fix the conflict,
43 + * but in that case the conflict is recorded in the returned {@link MergeResult}.
44 + *
45 + * Finally the configuration parameter accepts a null value: in that case, the fallback version is always the
46 + * current version.
47 + *
31 31   * @param <E> the type of compared elements
32 32   * @param commonAncestor the common ancestor of the two versions of the content to compare
33 33   * @param next the next version of the content to compare
... ... @@ -41,6 +41,12 @@
41 41  }
42 42  {{/code}}
43 43  
61 +=== Merge Configuration ===
62 +
63 +The merge configuration class is mainly used to setup the fallback version of the merge in case of conflict. As specified in the javadoc, the merge operation always return a ##MergeResult## which contains a merged value, even if they were conflicts during the operation. The possible fallback versions, are current, next or previous, current being the default version to fallback if nothing is specified.
64 +
65 +Starting with {{code}}XWiki 11.7RC1{{/code}} the ##MergeConfiguration## and ##MergeResult## classes get new APIs to retrieve precisely the conflicts information, and to be able to take decisions on a conflict by conflict basis. The decisions specified on the ##MergeConfiguration## to solve a conflict have always the priority over the fallback configuration.
66 +
44 44  == Display API module ==
45 45  
46 46  This module helps you display a ##DiffResult## obtained with the base API in various formats. Currently there are two diff formats supported.

Get Connected