com.atlassian.confluence.util
Class DiffUtils

java.lang.Object
  extended by com.atlassian.confluence.util.DiffUtils

Deprecated. since 4.0. Not used. Please use ConfluenceDiff instead.

@Deprecated
public class DiffUtils
extends Object


Field Summary
static byte DIFF_MODE_ADD
          Deprecated.  
static byte DIFF_MODE_CHANGE_ADD
          Deprecated.  
static byte DIFF_MODE_CHANGE_DELETE
          Deprecated.  
static byte DIFF_MODE_DELETE
          Deprecated.  
static byte DIFF_MODE_NONE
          Deprecated.  
static String STYLE_ADDED
          Deprecated.  
static String STYLE_DELETED
          Deprecated.  
static String STYLE_ERROR
          Deprecated.  
static String STYLE_NONE
          Deprecated.  
static byte WORD_DIFF_MAX
          Deprecated. maximum percentage of words to diff in a line.
 
Constructor Summary
DiffUtils()
          Deprecated.  
 
Method Summary
static String diffLine(String orig, String rev)
          Deprecated. Will perform a diff on two lines.
static DiffResult generateDiff(ContentEntityObject originalPage, ContentEntityObject revisedPage)
          Deprecated. Calculates the difference between two pages and returns the result as HTML.
static byte getDiffMode()
          Deprecated.  
static Object[] loadPage(ContentEntityObject page)
          Deprecated.  
static String mergeChanges(String originalPage, String revisionA, String revisionB)
          Deprecated.  
static void setDiffMode(byte mode)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORD_DIFF_MAX

public static final byte WORD_DIFF_MAX
Deprecated. 
maximum percentage of words to diff in a line. If the percentage of diffed words exceed this number only line diffing is displayed

See Also:
Constant Field Values

DIFF_MODE_NONE

public static final byte DIFF_MODE_NONE
Deprecated. 
See Also:
Constant Field Values

DIFF_MODE_ADD

public static final byte DIFF_MODE_ADD
Deprecated. 
See Also:
Constant Field Values

DIFF_MODE_DELETE

public static final byte DIFF_MODE_DELETE
Deprecated. 
See Also:
Constant Field Values

DIFF_MODE_CHANGE_DELETE

public static final byte DIFF_MODE_CHANGE_DELETE
Deprecated. 
See Also:
Constant Field Values

DIFF_MODE_CHANGE_ADD

public static final byte DIFF_MODE_CHANGE_ADD
Deprecated. 
See Also:
Constant Field Values

STYLE_NONE

public static final String STYLE_NONE
Deprecated. 
See Also:
Constant Field Values

STYLE_ADDED

public static final String STYLE_ADDED
Deprecated. 
See Also:
Constant Field Values

STYLE_DELETED

public static final String STYLE_DELETED
Deprecated. 
See Also:
Constant Field Values

STYLE_ERROR

public static final String STYLE_ERROR
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

DiffUtils

public DiffUtils()
Deprecated. 
Method Detail

generateDiff

public static DiffResult generateDiff(ContentEntityObject originalPage,
                                      ContentEntityObject revisedPage)
                               throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Deprecated. 
Calculates the difference between two pages and returns the result as HTML.

The CSS styles used are:

  1. diff-added-lines - section has been added
  2. diff-deleted-lines - section has been removed
  3. diff-snipped - section has not been changed
  4. differror - (rare) used if there is an error

Parameters:
originalPage - The original page
revisedPage - The revised page
Returns:
A DiffResult
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

loadPage

public static Object[] loadPage(ContentEntityObject page)
Deprecated. 

diffLine

public static String diffLine(String orig,
                              String rev)
                       throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Deprecated. 
Will perform a diff on two lines. This works similar to the deff above and if I had more time I would like to refactor the methods and merge them. //TODO Refactor the diff methods into one clean method

Parameters:
orig - the original line
rev - the revised line
Returns:
a html diff of the two lines
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

getDiffMode

public static byte getDiffMode()
Deprecated. 

setDiffMode

public static void setDiffMode(byte mode)
Deprecated. 

mergeChanges

public static String mergeChanges(String originalPage,
                                  String revisionA,
                                  String revisionB)
Deprecated. 
Returns:
null if the merge was unsuccessful


Copyright © 2003-2012 Atlassian. All Rights Reserved.