Package org.apache.wiki.diff

# Interface DifferenceManager

All Known Implementing Classes:
  `DefaultDifferenceManager`

public interface DifferenceManager
Load, initialize and delegate to the DiffProvider that will actually do the work.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`PROP_DIFF_PROVIDER`
Property value for storing a diff provider.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDiff(org.apache.wiki.api.core.Context context, int version1, int version2)`
Returns a diff of two versions of a page.
`String`
`makeDiff(org.apache.wiki.api.core.Context context, String firstWikiText, String secondWikiText)`
Returns valid XHTML string to be used in any way you please.

## Field Details

### PROP_DIFF_PROVIDER

static final String PROP_DIFF_PROVIDER
Property value for storing a diff provider. Value is "jspwiki.diffProvider".

See Also:
  - Constant Field Values

## Method Details

### makeDiff

String makeDiff(org.apache.wiki.api.core.Context context, String firstWikiText, String secondWikiText)
Returns valid XHTML string to be used in any way you please.

Parameters:
  `context` - The Wiki Context
  `firstWikiText` - The old text
  `secondWikiText` - the new text
Returns:
  XHTML, or empty string, if no difference detected.

### getDiff

String getDiff(org.apache.wiki.api.core.Context context, int version1, int version2)
Returns a diff of two versions of a page.

Note that the API was changed in 2.6 to provide a WikiContext object!

Parameters:
  `context` - The WikiContext of the page you wish to get a diff from
  `version1` - Version number of the old page. If WikiPageProvider.LATEST_VERSION (-1), then uses current page.
  `version2` - Version number of the new page. If WikiPageProvider.LATEST_VERSION (-1), then uses current page.
Returns:
  A HTML-ized difference between two pages. If there is no difference, returns an empty string.