com.gentics.contentnode.rest.model.request
Class DiffRequest

java.lang.Object
  extended by com.gentics.contentnode.rest.model.request.DiffRequest

public class DiffRequest
extends java.lang.Object

Class representing a diff request sent to DiffResource. Encapsulates request data.


Field Summary
protected  java.lang.String changeTemplate
          Template for rendering changes
protected  java.lang.String content1
          First content to be diff'ed
protected  java.lang.String content2
          Second content to be diff'ed
static java.lang.String DEFAULT_CHANGE_TEMPLATE
          Default template for changes
static java.lang.String DEFAULT_INSERT_TEMPLATE
          Default template for inserts
static java.lang.String DEFAULT_REMOVE_TEMPALTE
          Default template for removals
static int DEFAULT_WORDS_AFTER
          Default number of words after the change to be shown
static int DEFAULT_WORDS_BEFORE
          Default number of words before the change to be shown
protected  java.lang.String ignoreRegex
          Regex of content to be ignored while diffing
protected  java.lang.String insertTemplate
          Template for rendering inserts
protected  java.lang.String removeTemplate
          Template for rendering removals
protected  java.lang.Integer wordsAfter
          Number of words to be shown after the diff
protected  java.lang.Integer wordsBefore
          Number of words to be shown before the diff
 
Constructor Summary
DiffRequest()
          Create an empty instance (Used by JAXB)
 
Method Summary
 java.lang.String getChangeTemplate()
          Return the change template.
 java.lang.String getContent1()
          Return the content1.
 java.lang.String getContent2()
          Return the content2.
 java.lang.String getIgnoreRegex()
          Return the ignore regex that will be used to sanitize the content before the diff is invoked.
 java.lang.String getInsertTemplate()
          Return the insert template.
 java.lang.String getRemoveTemplate()
          Return the remove template.
 java.lang.Integer getWordsAfter()
          Return the amount of words that should be displayed after the actual diff.
 java.lang.Integer getWordsBefore()
          Return the number of words before the change to be shown.
 void setChangeTemplate(java.lang.String changeTemplate)
          Set the change template.
 void setContent1(java.lang.String content1)
          Set the content1.
 void setContent2(java.lang.String content2)
          Set the content2.
 void setIgnoreRegex(java.lang.String ignoreRegex)
          Set the ignore regex that will be used to sanitize the content before the diff is invoked.
 void setInsertTemplate(java.lang.String insertTemplate)
          Set the insert template for the diff request.
 void setRemoveTemplate(java.lang.String removeTemplate)
          Set the remove template.
 void setWordsAfter(java.lang.Integer wordsAfter)
          Set the amount of words that should be displayed after the actual diff.
 void setWordsBefore(java.lang.Integer wordsBefore)
          Set the amount of words that should be displayed before the actual diff.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CHANGE_TEMPLATE

public static final java.lang.String DEFAULT_CHANGE_TEMPLATE
Default template for changes

See Also:
Constant Field Values

DEFAULT_INSERT_TEMPLATE

public static final java.lang.String DEFAULT_INSERT_TEMPLATE
Default template for inserts

See Also:
Constant Field Values

DEFAULT_REMOVE_TEMPALTE

public static final java.lang.String DEFAULT_REMOVE_TEMPALTE
Default template for removals

See Also:
Constant Field Values

DEFAULT_WORDS_BEFORE

public static final int DEFAULT_WORDS_BEFORE
Default number of words before the change to be shown

See Also:
Constant Field Values

DEFAULT_WORDS_AFTER

public static final int DEFAULT_WORDS_AFTER
Default number of words after the change to be shown

See Also:
Constant Field Values

content1

protected java.lang.String content1
First content to be diff'ed


content2

protected java.lang.String content2
Second content to be diff'ed


ignoreRegex

protected java.lang.String ignoreRegex
Regex of content to be ignored while diffing


changeTemplate

protected java.lang.String changeTemplate
Template for rendering changes


insertTemplate

protected java.lang.String insertTemplate
Template for rendering inserts


removeTemplate

protected java.lang.String removeTemplate
Template for rendering removals


wordsBefore

protected java.lang.Integer wordsBefore
Number of words to be shown before the diff


wordsAfter

protected java.lang.Integer wordsAfter
Number of words to be shown after the diff

Constructor Detail

DiffRequest

public DiffRequest()
Create an empty instance (Used by JAXB)

Method Detail

getContent1

public java.lang.String getContent1()
Return the content1.

Returns:
the content1

setContent1

public void setContent1(java.lang.String content1)
Set the content1.

Parameters:
content1 - the content1 to set

getContent2

public java.lang.String getContent2()
Return the content2.

Returns:
the content2

setContent2

public void setContent2(java.lang.String content2)
Set the content2.

Parameters:
content2 - the content2 to set

getIgnoreRegex

public java.lang.String getIgnoreRegex()
Return the ignore regex that will be used to sanitize the content before the diff is invoked.

Returns:
the ignoreRegex

setIgnoreRegex

public void setIgnoreRegex(java.lang.String ignoreRegex)
Set the ignore regex that will be used to sanitize the content before the diff is invoked.

Parameters:
ignoreRegex - the ignoreRegex to set

getChangeTemplate

public java.lang.String getChangeTemplate()
Return the change template.

 The following default template will be used when no template has been set:
 <del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
 
 

Returns:
the changeTemplate

setChangeTemplate

public void setChangeTemplate(java.lang.String changeTemplate)
Set the change template.

The following default template will be used when no template has been set:

 <del class='diff modified gtx-diff'>$remove</del><ins class='diff modified gtx-diff'>$insert</ins>
 
 

Parameters:
changeTemplate - the template to set

getInsertTemplate

public java.lang.String getInsertTemplate()
Return the insert template.

 The following default template will be used when no template has been set:
 <ins class='diff modified gtx-diff'>$insert</ins>
 
 

Returns:
the insertTemplate

setInsertTemplate

public void setInsertTemplate(java.lang.String insertTemplate)
Set the insert template for the diff request.

The following default template will be used when no template has been set:

 <ins class='diff modified gtx-diff'>$insert</ins>
 
 

Parameters:
insertTemplate - the template to set

getRemoveTemplate

public java.lang.String getRemoveTemplate()
Return the remove template.

The following default template will be used when no template has been set:

 <del class='diff modified gtx-diff'>$remove</del>
 
 

Returns:
the removeTemplate

setRemoveTemplate

public void setRemoveTemplate(java.lang.String removeTemplate)
Set the remove template.

The following default template will be used when no template has been set:

 <del class='diff modified gtx-diff'>$remove</del>
 
 

Parameters:
removeTemplate - the removeTemplate to set

getWordsBefore

public java.lang.Integer getWordsBefore()
Return the number of words before the change to be shown. Default value: 10

Returns:
the wordsBefore

setWordsBefore

public void setWordsBefore(java.lang.Integer wordsBefore)
Set the amount of words that should be displayed before the actual diff. Default value: 10

Parameters:
wordsBefore - the wordsBefore to set

getWordsAfter

public java.lang.Integer getWordsAfter()
Return the amount of words that should be displayed after the actual diff. Default value: 10

Returns:
the wordsAfter

setWordsAfter

public void setWordsAfter(java.lang.Integer wordsAfter)
Set the amount of words that should be displayed after the actual diff. Default value: 10

Parameters:
wordsAfter - the wordsAfter to set


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.