public final class DitaMapfileCompare
extends java.lang.Object
Compares the XML content of two Darwin Information Typing Architecture (DITA) maps and produces a result map marked to show changes.
The input maps are first 'generalized' back to generic map documents, compared and then 'specialized' back to their original document types. Although the comparison of two different specialized types is not recommended, in such circumstances the result map is left in its generalised form, unless the force-specialization parameter is set to 'true'.
Changes are marked using 'rev' and 'status' attributes as discussed in the DITA Markup Section of the User Guide.
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.String,java.lang.Boolean> |
BOOLEAN_PAR_DEFAULTS |
protected java.util.Map<java.lang.String,java.lang.Boolean> |
booleanOverrides |
protected com.deltaxml.dita.MapfilePipelineConfig |
dcc |
protected com.deltaxml.licensing.LicenseManager |
lm |
protected static java.util.Map<java.lang.String,java.lang.Integer> |
PARAMETER_NAME_INDEX |
protected DitaCompareVersion |
productVersion |
protected long[] |
redistributionLicense |
protected net.sf.saxon.s9api.Processor |
saxonProcessor |
protected static java.util.Map<java.lang.String,java.lang.String> |
STRING_PAR_DEFAULTS |
protected java.util.Map<java.lang.String,java.lang.String> |
stringOverrides |
Constructor and Description |
---|
DitaMapfileCompare()
Constructs a new DitaMapFileCompare instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addDitaMapfileCompareProgressListener(DitaMapfileCompareProgressListener listener)
Add a progress listener.
|
void |
addLicenseFile(java.io.File licenseFile)
Adds the license file for use with Flexera licensing.
|
void |
addLicenseServer(java.lang.String hostname)
Adds a license server for use with concurrent licensing.
|
void |
addLicenseServer(java.lang.String hostname,
int port)
Adds a license server and port for use with concurrent licensing.
|
void |
compare(java.io.File input1,
java.io.File input2,
java.io.File result)
Compares two File inputs to produce a File result.
|
void |
compare(org.xml.sax.InputSource input1,
org.xml.sax.InputSource input2,
javax.xml.transform.stream.StreamResult result)
Compares two InputSource inputs to produce a StreamResult.
|
void |
compare(java.io.InputStream is1,
java.lang.String systemId1,
java.io.InputStream is2,
java.lang.String systemId2,
java.io.OutputStream result)
Compares two input streams to produce an output stream result.
|
void |
compare(java.io.Reader r1,
java.lang.String systemId1,
java.io.Reader r2,
java.lang.String systemId2,
java.io.Writer result)
Compares two input reader (character streams) to produce an output writer result.
|
java.lang.String |
compare(java.lang.String input1,
java.lang.String systemId1,
java.lang.String input2,
java.lang.String systemId2)
Compares two XML string inputs to produce an XML string result.
|
boolean |
getAddOutputclassAtts()
Returns the value of addOutputclassAtts
|
boolean |
getAddRevisionAtts()
Returns the value of addRevisionAtts
|
boolean |
getAddStatusAtts()
Returns the value of addStatusAtts
|
org.xml.sax.EntityResolver |
getEntityResolver()
Gets the explicitly set EntityResolver in use by the comparison.
|
org.xml.sax.EntityResolver |
getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the comparison.
|
boolean |
getForceSpecialization()
Returns the value of forceSpecialization
|
FrameMakerTrackChangesTableChangeMode |
getFramemakerTcsTableChangeMode()
Returns the value of framemakerTcsTableChangeMode
|
boolean |
getGrouping()
Returns the value of grouping
|
boolean |
getIncludeDeleted()
Returns the value of includeDeleted
|
IndentOutput |
getIndentOutput()
Returns the value of indentOutput
|
java.lang.String |
getInputASVGMarkupStyle()
Returns the value of inputASVGMarkupStyle
|
java.lang.String |
getInputBSVGMarkupStyle()
Returns the value of inputBSVGMarkupStyle
|
InvalidReferencedSVGBehaviour |
getInvalidReferencedSVGBehaviour()
Returns current setting for InvalidReferencedSVGBehaviour.
|
java.lang.String |
getMapPublicId()
Returns the value of mapPublicId
|
java.lang.String |
getMapSystemId()
Returns the value of mapSystemId
|
ModifiedAttributeMode |
getModifiedAttributeMode()
Returns the value of modifiedAttributeMode
|
java.lang.String |
getNewOutputclass()
Returns the value of newOutputclass
|
java.lang.String |
getNewRevision()
Returns the value of newRevision
|
java.util.Set<AttributeWithValue> |
getNewVersionAtts()
Returns the value of newVersionAtts
|
protected java.lang.String |
getNewVersionAttsString() |
java.lang.String |
getOldOutputclass()
Returns the value of oldOutputclass
|
java.lang.String |
getOldRevision()
Returns the value of oldRevision
|
java.util.Set<AttributeWithValue> |
getOldVersionAtts()
Returns the value of oldVersionAtts
|
protected java.lang.String |
getOldVersionAttsString() |
java.lang.String |
getOutputEncodingDeclaration()
Returns the value of outputEncodingDeclaration
|
OutputFormat |
getOutputFormat()
Returns the value of outputFormat
|
OxygenTrackChangesDeletedSpaceMode |
getOxygenTcsDeletedSpaceMode()
Returns the value of oxygenTcsDeletedSpaceMode
|
java.lang.String |
getOxygenTcsVersion()
Returns the value of oxygenTcsVersion
|
java.lang.String |
getPhraseContainerExclusions()
Returns the value of phraseContainerExclusions
|
java.lang.String |
getPhraseElementName()
Returns the value of phraseElementName
|
PreservationMode |
getPreservationMode()
Returns the value of preservationMode
|
DitaCompareVersion |
getProductVersion()
Get the product version.
|
java.lang.String |
getRemoveRevAttributeRegex()
Returns the value of removeRevAttributeRegex
|
ShowNonPhraseChanges |
getShowNonPhraseChanges()
Returns the value of showNonPhraseChanges
|
boolean |
getSVGFallback()
Returns current setting for SVG Processing Fallback.
|
double |
getSVGFallbackChangePercentage()
Returns current setting for SVG Fallback Change Percentage.
|
SVGGranularity |
getSVGGranularity()
Returns current setting for SVG Granularity.
|
boolean |
getSVGNumericTolerance()
Determines whether to use numeric tolerance.
|
java.lang.String |
getSVGNumericToleranceValue()
Returns the value of svg-numeric-tolerance-value
|
boolean |
getSVGProcessing()
Returns current setting for SVG Processing.
|
boolean |
getSVGZIndex()
Determines whether to use numeric tolerance.
|
java.lang.String |
getTrackedChangesAuthor()
Returns the value of trackedChangesAuthor
|
java.lang.String |
getTrackedChangesDate()
Returns the value of trackedChangesDate
|
UnmarkedChangeMode |
getUnmarkedChangeMode()
Returns the value of unmarkedChangeMode
|
javax.xml.transform.URIResolver |
getURIResolver()
Gets the explicitly set URIResolver in use by the comparison.
|
javax.xml.transform.URIResolver |
getURIResolver(boolean builtInResolver)
Gets the URIResolver in use by the comparison.
|
boolean |
getUseIdsAsKeys()
Returns the value of useIdsAsKeys
|
boolean |
getValidateInputs()
Returns the value of validateInputs
|
WhitespaceProcessingMode |
getWhitespaceProcessingMode()
Returns the value of whitespaceProcessingMode
|
XmetalTrackChangesTableChangeMode |
getXmetalTcsTableChangeMode()
Returns the value of xmetalTcsTableChangeMode
|
XmlVersionDeclaration |
getXmlVersionDeclaration()
Returns the value of xmlVersionDeclaration
|
java.lang.String |
getZIndexSVGMarkupStyle()
Returns the value of ZIndexSVGMarkupStyle
|
protected void |
init()
This method must be called as soon as possible after the call to super() by subclasses.
|
void |
removeDitaMapfileCompareProgressListener(DitaMapfileCompareProgressListener listener)
Remove a progress listener.
|
void |
setAddOutputclassAtts(boolean value)
Specifies whether to include an outputclass attribute for marking changes.
|
void |
setAddRevisionAtts(boolean value)
Specifies whether the result should use 'rev' attributes to mark change.
|
void |
setAddStatusAtts(boolean value)
Specifies whether the result should use 'status' attributes to mark change.
|
void |
setEntityResolver(org.xml.sax.EntityResolver resolver,
boolean fallbackToDefaultCatalogResolver)
Sets the EntityResolver to use during the comparison.
|
void |
setForceSpecialization(boolean value)
Specifies whether or not to force result specialization when the input types are different.
|
void |
setFramemakerTcsTableChangeMode(FrameMakerTrackChangesTableChangeMode value)
Specifies how changes in tables should be tracked.
|
void |
setGrouping(boolean value)
Specifies whether adjacent changes (insertions or deletions) should be grouped into a single insertion and/or deletion block.
|
void |
setIncludeDeleted(boolean value)
Specifies whether to include deleted content in the result.
|
void |
setIndentOutput(IndentOutput value)
Sets whether the result should be indented.
|
void |
setInputASVGMarkupStyle(java.lang.String value)
Sets the Input A SVG markup style setting for SVG comparison results.
|
void |
setInputBSVGMarkupStyle(java.lang.String value)
Sets the Input B SVG markup style setting for SVG comparison results.
|
void |
setInvalidReferencedSVGBehaviour(InvalidReferencedSVGBehaviour value)
Sets the mode to use for handling invalid referenced SVG.
|
void |
setLicenseFile(java.io.File licenseFile)
Deprecated.
Deprecated in favour of AddLicenseFile
|
void |
setLicenseServer(java.lang.String hostname)
Deprecated.
Deprecated in favour of AddLicenseServer
|
void |
setLicenseServer(java.lang.String hostname,
int port)
Deprecated.
Deprecated in favour of AddLicenseServer
|
void |
setMapPublicId(java.lang.String value)
Specifies the publicId to use for a Map doctype.
|
void |
setMapSystemId(java.lang.String value)
Specifies the systemId to use for a Map doctype.
|
void |
setModifiedAttributeMode(ModifiedAttributeMode value)
Specifies how modified attributes should be included in the output.
|
void |
setNewOutputclass(java.lang.String value)
Specifies the string value to use for the outputclass attribute of added content.
|
void |
setNewRevision(java.lang.String value)
Specifies the string value to use for the rev attribute of added content.
|
void |
setNewVersionAtts(java.util.Set<AttributeWithValue> value)
Specifies attributes to place on to added elements in the result.
|
void |
setOldOutputclass(java.lang.String value)
Specifies the string value to use for the outputclass attribute of deleted content.
|
void |
setOldRevision(java.lang.String value)
Specifies the string value to use for the rev attribute of deleted content.
|
void |
setOldVersionAtts(java.util.Set<AttributeWithValue> value)
Specifies attributes to place on deleted elements in the result.
|
void |
setOutputEncodingDeclaration(java.lang.String value)
Sets the character encoding output to use in the XML declaration.
|
void |
setOutputFormat(OutputFormat value)
Specifies what type of output is produced.
|
void |
setOutputImageRefForm(OutputImageRefForm value)
Specifies output image reference form after image comparison for topic only comparison.
|
void |
setOxygenTcsDeletedSpaceMode(OxygenTrackChangesDeletedSpaceMode value)
Specifies how deleted spaces should be handled.
|
void |
setOxygenTcsVersion(java.lang.String value)
Specifies the version of oXygen editor used to display, accept and reject the tracked changes.
|
void |
setPhraseContainerExclusions(java.lang.String value)
Specifies any specializations where phrases have been removed from the content model.
|
void |
setPhraseElementName(java.lang.String value)
Specifies the element name to use in place of <ph> in the result.
|
void |
setPreservationMode(PreservationMode value)
Sets the mode to use for preserving original data.
|
void |
setRedistributionLicenseContent(long[] license)
Sets a redistribution license for use with subsequent compare operations.
|
void |
setRemoveRevAttributeRegex(java.lang.String value)
'rev' attributes in the input could be confused with those used to represent change in the output.
|
void |
setShowNonPhraseChanges(ShowNonPhraseChanges value)
Specifies how to mark changes to text where <ph> elements are not allowed.
|
void |
setSVGFallback(boolean value)
Sets whether to fallback to
SVGGranularity.ADJACENT . |
void |
setSVGFallbackChangePercentage(double value)
Sets fallback change percentage setting for SVG comparison results.
|
void |
setSVGGranularity(SVGGranularity value)
Specifies the granularity at which the differences between two SVG images will be represented.
|
void |
setSVGNumericTolerance(boolean value)
Sets whether to use a numeric tolerance.
|
void |
setSVGNumericToleranceValue(java.lang.String value)
Sets SVG numeric tolerance value for SVG comparison results.
|
void |
setSVGProcessing(boolean value)
Sets whether to do should do SVG comparison.
|
void |
setSVGZIndex(boolean value)
Enable Z-Index.
|
void |
setTrackedChangesAuthor(java.lang.String value)
Specifies the author name that is embedded into the generated insertion and deletion processing instruction.
|
void |
setTrackedChangesDate(java.lang.String value)
Specifies the time-stamp that is embedded into the generated insertion and deletion processing instruction.
|
void |
setUnmarkedChangeMode(UnmarkedChangeMode value)
Specifies how to handle data that cannot contain difference markup.
|
void |
setURIResolver(javax.xml.transform.URIResolver resolver,
boolean fallbackToDefaultCatalogResolver)
Sets the URIResolver to use during the comparison.
|
void |
setUseIdsAsKeys(boolean value)
Specifies whether to use id attribute value as keys in order to provide identity during comparison.
|
void |
setValidateInputs(boolean value)
Specifies whether to validate input documents.
|
void |
setWhitespaceProcessingMode(WhitespaceProcessingMode value)
Specifies how to handle whitespace changes.
|
void |
setXmetalTcsTableChangeMode(XmetalTrackChangesTableChangeMode value)
Specifies how changes in tables should be tracked.
|
void |
setXmlVersionDeclaration(XmlVersionDeclaration value)
Sets the version to use in the XML declaration.
|
void |
setZIndexSVGMarkupStyle(java.lang.String value)
Sets the Z Index SVG markup style for SVG comparison results.
|
protected DitaCompareVersion productVersion
protected com.deltaxml.licensing.LicenseManager lm
protected net.sf.saxon.s9api.Processor saxonProcessor
protected long[] redistributionLicense
protected com.deltaxml.dita.MapfilePipelineConfig dcc
protected static final java.util.Map<java.lang.String,java.lang.Boolean> BOOLEAN_PAR_DEFAULTS
protected static final java.util.Map<java.lang.String,java.lang.String> STRING_PAR_DEFAULTS
protected static final java.util.Map<java.lang.String,java.lang.Integer> PARAMETER_NAME_INDEX
protected java.util.Map<java.lang.String,java.lang.Boolean> booleanOverrides
protected java.util.Map<java.lang.String,java.lang.String> stringOverrides
public DitaMapfileCompare() throws ParserException
Constructs a new DitaMapFileCompare instance.
ParserException
- when there is a problem creating/configuring a parserpublic DitaCompareVersion getProductVersion()
protected void init() throws ParserException
ParserException
public void addDitaMapfileCompareProgressListener(DitaMapfileCompareProgressListener listener)
listener
- the progress listener to add.public void removeDitaMapfileCompareProgressListener(DitaMapfileCompareProgressListener listener)
listener
- the progress listener to remove.public org.xml.sax.EntityResolver getEntityResolver()
Gets the explicitly set EntityResolver in use by the comparison.
public org.xml.sax.EntityResolver getEntityResolver(boolean builtInResolver)
Gets the EntityResolver in use by the comparison.
builtInResolver
- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set
resolver.public void setEntityResolver(org.xml.sax.EntityResolver resolver, boolean fallbackToDefaultCatalogResolver)
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
.
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.public javax.xml.transform.URIResolver getURIResolver()
Gets the explicitly set URIResolver in use by the comparison.
public javax.xml.transform.URIResolver getURIResolver(boolean builtInResolver)
Gets the URIResolver in use by the comparison.
builtInResolver
- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set
resolver.public void setURIResolver(javax.xml.transform.URIResolver resolver, boolean fallbackToDefaultCatalogResolver)
Sets the URIResolver to use during the comparison.
By default, the Apache Commons Resolver is used as an URIResolver. 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
.
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 URI.public void compare(java.io.File input1, java.io.File input2, java.io.File result) throws LicenseException, ParserException, java.io.FileNotFoundException, SerializationException, InputLoadException, FilterProcessingException, DifferentRootElementException, InvalidInputException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
Compares two File inputs to produce a File result.
input1
- the first input to compare as a File objectinput2
- the second input to compare as a File objectresult
- the File in which to write the comparison resultLicenseException
- when the license cannot be read or is not validParserException
- when there is a problem creating/configuring an XML parserjava.io.FileNotFoundException
- when an input File or the location of the result File cannot be foundSerializationException
- when there is a problem writing the result FileInputLoadException
- when there is a problem loading an input FileFilterProcessingException
- when an error occurs running a filter in the pipelineDifferentRootElementException
- if the two input Files have different rootsInvalidInputException
- if an input file is not in the correct formatcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
- if comparison is cancelled via a cancellation policyjava.security.InvalidParameterException
- if a previous parameter setting on the comparator cannot be used at comparison timepublic void compare(java.io.Reader r1, java.lang.String systemId1, java.io.Reader r2, java.lang.String systemId2, java.io.Writer result) throws LicenseException, ParserException, SerializationException, InputLoadException, FilterProcessingException, DifferentRootElementException, InvalidInputException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
Compares two input reader (character streams) to produce an output writer result.
r1
- the first input to comparesystemId1
- the location of the first input stream (for relative lookup)r2
- the second input to comparesystemId2
- the location of the second input stream (for relative lookup)result
- the writer in which to write the comparison resultLicenseException
- when the license cannot be read or is not validParserException
- when there is a problem creating/configuring an XML parserSerializationException
- when there is a problem writing the result FileInputLoadException
- when there is a problem loading an input FileFilterProcessingException
- when an error occurs running a filter in the pipelineDifferentRootElementException
- if the two input Files have different rootsInvalidInputException
- if an input file is not in the correct formatcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
- if comparison is cancelled via a cancellation policyjava.security.InvalidParameterException
- if a previous parameter setting on the comparator cannot be used at comparison timepublic void compare(java.io.InputStream is1, java.lang.String systemId1, java.io.InputStream is2, java.lang.String systemId2, java.io.OutputStream result) throws LicenseException, ParserException, SerializationException, InputLoadException, FilterProcessingException, DifferentRootElementException, InvalidInputException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
Compares two input streams to produce an output stream result.
is1
- the first input to comparesystemId1
- the location of the first input stream (for relative lookup)is2
- the second input to comparesystemId2
- the location of the second input stream (for relative lookup)result
- the output stream in which to write the comparison resultLicenseException
- when the license cannot be read or is not validParserException
- when there is a problem creating/configuring an XML parserSerializationException
- when there is a problem writing the result FileInputLoadException
- when there is a problem loading an input FileFilterProcessingException
- when an error occurs running a filter in the pipelineDifferentRootElementException
- if the two input Files have different rootsInvalidInputException
- if an input file is not in the correct formatcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
- if comparison is cancelled via a cancellation policyjava.security.InvalidParameterException
- if a previous parameter setting on the comparator cannot be used at comparison timepublic java.lang.String compare(java.lang.String input1, java.lang.String systemId1, java.lang.String input2, java.lang.String systemId2) throws LicenseException, ParserException, SerializationException, InputLoadException, FilterProcessingException, DifferentRootElementException, InvalidInputException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
Compares two XML string inputs to produce an XML string result.
input1
- the first input to compare as a string containing an XML documentsystemId1
- the location of the first input (for relative lookup)input2
- the second input to compare as a string containing an XML documentsystemId2
- the location of the second input (for relative lookup)LicenseException
- when the license cannot be read or is not validParserException
- when there is a problem creating/configuring an XML parserSerializationException
- when there is a problem writing the result FileInputLoadException
- when there is a problem loading an input FileFilterProcessingException
- when an error occurs running a filter in the pipelineDifferentRootElementException
- if the two input Files have different rootsInvalidInputException
- if an input file is not in the correct formatcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
- if comparison is cancelled via a cancellation policyjava.security.InvalidParameterException
- if a previous parameter setting on the comparator cannot be used at comparison timepublic void compare(org.xml.sax.InputSource input1, org.xml.sax.InputSource input2, javax.xml.transform.stream.StreamResult result) throws LicenseException, ParserException, SerializationException, InputLoadException, FilterProcessingException, DifferentRootElementException, InvalidInputException, com.deltaxml.cores9api.ComparisonCancelledException, com.deltaxml.core.PipelinedComparatorError
Compares two InputSource inputs to produce a StreamResult.
This is the most general of the compare methods, in the sense that all the other compare methods can (and are) written in terms of it. However, care must be taken to ensure that each InputSource is provided with an appropriate systemId (say via the InputSource's setSystemId method). This system identifier is used as the base-path for locating external resources (such as those provided by xi:includes and external entity references).
Note that the presence of a system id is not checked for as there are at least two plausible use cases where it is not required. First, simple documents that are self contained (i.e. have no external resource references) do not need to set a system Id, though it can still be useful for error reporting. Second, when catalogs are being used to provide access to external resources, then relative document based lookup mechanisms may not be required (as well).
input1
- the first input to compare as a Source objectinput2
- the second input to compare as a Source objectresult
- the Result to which to write the comparison resultLicenseException
- when the license cannot be read or is not validParserException
- when there is a problem creating/configuring an XML parserSerializationException
- when there is a problem writing the result FileInputLoadException
- when there is a problem loading an input FileFilterProcessingException
- when an error occurs running a filter in the pipelineDifferentRootElementException
- if the two input Files have different rootsInvalidInputException
- if an input file is not in the correct formatcom.deltaxml.core.PipelinedComparatorError
com.deltaxml.cores9api.ComparisonCancelledException
- if comparison is cancelled via a cancellation policyjava.security.InvalidParameterException
- if a previous parameter setting on the comparator cannot be used at comparison timepublic void setRedistributionLicenseContent(long[] license) 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.
license
- a redistribution licenseLicenseException
- if there is a problem with the supplied license@Deprecated public void setLicenseFile(java.io.File licenseFile) throws java.lang.SecurityException, java.io.IOException, LicenseException
licenseFile
- the FlexLM format license fileLicenseSecurityException
- if the file cannot be accessedjava.io.IOException
- if there are problems reading the fileLicenseException
- if there is a problem using the license filejava.lang.SecurityException
@Deprecated public void setLicenseServer(java.lang.String hostname) throws LicenseException
hostname
- of the license server host or its ip addressLicenseException
- if there is a problem using the license server@Deprecated public void setLicenseServer(java.lang.String hostname, int port) throws java.lang.IllegalArgumentException, LicenseException
hostname
- of the license server host or its ip addressport
- the port number on the license server for the lmgrdjava.lang.IllegalArgumentException
- if the port number is out of rangeLicenseException
- if there is a problem using the license serverpublic void addLicenseFile(java.io.File licenseFile) throws java.lang.SecurityException, java.io.IOException, LicenseException
licenseFile
- the FlexLM format license fileLicenseSecurityException
- if the file cannot be accessedjava.io.IOException
- if there are problems reading the fileLicenseException
- if there is a problem using the license filejava.lang.SecurityException
public void addLicenseServer(java.lang.String hostname) throws LicenseException
hostname
- of the license server host or its ip addressLicenseException
- if there is a problem using the license serverpublic void addLicenseServer(java.lang.String hostname, int port) throws java.lang.IllegalArgumentException, LicenseException
hostname
- of the license server host or its ip addressport
- the port number on the license server for the lmgrdjava.lang.IllegalArgumentException
- if the port number is out of rangeLicenseException
- if there is a problem using the license serverpublic void setMapPublicId(java.lang.String value)
Specifies the publicId to use for a Map doctype.
A value should only be passed if you wish to override the default values for the publicId (-//OASIS//DTD DITA Map//EN)
Note that this value is only used if the following are true:
Default: ""
value
- the value to set for the mapPublicId parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setMapSystemId(java.lang.String value)
Specifies the systemId to use for a Map doctype.
A value should only be passed if you wish to override the default values for the publicId (http://docs.oasis-open.org/dita/v1.1/OS/dtd/map.dtd for DITA 1.1 and http://docs.oasis-open.org/dita/v1.2/os/dtd1.2/technicalContent/dtd/map.dtd for DITA 1.2)
Note that this value is only used if the following are true:
Default: ""
value
- the value to set for the mapSystemId parameterjava.lang.IllegalArgumentException
- if the value is nullpublic java.lang.String getMapPublicId()
Returns the value of mapPublicId
setMapPublicId(String)
public java.lang.String getMapSystemId()
Returns the value of mapSystemId
setMapSystemId(String)
public void setOutputFormat(OutputFormat value)
Specifies what type of output is produced.
Default: OutputFormat.DITA_MARKUP
value
- the value to set for the outputFormat parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setValidateInputs(boolean value)
Specifies whether to validate input documents.
If set to true
and the inputs include a DOCTYPE, they will be validated against it. If they are not valid, the
compare method will throw an InputLoadException.
Default: true
value
- the value to set for the validateInputs parameterpublic void setUseIdsAsKeys(boolean value)
Specifies whether to use id attribute value as keys in order to provide identity during comparison.
If set to true
, elements with the same name and id value at the same XML tree level will always be matched,
regardless of their content.
This setting should only be used if id attribute values are consistent across versions.
Default: false
value
- the value to set for the useIdsAsKeys parameterpublic void setIndentOutput(IndentOutput value)
Sets whether the result should be indented.
If run with a compare method that produces a serialized result, a value of yes
causes the output to be pretty
printed.
Default: IndentOutput.NO
value
- the value to set for the indentOutput parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setWhitespaceProcessingMode(WhitespaceProcessingMode value)
Specifies how to handle whitespace changes.
When this option is set to 'show' whitespace differences are reported where possible. If the output-format is set to 'dita-markup', this will be wherever the DITA doctype allows text (as opposed to inter-element whitespace). For tracked-changes output formats, all whitespace changes can be shown.
This can lead to a significant amount of marked change throughout the document. When the parameter is set to 'ignore', whitespace differences are not shown; instead the 'B' document's whitespace is kept where possible.
Note that differences in whitespace are never ignored when the XML document explicitly states that the whitespace is
important, via the xml:space
attribute being set to 'preserve'.
The 'automatic' setting effectively behaves as either 'normalize' or 'ignore' depending on the value of the 'preservation-mode' and the 'output-format' parameters. Here, 'normalize' is chosen when: (1) the lexical preservation mode is set to 'automatic' and the output format is 'dita-markup'; or (2) the lexical preservation mode is set to either 'document' or 'docAndAttrib'. In all other cases, the automatic preservation mode is treated as if it were 'ignore'.
Default: WhitespaceProcessingMode.AUTOMATIC
value
- the value to set for the whitespaceProcessingMode parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setRemoveRevAttributeRegex(java.lang.String value)
'rev' attributes in the input could be confused with those used to represent change in the output. This parameter specifies the regular expression that matches 'rev' attributes to be stripped.
'rev' attributes that match this regex pattern are only stripped when the 'add-revision-atts' property is true.
Default: "deltaxml-.*"
value
- the value to set for the removeRevAttributeRegex parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setAddStatusAtts(boolean value)
Specifies whether the result should use 'status' attributes to mark change. When this property is true, any 'status' attributes in the input are stripped before comparison.
Default: "true"
value
- the value to set for the addStatusAtts parameterpublic void setAddRevisionAtts(boolean value)
Specifies whether the result should use 'rev' attributes to mark change. When this property is true, any 'rev' attributes in the input that match the regex pattern in 'remove-rev-attribute-regex' are stripped before comparison.
Default: "true"
value
- the value to set for the addRevisionAtts parameterpublic void setAddOutputclassAtts(boolean value)
Specifies whether to include an outputclass attribute for marking changes.
NOTE: This option only applies to the DITA Markup format.
Default: "false"
value
- the value to set for the addOutputclassAtts parameterpublic void setOldRevision(java.lang.String value)
Specifies the string value to use for the rev attribute of deleted content.
Deleted elements and text (via the <ph> parent) will have this string set as the value of the rev attribute in the result.
Default: "deltaxml-delete"
value
- the value to set for the oldRevision parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setNewRevision(java.lang.String value)
Specifies the string value to use for the rev attribute of added content.
Added elements and text (via the <ph> parent) will have this string set as the value of the rev attribute in the result.
Default: "deltaxml-add"
value
- the value to set for the newRevision parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setOldOutputclass(java.lang.String value)
Specifies the string value to use for the outputclass attribute of deleted content.
Deleted elements and text (via the <ph> parent) will have this string set as the value of the outputclass attribute in the result.
Default: "deltaxml-delete"
value
- the value to set for the oldOutputclass parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setNewOutputclass(java.lang.String value)
Specifies the string value to use for the outputclass attribute of added content.
Added elements and text (via the <ph> parent) will have this string set as the value of the outputclass attribute in the result.
Default: "deltaxml-add"
value
- the value to set for the newOutputclass parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setNewVersionAtts(java.util.Set<AttributeWithValue> value)
Specifies attributes to place on to added elements in the result.
Default: empty set
value
- the value to set for the newVersionAtts parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setOldVersionAtts(java.util.Set<AttributeWithValue> value)
Specifies attributes to place on deleted elements in the result.
Default: empty set
value
- the value to set for the oldVersionAtts parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setPhraseElementName(java.lang.String value)
Specifies the element name to use in place of <ph> in the result.
If the input documents are specialized documents that have renamed the phrase element, use this method to specify the element name that should be used instead.
N.B. It is assumed that the 'rev' attribute is allowed on the specified element.
Default: "ph"
value
- the value to set for the phraseElementName parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setPhraseContainerExclusions(java.lang.String value)
Specifies any specializations where phrases have been removed from the content model.
These should be listed by full specialization name, e.g. topic/title, in a comma-separated list.
If an element contains any of the items in this list as part of its class attribute, text changes within that element will not be marked using phrase elements.
Default: ""
value
- the value to set for the phraseContainerExclusions parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setShowNonPhraseChanges(ShowNonPhraseChanges value)
Specifies how to mark changes to text where <ph> elements are not allowed.
If text has changed within an element where phrase markup is not allowed, some other means must be used to process the
changes. If this parameter is set to where-valid
, the changed text is wrapped in textual delimiters e.g. -[[old
text ]]- +[[new text ]]+. If the value is set to never
, no markup is used and only the new text is output. If
set to always
then always use phrase markup to show changes, even if it will result in invalid DITA markup.
Default: "where-valid"
value
- the value to set for the showNonPhraseChanges parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setIncludeDeleted(boolean value)
Specifies whether to include deleted content in the result.
If set to false
, the result will only include unchanged and added content.
Default: "true"
value
- the value to set for the includeDeleted parameterpublic void setForceSpecialization(boolean value)
Specifies whether or not to force result specialization when the input types are different.
If this value is set to false
and the input documents are different DITA types, the result document will be left
in its generalized form with class attributes to indicate what the specializations are.
If this value is set to true
and the input documents are different DITA types, the result document will be
specialized to the DITA type of the second input. Please note that this may produce a result document that is not valid
against its doctype.
Default: false
value
- the value to set for the forceSpecialization parameterpublic void setGrouping(boolean value)
Specifies whether adjacent changes (insertions or deletions) should be grouped into a single insertion and/or deletion block. One benefit of this is that changes to a consecutive group of words within a sentence are gathered into one insertion and one deletion block, rather than a series of individual word swaps. This makes it easier to read and understand the changes.
Note that when either HTML or CALS table processing modes are selected, then this grouping mechanism is turned off within the context of these tables. The table processing has its own specialised grouping mechanisms.
Default: false
value
- the value to set for the grouping parameterpublic void setTrackedChangesAuthor(java.lang.String value)
Specifies the author name that is embedded into the generated insertion and deletion processing instruction.
Default: "deltaxml"
value
- the value to set for the trackedChangesAuthor parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setTrackedChangesDate(java.lang.String value)
Specifies the time-stamp that is embedded into the generated insertion and deletion processing instruction. The default time-stamp is that of the time that the comparison is run.
Default: "xsl date"
value
- the value to set for the trackedChangesDate parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setOxygenTcsVersion(java.lang.String value)
Specifies the version of oXygen editor used to display, accept and reject the tracked changes.
The format of the version is either '[0-9]+' or '[0-9]+.[0-9]+' without the enclosing string quotes, where: the first number sequence is the major number; and the optional second number sequence is the minor number.
This parameter is used to automatically set the relevant backwards compatibility options related to the oXygen tracked changes format. For example, prior to oXygen 14.0 release deleted whitespace needed to be normalised in order to consistently generate a reasonable result.
Default: "11.2"
value
- the value to set for the oxygenTcsVersion parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setOxygenTcsDeletedSpaceMode(OxygenTrackChangesDeletedSpaceMode value)
Specifies how deleted spaces should be handled.
Prior to oXygen 14 whitespace within the deleted content of a processing instruction were sometimes not displayed correctly. A work-around was to normalise the space within a deleted region.
Default: OxygenTrackChangesDeletedSpaceMode.AUTOMATIC
value
- the value to set for the oxygenTcsDeletedSpaceMode parameterjava.lang.IllegalArgumentException
- if the value is nullOxygenTrackChangesDeletedSpaceMode
public void setXmetalTcsTableChangeMode(XmetalTrackChangesTableChangeMode value)
Specifies how changes in tables should be tracked.
The XMetaL editor cannot track the addition or deletion of a row or cell within a table. Such changes can be pushed down to the cell level, pushed up to the table level (e.g. a CALS or HTML 'table' element), or ignored. The advantage of pushing the changes down to the cell content level, is that this provides the highest level of change granularity, at the cost of having to accept or reject every changed cell in the table independently.
The push up processing means that any table that contains a row or cell level update is represented by a table level add and delete.
The ignore option is similar to the way in which track changes within tables are handled in XMetaL; as neither row insertion and deletion or cell splitting and merging is tracked. However, for clarity this mode of operation ignores all changes within a table, it simply produces the 'B' version of the table.
Default: XmetalTrackChangesTableChangeMode.DOWN
value
- the value to set for the xmetalTcsTableChangeMode parameterjava.lang.IllegalArgumentException
- if the value is nullXmetalTrackChangesTableChangeMode
public void setFramemakerTcsTableChangeMode(FrameMakerTrackChangesTableChangeMode value)
Specifies how changes in tables should be tracked.
The FrameMaker editor cannot track the addition or deletion of a row or cell within a table. Such changes can be pushed down to the cell level, pushed up to the table level (e.g. a CALS or HTML 'table' element), or ignored. The advantage of pushing the changes down to the cell content level, is that this provides the highest level of change granularity, at the cost of having to accept or reject every changed cell in the table independently.
The push up processing means that any table that contains a row or cell level update is represented by a table level add and delete.
The ignore option is similar to the way in which track changes within tables are handled in FrameMaker; as neither row insertion and deletion or cell splitting and merging is tracked. However, for clarity this mode of operation ignores all changes within a table, it simply produces the 'B' version of the table.
Default: FrameMakerTrackChangesTableChangeMode.DOWN
value
- the value to set for the framemakerTcsTableChangeMode parameterjava.lang.IllegalArgumentException
- if the value is nullFrameMakerTrackChangesTableChangeMode
public void setPreservationMode(PreservationMode value)
Sets the mode to use for preserving original data.
This mode can be used to preserve information for round trip processing.
The 'automatic' setting will have an effective setting of 'roundTrip' when the output format is a tracked change format and 'docAndAttrib' otherwise.
Default: PreservationMode.AUTOMATIC
value
- the value to set for the preservationMode parameterjava.lang.IllegalArgumentException
- if the value is nullPreservationMode
public void setUnmarkedChangeMode(UnmarkedChangeMode value)
Specifies how to handle data that cannot contain difference markup.
Some differences between two XML documents cannot feasibly be displayed in a valid output document. These typically include changes to the XML declaration, doctype, internal subset and processing instructions. In these situations it is useful to specify what should be done.
Note that the internal subset can contain local element, attribute, and entity declarations, as well as processing instructions, comments, and entity-references.
Default: UnmarkedChangeMode.DOCUMENT_B_THEN_DECL_A
value
- the value to set for the unmarkedChangeMode parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setModifiedAttributeMode(ModifiedAttributeMode value)
Specifies how modified attributes should be included in the output.
Not all output formats allow the markup of attribute changes. When this is the case, a decision needs to be made on which version of the attribute should be present in the result file. This parameter is used to define what behaviour is required.
Default: ModifiedAttributeMode.AUTOMATIC
value
- the value to set for the modifiedAttributeMode parameterjava.lang.IllegalArgumentException
- if the value is nullpublic void setXmlVersionDeclaration(XmlVersionDeclaration value)
Sets the version to use in the XML declaration.
The 'system' special value is introduced; selecting it has the affect of choosing 'B' document's xml-version (as provided by the parser).
Default: XmlVersionDeclaration.SYSTEM
value
- the value to set for the xmlVersionDeclaration parameterjava.lang.IllegalArgumentException
- if the value is nullXmlVersionDeclaration
public void setOutputEncodingDeclaration(java.lang.String value)
Sets the character encoding output to use in the XML declaration. For example, 'UTF-8', 'ISO-8859-1', 'windows-1252', and 'ascii'. Precisely which encodings are available is dependent on the specific Java or .NET runtime environment that you use. Note that an invalid output encoding will cause an exception to be raised.
The 'system' special value is introduced; selecting it has the affect of choosing the 'B' document's character encoding.
Default: "system"
value
- the value to set for the outputEncodingDeclaration parameterjava.lang.IllegalArgumentException
- if the value is nullpublic OutputFormat getOutputFormat()
Returns the value of outputFormat
setOutputFormat(OutputFormat)
public boolean getValidateInputs()
Returns the value of validateInputs
setValidateInputs(boolean)
public boolean getUseIdsAsKeys()
Returns the value of useIdsAsKeys
setUseIdsAsKeys(boolean)
public IndentOutput getIndentOutput()
Returns the value of indentOutput
setIndentOutput(IndentOutput)
public WhitespaceProcessingMode getWhitespaceProcessingMode()
Returns the value of whitespaceProcessingMode
setWhitespaceProcessingMode(WhitespaceProcessingMode)
public java.lang.String getRemoveRevAttributeRegex()
Returns the value of removeRevAttributeRegex
setRemoveRevAttributeRegex(String)
public boolean getAddStatusAtts()
Returns the value of addStatusAtts
setAddStatusAtts(boolean)
public boolean getAddRevisionAtts()
Returns the value of addRevisionAtts
setAddRevisionAtts(boolean)
public boolean getAddOutputclassAtts()
Returns the value of addOutputclassAtts
setAddOutputclassAtts(boolean)
public java.lang.String getOldRevision()
Returns the value of oldRevision
setOldRevision(String)
public java.lang.String getNewRevision()
Returns the value of newRevision
setNewRevision(String)
public java.lang.String getOldOutputclass()
Returns the value of oldOutputclass
setOldOutputclass(String)
public java.lang.String getNewOutputclass()
Returns the value of newOutputclass
setNewOutputclass(String)
public java.util.Set<AttributeWithValue> getNewVersionAtts()
Returns the value of newVersionAtts
setNewVersionAtts(Set)
protected java.lang.String getNewVersionAttsString()
public java.util.Set<AttributeWithValue> getOldVersionAtts()
Returns the value of oldVersionAtts
setOldVersionAtts(Set)
protected java.lang.String getOldVersionAttsString()
public java.lang.String getPhraseElementName()
Returns the value of phraseElementName
setPhraseElementName(String)
public java.lang.String getPhraseContainerExclusions()
Returns the value of phraseContainerExclusions
setPhraseContainerExclusions(String)
public ShowNonPhraseChanges getShowNonPhraseChanges()
Returns the value of showNonPhraseChanges
setShowNonPhraseChanges(ShowNonPhraseChanges)
public boolean getIncludeDeleted()
Returns the value of includeDeleted
setIncludeDeleted(boolean)
public boolean getForceSpecialization()
Returns the value of forceSpecialization
setForceSpecialization(boolean)
public boolean getGrouping()
Returns the value of grouping
setGrouping(boolean)
public java.lang.String getTrackedChangesAuthor()
Returns the value of trackedChangesAuthor
setTrackedChangesAuthor(String)
public java.lang.String getTrackedChangesDate()
Returns the value of trackedChangesDate
setTrackedChangesDate(String)
public java.lang.String getOxygenTcsVersion()
Returns the value of oxygenTcsVersion
setOxygenTcsVersion(String)
public OxygenTrackChangesDeletedSpaceMode getOxygenTcsDeletedSpaceMode()
Returns the value of oxygenTcsDeletedSpaceMode
setOxygenTcsDeletedSpaceMode(OxygenTrackChangesDeletedSpaceMode)
public XmetalTrackChangesTableChangeMode getXmetalTcsTableChangeMode()
Returns the value of xmetalTcsTableChangeMode
setXmetalTcsTableChangeMode(XmetalTrackChangesTableChangeMode)
public FrameMakerTrackChangesTableChangeMode getFramemakerTcsTableChangeMode()
Returns the value of framemakerTcsTableChangeMode
setFramemakerTcsTableChangeMode(FrameMakerTrackChangesTableChangeMode)
public PreservationMode getPreservationMode()
Returns the value of preservationMode
setPreservationMode(PreservationMode)
public UnmarkedChangeMode getUnmarkedChangeMode()
Returns the value of unmarkedChangeMode
setUnmarkedChangeMode(UnmarkedChangeMode)
public ModifiedAttributeMode getModifiedAttributeMode()
Returns the value of modifiedAttributeMode
setModifiedAttributeMode(ModifiedAttributeMode)
public XmlVersionDeclaration getXmlVersionDeclaration()
Returns the value of xmlVersionDeclaration
setXmlVersionDeclaration(XmlVersionDeclaration)
public java.lang.String getOutputEncodingDeclaration()
Returns the value of outputEncodingDeclaration
setOutputEncodingDeclaration(String)
public void setSVGFallback(boolean value)
Sets whether to fallback to SVGGranularity.ADJACENT
. SVG comparison granularity will fallback to
SVGGranularity.ADJACENT
if SVG exceeds the number changed elements defined by FallbackChangePercentage.
value
- whether to use SVG Granularity fallbackpublic boolean getSVGFallback()
Returns current setting for SVG Processing Fallback.
setSVGFallback(boolean)
public void setSVGProcessing(boolean value)
Sets whether to do should do SVG comparison.
SVG comparison is recommended as it will use SVG XML-aware features when comparing two SVG images to ensure that the result can be rendered.
value
- whether to use SVG comparisonpublic boolean getSVGProcessing()
Returns current setting for SVG Processing.
setSVGProcessing(boolean)
public void setSVGGranularity(SVGGranularity value)
Specifies the granularity at which the differences between two SVG images will be represented. Will only work if SVGProcessing is set to 'true'
SVG Granularity can be of two types - 'detailed-adjacent' and 'adjacent'.
The 'adjacent' mode will display both SVG images side-by-side, and 'detailed-adjacent' will do the same while also adding styling to highlight individual changes.
Default: detailed-adjacent
value
- value for type of SVGGranularitypublic SVGGranularity getSVGGranularity()
Returns current setting for SVG Granularity.
setSVGGranularity(SVGGranularity)
public void setSVGFallbackChangePercentage(double value)
value
- a value for fallback change percentagepublic double getSVGFallbackChangePercentage()
Returns current setting for SVG Fallback Change Percentage.
setSVGFallbackChangePercentage(double)
public void setInputASVGMarkupStyle(java.lang.String value)
value
- the Input A SVG markup stylepublic java.lang.String getInputASVGMarkupStyle()
Returns the value of inputASVGMarkupStyle
setInputASVGMarkupStyle(String)
public void setInputBSVGMarkupStyle(java.lang.String value)
value
- the Input B SVG markup stylepublic java.lang.String getInputBSVGMarkupStyle()
Returns the value of inputBSVGMarkupStyle
setInputBSVGMarkupStyle(String)
public void setZIndexSVGMarkupStyle(java.lang.String value)
value
- the Z Index SVG markup stylepublic void setInvalidReferencedSVGBehaviour(InvalidReferencedSVGBehaviour value)
Sets the mode to use for handling invalid referenced SVG.
Default: InvalidReferencedSVGBehaviour.FAIL
value
- the value to set for the invalidReferencedSVGBehaviour parameterjava.lang.IllegalArgumentException
- if the value is nullInvalidReferencedSVGBehaviour
public InvalidReferencedSVGBehaviour getInvalidReferencedSVGBehaviour()
Returns current setting for InvalidReferencedSVGBehaviour.
public java.lang.String getZIndexSVGMarkupStyle()
Returns the value of ZIndexSVGMarkupStyle
setZIndexSVGMarkupStyle(String)
public void setSVGZIndex(boolean value)
Enable Z-Index. SVG comparison will account for Z-Index changes and mark them up differently to standard change.
value
- whether to use z index markup styling in SVG comparisonpublic boolean getSVGZIndex()
Determines whether to use numeric tolerance.
public void setSVGNumericTolerance(boolean value)
Sets whether to use a numeric tolerance. SVG comparison will check co-ordinate values are within specified tolerance and therefore can be considered having negligible change.
value
- whether to use in SVG comparisonpublic boolean getSVGNumericTolerance()
Determines whether to use numeric tolerance.
public void setSVGNumericToleranceValue(java.lang.String value)
String
- a value for numeric tolerancepublic java.lang.String getSVGNumericToleranceValue()
Returns the value of svg-numeric-tolerance-value
setSVGNumericToleranceValue(String)
public void setOutputImageRefForm(OutputImageRefForm value)
Specifies output image reference form after image comparison for topic only comparison.
Default: source
value
- a value for output image reference formCopyright © 2001-2016 DeltaXML Ltd. All Rights Reserved.