Class ExternalDiffProvider

java.lang.Object
org.apache.wiki.diff.ExternalDiffProvider
All Implemented Interfaces:
org.apache.wiki.api.providers.WikiProvider, DiffProvider

public class ExternalDiffProvider extends Object implements DiffProvider
This DiffProvider allows external command line tools to be used to generate the diff.
  • Field Details

    • PROP_DIFFCOMMAND

      public static final String PROP_DIFFCOMMAND
      Determines the command to be used for 'diff'. This program must be able to output diffs in the unified format. For example 'diff -u %s1 %s2'.
      See Also:
  • Constructor Details

  • Method Details

    • getProviderInfo

      Specified by:
      getProviderInfo in interface org.apache.wiki.api.providers.WikiProvider
      See Also:
      • WikiProvider.getProviderInfo()
    • initialize

      public void initialize(org.apache.wiki.api.core.Engine engine, Properties properties) throws org.apache.wiki.api.exceptions.NoRequiredPropertyException, IOException
      Specified by:
      initialize in interface org.apache.wiki.api.providers.WikiProvider
      Throws:
      org.apache.wiki.api.exceptions.NoRequiredPropertyException
      IOException
      See Also:
      • WikiProvider.initialize(org.apache.wiki.api.core.Engine, java.util.Properties)
    • makeDiffHtml

      public String makeDiffHtml(org.apache.wiki.api.core.Context ctx, String p1, String p2)
      Makes the diff by calling "diff" program. The return string is to be XHTML compliant ready to display html. No further processing of this text will be done by the wiki engine.
      Specified by:
      makeDiffHtml in interface DiffProvider
      Parameters:
      ctx - The Wiki Context
      p1 - the old text
      p2 - the new text
      Returns:
      An XHTML diff.