Jive API (5.0.0.0) Core Javadocs

com.jivesoftware.community.renderer
Interface RenderFilter

All Superinterfaces:
com.jivesoftware.community.renderer.RenderPlugin
All Known Implementing Classes:
AbstractRenderFilter, BaseFilter

public interface RenderFilter
extends com.jivesoftware.community.renderer.RenderPlugin

A filter is an object that performs filtering on Strings. For example, a filter might look for newline characters in a string (\n, \r\n) and replace them with <br> or <p> tags.

It is recommended that each filter provide through the BeanInfo interface the following:

These values can then be internationalized as necessary using ResourceBundles. For example, say you create a filter com.foo.SampleFilter. You should also create a class named com.foo.SampleFilterBeanInfo that extends the JiveBeanInfo class. Then, create a resource bundle named bean_SampleFilter.properties and other property files for various locales as desired.

Filters have 0 or more properties that can be configured by an administrator. Each property may control any aspect of how the filter works -- for example, a property named "color" could control which color to format text in. All properties are configurable through the standard JavaBeans conventions. You should specify exactly which properties can be controlled by an administrator by using the BeanInfo interface and JiveBeanInfo class described above.

If end user documentation is pertinent to the filter (i.e. end users may need to know a tag syntax for the filter to function) documentation should be returned from the getUserDocumentation(String) method. The output of this method is expected to follow the guidelines outlined in the documentation distributed with the product.

Instantiating classes of this interface are required to have a zero argument constructor.

See Also:
JiveBeanInfo

Method Summary
 void execute(Document document, RenderContext renderContext)
          Process the xml document that is passed to this method.
 int getOrder()
          Return the order in which to place the filter in the render pipeline.
 String[] getUserDocumentation(String language)
          Returns a string array of [section,title, body] of xml formatted documentation that is targetted for end user usage.
 boolean isDisplayable()
           
 
Methods inherited from interface com.jivesoftware.community.renderer.RenderPlugin
getName, getParameters, isEnabled, setEnabled, setParameters
 

Method Detail

execute

void execute(Document document,
             RenderContext renderContext)
Process the xml document that is passed to this method. Render filters modify the document in place buy adding, modify and/or removing elements from the document.

Parameters:
document - the element to filter
renderContext - the context the filter is being executed within

getUserDocumentation

String[] getUserDocumentation(String language)
Returns a string array of [section,title, body] of xml formatted documentation that is targetted for end user usage. Documentation on how this output should be formatted can be found in the documentation that is shipped with this product.

Parameters:
language - the language as an ISO-639 language code to return the documentation in.
Returns:
a string array of [section, title, body] or null if end user documentation is not relevant to the filter.

isDisplayable

boolean isDisplayable()

getOrder

int getOrder()
Return the order in which to place the filter in the render pipeline. A filter with order value of 0 will be applied before a filter of order 1.

Specified by:
getOrder in interface com.jivesoftware.community.renderer.RenderPlugin
Returns:
order in which to apply the filter

Jive Product Page

Copyright © 1999-2007 Jive Software.