Class DitaMapTopicsetCompare
This comparator aligns the topics between the two maps, compares the aligned topics, and returns a map, or maps, that contain the compared, added, and deleted topics. Precisely what is returned is dependent on the parameters specified in this class, as discussed in the Map Level Output Formats section of the User Guide.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLicenseFile(File licenseFile) Adds the license file for use with Flexera licensing.voidaddLicenseServer(String hostname) Adds a license server for use with concurrent licensing.voidaddLicenseServer(String hostname, int port) Adds a license server and port for use with concurrent licensing.voidAdd a progress listener.voidCompare two DITA maps.voidcompareInPlace(File input1, File input2) Compare two DITA maps.Get theAdvancedParametersin use by this DITA comparator.booleanGets whether the production of debug files is on or not.Get theDitaConfigin use by this DITA comparator.Gets the explicitly set EntityResolver in use by the comparison.getEntityResolver(boolean builtInResolver) Gets the EntityResolver in use by the comparison.Get theFormattingElementsConfigin use by this DITA comparator.Get theImageConfigurationin use by this DITA comparator.Get theMapParametersin use by this DITA comparator.Get theMathMLConfigin use by this DITA comparator.Get theMovesConfigin use by this DITA comparator.Get theOutputParametersin use by this DITA comparator.Get theSVGConfigin use by this DITA comparator.Get theTableConfigin use by this DITA comparator.Get theTextComparisonConfigin use by this DITA comparator.Get theTopicConfigin use by this DITA comparator.Gets the explicitly set URIResolver in use by the comparison.getURIResolver(boolean builtInResolver) Gets the URIResolver in use by the comparison.voidRemove a progress listener.voidsetAdvancedParameters(AdvancedParameters advancedParameters) Set theAdvancedParametersin use by this DITA comparator.voidsetDebugFiles(boolean enableDebug) Determines whether intermediate pipeline result files are generated.voidsetDitaConfig(DitaConfig ditaConfig) Set theDitaConfigin use by this DITA comparator.voidsetEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver) Sets the EntityResolver to use during the comparison.voidsetFormattingElementsConfig(FormattingElementsConfig formattingElementsConfig) Set theFormattingElementsConfigin use by the DITA comparator.voidsetImageConfiguration(ImageConfiguration imageConfiguration) Set theImageConfigurationin use by the DITA comparator.voidsetMapParameters(MapParameters mapParameters) Set theMapParametersin use by this DITA comparator.voidsetMathmlConfig(MathMLConfig mathmlConfig) Set theMathMLConfigin use by the DITA comparator.voidsetMovesConfig(MovesConfig movesConfig) Set theMovesConfigin use by the DITA comparator.voidsetOutputParameters(OutputParameters outputParameters) Set theOutputParametersin use by this DITA comparator.voidsetSvgConfig(SVGConfig svgConfig) Set theSVGConfigin use by the DITA comparator.voidsetTableConfig(TableConfig tableConfig) Set theTableConfigin use by the DITA comparator.voidsetTextComparisonConfig(TextComparisonConfig textComparisonConfig) Set theTextComparisonConfigin use by the DITA comparator.voidsetTopicConfig(TopicConfig topicConfig) Set theTopicConfigin use by the DITA comparator.voidsetURIResolver(URIResolver resolver, boolean fallbackToDefaultCatalogResolver) Sets the URIResolver to use during the comparison.
-
Constructor Details
-
DitaMapTopicsetCompare
Create a DITA Map comparator.- Throws:
ParserException- If the DITA map comparator cannot be created due to the availability/configuration of the underpinning XML parser and XSLT technologies.
-
-
Method Details
-
compare
public void compare(File input1, File input2, File outputDir) throws ParserException, SerializationException, InputLoadException, InvalidInputException, DitaIOException, FilterException, com.deltaxml.licensing.LicenseException, DitaTopicProcessingException Compare two DITA maps. The result is copied to the separate location specified in the outputDir parameter.- Parameters:
input1- The first input file ('A' document).input2- The second input file ('B' document).outputDir- The output copy location- Throws:
com.deltaxml.licensing.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 FileFilterException- when an error occurs running a filter in the pipelineInvalidInputException- when an input file is not in the correct formatDitaIOException- when there is a problem with locating, moving, copying, or accessing resources.DitaTopicProcessingException
-
compareInPlace
public void compareInPlace(File input1, File input2) throws ParserException, SerializationException, InputLoadException, InvalidInputException, DitaIOException, FilterException, com.deltaxml.licensing.LicenseException, DitaTopicProcessingException Compare two DITA maps. The result is either interspersed with the inputs, with possible backup files- Parameters:
input1- The first input file ('A' document).input2- The second input file ('B' document).- Throws:
com.deltaxml.licensing.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 FileFilterException- when an error occurs running a filter in the pipelineInvalidInputException- when an input file is not in the correct formatDitaIOException- when there is a problem with locating, moving, copying, or accessing resources.DitaTopicProcessingException
-
addProgressListener
Add a progress listener. This adds a progress listener to the list of registered progress listeners. The same listener may be added more than once.- Parameters:
listener- the progress listener to add.
-
removeProgressListener
Remove a progress listener. This removes the first occurrence of the progress listener from the registered progress listener list.- Parameters:
listener- the progress listener to remove.
-
getMapParameters
Get theMapParametersin use by this DITA comparator. TheMapParameterscontrol how the map comparison is performed in a map topic set comparison.- Returns:
- the active
MapParametersin use by this DITA comparator. - See Also:
-
setMapParameters
Set theMapParametersin use by this DITA comparator. TheMapParameterscontrol how the map comparison is performed in a map topic set comparison.- Parameters:
mapParameters- theMapParametersto use.- Throws:
IllegalArgumentException- if passedMapParametersis null.- See Also:
-
getSvgConfig
-
setSvgConfig
Set theSVGConfigin use by the DITA comparator. TheSVGConfigcontains parameters that control how SVG comparison is performed and the output is displayed.- Parameters:
svgConfig- theSVGConfigto use- Throws:
IllegalArgumentException- if passedSVGConfigis null- See Also:
-
getMovesConfig
Get theMovesConfigin use by this DITA comparator. TheMovesConfigcontains parameters that control how and if element moves are shown and how they are represented.- Returns:
- the active
MovesConfigin use by this DITA comparator - See Also:
-
setMovesConfig
Set theMovesConfigin use by the DITA comparator. TheMovesConfigcontains parameters that control how and if element moves are shown and how they are represented.- Parameters:
movesConfig- theMovesConfigto use- Throws:
IllegalArgumentException- if passedMovesConfigis null- See Also:
-
getImageConfiguration
Get theImageConfigurationin use by this DITA comparator. TheImageConfigurationcontains parameters that control how and if referenced image content is compared.- Returns:
- the active
ImageConfigurationin use by this DITA comparator - See Also:
-
setImageConfiguration
Set theImageConfigurationin use by the DITA comparator. TheImageConfigurationcontains parameters that control how and if referenced image content is compared.- Parameters:
imageConfiguration- theImageConfigurationto use- Throws:
IllegalArgumentException- if passedImageConfigurationis null- See Also:
-
getMathmlConfig
Get theMathMLConfigin use by this DITA comparator. TheMathMLConfigcontains parameters that control how and if MathML content is specially handled.- Returns:
- the active
MathMLConfigin use by this DITA comparator - See Also:
-
setMathmlConfig
Set theMathMLConfigin use by the DITA comparator. TheMathMLConfigcontains parameters that control how and if MathML content is specially handled.- Parameters:
mathmlConfig- theMathMLConfigto use- Throws:
IllegalArgumentException- if passedMathMLConfigis null- See Also:
-
getFormattingElementsConfig
Get theFormattingElementsConfigin use by this DITA comparator. TheFormattingElementsConfigcontains parameters that control how formatting elements are defined and compared.- Returns:
- the active
FormattingElementsConfigin use by this DITA comparator - See Also:
-
setFormattingElementsConfig
Set theFormattingElementsConfigin use by the DITA comparator. TheFormattingElementsConfigcontains parameters that control how formatting elements are defined and compared.- Parameters:
formattingElementsConfig- theFormattingElementsConfigto use- Throws:
IllegalArgumentException- if passedFormattingElementsConfigis null- See Also:
-
getTableConfig
Get theTableConfigin use by this DITA comparator. TheTableConfigcontains parameters that control how tables are handled and compared.- Returns:
- the active
TableConfigin use by this DITA comparator - See Also:
-
setTableConfig
Set theTableConfigin use by the DITA comparator. TheTableConfigcontains parameters that control how tables are handled and compared.- Parameters:
tableConfig- theTableConfigto use- Throws:
IllegalArgumentException- if passedTableConfigis null- See Also:
-
getTopicConfig
Get theTopicConfigin use by this DITA comparator. TheTopicConfigcontains topic specific parameters that control how the DITA input documents are compared.- Returns:
- the active
TopicConfigin use by this DITA comparator - See Also:
-
setTopicConfig
Set theTopicConfigin use by the DITA comparator. TheTopicConfigcontains topic specific parameters that control how the DITA input documents are compared.- Parameters:
topicConfig- theTopicConfigto use- Throws:
IllegalArgumentException- if passedTopicConfigis null- See Also:
-
getTextComparisonConfig
Get theTextComparisonConfigin use by this DITA comparator. TheTextComparisonConfigcontains parameters that control how text is compared during the comparison.- Returns:
- the active
TextComparisonConfigin use by this DITA comparator - See Also:
-
setTextComparisonConfig
Set theTextComparisonConfigin use by the DITA comparator. TheTextComparisonConfigcontains parameters that control how text is compared during the comparison.- Parameters:
textComparisonConfig- theTextComparisonConfigto use- Throws:
IllegalArgumentException- if passedTextComparisonConfigis null- See Also:
-
getDitaConfig
Get theDitaConfigin use by this DITA comparator. TheDitaConfigcontains general parameters that control how the DITA input documents are compared.- Returns:
- the active
DitaConfigin use by this DITA comparator - See Also:
-
setDitaConfig
Set theDitaConfigin use by this DITA comparator. TheDitaConfigcontains general parameters that control how the DITA input documents are compared.- Parameters:
ditaConfig- theDitaConfigto use- Throws:
IllegalArgumentException- if passedDitaConfigis null- See Also:
-
getOutputParameters
Get theOutputParametersin use by this DITA comparator. TheOutputParameterscontains parameters that control how the result of the comparison is presented.- Returns:
- the active
OutputParametersin use by this DITA comparator - See Also:
-
setOutputParameters
Set theOutputParametersin use by this DITA comparator. TheOutputParameterscontains parameters that control how the result of the comparison is presented.- Parameters:
outputParameters- theOutputParametersto use- Throws:
IllegalArgumentException- if passedOutputParametersis null- See Also:
-
getAdvancedParameters
Get theAdvancedParametersin use by this DITA comparator. TheAdvancedParametersprovide a finer level of control over the comparison, the output, and error reporting.- Returns:
- the active
AdvancedParametersin use by this DITA comparator - See Also:
-
setAdvancedParameters
Set theAdvancedParametersin use by this DITA comparator. TheAdvancedParametersprovide a finer level of control over the comparison, the output, and error reporting.- Parameters:
advancedParameters- theAdvancedParametersto use- Throws:
IllegalArgumentException- if passedAdvancedParametersis null- See Also:
-
setDebugFiles
public void setDebugFiles(boolean enableDebug) Determines whether intermediate pipeline result files are generated. When developing a pipelined application it is sometimes useful to see the intermediate results. This debug option when set will generate a file containing the XML corresponding the intermediate result of most of the pipeline stages.
For topic and mapfile comparisons the directory these files are written to can be controlled with setDebugFilesPrefix(String).
- Parameters:
enableDebug- when true intermediate result files are produced and stored in a directory.
-
getDebugFiles
public boolean getDebugFiles()Gets whether the production of debug files is on or not.
- Returns:
- whether the production of debug files is on or not.
-
getEntityResolver
Gets the explicitly set EntityResolver in use by the comparison.
- Returns:
- the explicitly set EntityResolver in use by the comparison.
-
getEntityResolver
Gets the EntityResolver in use by the comparison.
- Parameters:
builtInResolver- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set resolver.- Returns:
- the explicitly set EntityResolver in use by the comparison.
-
setEntityResolver
Sets the EntityResolver to use during the comparison.
By default, the Apache Commons Resolver is used as an EntityResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a
nullresolver and setting thefallbackToDefaultCatalogResolvertofalse.- Parameters:
resolver- The resolver to use. Using null removes an existing resolver.fallbackToDefaultCatalogResolver- Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the entity.
-
getURIResolver
Gets the explicitly set URIResolver in use by the comparison.
- Returns:
- the explicitly set URIResolver in use by the comparison.
-
getURIResolver
Gets the URIResolver in use by the comparison.
- Parameters:
builtInResolver- Whether to get the built in resolver (with any explicit enhancement), or just the explicitly set resolver.- Returns:
- the explicitly set URIResolver in use by the comparison.
-
setURIResolver
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
nullresolver and setting thefallbackToDefaultCatalogResolvertofalse.- Parameters:
resolver- The resolver to use. Using null removes an existing resolver.fallbackToDefaultCatalogResolver- Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the URI.
-
addLicenseFile
public void addLicenseFile(File licenseFile) throws SecurityException, IOException, com.deltaxml.licensing.LicenseException Adds the license file for use with Flexera licensing. This can be either simple server/named-user license file or a concurrent license file containing the USE_SERVER directive- Parameters:
licenseFile- the FlexLM format license file- Throws:
com.deltaxml.licensing.LicenseException- When there is a problem due to licensing considerations.IOException- When there is a problem related to the license file.SecurityException- When there is a problem related to the license file.
-
addLicenseServer
Adds a license server for use with concurrent licensing.- Parameters:
hostname- of the license server host or its IP address- Throws:
com.deltaxml.licensing.LicenseException- When there is a problem due to licensing considerations.
-
addLicenseServer
public void addLicenseServer(String hostname, int port) throws IllegalArgumentException, com.deltaxml.licensing.LicenseException Adds a license server and port for use with concurrent licensing.- Parameters:
hostname- of the license server host or its IP address.port- the port number on the license server for the 'lmgrd' license server.- Throws:
IllegalArgumentException- if the port number is outside the allowed range.com.deltaxml.licensing.LicenseException- When there is a problem due to licensing considerations.
-