Pipelines and Discovery

Pipelines and Discovery

The DeltaNova REST service is oriented towards discovery and running of all capabilities and pipelines including those specified using DXP, DCP, and DTCP configuration files, DOCBOOK, DITA, unstructured comparisons and Merge and Check. The existing (non-REST) command-line driver includes a number of prepared pipelines. The REST service includes all the pipelines available in the (non-REST) command line driver (ran through the deltanova-year.x.y.z.jar) for discovery and comparison.

Additionally, DXP, DCP and DTCP configuration files can be added to the REST service by placing them in the install directory. When doing so please ensure that any additional pipeline configurations have distinct id and description attributes to any existing or built-in pipelines to avoid overwriting them.

The /pipelines resource provides information about the comparison pipelines that have been discovered by the REST service.

The GET /api/compare/pipelines call provides similar information to the use of the standard DeltaNova command line driver without arguments.

Request
XML
GET /api/compare/pipelines
Response
XML
HTTP/1.1 200 OK
<pipelines>
    <pipeline>
        <id>schema</id>
        <name>[DXP] Schema Compare, output HTML report</name>
        <fullDescription>
This configuration is used to compare two schema input files and produce a HTML differences report.
  </fullDescription>
        <links>
            <link href="/api/compare/pipelines/schema" rel="self"/>
        </links>
        <fileExtension>.html</fileExtension>
    </pipeline>
    <pipeline>
        <id>doc-xhtml</id>
        <name>[DCP] XML Compare, output XHTML</name>
        <fullDescription>
    [Uses DocumentComparator] Produce an XHTML delta file representing changes in the two XHTML input files.
  </fullDescription>
        <links>
            <link href="/api/compare/pipelines/doc-xhtml" rel="self"/>
        </links>
        <outputType>xhtml</outputType>
    </pipeline>
    ...
    ...
    ...
</pipelines>


The response above is an XML result. An equivalent, similar JSON result could be obtained by using the Accept http header:

Request
GET /api/compare/pipelines
Accept: application/json
Response
JavaScript
{
    "pipelines": [
        {
            "id": "schema",
            "name": "[DXP] Schema Compare, output HTML report",
            "fullDescription": "\nThis configuration is used to compare two schema input files and produce a HTML differences report.\n  ",
            "links": [
                {
                    "href": "/api/compare/pipelines/schema",
                    "rel": "self"
                }
            ],
            "fileExtension": ".html"
        },
        {
            "id": "doc-xhtml",
            "name": "[DCP] XML Compare, output XHTML",
            "fullDescription": "\n    [Uses DocumentComparator] Produce an XHTML delta file representing changes in the two XHTML input files.\n  ",
            "links": [
                {
                    "href": "/api/compare/pipelines/doc-xhtml",
                    "rel": "self"
                }
            ],
            "outputType": "xhtml"
        },
      ...
      ...
      ...
      }
}


Further discovery of the pipeline parameters and their default values is possible by using the specific pipelines resource - i.e. /pipelines/{pipelineId}. This capability is similar to that provided by the 'describe' operation in the standard DeltaNova command-line driver.

Request
GET /api/compare/pipelines/delta


Response (XML)
XML
<pipeline>
    <id>delta</id>
    <name>[DXP] XML Compare, output XML delta</name>
    <configurationParameters>
        <configurationParameter type="boolean">
            <name>Preserve Whitespace</name>
            <description>whether to normalise whitespace before comparison</description>
            <defaultValue>false</defaultValue>
        </configurationParameter>
        <configurationParameter type="boolean">
            <name>Full Context</name>
            <description>whether to include unchanged data in the delta file</description>
            <defaultValue>true</defaultValue>
        </configurationParameter>
        <configurationParameter type="boolean">
            <name>Word By Word</name>
            <description>whether to compare PCDATA in a more detailed way</description>
            <defaultValue>false</defaultValue>
        </configurationParameter>
        <configurationParameter type="boolean">
            <name>Enhanced Match 1</name>
            <description>whether to use the 4.x enhanced matcher that is tailored to comparing documents</description>
            <defaultValue>true</defaultValue>
        </configurationParameter>
        <configurationParameter type="string">
            <name>Indent</name>
            <description>whether to pretty print the output or not. May be set to 'yes' or 'no'</description>
            <defaultValue>yes</defaultValue>
        </configurationParameter>
    </configurationParameters>
    <fullDescription>
This configuration is used to produce an XML delta file representing changes in the input xml.
  </fullDescription>
    <links>
        <link href="/api/compare/pipelines/delta" rel="self"/>
    </links>
    <fileExtension>.xml</fileExtension>
</pipeline>


Response (JSON)
JavaScript
{
    "id": "delta",
    "name": "[DXP] XML Compare, output XML delta",
    "configurationParameters": [
        {
            "type": "boolean",
            "name": "Preserve Whitespace",
            "description": "whether to normalise whitespace before comparison",
            "defaultValue": false
        },
        {
            "type": "boolean",
            "name": "Full Context",
            "description": "whether to include unchanged data in the delta file",
            "defaultValue": true
        },
        {
            "type": "boolean",
            "name": "Word By Word",
            "description": "whether to compare PCDATA in a more detailed way",
            "defaultValue": false
        },
        {
            "type": "boolean",
            "name": "Enhanced Match 1",
            "description": "whether to use the 4.x enhanced matcher that is tailored to comparing documents",
            "defaultValue": true
        },
        {
            "type": "string",
            "name": "Indent",
            "description": "whether to pretty print the output or not. May be set to 'yes' or 'no'",
            "defaultValue": "yes"
        }
    ],
    "fullDescription": "\nThis configuration is used to produce an XML delta file representing changes in the input xml.\n  ",
    "links": [
        {
            "href": "/api/compare/pipelines/delta",
            "rel": "self"
        }
    ],
    "fileExtension": ".xml"
}