Store Merge API

Last modified by Admin on 2024/05/11 01:13

cogPerform document merge operations and manage related conflicts resolution.
Developed by

XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Installable with the Extension Manager


XWiki module API dedicated to perform document merge operations and manage related conflicts resolution of XWiki documents and related parts of the document.
This API relies on the more generic merge API defined in the Diff Module.

Merging documents

The merging operations are performed by using the MergeManager component. The various merge operations defined there returns either a MergeManagerResult or a MergeDocumentResult which actually extends MergeManagerResult. The idea of MergeDocumentResult is that it's a combination of a multiple results corresponding to the merging of the various parts of the document (content, metadata, objects, classes, attachments, etc).


The merge operations to perform are using a configuration defined by MergeConfiguration. The merge configuration should always define the concerned document and user who is triggering the merge operations. Then it allows to define if the given elements where to perform merge can be directly modified, or if they should be cloned before they are modified: the returned result will then be a clone, and not the actual current element.
XWiki 15.2+  It also allows to define what should be the default fallback version in case of conflicts during the merge (see below for details about conflicts).



Conflicts happening during a merge are systematically recorded as errors in the resulting logs. We currently record precise information for content conflicts to allow users to chose custom resolution, but we only do it for content of XWiki Documents right now. Other conflicts are only logged. 

In case of conflicts, by default we do perform a fallback by chosing the current version: it's possible since 15.2RC1 to change that default fallback version by setting the configuration.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


Dependencies for this extension (org.xwiki.platform:xwiki-platform-store-merge-api 16.3.1):

Get Connected