be.re.repo
Interface XMLCompare


public interface XMLCompare

The interface for external modules that present the differences between two XML resources. Such modules are declared in /configuration/maps.xml using the compare element as in the following example:

 <compare>
  <mime-type>* /xml</mime-type>
  <mime-type>* /*+xml</mime-type>
   <!-- Additional mime-type elements can come here. -->
   <!-- Several path elements can come here. -->
   <class>
     <name>mypackage.CompareXML</name>
     <!-- Optional URL relative to maps.xml. 
     <jar>modules/my_module.jar</jar>
     -->
   </class>
 </compare>
 
 

Author:
Werner Donné

Method Summary
 void compare(XMLEventReader oldVersion, XMLEventReader newVersion, XMLEventWriter out, String mimeType, Context context)
          Calculates the difference between two versions of a resource.
 String resultMimeType(String mimeType)
           
 

Method Detail

compare

void compare(XMLEventReader oldVersion,
             XMLEventReader newVersion,
             XMLEventWriter out,
             String mimeType,
             Context context)
             throws IOException
Calculates the difference between two versions of a resource.

Parameters:
oldVersion - the XML reader for the old version of the resource.
newVersion - the XML reader for the new version of the resource.
out - the XML writer in which the result with the differences should be written.
mimeType - the MIME type of the resource.
context - the repository context.
Throws:
IOException

resultMimeType

String resultMimeType(String mimeType)
Parameters:
mimeType - the MIME type of the resource.
Returns:
The MIME type of the document that contains the differences. It will be the Content-Type of the response of the GET method when the X-be.re.Compare-With header is present. This is a Pincette extension.