DiffResource

The following resources are part of this group:

/diff/daisyDiff

Mount Point: /CNPortletapp/rest/diff/daisyDiff

POST

Annotates a newer HTML document with differences to an older HTML document.

The annotations will be done by the DaisyDiff Algorithm. Please see the DaisyDiff project site for more information and examples.

The resulting HTML will need some CSS and (optionally) some Javascript includes from version 1.1 of the DaisyDiff distribution.

The CSS file in "css/diff.css" of the DaisyDiff distribution archive provides basic styles for inserted/deleted/changed elements and is sufficient by itself to provide basic visualization of changes.

The following JavaScript files need to be included to get an extended interface that allows navigation between changes and provides more information about a change when it is clicked:

The included JavaScript must be explicitly initialized:

The DaisyDiff algorithm differs from the standard diff algorithm in that it tries to preserve the HTML tree structure, while the standard HTML diff alogrithm may break it.

If the given HTML documents contain <body> tags, only content inside the tags will be diffed. Differences outside the body tags will be ignored. The resulting HTML document will contain the same header (substring from start of document until and including the body tag) as the newer document.

Please note that the HTML diff will not reflect the changes exactly. The HTML will be cleaned up and some content may be lost in this process. The result is meant for human consumption, not to generate exact differences between HTML documents.

Request Body

element: daisyDiffRequest

contains the parameters for the DaisyDiff algorithm

Response Body

element: diffResponse

a response containing the diff for the two HTML documents

/diff/html

Mount Point: /CNPortletapp/rest/diff/html

POST

Method to calculate the diff in HTML

Request Body

element: diffRequest

request containing the HTML contents to be diffed

Response Body

element: diffResponse

response containing the diff

/diff/source

Mount Point: /CNPortletapp/rest/diff/source

POST

Method to calculate the diff between two HTML contents in source

Request Body

element: diffRequest

request containing the HTML contents to be diffed

Response Body

element: diffResponse

response containing the diff