Class MergeScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("merge")
    @Singleton
    public class MergeScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Script service allowing to perform merge operations on documents.
    Since:
    11.5RC1
    Version:
    $Id: a2d955cbf95b8ed540853e1fb271913cf279c346 $
    • Constructor Detail

      • MergeScriptService

        public MergeScriptService()
    • Method Detail

      • mergeDocument

        public MergeDocumentResultScript mergeDocument​(Document previousDocument,
                                                       Document currentDocument,
                                                       Document newDocument)
        Perform a merge 3 points between the currentDocument and the newDocument, the previousDocument being the common ancestor of both documents. This operation doesn't save anything.
        Parameters:
        previousDocument - the previous version of the document to merge.
        currentDocument - the current version of the document to merge.
        newDocument - the new version of the document to merge.
        Returns:
        a MergeDocumentResult object containing the merged document.
      • getDecision

        public org.xwiki.diff.ConflictDecision<String> getDecision​(org.xwiki.diff.Conflict<String> conflict,
                                                                   org.xwiki.diff.ConflictDecision.DecisionType type,
                                                                   String customDecision)
        Create a ConflictDecision based on an existing conflict and a choice made.
        Parameters:
        conflict - the conflict for which the decision has been taken.
        type - the choice made to solve the conflict.
        customDecision - if a value is given, the decision type will be custom and this value will be used to solve the conflict.
        Returns:
        a decision that solve the conflict.
        Since:
        11.8RC1
      • recordDecisions

        public void recordDecisions​(List<org.xwiki.diff.ConflictDecision> decisionList)
        Record all the decisions taken in the MergeConflictDecisionsManager.
        Parameters:
        decisionList - the list of decision to save.
        Since:
        11.8RC1