|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.renderer.AbstractRenderFilter
com.jivesoftware.forum.renderer.filter.HTMLFilter
public class HTMLFilter
A Filter that takes a string which may contain HTML tags (ie, <table>, etc) and converts the '<', '>' and '&' characters to their HTML escape sequences. If block mode is enabled HTML will only be escaped inside of [html] [/html] blocks.
This filter has the ability to allow specific HTML tags to pass through the filter when not used in block mode. By default the following tags are allowed to bypass the filter:
Note: if you have this filter enabled you do not also need to have the NewlineFilter
filter
enabled. This HTML filter will filter newline characters ('\n' or '\r\n') when the filter input does not
contain any HTML tags.
Field Summary | |
---|---|
static java.lang.String |
HTML_FILTER_CONTEXT_PARAM
|
Constructor Summary | |
---|---|
HTMLFilter()
Creates a new default HTML filter. |
Method Summary | |
---|---|
protected java.lang.String |
cleanseText(java.lang.String text,
RenderContext renderContext)
|
protected boolean |
contentIsHtml(java.lang.Object sourceObject)
|
protected java.lang.String |
executeHtmlTarget(java.lang.String string,
RenderContext renderContext)
This method is called to execute the filter when the render target specified in the context is RenderTarget.TARGET_HTML . |
protected java.lang.String |
executeNoMarkupTarget(java.lang.String string,
RenderContext renderContext)
This method is called to execute the filter when the render target specified in the context is RenderTarget.TARGET_NO_MARKUP . |
protected java.lang.String |
executePlainEmailTarget(java.lang.String string,
RenderContext renderContext)
This method is called to execute the filter when the render target specified in the context is RenderTarget.TARGET_PLAIN_EMAIL . |
protected java.lang.String |
executePlainTextTarget(java.lang.String string,
RenderContext renderContext)
This method is called to execute the filter when the render target specified in the context is RenderTarget.TARGET_PLAIN_TEXT . |
protected java.lang.String |
executeWysiwygEditorTarget(java.lang.String string,
RenderContext renderContext)
This method is called to execute the filter when the render target specified in the context is RenderTarget.TARGET_WYSIWYG_EDITOR . |
java.lang.String |
getAllowedSchemesStr()
|
java.lang.String |
getAllowedTagsStr()
|
java.lang.String |
getBlockEnd()
Returns the HTML tag that ends a HTML block. |
java.lang.String |
getBlockStart()
Returns the HTML tag that starts a HTML block. |
protected java.lang.String[] |
getDefaultHelp()
Returns a String[section,title,body] for the default help for the filter. |
java.lang.String |
getDisallowedTagsStr()
|
protected java.util.Map |
getDocumentationMap()
Returns a documentation Map keyed by languageCode -> String[section,title,body]. |
java.lang.String |
getName()
Returns the unique name of the filter. |
boolean |
isAllowRelativeLinks()
|
boolean |
isAllowSymbols()
|
protected boolean |
isEnabledByDefault()
Returns true if the filter should be enabled by default, false otherwise. |
boolean |
isOnlyFltrBlksEnabled()
Returns true if HTML filtering will only occur inside of [html] blocks or not. |
boolean |
isStripDisallowedTags()
|
void |
setAllowedSchemesStr(java.lang.String allowedSchemesString)
|
void |
setAllowedTagsStr(java.lang.String allowedTagsString)
|
void |
setAllowRelativeLinks(boolean allowRelativeLinks)
|
void |
setAllowSymbols(boolean allowSymbols)
|
void |
setBlockEnd(java.lang.String blockEnd)
Sets the HTML tag that ends a HTML block. |
void |
setBlockStart(java.lang.String blockStart)
Sets the HTML tag that starts a HTML block. |
void |
setDisallowedTagsStr(java.lang.String allowedTagsString)
|
void |
setOnlyFltrBlksEnabled(boolean enabled)
Enables or disables the HTML filtering only inside of [html] [/html] blocks or not. |
void |
setStripDisallowedTags(boolean stripDisallowedTags)
|
Methods inherited from class com.jivesoftware.forum.renderer.AbstractRenderFilter |
---|
execute, getUserDocumentation, isEnabled, setEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HTML_FILTER_CONTEXT_PARAM
Constructor Detail |
---|
public HTMLFilter()
Method Detail |
---|
public java.lang.String getName()
RenderFilter
getName
in interface RenderFilter
getName
in class AbstractRenderFilter
protected boolean isEnabledByDefault()
AbstractRenderFilter
isEnabledByDefault
in class AbstractRenderFilter
protected java.lang.String executePlainTextTarget(java.lang.String string, RenderContext renderContext)
AbstractRenderFilter
RenderTarget.TARGET_PLAIN_TEXT
.
executePlainTextTarget
in class AbstractRenderFilter
string
- the String to filterrenderContext
- the context the filter is being executed within
protected java.lang.String executePlainEmailTarget(java.lang.String string, RenderContext renderContext)
AbstractRenderFilter
RenderTarget.TARGET_PLAIN_EMAIL
.
executePlainEmailTarget
in class AbstractRenderFilter
string
- the String to filterrenderContext
- the context the filter is being executed within
protected java.lang.String executeHtmlTarget(java.lang.String string, RenderContext renderContext)
AbstractRenderFilter
RenderTarget.TARGET_HTML
.
executeHtmlTarget
in class AbstractRenderFilter
string
- the String to filterrenderContext
- the context the filter is being executed within
protected java.lang.String executeWysiwygEditorTarget(java.lang.String string, RenderContext renderContext)
AbstractRenderFilter
RenderTarget.TARGET_WYSIWYG_EDITOR
.
executeWysiwygEditorTarget
in class AbstractRenderFilter
string
- the String to filterrenderContext
- the context the filter is being executed within
protected java.lang.String executeNoMarkupTarget(java.lang.String string, RenderContext renderContext)
AbstractRenderFilter
RenderTarget.TARGET_NO_MARKUP
.
executeNoMarkupTarget
in class AbstractRenderFilter
string
- the String to filterrenderContext
- the context the filter is being executed within
protected java.util.Map getDocumentationMap()
AbstractRenderFilter
getDocumentationMap
in class AbstractRenderFilter
protected java.lang.String[] getDefaultHelp()
AbstractRenderFilter
getDefaultHelp
in class AbstractRenderFilter
public boolean isOnlyFltrBlksEnabled()
public void setOnlyFltrBlksEnabled(boolean enabled)
enabled
- true if new window mode should be enabled.public boolean isStripDisallowedTags()
public void setStripDisallowedTags(boolean stripDisallowedTags)
public boolean isAllowSymbols()
public void setAllowSymbols(boolean allowSymbols)
public boolean isAllowRelativeLinks()
public void setAllowRelativeLinks(boolean allowRelativeLinks)
public java.lang.String getAllowedTagsStr()
public void setAllowedTagsStr(java.lang.String allowedTagsString)
public java.lang.String getDisallowedTagsStr()
public void setDisallowedTagsStr(java.lang.String allowedTagsString)
public java.lang.String getAllowedSchemesStr()
public void setAllowedSchemesStr(java.lang.String allowedSchemesString)
public java.lang.String getBlockStart()
<pre>
. This will only be used if we are filtering html
in [html] [/html] blocks.
public void setBlockStart(java.lang.String blockStart)
<pre>
. This will only be used if we are filtering html
in [html] [/html] blocks.
blockStart
- the HTML tag to start a HTML block.public java.lang.String getBlockEnd()
</pre>
. This will only be used if we are filtering html
in [html] [/html] blocks.
public void setBlockEnd(java.lang.String blockEnd)
</pre>
. This will only be used if we are filtering html
in [html/ [/html] blocks.
blockEnd
- the HTML tag to end a HTML block.protected java.lang.String cleanseText(java.lang.String text, RenderContext renderContext)
protected boolean contentIsHtml(java.lang.Object sourceObject)
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |