| com.ecyrd.jspwiki.filters.PageFilter
All known Subclasses: com.ecyrd.jspwiki.filters.BasicPageFilter,
PageFilter | public interface PageFilter (Code) | | Provides a definition for a page filter. A page filter is a class
that can be used to transform the WikiPage content being saved or
being loaded at any given time.
Note that the WikiContext.getPage() method always returns the context
in which text is rendered, i.e. the original request. Thus the content
may actually be different content than what what the wikiContext.getPage()
implies! This happens often if you are for example including multiple
pages on the same page.
PageFilters must be thread-safe! There is only one instance of each PageFilter
per each WikiEngine invocation. If you need to store data persistently, use
VariableManager, or WikiContext.
As of 2.5.30, initialize() gains accesso to the WikiEngine.
author: Janne Jalkanen |
Method Summary | |
public void | destroy(WikiEngine engine) Called for every filter, e.g. | public void | initialize(WikiEngine engine, Properties properties) Is called whenever the a new PageFilter is instantiated and
reset. | public void | postSave(WikiContext wikiContext, String content) This method is called after the page has been successfully saved. | public String | postTranslate(WikiContext wikiContext, String htmlContent) This method is called after a page has been fed through the TranslatorReader,
so anything you are seeing here is translated content. | public String | preSave(WikiContext wikiContext, String content) This method is called before the page has been saved to the PageProvider. | public String | preTranslate(WikiContext wikiContext, String content) This method is called whenever a page has been loaded from the provider,
but not yet been sent through the TranslatorReader. |
destroy | public void destroy(WikiEngine engine)(Code) | | Called for every filter, e.g. on wiki eingine shutdown. Use this if you have to
clean up or close global resources you allocated in the initialize() method.
since: 2.5.36 |
postSave | public void postSave(WikiContext wikiContext, String content) throws FilterException(Code) | | This method is called after the page has been successfully saved.
If the saving fails for any reason, then this method will not
be called.
Since the result is discarded from this method, this is only useful
for things like counters, etc.
|
postTranslate | public String postTranslate(WikiContext wikiContext, String htmlContent) throws FilterException(Code) | | This method is called after a page has been fed through the TranslatorReader,
so anything you are seeing here is translated content. If you want to
do any of your own WikiMarkup2HTML translation, do it here.
|
preTranslate | public String preTranslate(WikiContext wikiContext, String content) throws FilterException(Code) | | This method is called whenever a page has been loaded from the provider,
but not yet been sent through the TranslatorReader. Note that you cannot
do HTML translation here, because TranslatorReader is likely to escape it.
Parameters: wikiContext - The current wikicontext. Parameters: content - WikiMarkup. |
|
|