|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.api.filters.BasicPageFilter
public class BasicPageFilter
Provides a base implementation of a PageFilter. None of the callbacks do anything, so it is a good idea for you to extend from this class and implement only methods that you need.
Field Summary | |
---|---|
protected WikiEngine |
m_engine
|
Constructor Summary | |
---|---|
BasicPageFilter()
|
Method Summary | |
---|---|
void |
destroy(WikiEngine engine)
Called for every filter, e.g. on wiki engine shutdown. |
void |
initialize(WikiEngine engine,
Properties properties)
If you override this, you should call super.initialize() first. |
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 translation process, 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 markup-translation process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected WikiEngine m_engine
Constructor Detail |
---|
public BasicPageFilter()
Method Detail |
---|
public void initialize(WikiEngine engine, Properties properties) throws FilterException
initialize
in interface PageFilter
engine
- The WikiEngine whic owns this PageFilterproperties
- The properties ripped from filters.xml.
FilterException
- If the filter could not be initialized. If this is thrown,
the filter is not added to the internal queues.public String preTranslate(WikiContext wikiContext, String content) throws FilterException
preTranslate
in interface PageFilter
wikiContext
- The current wikicontext.content
- WikiMarkup.
FilterException
- If something goes wrong. Throwing this causes the entire page
processing to be abandoned.public String postTranslate(WikiContext wikiContext, String htmlContent) throws FilterException
postTranslate
in interface PageFilter
wikiContext
- The WikiContext.htmlContent
- The translated HTML
FilterException
- If something goes wrong. Throwing this causes the entire page
processing to be abandoned.public String preSave(WikiContext wikiContext, String content) throws FilterException
preSave
in interface PageFilter
wikiContext
- The WikiContextcontent
- The wikimarkup that the user just wanted to save.
FilterException
- If something goes wrong. Throwing this causes the entire page
processing to be abandoned.public 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.
postSave
in interface PageFilter
wikiContext
- The WikiContextcontent
- The content which was just stored.
FilterException
- If something goes wrong. As the page is already saved,
This is just logged.public void destroy(WikiEngine engine)
destroy
in interface PageFilter
engine
- The WikiEngine which owns this filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |