Package org.apache.wiki.diff
Class ExternalDiffProvider
java.lang.Object
org.apache.wiki.diff.ExternalDiffProvider
- All Implemented Interfaces:
WikiProvider
,DiffProvider
This DiffProvider allows external command line tools to be used to generate the diff.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.wiki.diff.DiffProvider
DiffProvider.NullDiffProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Determines the command to be used for 'diff'.Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Engine engine, Properties properties) makeDiffHtml
(Context ctx, String p1, String p2) Makes the diff by calling "diff" program.
-
Field Details
-
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
-
ExternalDiffProvider
public ExternalDiffProvider()Creates a new ExternalDiffProvider.
-
-
Method Details
-
getProviderInfo
- Specified by:
getProviderInfo
in interfaceWikiProvider
- See Also:
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initialize
in interfaceWikiProvider
- Throws:
NoRequiredPropertyException
IOException
- See Also:
-
makeDiffHtml
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 interfaceDiffProvider
- Parameters:
ctx
- The Wiki Contextp1
- the old textp2
- the new text- Returns:
- An XHTML diff.
-