public class DocumentDiffServiceImpl extends Object implements DocumentDiffService
The diff is made by exporting the documents to XML, then using the Diff feature provided by XMLUnit to get the differences between the XML exports.
Constructor and Description |
---|
DocumentDiffServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected DocumentDiff |
computeDocDiff(org.custommonkey.xmlunit.DetailedDiff detailedDiff)
Computes the doc diff.
|
void |
configureDiff(org.custommonkey.xmlunit.Diff diff)
Configures the diff.
|
void |
configureXMLUnit()
Configures XMLUnit.
|
DocumentDiff |
diff(CoreSession session,
DocumentModel leftDoc,
DocumentModel rightDoc)
Makes a diff between leftDoc and rightDoc.
|
DocumentDiff |
diff(String leftXML,
String rightXML)
Makes a diff between leftXML and rightXML.
|
protected org.custommonkey.xmlunit.DetailedDiff |
diffXML(InputSource leftDocXMLInputSource,
InputSource rightDocXMLInputSource)
Processes the XML diff using the XMLUnit Diff feature.
|
protected org.custommonkey.xmlunit.DetailedDiff |
diffXML(String leftXML,
String rightXML)
Processes the XML diff using the XMLUnit Diff feature.
|
protected void |
exportXML(CoreSession session,
DocumentModel leftDoc,
DocumentModel rightDoc,
InputSource leftDocXMLInputSource,
InputSource rightDocXMLInputSource)
Exports leftDoc and rightDoc to XML.
|
protected DocumentXMLExporter |
getDocumentXMLExporter()
Gets the document XML exporter service.
|
public DocumentDiffServiceImpl()
public DocumentDiff diff(CoreSession session, DocumentModel leftDoc, DocumentModel rightDoc)
diff
in interface DocumentDiffService
session
- the sessionleftDoc
- the left docrightDoc
- the right docpublic DocumentDiff diff(String leftXML, String rightXML)
diff
in interface DocumentDiffService
leftXML
- the left XMLrightXML
- the right XMLpublic void configureXMLUnit()
configureXMLUnit
in interface DocumentDiffService
public void configureDiff(org.custommonkey.xmlunit.Diff diff)
configureDiff
in interface DocumentDiffService
diff
- the diffprotected final void exportXML(CoreSession session, DocumentModel leftDoc, DocumentModel rightDoc, InputSource leftDocXMLInputSource, InputSource rightDocXMLInputSource)
session
- the sessionleftDoc
- the left docrightDoc
- the right docleftDocXMLInputSource
- the left doc XML input sourcerightDocXMLInputSource
- the right doc XML input sourceprotected final DocumentXMLExporter getDocumentXMLExporter()
protected final org.custommonkey.xmlunit.DetailedDiff diffXML(InputSource leftDocXMLInputSource, InputSource rightDocXMLInputSource)
leftDocXMLInputSource
- the left doc XML input sourcerightDocXMLInputSource
- the right doc XML input sourceprotected final org.custommonkey.xmlunit.DetailedDiff diffXML(String leftXML, String rightXML)
leftXML
- the left xmlrightXML
- the right xmlprotected final DocumentDiff computeDocDiff(org.custommonkey.xmlunit.DetailedDiff detailedDiff)
detailedDiff
- the detailed diffCopyright © 2018 Nuxeo. All rights reserved.