|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PageFilter
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.
Method Summary | |
---|---|
void |
initialize(Properties properties)
Is called whenever the a new PageFilter is instantiated and reset. |
void |
postSave(WikiContext wikiContext,
String content)
This method is called after the page has been successfully saved. |
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. |
String |
preSave(WikiContext wikiContext,
String content)
This method is called before the page has been saved to the PageProvider. |
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. |
Method Detail |
---|
void initialize(Properties properties) throws FilterException
FilterException
String preTranslate(WikiContext wikiContext, String content) throws FilterException
wikiContext
- The current wikicontext.content
- WikiMarkup.
FilterException
String postTranslate(WikiContext wikiContext, String htmlContent) throws FilterException
FilterException
String preSave(WikiContext wikiContext, String content) throws FilterException
FilterException
void postSave(WikiContext wikiContext, String content) throws FilterException
Since the result is discarded from this method, this is only useful for things like counters, etc.
FilterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |