Testing Using Sample Command Line Driver
The provided sample command-line driver can be used to experiment using REST from the command-line.
The command-line driver was written as proof of concept to demonstrate use of the REST API, and is not intended as a primary way of interacting with it.
Source code for the command-line driver is available as an IntelliJ/Maven project in a Bitbucket repository - https://bitbucket.org/deltaxml/dita-compare-rest-java-cli/. Please customize as needed. This client doesn’t use ‘model’ POJOs corresponding to requests and responses in the API. Instead it processes responses as Strings and use XPath to process results.
For example:
$ java -jar deltaxml-dita-compare-client-1.0.0.jar compare topic resources/personA.xml
resources/personB.xml resources/person-config.xml resources/result.xml
Dita Compare REST command-line driver. (C) 2019 DeltaXML Ltd. All rights reserved.
Progress:
STARTED
PROCESSING
Inputs Loading -'input-a'
Inputs Loading -'input-b'
Comparison in progress
Output processing in progress
SUCCESS
Results written to resources/result.xml
mts example:
java -jar deltaxml-dita-rest-client-1.0.0.jar compare mts
inputA.zip inputA/inA.ditamap inputB.zip inputB/inB.ditamap result.zip
Dita Compare REST command-line driver. (C) 2022 DeltaXML Ltd. All rights reserved.
To see your result open result.zip
The client defaults to http://localhost:8080
but this can be changed by using the host
property.
For example, if the REST service is running on port 1234 instead of 8080:
java -Dhost=http://localhost:1234 -jar deltaxml-dita-compare-client-1.0.0.jar
In these samples, references to the deltaxml-dita-rest-client-1.0.0.jar should be modified to match the major.minor.patch version of DITA Compare you are using.
Also, if using a Windows terminal, the '\' line-continuation character should be replaced with '^' character.