Package ro.sync.exml.workspace.api.util
Interface CompareUtilAccess
@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface CompareUtilAccess
Compare utilities.
-
Method Summary
Modifier and TypeMethodDescriptionCreate an Author difference performer.Create difference performer.mergeAuthorContent(AuthorAccess authorAccess, String newContent, String trackChangesUser, TrackChangesMode trackChangesMode) AppliesnewContentonto the Author document behindauthorAccessas a sequence of incremental modifications (delete/insert fragment) computed by diffing, instead of replacing the entire document.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.
-
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
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
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) AppliesnewContentonto the Author document behindauthorAccessas a sequence of incremental modifications (delete/insert fragment) computed by diffing, instead of replacing the entire document.
The modifications go through the document'sAuthorDocumentController, 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 fromauthorAccessat 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 returnedDiffMergeResult- this method does not throw.
The merge is declined when the document is read-only. Callers that imposed the read-only state themselves, throughWSEditorPage.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 ofnewContent.newContent- The new content to apply on the document.trackChangesUser- The name recorded on the tracked changes, when the merge is tracked. Whennull, the reviewer name of the document is used.trackChangesMode- Whether the merge is recorded as tracked changes. Whennull,TrackChangesMode.AUTOis 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.
-