public abstract class ToolServlet extends VmServlet
ToolServlet is a Servlet that support CHEF tools.
Extending VmServlet provides support for component location and use of the Velocity Template Engine.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALERT_ATTR
The state attribute name used to store the Alert.
|
protected static String |
ALERT_STATE_INITED
The state attribute name used to store the marker of have been initialized.
|
protected static String |
HELPER_ID
ToolSession attribute name holding the helper id, if we are in helper mode.
|
protected String |
MAIN_PANEL
The special panel name for the main.
|
protected static String |
MENU_ATTR
The state attribute name used to store the Menu.
|
protected static String |
PARAM_ACTION
The request parameter name whose value is the action.
|
protected static String |
PARAM_ACTION_COMBO
The request parameter name root that has the action name following.
|
protected String |
TITLE_PANEL
The special panel name for the title.
|
protected String |
TOOL_MODE_ATTR
The mode attribute name base - postfix with the portlet mode.
|
protected String |
TOOL_MODE_DEFAULT
The mode value when no mode has been set.
|
m_validatorATTR_PARAMS| Constructor and Description |
|---|
ToolServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
actionDispatch(String methodBase,
String methodExt,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Dispatch to a "processAction" method based on reflection.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Respond to a request by dispatching to a portlet like "do" method based on the portlet mode and tool mode
|
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Respond to a request by dispatching to a portlet like "do" method based on the portlet mode and tool mode
|
protected Alert |
getAlert(javax.servlet.http.HttpServletRequest req)
Access the Alert for the current request.
|
protected Alert |
getAlert(SessionState state)
Access the Alert in this state - will create one if needed.
|
protected Menu |
getMenu(javax.servlet.http.HttpServletRequest req)
Access the Menu for the current request.
|
protected String |
getPid(javax.servlet.http.HttpServletRequest req)
Access the "pid" - portlet window id, tool id, from the request
|
protected SessionState |
getState(javax.servlet.http.HttpServletRequest req)
Access the SessionState for the current request.
|
protected String |
getToolMode(javax.servlet.http.HttpServletRequest req)
Access the tool mode for the current Portlet mode.
|
protected void |
initState(SessionState state,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Initialize for the first time the session state for this session.
|
protected void |
prepState(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Prepare state, either for first time or update
|
protected void |
processAction(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Process a Portlet action.
|
protected boolean |
sendToHelper(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String target) |
protected void |
setToolMode(String toolMode,
javax.servlet.http.HttpServletRequest req)
Set the tool mode.
|
protected void |
setVmStdRef(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Add some standard references to the vm context.
|
protected void |
startHelper(javax.servlet.http.HttpServletRequest req,
String helperId)
Setup for a helper tool - all subsequent requests will be directed there, till the tool is done.
|
protected void |
startHelper(javax.servlet.http.HttpServletRequest req,
String helperId,
String panel)
Setup for a helper tool - all subsequent requests will be directed there, till the tool is done.
|
protected void |
toolModeDispatch(String methodBase,
String methodExt,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Dispatch to a "do" method based on reflection.
|
protected void |
updateState(SessionState state,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Update for this request processing the session state.
|
getActionURL, getVmReference, includeVm, setVmReferencesendParentRedirect, service, setNoCacheHeadersdoDelete, doHead, doOptions, doPut, doTrace, getLastModified, serviceprotected static final String HELPER_ID
protected final String TOOL_MODE_DEFAULT
protected final String TOOL_MODE_ATTR
protected final String TITLE_PANEL
protected final String MAIN_PANEL
protected static final String PARAM_ACTION_COMBO
protected static final String PARAM_ACTION
protected static final String ALERT_STATE_INITED
protected static final String ALERT_ATTR
protected static final String MENU_ATTR
protected void setVmStdRef(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
setVmStdRef in class VmServletrequest - The render request.response - The render response.protected void setToolMode(String toolMode, javax.servlet.http.HttpServletRequest req)
toolMode - The new tool mode.req - The portlet request.protected String getToolMode(javax.servlet.http.HttpServletRequest req)
req - The portlet request.protected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionprotected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionprotected void startHelper(javax.servlet.http.HttpServletRequest req,
String helperId,
String panel)
helperId - The helper tool id.protected void startHelper(javax.servlet.http.HttpServletRequest req,
String helperId)
helperId - The helper tool id.protected void toolModeDispatch(String methodBase, String methodExt, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws ToolException
methodBase - The base name of the method to call.methodExt - The end name of the method to call.req - The HttpServletRequest.res - The HttpServletResponsePortletExcption, - IOException, just like the "do" methods.ToolExceptionprotected void processAction(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
protected void actionDispatch(String methodBase, String methodExt, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
methodBase - The base name of the method to call.methodExt - The end name of the method to call.req - The ActionRequest.res - The ActionResponsePortletExcption, - IOException, just like the "do" methods.protected String getPid(javax.servlet.http.HttpServletRequest req)
req - The current request.protected SessionState getState(javax.servlet.http.HttpServletRequest req)
req - The current portlet request.protected void prepState(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
req - The current portlet request.res - The current response.protected void initState(SessionState state, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
state - The session state.req - The current request.res - The current response.protected void updateState(SessionState state, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
state - The session state.req - The current request.res - The current response.protected Alert getAlert(javax.servlet.http.HttpServletRequest req)
req - The current portlet request.protected Alert getAlert(SessionState state)
state - The state in which to find the alert.protected Menu getMenu(javax.servlet.http.HttpServletRequest req)
req - The current portlet request.protected boolean sendToHelper(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String target)
throws ToolException
req - res - target - ToolExceptionCopyright © 2003–2020 Sakai Project. All rights reserved.