public class SequentialMerge extends Object implements MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
A sequential merge class which supports n-way merging of the sequentially edited DITA documents.
The term sequential describes a scenario in which the each of the versions added to the merge would be a derivative of the previous version. Such a merge would be 'non-concurrent'.
Modifier and Type | Class and Description |
---|---|
static class |
SequentialMerge.MergeResultType
The various types of result that can be produced by the Sequential DITA Merger.
|
static class |
SequentialMerge.State
This enum represents the current state of the sequential dita merge object.
|
Constructor and Description |
---|
SequentialMerge()
Constructs a new SequentialMerge instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(MergeProgressListener listener)
Add a progress listener to the list of registered progress listeners.
|
void |
addVersion(File file,
String version)
Adds a version with a File input.
|
void |
addVersion(InputStream is,
String systemId,
String version)
Adds a version with an input stream input.
|
void |
addVersion(Reader r,
String systemId,
String version)
Adds a version with a File input.
|
void |
addVersion(URL url,
String version)
Adds a version with a URL input.
|
void |
clearProgressListeners()
Remove all currently registered progress listeners.
|
void |
extractAll(File file)
Extracts the entire content of all added versions of the Merger to a File using the deltaV2 merge format.
|
void |
extractAll(OutputStream os)
Extracts the entire content of all added versions of the Merger to a OutputStream using the deltaV2 merge format.
|
void |
extractAll(Writer w)
Extracts the entire content of all added versions of the Merger to a Writer using the deltaV2 merge format.
|
com.deltaxml.cores9api.config.ValidationLevel |
getCalsValidationLevel()
Returns the
ValidationLevel current in use when validating CALS tables. |
SequentialMerge.State |
getCurrentState()
Returns the current state of the DitaMerge object.
|
DoctypePreservationMode |
getDoctypePreservationMode()
Reports the current mode.
|
boolean |
getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
|
EntityReferencePreservationMode |
getEntityReferencePreservationMode()
Reports the current mode.
|
EntityResolver |
getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
|
EntityResolver |
getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
|
List<String> |
getFormatExtractionPriorityList()
Reports the current setting of the format extraction priority list.
|
FormattingElementsConfiguration |
getFormattingElementsConfiguration()
Returns the currently used FormattingElementConfiguration object.
|
FormattingOutputType |
getFormattingOutputType()
Get the output type used for representing formatting elements in the output.
|
com.deltaxml.cores9api.config.InvalidCalsTableBehaviour |
getInvalidCalsTableBehaviour()
Returns the current behaviour in use when inputs contain invalid CALS tables.
|
SequentialMerge.MergeResultType |
getResultType()
Reports the result type setting for the Merger.
|
List<String> |
getVersions()
Returns an immutable list of versions which have been added.
|
com.deltaxml.cores9api.config.WarningReportMode |
getWarningReportMode()
Returns the
WarningReportMode in use when invalid CALS tables are encountered. |
boolean |
getWordByWord()
Reports the state of the WordByWord setting.
|
boolean |
isProcessCalsTables()
Determines whether CALS table processing is enabled.
|
boolean |
isProcessHtmlTables()
Determines whether HTML table processing is enabled.
|
void |
removeProgressListener(MergeProgressListener listener)
Remove a progress listener from the list of registered progress listeners.
|
void |
reset()
Reverts the state of the merger to the point where
MergeCommon.setAncestor(java.io.File, String) can be used. |
void |
setCalsTableProcessing(boolean enable)
Specifies whether to apply CALS table processing.
|
void |
setCalsValidationLevel(com.deltaxml.cores9api.config.ValidationLevel level)
Sets the
ValidationLevel to use for CALS table validation. |
void |
setDebug(boolean debug)
Enables the generation of intermediate pipeline debug files.
|
void |
setDoctypePreservationMode(DoctypePreservationMode mode)
Sets how Doctype declarations should be preserved.
|
void |
setElementSplitting(boolean enabled)
Sets whether modified elements containing text should be split when the amount of unchanged text falls below 10%.
|
void |
setEntityReferencePreservationMode(EntityReferencePreservationMode mode)
Sets how Entity references should be preserved.
|
void |
setEntityResolver(EntityResolver resolver,
boolean fallbackToDefaultCatalogResolver)
Sets the EntityResolver to use during the comparison.
|
void |
setFormatExtractionPriorityList(List<String> priorityList)
Merge operations represent overlapping hierarchies from the input documents by flattening and subsequently
fragmenting formatting elements where necessary.
|
void |
setFormattingElementsConfiguration(FormattingElementsConfiguration formattingElementsConfiguration)
Provides various settings for specifying formatting elements.
|
void |
setFormattingOutputType(FormattingOutputType formattingOutputType)
Set the output type used for representing formatting elements in the output.
|
void |
setHtmlTableProcessing(boolean enable)
Specifies whether to apply HTML table or DITA simpletable processing.
|
void |
setIndent(boolean indent)
Enables indentation of output using the serializer output indent property.
|
void |
setInvalidCalsTableBehaviour(com.deltaxml.cores9api.config.InvalidCalsTableBehaviour value)
In order to ensure that only valid CALS tables are passed to our specialized CALS table processing,
each input table is marked either valid or invalid.
|
void |
setLicenseFile(File licenseFile)
Sets the license file for use with Flexera licensing.
|
void |
setLicenseServer(String hostname)
Sets a license server for use with concurrent licensing.
|
void |
setLicenseServer(String hostname,
int port)
Sets a license server and port for use with concurrent licensing.
|
void |
setRedistributionLicenseContent(long[] key)
Sets a redistribution license for use with subsequent three way merge operations.
|
void |
setResultType(SequentialMerge.MergeResultType type)
Sets the type of result which this Merger will produce.
|
void |
setWarningReportMode(com.deltaxml.cores9api.config.WarningReportMode mode)
Specifies how table invalidity warnings should be reported.
|
void |
setWordByWord(boolean wbwValue)
Determines whether WordByWord filter is used.
|
public SequentialMerge()
Constructs a new SequentialMerge instance.
After construction the SequentialMerge object will, by default, preserve Doctype information. The
DoctypePreservationMode.PRESERVE_WHEN_UNCHANGED
setting is used unless configured with the
SequentialMerge.setDoctypePreservationMode(com.deltaxml.ditamerge.DoctypePreservationMode)
method.
Also, entity references will be preserved by default. The EntityReferencePreservationMode.PRESERVE_REFERENCES
setting
is used unless configured with the SequentialMerge.setEntityReferencePreservationMode(com.deltaxml.ditamerge.EntityReferencePreservationMode)
method.
public void setResultType(SequentialMerge.MergeResultType type)
type
- the desired result typepublic SequentialMerge.MergeResultType getResultType()
public void setDebug(boolean debug)
Enables the generation of intermediate pipeline debug files.
setDebug
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
debug
- when true debug files are generatedpublic void setIndent(boolean indent)
Enables indentation of output using the serializer output indent property.
setIndent
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
indent
- when true the output is indentedpublic EntityResolver getEntityResolver()
Gets the explicitly set EntityResolver in use by the merger.
getEntityResolver
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public EntityResolver getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the merger.
getEntityResolver
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
builtInResolver
- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set
resolver.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 null
resolver and setting the
fallbackToDefaultCatalogResolver
to false
.
setEntityResolver
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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.IllegalStateException
- Thrown if the merger object's state is not INITIAL or 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).
public SequentialMerge.State getCurrentState()
Returns the current state of the DitaMerge object. The state affects which methods can be validly be called, this is
documented in the SequentialMerge.State
enum.
public void addVersion(File file, String version) throws IllegalStateException, IllegalArgumentException, FileNotFoundException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException
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.
addVersion
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.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.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.public void addVersion(InputStream is, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException
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.
addVersion
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.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.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.public void addVersion(Reader r, String systemId, String version) throws IllegalStateException, IllegalArgumentException, DifferentRootElementException, InvalidInputException, DifferingOrderedAttributesException, LicenseException, UnorderedDuplicateKeysException, UnorderedElementContainingPCDATAException
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.
addVersion
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
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 the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.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.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.public void addVersion(URL url, String version) throws IllegalStateException, IllegalArgumentException, IOException, DifferentRootElementException, InvalidInputException, LicenseException, UnorderedDuplicateKeysException, DifferingOrderedAttributesException, UnorderedElementContainingPCDATAException
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.
addVersion
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
url
- The URL which is the version to be added.version
- The string to use as the name of the version. This appears in the deltaxml:deltaV2
attributes in
the result. This cannot contain '=' or '!' characters.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.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.public void setWordByWord(boolean wbwValue) throws IllegalStateException
setWordByWord
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
wbwValue
- The new WordByWord setting to use.IllegalStateException
- when this operation is not allowed according to the MergeStatepublic boolean getWordByWord()
getWordByWord
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setDoctypePreservationMode(DoctypePreservationMode mode)
The DoctypePreservationMode.PRESERVE_WHEN_UNCHANGED
setting is used by default.
mode
- the new preservation modepublic DoctypePreservationMode getDoctypePreservationMode()
public void setEntityReferencePreservationMode(EntityReferencePreservationMode mode)
The EntityReferencePreservationMode.PRESERVE_REFERENCES
setting is used by default.
mode
- the new preservation modeEntityReferencePreservationMode
public EntityReferencePreservationMode getEntityReferencePreservationMode()
public void extractAll(File file) throws IllegalStateException, DoctypeChangeException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
file
- The file into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its usepublic void extractAll(Writer w) throws IllegalStateException, DoctypeChangeException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
w
- The writer into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its usepublic void extractAll(OutputStream os) throws IllegalStateException, DoctypeChangeException, InvalidInputException, LicenseException
extractAll
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
os
- The OutputStream into which the deltaV2 content is extractedIllegalStateException
- the Merger is not in a state ready for extractionDoctypeChangeException
- when there are doctype changes and DoctypePreservationMode specifies that they are
reportedInvalidInputException
- Thrown if the input is invalid in some way.LicenseException
- if there are any problems with the supplied license or its usepublic List<String> getVersions()
getVersions
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setRedistributionLicenseContent(long[] key) throws LicenseException
DeltaXML Redistribution or 'OEM' customers should use this method in conjunction with supplied code which is typically compiled and integrated into their own products. The supplied code provides examples of usage. This method is not intended to be used by other types of license/customer.
A LicenseException should always contain a nested exception or cause containing further details of the underlying issue. This will be typically one of: LicenseContentException, CPUCountException, LicenseSecurityException, LicenseExpiredException, LicenseNotYetValidException, InvalidLicenseException, LicenseConcurrencyLimitException.
Note that some of the exceptions thrown here can also be thrown by a compare method. For example, it may be the case a license has not expired when calling this method, but for long running app-server processes may have expired when calling compare methods later.
setRedistributionLicenseContent
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
key
- a redistribution licenseLicenseException
- if there are any problems with the supplied license or its usepublic void setLicenseFile(File licenseFile) throws SecurityException, IOException, LicenseException
setLicenseFile
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
licenseFile
- the FlexLM format license fileSecurityException
- if the file cannot be accessedIOException
- if there are problems reading the fileLicenseException
- if there is a problem using the license filepublic void setLicenseServer(String hostname) throws LicenseException
setLicenseServer
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
hostname
- the license server host or its ip addressLicenseException
- if there is a problem using the license serverpublic void setLicenseServer(String hostname, int port) throws IllegalArgumentException, LicenseException
setLicenseServer
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
hostname
- the license server host or its ip addressport
- the port number on the license server for the lmgrdIllegalArgumentException
- if the port number is out of rangeLicenseException
- if there is a problem using the license serverpublic void setCalsTableProcessing(boolean enable)
Specifies whether to apply CALS table processing.
CALS table processing ensures that when valid (both syntactically and semantically according to the OASIS CALS table model documentation) input tables are provided the result will be a valid CALS table.
Simple changes to the table, such as changing the contents of an entry, adding a row or column are generally represented as fine grain changes. Because CALS entries can overlap or span multiple rows and columns, some types of change are difficult to represent at fine granularity, whilst ensuring validity. In these cases changes are represented at row (ie, groups of added/deleted rows) or even whole-table granularity.
Setting this parameter to false
turns off this processing, therefore it is possible to generate
an invalid table. However, if table validity is not a concern changes may be represented at finer granularity.
Default: true
setCalsTableProcessing
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
enable
- a boolean value to enable CALS table processingpublic boolean isProcessCalsTables()
Determines whether CALS table processing is enabled.
isProcessCalsTables
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setInvalidCalsTableBehaviour(com.deltaxml.cores9api.config.InvalidCalsTableBehaviour value)
In order to ensure that only valid CALS tables are passed to our specialized CALS table processing, each input table is marked either valid or invalid. This parameter declares what type of processing should be used for those tables that are marked as invalid. The 'warning report mode' parameter configures how recoverable errors are reported.
Three options are provided: fail, propagate up, and compare as XML. The fail option stops the comparison by throwing an appropriate exception (that includes the errors identified by the validity checker). The propagate up option ensures that changes to an invalid table (or more specifically 'tgroup') are represented at the table level. The compare as XML option essentially compares the tables as if they were well-formed XML.
Note that the results of the compare as XML option can differ from comparing the tables without CALS table processing enabled, as a small amount of CALS specific processing is applied to invalid tables in order to allow them to be compared against a similar valid table.
Default: InvalidCalsTableBehaviour.PROPAGATE_UP
setInvalidCalsTableBehaviour
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
value
- the value to set for the invalidCalsTableBehaviour parameterInvalidCalsTableBehaviour
public com.deltaxml.cores9api.config.InvalidCalsTableBehaviour getInvalidCalsTableBehaviour()
getInvalidCalsTableBehaviour
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
InvalidCalsTableBehaviour
describing the behaviour in usepublic void setWarningReportMode(com.deltaxml.cores9api.config.WarningReportMode mode)
setWarningReportMode
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
mode
- the WarningReportMode
to use when invalid CALS tables are encounteredpublic com.deltaxml.cores9api.config.WarningReportMode getWarningReportMode()
WarningReportMode
in use when invalid CALS tables are encountered.getWarningReportMode
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
WarningReportMode
describing the reporting mode in usepublic void setCalsValidationLevel(com.deltaxml.cores9api.config.ValidationLevel level)
Sets the ValidationLevel
to use for CALS table validation.
A value of ValidationLevel.STRICT
will cause the InvalidCalsTableBehaviour
mode to be used for any CALS
invalidity. A value of ValidationLevel.RELAXED
means that invalidities which are known to have no effect on CALS
processing will not prevent CALS processing from running. N.B. Warnings will be reported according to the
WarningReportMode
regardless of the setting used here.
setCalsValidationLevel
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
level
- an instance of ValidationLevel
describing the level to usepublic com.deltaxml.cores9api.config.ValidationLevel getCalsValidationLevel()
Returns the ValidationLevel
current in use when validating CALS tables.
getCalsValidationLevel
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
ValidationLevel
describing the level in usepublic void setHtmlTableProcessing(boolean enable)
Specifies whether to apply HTML table or DITA simpletable processing.
HTML tables processing ensures that when valid input tables are provided - according to the HTML 4 or HTML 5 documentation - the result will be a valid HTML 4/5 table. Note that both inputs need to follow the same standard (i.e. be HTML 4 or HTML 5).
Simple changes to the table, such as changing the contents of a cell and adding a row or column are generally represented as fine grain changes. Because HTML entries can overlap or span multiple rows and columns, some types of change are difficult to represent at fine granularity, whilst ensuring validity. In these cases changes are represented at row (ie, groups of added/deleted rows) or even whole-table granularity.
DITA Simple tables are also handled by this filter. In this case, the syntactic constraints ensure that cells cannot overlap or span either rows or columns, therefore changes are represented at a fine grained level of detail.
Setting this parameter to false
turns off this processing, therefore it is possible to generate
an invalid table. However, if table validity is not a concern changes may be represented at finer granularity.
Default: true
setHtmlTableProcessing
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
enable
- a boolean value to enable HTML table processingpublic boolean isProcessHtmlTables()
Determines whether HTML table processing is enabled.
isProcessHtmlTables
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void addProgressListener(MergeProgressListener listener)
addProgressListener
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
listener
- the progress listener to register.public void removeProgressListener(MergeProgressListener listener)
removeProgressListener
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
listener
- the progress listener to remove.public void clearProgressListeners()
public void setElementSplitting(boolean enabled) throws IllegalStateException
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: true
Certain 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
setElementSplitting
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
enabled
- whether or not to enable element splittingIllegalStateException
- when this operation is not allowed according to the MergeStatepublic boolean getElementSplitting()
States whether modified elements containing text are split when the amount of unchanged text falls below 10%.
getElementSplitting
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
public void setFormattingElementsConfiguration(FormattingElementsConfiguration formattingElementsConfiguration) throws IllegalStateException, IllegalArgumentException
formattingElementsConfiguration
- a FormattingElementsConfiguration objectIllegalStateException
- when this operation is not allowed according to the merge stateIllegalArgumentException
- when FormattingElementsConfiguration is nullpublic FormattingElementsConfiguration getFormattingElementsConfiguration()
public void setFormattingOutputType(FormattingOutputType formattingOutputType)
Set the output type used for representing formatting elements in the output.
The default is FormattingOutputType.DELTA_V_2_1
which represents Formatting Elements using our Delta v2.1 format.
setFormattingOutputType
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
formattingOutputType
- the type of representation to use.FormattingOutputType
public FormattingOutputType getFormattingOutputType()
Get the output type used for representing formatting elements in the output.
getFormattingOutputType
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
FormattingOutputType
public void setFormatExtractionPriorityList(List<String> priorityList)
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).
setFormatExtractionPriorityList
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
priorityList
- a list of priority versions specified using Stringspublic List<String> getFormatExtractionPriorityList()
getFormatExtractionPriorityList
in interface MergeBase<DeltaXMLDitaMergeException,InvalidInputException,LicenseException,DifferentRootElementException,DoctypeChangeException,UnorderedDuplicateKeysException,DifferingOrderedAttributesException,UnorderedElementContainingPCDATAException>
Copyright © 2015 - 2019 DeltaXML Ltd. All Rights Reserved.