org.apache.wiki.api.engine
Interface FilterManager

All Known Implementing Classes:
DefaultFilterManager

public interface FilterManager


Field Summary
static String DEFAULT_XMLFILE
          Default location for the filter XML property file.
static String PROP_FILTERXML
          Property name for setting the filter XML property file.
static int SYSTEM_FILTER_PRIORITY
          JSPWiki system filters are all below this value.
static int USER_FILTER_PRIORITY
          The standard user level filtering.
 
Method Summary
 void addPageFilter(PageFilter f, int priority)
          Adds a page filter to the queue.
 void destroy()
          Notifies PageFilters to clean up their ressources.
 void doPostSaveFiltering(WikiContext context, String pageData)
          Does the page filtering after the page has been saved.
 String doPostTranslateFiltering(WikiContext context, String htmlData)
          Does the filtering after HTML translation.
 String doPreSaveFiltering(WikiContext context, String pageData)
          Does the filtering before a save to the page repository.
 String doPreTranslateFiltering(WikiContext context, String pageData)
          Does the filtering before a translation.
 List<PageFilter> getFilterList()
          Returns the list of filters currently installed.
 Collection modules()
          Returns a collection of modules currently managed by this ModuleManager.
 

Field Detail

PROP_FILTERXML

static final String PROP_FILTERXML
Property name for setting the filter XML property file. Value is "jspwiki.filterConfig".

See Also:
Constant Field Values

DEFAULT_XMLFILE

static final String DEFAULT_XMLFILE
Default location for the filter XML property file. Value is "/WEB-INF/filters.xml".

See Also:
Constant Field Values

SYSTEM_FILTER_PRIORITY

static final int SYSTEM_FILTER_PRIORITY
JSPWiki system filters are all below this value.

See Also:
Constant Field Values

USER_FILTER_PRIORITY

static final int USER_FILTER_PRIORITY
The standard user level filtering.

See Also:
Constant Field Values
Method Detail

addPageFilter

void addPageFilter(PageFilter f,
                   int priority)
                   throws IllegalArgumentException
Adds a page filter to the queue. The priority defines in which order the page filters are run, the highest priority filters go in the queue first.

In case two filters have the same priority, their execution order is the insertion order.

Parameters:
f - PageFilter to add
priority - The priority in which position to add it in.
Throws:
IllegalArgumentException - If the PageFilter is null or invalid.
Since:
2.1.44.

doPreTranslateFiltering

String doPreTranslateFiltering(WikiContext context,
                               String pageData)
                               throws FilterException
Does the filtering before a translation.

Parameters:
context - The WikiContext
pageData - WikiMarkup data to be passed through the preTranslate chain.
Returns:
The modified WikiMarkup
Throws:
FilterException - If any of the filters throws a FilterException
See Also:
PageFilter.preTranslate(WikiContext, String)

doPostTranslateFiltering

String doPostTranslateFiltering(WikiContext context,
                                String htmlData)
                                throws FilterException
Does the filtering after HTML translation.

Parameters:
context - The WikiContext
htmlData - HTML data to be passed through the postTranslate
Returns:
The modified HTML
Throws:
FilterException - If any of the filters throws a FilterException
See Also:
PageFilter.postTranslate(WikiContext, String)

doPreSaveFiltering

String doPreSaveFiltering(WikiContext context,
                          String pageData)
                          throws FilterException
Does the filtering before a save to the page repository.

Parameters:
context - The WikiContext
pageData - WikiMarkup data to be passed through the preSave chain.
Returns:
The modified WikiMarkup
Throws:
FilterException - If any of the filters throws a FilterException
See Also:
PageFilter.preSave(WikiContext, String)

doPostSaveFiltering

void doPostSaveFiltering(WikiContext context,
                         String pageData)
                         throws FilterException
Does the page filtering after the page has been saved.

Parameters:
context - The WikiContext
pageData - WikiMarkup data to be passed through the postSave chain.
Throws:
FilterException - If any of the filters throws a FilterException
See Also:
PageFilter.postSave(WikiContext, String)

getFilterList

List<PageFilter> getFilterList()
Returns the list of filters currently installed. Note that this is not a copy, but the actual list. So be careful with it.

Returns:
A List of PageFilter objects

destroy

void destroy()
Notifies PageFilters to clean up their ressources.


modules

Collection modules()
Returns a collection of modules currently managed by this ModuleManager. Each entry is an instance of the WikiModuleInfo class. This method should return something which is safe to iterate over, even if the underlying collection changes.

Returns:
A Collection of WikiModuleInfo instances.


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.