|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ecyrd.jspwiki.WikiContext
Provides state information throughout the processing of a page. A WikiContext is born when the JSP pages that are the main entry points, are invoked. The JSPWiki engine creates the new WikiContext, which basically holds information about the page, the handling engine, and in which context (view, edit, etc) the call was done.
A WikiContext also provides request-specific variables, which can be used to communicate between plugins on the same page, or between different instances of the same plugin. A WikiContext variable is valid until the processing of the page has ended. For an example, please see the Counter plugin.
Counter| Field Summary | |
static java.lang.String |
COMMENT
|
static java.lang.String |
CONFLICT
User has an internal conflict, and does quite not know what to do. |
static java.lang.String |
DIFF
User is viewing a DIFF between the two versions of the page. |
static java.lang.String |
EDIT
The EDIT context - the user is editing the page. |
static java.lang.String |
ERROR
An error has been encountered and the user needs to be informed. |
static java.lang.String |
INFO
User is viewing page history. |
static java.lang.String |
LOGIN
User is preparing for a login/authentication. |
static java.lang.String |
PREVIEW
User is previewing the changes he just made. |
static java.lang.String |
UPLOAD
|
static java.lang.String |
VIEW
The VIEW context - the user just wants to view the page contents. |
| Constructor Summary | |
WikiContext(WikiEngine engine,
java.lang.String pagename)
Create a new WikiContext. |
|
WikiContext(WikiEngine engine,
WikiPage page)
Create a new WikiContext for the given WikiPage. |
|
| Method Summary | |
WikiEngine |
getEngine()
Returns the handling engine. |
java.lang.String |
getHttpParameter(java.lang.String paramName)
This method will safely return any HTTP parameters that might have been defined. |
javax.servlet.http.HttpServletRequest |
getHttpRequest()
If the request did originate from a HTTP request, then the HTTP request can be fetched here. |
WikiPage |
getPage()
Returns the page that is being handled. |
java.lang.String |
getRequestContext()
Returns the request context. |
java.lang.Object |
getVariable(java.lang.String key)
Gets a previously set variable. |
void |
setHttpRequest(javax.servlet.http.HttpServletRequest req)
If the request originated from a HTTP server, the HTTP request is stored here. |
void |
setRequestContext(java.lang.String arg)
Sets the request context. |
void |
setVariable(java.lang.String key,
java.lang.Object data)
Sets a variable. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String VIEW
public static final java.lang.String EDIT
public static final java.lang.String LOGIN
public static final java.lang.String DIFF
public static final java.lang.String INFO
public static final java.lang.String PREVIEW
public static final java.lang.String CONFLICT
public static final java.lang.String ERROR
public static final java.lang.String UPLOAD
public static final java.lang.String COMMENT
| Constructor Detail |
public WikiContext(WikiEngine engine,
java.lang.String pagename)
engine - The WikiEngine that is handling the request.pagename - The name of the page. A new WikiPage is
created.
public WikiContext(WikiEngine engine,
WikiPage page)
engine - The WikiEngine that is handling the request.page - The WikiPage. If you want to create a
WikiContext for an older version of a page, you must use this
constructor.| Method Detail |
public WikiEngine getEngine()
public WikiPage getPage()
public java.lang.String getRequestContext()
public void setRequestContext(java.lang.String arg)
arg - The request context (one of the predefined contexts.)public java.lang.Object getVariable(java.lang.String key)
key - The variable name.
public void setVariable(java.lang.String key,
java.lang.Object data)
key - The variable name.data - The variable value.public java.lang.String getHttpParameter(java.lang.String paramName)
paramName - Parameter name to look for.
public void setHttpRequest(javax.servlet.http.HttpServletRequest req)
req - The HTTP servlet request.public javax.servlet.http.HttpServletRequest getHttpRequest()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||