|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ecyrd.jspwiki.filters.BasicPageFilter
org.ceryle.wiki.filters.PermittedPageFilter
public class PermittedPageFilter
A page filter that blocks access to all but a predefined set of pages. The permitted pages are defined on a wiki page called "PermittedPages", the error page the contents of the wiki page named "Forbidden".
If the PermittedPages page does not exist this filter does nothing, passing the content through with no change in behaviour. If the Forbidden page does not exist a generic 403-style XHTML error message is returned.
So that the list of permitted pages doesn't have to be compiled upon each page request, the list is cached on periodic intervals. The interval is determined by a variable that can be set from a property.
NOTE: this class is not currently functional.
A sample filters.xml file is appended as a comment on the source.
| Field Summary | |
|---|---|
protected String |
m_403_message
The content of the 403-style Forbidden error message (in wiki text). |
protected boolean |
m_enabled
When true enables the filter. |
protected String |
m_forbiddenPageName
The name of the forbidden (403 error) page. |
protected boolean |
m_permitFrontPage
When true permits unfiltered access to the front (Main) page. |
protected String |
m_permittedPageName
The name of the permitted page list. |
protected long |
m_refresh
The time in milliseconds between refreshes of the page list. |
static String |
PROPERTY_403_MESSAGE
The name of the property setting the content of the error message (in wiki text). |
static String |
PROPERTY_FILTER_ENABLE
The name of the property that when "true" enables the filter. |
static String |
PROPERTY_PAGE_FORBIDDEN
The name of the property setting the name of the Forbidden page. |
static String |
PROPERTY_PAGE_LIST
The name of the property setting the name of the permitted page list. |
static String |
PROPERTY_PERMIT_FRONT
The name of the property permitting unfiltered display of the front page. |
static String |
PROPERTY_REFRESH
The name of the property setting the name of the refresh period in milliseconds. |
| Fields inherited from class com.ecyrd.jspwiki.filters.BasicPageFilter |
|---|
m_engine |
| Constructor Summary | |
|---|---|
PermittedPageFilter()
|
|
| Method Summary | |
|---|---|
void |
initialize(WikiEngine engine,
Properties properties)
Overrides the method in BasicPageFilter to set the WikiEngine and read in any properties from filters.xml. |
String |
preTranslate(WikiContext context,
String content)
Extends the method in BasicPageFilter to check the page name against the permitted page list, returning an error message if the page fails the test. |
| Methods inherited from class com.ecyrd.jspwiki.filters.BasicPageFilter |
|---|
destroy, postSave, postTranslate, preSave |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTY_FILTER_ENABLE
public static final String PROPERTY_PAGE_LIST
public static final String PROPERTY_PAGE_FORBIDDEN
public static final String PROPERTY_REFRESH
public static final String PROPERTY_PERMIT_FRONT
public static final String PROPERTY_403_MESSAGE
protected long m_refresh
protected String m_permittedPageName
protected String m_forbiddenPageName
protected boolean m_enabled
protected boolean m_permitFrontPage
protected String m_403_message
| Constructor Detail |
|---|
public PermittedPageFilter()
| Method Detail |
|---|
public void initialize(WikiEngine engine,
Properties properties)
throws FilterException
initialize in interface PageFilterinitialize in class BasicPageFilterFilterException
public String preTranslate(WikiContext context,
String content)
preTranslate in interface PageFilterpreTranslate in class BasicPageFilter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||