Class ThreeWayMerge
- All Implemented Interfaces:
MergeBase,MergeCommon
The main class for three-way concurrent DITA merge operations.
This class provides further output types beyond those provided in the ConcurrentMerge class because some specific
three-way processing is possible when three inputs can be guaranteed. A set of 'single shot' merge methods are also provided,
these avoid the use of the setAncestor/addVersion/extract methods that are used in the n-way class.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.deltaxml.mergecommon.MergeCommon
MERGE_REST_CONFIG_NAMESPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLicenseFile(File licenseFile) Adds the license file for use with Flexera licensing.voidaddLicenseServer(String hostname) Adds a license server for use with concurrent licensing.voidaddLicenseServer(String hostname, int port) Adds a license server and port for use with concurrent licensing.voidaddProgressListener(MergeProgressListener listener) Add a progress listener to the list of registered progress listeners.voidaddVersion(File file, String version) Adds a version with a File input.voidaddVersion(InputStream is, String systemId, String version) Adds a version with an input stream input.voidaddVersion(Reader r, String systemId, String version) Adds a version with a File input.voidaddVersion(URL url, String version) Adds a version with a URL input.voidRemove all currently registered progress listeners.voidextractAll(File file) Extracts the entire content of all added versions of the Merger to a File using the deltaV2 merge format.voidExtracts the entire content of all added versions of the Merger to a OutputStream using the deltaV2 merge format.voidextractAll(Writer w) Extracts the entire content of all added versions of the Merger to a Writer using the deltaV2 merge format.Returns the version name of the ancestor.Returns the current configuration options for CALS table comparison.Returns the current state of the ThreeWayMerge object.booleanGets whether the production of debug files is on or not.Get the current prefix used for debug result files.Reports the current mode.booleanStates whether modified elements containing text are split when the amount of unchanged text falls below 10%.Reports the current mode.Gets the explicitly set EntityResolver in use by the merger.getEntityResolver(boolean builtInResolver) Gets the EntityResolver in use by the merger.Reports the existing oxygen TCs processing mode used with three way track change output.Reports the current setting of the format extraction priority list.Returns the currently used FormattingElementConfiguration object.Get the output type used for representing formatting elements in the output.Returns the current configuration options for HTML table comparison.Reports preset of three to two way merge use cases.Returns the currently used (for extract operations) rule configuration object.Reports the result type setting for the Merger.Reports the attribute mode used with three way track change output.Reports the result format setting for the Merger.Returns an immutable list of versions which have been added.booleanReports the state of the WordByWord setting.booleanReturns the current setting for new table processing.voidThis method is used to perform three way merge of DITA inputs.voidmerge(InputStream ancestor, String systemIdAncestor, InputStream edit1, String systemIdEdit1, InputStream edit2, String systemIdEdit2, OutputStream result) This method is used to perform three way merge of InputStreams.voidmerge(Reader ancestor, String systemIdAncestor, Reader edit1, String systemIdEdit1, Reader edit2, String systemIdEdit2, Writer result) This method is used to perform three way merge with Readers.voidremoveProgressListener(MergeProgressListener listener) Remove a progress listener from the list of registered progress listeners.voidreset()Reverts the state of the merger to the point whereMergeCommon.setAncestor(java.io.File, String)can be used.voidsetAncestor(File file, String version) Sets the ancestor document with a File input.voidsetAncestor(InputStream is, String systemId, String version) Sets the ancestor document with a InputStream.voidsetAncestor(Reader r, String systemId, String version) Sets the ancestor document with a Reader.voidsetAncestor(URL url, String version) Sets the ancestor document with a URL.voidSets the configuration options for CALS table comparison.voidsetDebugFiles(boolean debug) Enables the generation of intermediate pipeline debug files.voidsetDebugFilesPrefix(String prefix) Provides a prefix for debug result files.voidSets how Doctype declarations should be preserved in the result.voidsetElementSplitting(boolean enabled) Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.voidSets how Entity references should be preserved.voidsetEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver) Sets the EntityResolver to use during the comparison.voidSets the existing oxygen TCs processing mode for three way track change output.voidsetFormatExtractionPriorityList(List<String> priorityList) Merge operations represent overlapping hierarchies from the input documents by flattening and subsequently fragmenting formatting elements where necessary.voidsetFormattingElementsConfiguration(FormattingElementsConfiguration formattingElementsConfiguration) Provides various settings for specifying formatting elements.voidsetFormattingOutputType(FormattingOutputType formattingOutputType) Set the output type used for representing formatting elements in the output.voidSets the configuration options for HTML table comparison.voidsetIndent(boolean indent) Enables indentation of output using the serializer output indent property.voidUsed to preset three to two way merge use cases.voidAllows the rules for ditamerge processing (during extract operations) to be specified.voidsetTableProcessingAlgorithmVersion2(boolean value) Enables new table processing algorithm for CALS and HTML table.voidSets the type of result which this Merger will produce.voidSets the attribute mode for three way track change output.voidSets the result format which this Merger will produce.voidsetWordByWord(boolean wbwValue) Determines whether WordByWord filter is used.
-
Constructor Details
-
ThreeWayMerge
public ThreeWayMerge()Constructs a new ThreeWayMerge instance.
-
-
Method Details
-
setThreeWayResultType
Sets the type of result which this Merger will produce.- Parameters:
type- the desired result type
-
getThreeWayResultType
Reports the result type setting for the Merger.- Returns:
- the current result type setting
-
setDebugFiles
public void setDebugFiles(boolean debug) Enables the generation of intermediate pipeline debug files.
- Specified by:
setDebugFilesin interfaceMergeBase- Parameters:
debug- when true debug files are generated
-
getDebugFiles
public boolean getDebugFiles()Gets whether the production of debug files is on or not.
- Specified by:
getDebugFilesin interfaceMergeBase- Returns:
- whether the production of debug files is on or not.
- See Also:
-
setDebugFilesPrefix
Provides a prefix for debug result files.
- Specified by:
setDebugFilesPrefixin interfaceMergeBase- Parameters:
prefix- The prefix that will be used for debug file names in subsequent merge operations- See Also:
-
getDebugFilesPrefix
Get the current prefix used for debug result files.- Specified by:
getDebugFilesPrefixin interfaceMergeBase- Returns:
- the current prefix used for debug result files.
- See Also:
-
setIndent
public void setIndent(boolean indent) Enables indentation of output using the serializer output indent property.
-
getEntityResolver
Gets the explicitly set EntityResolver in use by the merger.
- Specified by:
getEntityResolverin interfaceMergeBase- Returns:
- the explicitly set EntityResolver in use by the merger.
-
getEntityResolver
Gets the EntityResolver in use by the merger.
- Specified by:
getEntityResolverin interfaceMergeBase- Parameters:
builtInResolver- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set resolver.- Returns:
- the EntityResolver in use by the merger.
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver) throws IllegalStateException Sets the EntityResolver to use during the comparison.
By default, the Apache Commons Resolver is used as an EntityResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a
nullresolver and setting thefallbackToDefaultCatalogResolvertofalse.- Specified by:
setEntityResolverin interfaceMergeBase- Parameters:
resolver- The resolver to use. Using null removes an existing resolver.fallbackToDefaultCatalogResolver- Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the entity.- Throws:
IllegalStateException- Thrown if the merger object's state is not INITIAL or RESET.
-
reset
public void reset()Reverts the state of the merger to the point where
MergeCommon.setAncestor(java.io.File, String)can be used. This is useful if you want to perform a new merge with the same configuration settings.The merger has a state machine to control the proper ordering of setAncestor and addVersion methods. reset() is used to clear the ancestor and version state. After calling reset() a new ancestor should be provided.
It does not completely re-initialize a merger to the state it would have after calling the constructor, in particular settings for catalogs, entity resolvers and word by word are preserved through a reset method (methods are provided to change these settings, alternatively you can create a new merger object via the constructor).
-
getCurrentState
Returns the current state of the ThreeWayMerge object. The state affects which methods can be validly be called, this is documented in the
ConcurrentMergeStateenumeration.- Returns:
- The current state of the ThreeWayMerge object.
-
setAncestor
public void setAncestor(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, com.deltaxml.licensing.LicenseException Sets the ancestor document with a File input.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
setAncestorin interfaceMergeCommon- Parameters:
file- The input file which is the ancestor version.version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This must be an XML NMTOKEN- Throws:
IllegalStateException- Thrown if the merge object's state is not INITIAL or RESET.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN.FileNotFoundException- Thrown if the provided file object does not exist.InvalidInputException- Thrown if the input is invalid in some way.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.- See Also:
-
setAncestor
public void setAncestor(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException Sets the ancestor document with a InputStream.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
setAncestorin interfaceMergeCommon- Parameters:
is- The input steam which is the ancestor version.systemId- The location of the ancestor input stream (for relative lookup).version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not INITIAL or RESET.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN.InvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.- See Also:
-
setAncestor
public void setAncestor(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException Sets the ancestor document with a Reader.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
setAncestorin interfaceMergeCommon- Parameters:
r- The reader which is the ancestor version.systemId- The location of the ancestor reader (for relative lookup).version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not INITIAL or RESET.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN.InvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.- See Also:
-
setAncestor
public void setAncestor(URL url, String version) throws IllegalStateException, IllegalArgumentException, IOException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException Sets the ancestor document with a URL.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
setAncestorin interfaceMergeCommon- Parameters:
url- The URL to load as the ancestor version.version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not INITIAL or RESET.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN.IOException- Thrown if a stream for the supplied URL cannot be opened.InvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.- See Also:
-
addVersion
public void addVersion(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, DifferentRootElementException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, ComparisonCancelledException Adds a version with a File input.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
addVersionin interfaceMergeBase- Parameters:
file- The input file which is the version to be added.version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.FileNotFoundException- Thrown if the provided file object does not exist.DifferentRootElementException- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException- Thrown if the input is invalid.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.ComparisonCancelledException- See Also:
-
addVersion
public void addVersion(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, ComparisonCancelledException Adds a version with an input stream input.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
addVersionin interfaceMergeBase- Parameters:
is- The input stream which is the version to be added.systemId- The location of the version input stream (for relative lookup).version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException- Thrown if the input is invalid.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.ComparisonCancelledException- See Also:
-
addVersion
public void addVersion(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, DifferingOrderedAttributesException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException, ComparisonCancelledException Adds a version with a File input.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
addVersionin interfaceMergeBase- Parameters:
r- The input reader which is the version to be added.systemId- The location of the ancestor reader (for relative lookup).version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.DifferentRootElementException- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException- Thrown if the input is invalid.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.ComparisonCancelledException- See Also:
-
addVersion
public void addVersion(URL url, String version) throws IllegalStateException, IllegalArgumentException, IOException, DifferentRootElementException, InvalidInputException, com.deltaxml.licensing.LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException, ComparisonCancelledException Adds a version with a URL input.The version parameter appears in the result file and must correspond to the NMTOKEN production rule in the XML Specification (the same production rule is used in both XML 1.0 and XML 1.1). This precludes the use of the '!' (0x21) and '=' (0x3d) characters used for version delimiting and other characters which could cause confusion such as the space character.
- Specified by:
addVersionin interfaceMergeBase- Parameters:
url- The URL which is the version to be added.version- The string to use as the name of the version. This appears in thedeltaxml:deltaV2attributes in the result. This cannot contain '=' or '!' characters.- Throws:
IllegalStateException- Thrown if the merger object's state is not STARTED or EXTRACTABLE.IllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.IOException- Thrown if a stream for the supplied URL cannot be opened.DifferentRootElementException- Thrown if the version added has a different root XML element as the ancestor.InvalidInputException- Thrown if the input is invalid.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.UnorderedElementContainingPCDATAException- Thrown if input contains mixed content in orderless merge.ComparisonCancelledException- See Also:
-
setWordByWord
Determines whether WordByWord filter is used.- Specified by:
setWordByWordin interfaceMergeBase- Parameters:
wbwValue- The new WordByWord setting to use.- Throws:
IllegalStateException- when this operation is not allowed according to the MergeState
-
getWordByWord
public boolean getWordByWord()Reports the state of the WordByWord setting.- Specified by:
getWordByWordin interfaceMergeBase- Returns:
- the current value
-
setElementSplitting
Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.
Note that element splitting does not happen when the WordByWord setting is 'false'.
Default:
trueCertain DITA elements such as a section, title are only permitted once in the DITA DTD. Therefore, the element splitting feature is not applied to such elements.
Element splitting is currently applied to following DITA elements.
DITA elements : apiname, b, cite, cmdname, codeph, filepath, i, li, lines, msgnum, msgph, note, p, parmname, pre, q, sli, sub, sup, systemoutput, term, text, tm, tt, u, uicontrol, userinput, var, varname, wintitle
- Specified by:
setElementSplittingin interfaceMergeBase- Parameters:
enabled- whether or not to enable element splitting- Throws:
IllegalStateException- when this operation is not allowed according to the MergeState
-
getElementSplitting
public boolean getElementSplitting()States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
- Specified by:
getElementSplittingin interfaceMergeBase- Returns:
- a boolean stating whether the splitting behaviour is enabled or not
-
setDoctypePreservationMode
Sets how Doctype declarations should be preserved in the result.Default Setting
The
DoctypePreservationMode.PRESERVE_WHEN_UNCHANGEDsetting is used by default.- Parameters:
mode- the new preservation mode
-
getDoctypePreservationMode
Reports the current mode.- Returns:
- the current mode
-
setEntityReferencePreservationMode
Sets how Entity references should be preserved.Default Setting
The
EntityReferencePreservationMode.PRESERVE_REFERENCESsetting is used by default.- Parameters:
mode- the new preservation mode
-
getEntityReferencePreservationMode
Reports the current mode.- Returns:
- the current mode
-
setRuleConfiguration
Allows the rules for ditamerge processing (during extract operations) to be specified.- Parameters:
rc- A new set of rules
-
getRuleConfiguration
Returns the currently used (for extract operations) rule configuration object.- Returns:
- the current rule configuration
-
extractAll
public void extractAll(File file) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, com.deltaxml.licensing.LicenseException Extracts the entire content of all added versions of the Merger to a File using the deltaV2 merge format.- Specified by:
extractAllin interfaceMergeBase- Parameters:
file- The file into which the deltaV2 content is extracted- Throws:
IllegalStateException- the Merger is not in a state ready for extractionDoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype is missing and DoctypePreservationMode specifies that they are reportedInvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- if there are any problems with the supplied license or its use
-
extractAll
public void extractAll(Writer w) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, com.deltaxml.licensing.LicenseException Extracts the entire content of all added versions of the Merger to a Writer using the deltaV2 merge format.- Specified by:
extractAllin interfaceMergeBase- Parameters:
w- The writer into which the deltaV2 content is extracted- Throws:
IllegalStateException- the Merger is not in a state ready for extractionDoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype is missing and DoctypePreservationMode specifies that they are reportedInvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- if there are any problems with the supplied license or its use
-
extractAll
public void extractAll(OutputStream os) throws IllegalStateException, DoctypeChangeException, DoctypeMissingException, InvalidInputException, com.deltaxml.licensing.LicenseException Extracts the entire content of all added versions of the Merger to a OutputStream using the deltaV2 merge format.- Specified by:
extractAllin interfaceMergeBase- Parameters:
os- The OutputStream into which the deltaV2 content is extracted- Throws:
IllegalStateException- the Merger is not in a state ready for extractionDoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype is missing and DoctypePreservationMode specifies that they are reportedInvalidInputException- Thrown if the input is invalid in some way.com.deltaxml.licensing.LicenseException- if there are any problems with the supplied license or its use
-
getAncestorVersion
Returns the version name of the ancestor.- Specified by:
getAncestorVersionin interfaceMergeCommon- Returns:
- the version name of the ancestor
-
getVersions
Returns an immutable list of versions which have been added.- Specified by:
getVersionsin interfaceMergeBase- Returns:
- an immutable list of versions which have been added
-
merge
public void merge(File ancestor, File edit1, File edit2, File result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, com.deltaxml.licensing.LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, ComparisonCancelledException This method is used to perform three way merge of DITA inputs.- Parameters:
ancestor- The common ancestor.edit1- First versionedit2- second versionresult- Result of a three way dita merge.- Throws:
DifferentRootElementException- Thrown if any version has a different root XML element as the ancestor.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- if an orderless element contains PCDATA or text nodes.InvalidInputException- Thrown if the input is invalid.FileNotFoundException- Thrown if an attempt to open the file denoted by a specified pathname failsIllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype missing and DoctypePreservationMode specifies that they are reportedComparisonCancelledException
-
merge
public void merge(InputStream ancestor, String systemIdAncestor, InputStream edit1, String systemIdEdit1, InputStream edit2, String systemIdEdit2, OutputStream result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, com.deltaxml.licensing.LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, ComparisonCancelledException This method is used to perform three way merge of InputStreams.- Parameters:
ancestor- The common ancestor.systemIdAncestor- The location of the ancestor input stream (for relative lookup).edit1- First versionsystemIdEdit1- The location of the version 1 input stream (for relative lookup).edit2- second versionsystemIdEdit2- The location of the version 2 input stream (for relative lookup).result- Result of a three way dita merge.- Throws:
DifferentRootElementException- Thrown if any version has a different root XML element to the ancestor.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- if an orderless element contains PCDATA or text nodes.InvalidInputException- Thrown if the input is invalid.FileNotFoundException- Thrown if an attempt to open the file denoted by a specified pathname has failedIllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedComparisonCancelledException- Since:
- 1.2.1
-
merge
public void merge(Reader ancestor, String systemIdAncestor, Reader edit1, String systemIdEdit1, Reader edit2, String systemIdEdit2, Writer result) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, InvalidInputException, UnorderedElementContainingPCDATAException, UnorderedDuplicateKeysException, com.deltaxml.licensing.LicenseException, DifferentRootElementException, DifferingOrderedAttributesException, DoctypeChangeException, DoctypeMissingException, ComparisonCancelledException This method is used to perform three way merge with Readers.- Parameters:
ancestor- The common ancestor.systemIdAncestor- The location of the ancestor reader (for relative lookup).edit1- First versionsystemIdEdit1- The location of the version 1 reader (for relative lookup).edit2- second versionsystemIdEdit2- The location of the version 2 reader (for relative lookup).result- Result of a three way dita merge.- Throws:
DifferentRootElementException- Thrown if any version has a different root XML element to the ancestor.com.deltaxml.licensing.LicenseException- Thrown if there is no license installed, or if the installed license is invalid.UnorderedDuplicateKeysException- Thrown if there are duplicate keys in orderless merge.UnorderedElementContainingPCDATAException- if an orderless element contains PCDATA or text nodes.InvalidInputException- Thrown if the input is invalid.FileNotFoundException- Thrown if an attempt to open the file denoted by a specified pathname has failedIllegalArgumentException- Thrown if the version parameter is not an NMTOKEN, if a version has already been added with this name, or if the supplied name is the same as the ancestor version.IllegalStateException- Thrown if the merge object's state is not STARTED or EXTRACTABLE.DifferingOrderedAttributesException- Thrown if inputs have different deltaxml:ordered attribute values.DoctypeChangeException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedDoctypeMissingException- when there are doctype changes and DoctypePreservationMode specifies that they are reportedComparisonCancelledException- Since:
- 1.2.1
-
setTwoWayResultFormat
Sets the result format which this Merger will produce.- Parameters:
rf- the desired result format
-
getTwoWayResultFormat
Reports the result format setting for the Merger.- Returns:
- the current result format setting
-
setThreeWayTrackChangeAttributeMode
Sets the attribute mode for three way track change output. Note: This setting has an effect with the result typeThreeWayMergeResultType.THREE_WAY_OXYGEN_TRACK_CHANGESDefault Setting
The
TrackChangesAttributeMode.TC_EDIT1setting is used by default.- Parameters:
mode- the desired attribute mode
-
getThreeWayTrackChangeAttributeMode
Reports the attribute mode used with three way track change output.- Returns:
- the current attribute mode
-
setExistingOxygenTCsProcessingMode
Sets the existing oxygen TCs processing mode for three way track change output. Note: This setting has an effect with the result typeThreeWayMergeResultType.THREE_WAY_OXYGEN_TRACK_CHANGESDefault Setting
The
ExistingOxygenTCsProcessingMode.ACCEPTsetting is used by default.- Parameters:
mode- the desired existing oxygen TCs processing mode
-
getExistingOxygenTCsProcessingMode
Reports the existing oxygen TCs processing mode used with three way track change output.- Returns:
- the current existing oxygen TCs processing mode
-
setResultPreset
Used to preset three to two way merge use cases.
The merge extraction process applies default rule configuration settings which executes before this method. Applying this configuration overrides the different
RuleConfigurationandThreeWayMergeResultTypesettings applied prior to this.- Parameters:
p- the desiredThreeToTwoResultPreset
-
getResultPreset
Reports preset of three to two way merge use cases.- Returns:
- the current preset
-
addLicenseFile
public void addLicenseFile(File licenseFile) throws SecurityException, IOException, com.deltaxml.licensing.LicenseException Adds the license file for use with Flexera licensing. This can be either simple fixed host/user licensing, or a concurrent licensing containing the USE_SERVER directive- Specified by:
addLicenseFilein interfaceMergeBase- Parameters:
licenseFile- the FlexLM format license file- Throws:
SecurityException- if the file cannot be accessedIOException- if there are problems reading the filecom.deltaxml.licensing.LicenseException- if there is a problem using the license file
-
addLicenseServer
Adds a license server for use with concurrent licensing.- Specified by:
addLicenseServerin interfaceMergeBase- Parameters:
hostname- the license server host or its ip address- Throws:
com.deltaxml.licensing.LicenseException- if there is a problem using the license server
-
addLicenseServer
public void addLicenseServer(String hostname, int port) throws IllegalArgumentException, com.deltaxml.licensing.LicenseException Adds a license server and port for use with concurrent licensing.- Specified by:
addLicenseServerin interfaceMergeBase- Parameters:
hostname- the license server host or its ip addressport- the port number on the license server for the lmgrd- Throws:
IllegalArgumentException- if the port number is out of rangecom.deltaxml.licensing.LicenseException- if there is a problem using the license server
-
setCalsTableConfiguration
Sets the configuration options for CALS table comparison.
- Specified by:
setCalsTableConfigurationin interfaceMergeBase- Parameters:
config- aCalsTableConfigurationobject that contains the settings to use for CALS table comparison
-
getCalsTableConfiguration
Returns the current configuration options for CALS table comparison.
- Specified by:
getCalsTableConfigurationin interfaceMergeBase- Returns:
- a
CalsTableConfigurationobject that contains the settings to use for CALS table comparison
-
setHtmlTableConfiguration
Sets the configuration options for HTML table comparison.
- Specified by:
setHtmlTableConfigurationin interfaceMergeBase- Parameters:
config- aHtmlTableConfigurationobject that contains the settings to use for HTML table comparison
-
getHtmlTableConfiguration
Returns the current configuration options for HTML table comparison.
- Specified by:
getHtmlTableConfigurationin interfaceMergeBase- Returns:
- a
HtmlTableConfigurationobject that contains the settings to use for HTML table comparison
-
addProgressListener
Add a progress listener to the list of registered progress listeners. It is possible to add the same listener multiple times.- Specified by:
addProgressListenerin interfaceMergeBase- Parameters:
listener- the progress listener to register.
-
removeProgressListener
Remove a progress listener from the list of registered progress listeners. This will remove the first occurrence of a progress listener.- Specified by:
removeProgressListenerin interfaceMergeBase- Parameters:
listener- the progress listener to remove.
-
clearProgressListeners
public void clearProgressListeners()Remove all currently registered progress listeners.- Specified by:
clearProgressListenersin interfaceMergeBase
-
setFormattingElementsConfiguration
public void setFormattingElementsConfiguration(FormattingElementsConfiguration formattingElementsConfiguration) throws IllegalStateException, IllegalArgumentException Provides various settings for specifying formatting elements.- Parameters:
formattingElementsConfiguration- a FormattingElementsConfiguration object- Throws:
IllegalStateException- when this operation is not allowed according to the merge stateIllegalArgumentException- when FormattingElementsConfiguration is null
-
getFormattingElementsConfiguration
Returns the currently used FormattingElementConfiguration object.- Returns:
- the FormattingElementConfiguration object
-
setFormattingOutputType
Set the output type used for representing formatting elements in the output. The default is
FormattingOutputType.DELTA_V_2_1which represents Formatting Elements using our Delta v2.1 format.- Specified by:
setFormattingOutputTypein interfaceMergeBase- Parameters:
formattingOutputType- the type of representation to use.- See Also:
-
getFormattingOutputType
Get the output type used for representing formatting elements in the output.
- Specified by:
getFormattingOutputTypein interfaceMergeBase- Returns:
- the output type
- See Also:
-
setFormatExtractionPriorityList
Merge operations represent overlapping hierarchies from the input documents by flattening and subsequently fragmenting formatting elements where necessary.
To produce a result without overlapping or nesting of formatting elements, it may be necessary to remove formatting information in a controlled way.
The format extraction priority list specifies the list of versions by priority. This priority list will be used to extract formatting to resolve overlaps and nesting to produce a deltaV2 result.
Please note that if only some, not all, of the versions are specified in the priority list there is a possibility of format loss due to additions/deletions of formatting by the missing version(s).
- Specified by:
setFormatExtractionPriorityListin interfaceMergeBase- Parameters:
priorityList- a list of priority versions specified using Strings
-
getFormatExtractionPriorityList
Reports the current setting of the format extraction priority list.- Specified by:
getFormatExtractionPriorityListin interfaceMergeBase- Returns:
- the current list of priority versions
-
isNewTableProcessingEnabled
public boolean isNewTableProcessingEnabled()Returns the current setting for new table processing.- Specified by:
isNewTableProcessingEnabledin interfaceMergeCommon- Returns:
- the current value
-
setTableProcessingAlgorithmVersion2
public void setTableProcessingAlgorithmVersion2(boolean value) Enables new table processing algorithm for CALS and HTML table.- Specified by:
setTableProcessingAlgorithmVersion2in interfaceMergeCommon- Parameters:
value- The new newTableProcessing setting to use.
-