@Produces(value={"application/json; charset=UTF-8","application/xml; charset=UTF-8"})
@Path(value="/diff")
public interface DiffResource
Modifier and Type | Method and Description |
---|---|
DiffResponse |
daisyDiff(DaisyDiffRequest request)
Annotates a newer HTML document with differences to an older HTML document.
|
DiffResponse |
diffHTML(DiffRequest request)
Method to calculate the diff in HTML
|
DiffResponse |
diffSource(DiffRequest request)
Method to calculate the diff between two HTML contents in source
|
@POST @Path(value="/daisyDiff") DiffResponse daisyDiff(DaisyDiffRequest request)
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: <script type='text/javascript'>htmlDiffInit();</script>
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
- contains the parameters for the DaisyDiff algorithm@POST @Path(value="/html") DiffResponse diffHTML(DiffRequest request)
request
- request containing the HTML contents to be diffed@POST @Path(value="/source") DiffResponse diffSource(DiffRequest request)
request
- request containing the HTML contents to be diffedCopyright © 2024 Gentics Software. All rights reserved.