Interface MergeConflictDecisionsManager


  • @Role
    public interface MergeConflictDecisionsManager
    Manage the decisions taken to solve the merge conflicts. For more information about the conflict decision and how they are used, read the documentation of DiffManager.merge(List, List, List, MergeConfiguration).
    Since:
    11.8RC1
    Version:
    $Id: 70ba431700dcfba1cd9fe6ead73697ed9f3e5dbd $
    • Method Detail

      • getConflictDecisionList

        List<org.xwiki.diff.ConflictDecision> getConflictDecisionList​(DocumentReference documentReference,
                                                                      EntityReference userReference)
        Retrieve the list of ConflictDecision recorded for the given document and user.
        Parameters:
        documentReference - the document reference for which to retrieve the decisions.
        userReference - the user who made the decisions.
        Returns:
        a list of ConflictDecision or null if no decision has been recorded for this pair of document and user.
      • setConflictDecisionList

        void setConflictDecisionList​(List<org.xwiki.diff.ConflictDecision> conflictDecisionList,
                                     DocumentReference documentReference,
                                     EntityReference userReference)
        Record a list of decisions for a given document and a given user. This pair document, user is used to properly identify the decisions made.
        Parameters:
        conflictDecisionList - the decisions to record.
        documentReference - the document on which the decisions should apply.
        userReference - the user who made the decisions.
      • removeConflictDecisionList

        void removeConflictDecisionList​(DocumentReference documentReference,
                                        EntityReference userReference)
        Remove a record of decisions.
        Parameters:
        documentReference - the document for which to remove the record.
        userReference - the user who made the decisions.
      • recordConflicts

        void recordConflicts​(DocumentReference documentReference,
                             EntityReference userReference,
                             List<org.xwiki.diff.Conflict<?>> conflicts)
        Record a list of conflicts to be used in for the later decisions.
        Parameters:
        documentReference - the document on which the decisions should apply.
        userReference - the user who performed the merge.
        conflicts - the list of conflicts to record.
      • recordDecision

        <E> boolean recordDecision​(DocumentReference documentReference,
                                   EntityReference userReference,
                                   String conflictReference,
                                   org.xwiki.diff.ConflictDecision.DecisionType decisionType,
                                   List<E> customDecision)
        Record a decision made for a given conflict.
        Type Parameters:
        E - the type of element concerned by the conflict.
        Parameters:
        documentReference - the document on which the decisions should apply.
        userReference - the user who performed the merge.
        conflictReference - the reference of a conflict as given by Conflict.getReference().
        decisionType - the decision made.
        customDecision - the custom decision to apply if needed, as specified in ConflictDecision.setCustom(List) or null.
        Returns:
        true if the decision has been properly recorded, false if something went wrong.