org.exoplatform.wiki.service.diff
Class DiffService

java.lang.Object
  extended by org.exoplatform.wiki.service.diff.DiffService

public class DiffService
extends Object

This service provide different methods to be able to compare and make a diff list between content.


Constructor Summary
DiffService()
           
 
Method Summary
protected  String escape(String text)
          Escape string by using a common filter
protected  List getDeltas(org.suigeneris.jrcs.diff.Revision rev)
          Return a list of delta based on a wiki page revision
 DiffResult getDifferencesAsHTML(String text1, String text2, boolean allDoc)
          Return a DiffResult object representing line diffs between text1 and text2
 List getDifferencesAsList(String text1, String text2)
          Return a list of Delta objects representing line differences in text1 and text2
 DiffResult getWordDifferencesAsHTML(String text1, String text2)
          Return a DiffResult object representing word diffs between text1 and text2
 List getWordDifferencesAsList(String text1, String text2)
          Return a list of Delta objects representing word differences in text1 and text2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiffService

public DiffService()
Method Detail

getDifferencesAsList

public List getDifferencesAsList(String text1,
                                 String text2)
                          throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Return a list of Delta objects representing line differences in text1 and text2

Parameters:
text1 - original content
text2 - revised content
Returns:
list of Delta objects
Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException

getWordDifferencesAsList

public List getWordDifferencesAsList(String text1,
                                     String text2)
                              throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Return a list of Delta objects representing word differences in text1 and text2

Parameters:
text1 - original content
text2 - revised content
Returns:
list of Delta objects
Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException

getWordDifferencesAsHTML

public DiffResult getWordDifferencesAsHTML(String text1,
                                           String text2)
                                    throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Return a DiffResult object representing word diffs between text1 and text2

Parameters:
text1 - original content
text2 - revised content
Returns:
list of Delta objects
Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException

getDifferencesAsHTML

public DiffResult getDifferencesAsHTML(String text1,
                                       String text2,
                                       boolean allDoc)
                                throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Return a DiffResult object representing line diffs between text1 and text2

Parameters:
text1 - original content
text2 - revised content
allDoc - show all document
Returns:
list of Delta objects
Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException

getDeltas

protected List getDeltas(org.suigeneris.jrcs.diff.Revision rev)
Return a list of delta based on a wiki page revision

Parameters:
rev -
Returns:
list of delta

escape

protected String escape(String text)
Escape string by using a common filter

Parameters:
text - the text to escape
Returns:
string


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.