Interface CompareUtilAccess


@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface CompareUtilAccess
Compare utilities.
  • Method Details

    • threeWayAutoMerge

      MergeResult threeWayAutoMerge(String ancestor, String left, String right, MergeConflictResolutionMethods conflictResolutionMethod)
      Merges two strings representing XML files using a three way merging algorithm which needs an ancestor file.
      Parameters:
      ancestor - The original file string which has been modified into left and right.
      left - The left version of the file string, the one with "our" changes.
      right - The right version of the file string, the one with "others" changes.
      conflictResolutionMethod - The conflict resolution method to use.
      Returns:
      A merged file string where conflicts are resolved by using the left version of the file or null if the merge encountered an error.
      Since:
      17.1
    • createDiffPerformer

      DifferencePerformer createDiffPerformer() throws DiffException
      Create difference performer.
      Returns:
      a difference performer that can be used to compare two resources using different algorithms and options.
      Throws:
      DiffException - When it fails to create the diff performer.
      Since:
      19.1
    • createAuthorDiffPerformer

      AuthorDifferencePerformer createAuthorDiffPerformer() throws DiffException
      Create an Author difference performer.
      Returns:
      a difference performer that can be used to compare two Author documents using different algorithms and options.
      Throws:
      DiffException - When it fails to create the difference performer.
      Since:
      22
    • mergeAuthorContent

      DiffMergeResult mergeAuthorContent(AuthorAccess authorAccess, String newContent, String trackChangesUser, TrackChangesMode trackChangesMode)
      Applies newContent onto the Author document behind authorAccess as a sequence of incremental modifications (delete/insert fragment) computed by diffing, instead of replacing the entire document.
      The modifications go through the document's AuthorDocumentController, inside a single compound edit, so any listener attached to the Author document model (for example a Content Fusion concurrent editing room) observes them like normal edits. The current content is read fresh from authorAccess at call time - no separate baseline needed.
      If applying any of the differences fails, all modifications made so far are rolled back, so the document is either fully updated or left unchanged. Every outcome, including a failure, is reported through the returned DiffMergeResult - this method does not throw.
      The merge is declined when the document is read-only. Callers that imposed the read-only state themselves, through WSEditorPage.setReadOnly, must lift it around this call.
      The whole operation runs on the calling thread, so it must be called on the thread owning the document: the AWT thread in the standalone application, the thread holding the document lock in Web Author.
      Parameters:
      authorAccess - Access to the Author document to be modified. The location of this document is also used to resolve the relative paths and the DTD references of newContent.
      newContent - The new content to apply on the document.
      trackChangesUser - The name recorded on the tracked changes, when the merge is tracked. When null, the reviewer name of the document is used.
      trackChangesMode - Whether the merge is recorded as tracked changes. When null, TrackChangesMode.AUTO is used.
      Returns:
      The merge result, never null.
      Since:
      28.1.0.4

      **************************************
      EXPERIMENTAL - Subject to change
      **************************************

      Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.