Interface DocumentComparator

All Known Implementing Classes:
AbstractDocumentComparator, BasicComparator, NotAvailableComparator, WorkShareComparator

public interface DocumentComparator
Implementations of this interface are specialized classes that perform comparison between documents
Since:
8.2.3
Author:
Marco Meschieri - LogicalDOC
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    compare(String sid, com.logicaldoc.core.document.Version originalVersion, com.logicaldoc.core.document.Version modifiedVersion, File dest)
    Performs the comparison
    void
    compare(String sid, File original, File modified, File dest)
    Performs the comparison
    Gets the value of a parameter
    Implementations should return the list of the required parameters.
    Returns the map of parameters
    boolean
    Checks if the comparator is enabled or not
    void
    Reads it's own parameters and stores them in the parameters map
    void
    setEnabled(boolean enabled)
    Enables or disables the comparator
  • Method Details

    • compare

      void compare(String sid, File original, File modified, File dest) throws IOException, com.logicaldoc.core.parser.ParseException
      Performs the comparison
      Parameters:
      sid - identifier of the session
      original - The original file
      modified - The modified file
      dest - The comparison output as PDF file
      Throws:
      IOException - error writing the temporary files or in the comparison
      com.logicaldoc.core.parser.ParseException - error in the parsing
    • compare

      void compare(String sid, com.logicaldoc.core.document.Version originalVersion, com.logicaldoc.core.document.Version modifiedVersion, File dest) throws IOException, com.logicaldoc.core.PersistenceException, com.logicaldoc.core.parser.ParseException
      Performs the comparison
      Parameters:
      sid - The actual Session ID
      originalVersion - The original version
      modifiedVersion - The modified version
      dest - The comparison output as PDF file
      Throws:
      IOException - error writing the temporary files or in the comparison
      com.logicaldoc.core.PersistenceException - error at database level
      com.logicaldoc.core.parser.ParseException - error in the parsing
    • getParameterNames

      List<String> getParameterNames()
      Implementations should return the list of the required parameters. A parameter is stored in the context as comparator.SimpleClassName.parameter = value
      Returns:
      the list of configuration parameters
    • getParameters

      Map<String,String> getParameters()
      Returns the map of parameters
      Returns:
      map of parameters
    • getParameter

      String getParameter(String name)
      Gets the value of a parameter
      Parameters:
      name - name of the parameter
      Returns:
      value of the configuration parameter
    • loadParameters

      void loadParameters()
      Reads it's own parameters and stores them in the parameters map
    • isEnabled

      boolean isEnabled()
      Checks if the comparator is enabled or not
      Returns:
      the enabled status
    • setEnabled

      void setEnabled(boolean enabled)
      Enables or disables the comparator
      Parameters:
      enabled - the new enabled status