org.sakaiproject.cheftool
Class VelocityPortletPaneledAction

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sakaiproject.vm.ComponentServlet
              extended byorg.sakaiproject.vm.VmServlet
                  extended byorg.sakaiproject.cheftool.VmServlet
                      extended byorg.sakaiproject.cheftool.ToolServlet
                          extended byorg.sakaiproject.cheftool.VelocityPortletPaneledAction
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
ArchiveAction, ChatAction, ContactSupportAction, FilePickerAction, IFrameAction, MemoryAction, NewPagedResourceAction, NewsAction, PagedResourceAction, PagedResourceActionII, PagedResourceHelperAction, PermissionsHelperAction, PresenceToolAction, SynopticMessageAction, ThreadedDiscussionIIAction, VelocityPortletStateAction

public abstract class VelocityPortletPaneledAction
extends ToolServlet

VelocityPortletPaneledAction ...

Version:
$Revision: 7328 $
Author:
University of Michigan, Sakai Software Development Team
See Also:
Serialized Form

Nested Class Summary
protected  class VelocityPortletPaneledAction.MyLogger
           
 
Field Summary
protected static String ATTR_CONFIG
          A PortletConfig bound into the request attributes.
protected static String ATTR_CONTEXT
          A Context bound into the request attributes.
static String ATTR_FRAME_FOCUS
          Tool session attribute name used to schedule a focus change.
static String ATTR_FRAME_REFRESH
          Tool session attribute name used to schedule a peer frame refresh.
protected static String ATTR_PORTLET
          A VelocityPortlet bound into the request attributes.
protected static String ATTR_RUNDATA
          A JetspeedRunData bound into the request attributes.
static String ATTR_TOP_REFRESH
          Tool session attribute name used to schedule a whole page refresh.
protected static String BUTTON
           
protected static String CONTEXT_SITE_COLLECTION_ID
          The name of the context variable containing the identifier for the site's root content collection
protected static String CONTEXT_SITE_COLLECTION_URL
          The name of the context variable containing the access URL for the site's root content collection
protected static String LAYOUT_MAIN
          The panel name of the main panel - append the tool's id.
protected  VelocityPortletPaneledAction.MyLogger Log
           
static String MODE_OPTIONS
          Standard modes.
protected static String STATE_ACTION
           
static String STATE_FLOAT
           
static String STATE_HELPER
          The currently active helper mode static class.
static String STATE_MESSAGE
           
protected static String STATE_MODE
           
protected static String STATE_OBSERVER
           
static String STATE_OBSERVER2
           
static String STATE_PRESENCE_OBSERVER
           
static String STATE_TOOL
           
 
Fields inherited from class org.sakaiproject.cheftool.ToolServlet
ALERT_ATTR, ALERT_STATE_INITED, MENU_ATTR, PARAM_ACTION, PARAM_ACTION_COMBO, TITLE_PANEL, TOOL_MODE_ATTR, TOOL_MODE_DEFAULT
 
Fields inherited from class org.sakaiproject.cheftool.VmServlet
m_validator
 
Fields inherited from class org.sakaiproject.vm.ComponentServlet
ATTR_PARAMS
 
Constructor Summary
VelocityPortletPaneledAction()
           
 
Method Summary
protected  void actionDispatch(String methodBase, String methodExt, HttpServletRequest req, HttpServletResponse res)
          Dispatch to a "processAction" method based on reflection.
static void addAlert(SessionState state, String message)
          Add another string to the alert message.
protected  void addOptionsMenu(Menu bar, JetspeedRunData data)
          Add the options to the menu bar, if allowed.
protected  void cancelOptions()
          Cancel the options process.
protected  String clientWindowId(SessionState state, String toolId)
          Compute the deliver address for the current request.
static void disableObservers(SessionState state)
          Disable any observers registered in state in STATE_OBSERVER or STATE_OBSERVER2
protected  void doGet(HttpServletRequest req, HttpServletResponse res)
          Respond to a request by dispatching to a portlet like "do" method based on the portlet mode and tool mode
 void doOptions(RunData runData, Context context)
          Handle a request to set options.
 void doReset(RunData runData, Context context)
          Handle the "reset tool" option from the Title bar.
static void enableObservers(SessionState state)
          Enable any observers registered in state in STATE_OBSERVER or STATE_OBSERVER2
protected  Map getContext(RunData data)
          This is used to get "template" from the map, the default template registered for the tool in chef_tools.xreg.
protected  void helperActionDispatch(String methodBase, String methodExt, HttpServletRequest req, HttpServletResponse res, String className)
          Dispatch to a "processAction" method based on reflection in a helper class.
protected  void initState(SessionState state, HttpServletRequest req, HttpServletResponse res)
          Initialize for the first time the session state for this session.
protected  void initState(SessionState state, VelocityPortlet portlet, JetspeedRunData rundata)
           
static void justDelivered(SessionState state)
          Tell the main observer we have just delivered.
static String mainPanelUpdateId(String toolId)
          Compute the courier update html element id for the main panel - add "." and other names for inner panels.
 void processAction(HttpServletRequest req, HttpServletResponse res)
          Process a Portlet action.
protected  void resetTool(SessionState state)
          Reset the tool (state) to "home" conditions.
protected  void saveOptions()
          Complete the options process with a save.
protected  void scheduleFocusRefresh(String[] path)
          Schedule a focus change.
protected  void schedulePeerFrameRefresh(String id)
          Schedule a refresh for a peer frame.
protected  void scheduleTopRefresh()
          Schedule a refresh for whole page
protected  void setVmCourier(HttpServletRequest request, int refresh)
          Setup the vm context for a courier
protected  void setVmStdRef(HttpServletRequest request, HttpServletResponse response)
          Add some standard references to the vm context.
static String titlePanelUpdateId(String toolId)
          Compute the courier update html element id for the title panel.
protected  void toolModeDispatch(String methodBase, String methodExt, HttpServletRequest req, HttpServletResponse res)
          Dispatch to a "do" method based on reflection.
protected  void updateState(SessionState state, HttpServletRequest req, HttpServletResponse res)
          Update for this request processing the session state.
 
Methods inherited from class org.sakaiproject.cheftool.ToolServlet
doPost, getAlert, getAlert, getMenu, getPid, getState, getToolMode, prepState, setToolMode
 
Methods inherited from class org.sakaiproject.vm.VmServlet
getActionURL, getVmReference, includeVm, setVmReference
 
Methods inherited from class org.sakaiproject.vm.ComponentServlet
sendParentRedirect, service, setNoCacheHeaders
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON

protected static final String BUTTON
See Also:
Constant Field Values

STATE_HELPER

public static final String STATE_HELPER
The currently active helper mode static class.

See Also:
Constant Field Values

STATE_MODE

protected static final String STATE_MODE
See Also:
Constant Field Values

STATE_OBSERVER

protected static final String STATE_OBSERVER
See Also:
Constant Field Values

STATE_ACTION

protected static final String STATE_ACTION
See Also:
Constant Field Values

CONTEXT_SITE_COLLECTION_ID

protected static final String CONTEXT_SITE_COLLECTION_ID
The name of the context variable containing the identifier for the site's root content collection

See Also:
Constant Field Values

CONTEXT_SITE_COLLECTION_URL

protected static final String CONTEXT_SITE_COLLECTION_URL
The name of the context variable containing the access URL for the site's root content collection

See Also:
Constant Field Values

LAYOUT_MAIN

protected static final String LAYOUT_MAIN
The panel name of the main panel - append the tool's id.

See Also:
Constant Field Values

Log

protected VelocityPortletPaneledAction.MyLogger Log

STATE_OBSERVER2

public static final String STATE_OBSERVER2
See Also:
Constant Field Values

STATE_PRESENCE_OBSERVER

public static final String STATE_PRESENCE_OBSERVER
See Also:
Constant Field Values

STATE_FLOAT

public static final String STATE_FLOAT
See Also:
Constant Field Values

STATE_TOOL

public static final String STATE_TOOL
See Also:
Constant Field Values

STATE_MESSAGE

public static final String STATE_MESSAGE
See Also:
Constant Field Values

MODE_OPTIONS

public static final String MODE_OPTIONS
Standard modes.

See Also:
Constant Field Values

ATTR_CONTEXT

protected static final String ATTR_CONTEXT
A Context bound into the request attributes.

See Also:
Constant Field Values

ATTR_CONFIG

protected static final String ATTR_CONFIG
A PortletConfig bound into the request attributes.

See Also:
Constant Field Values

ATTR_PORTLET

protected static final String ATTR_PORTLET
A VelocityPortlet bound into the request attributes.

See Also:
Constant Field Values

ATTR_RUNDATA

protected static final String ATTR_RUNDATA
A JetspeedRunData bound into the request attributes.

See Also:
Constant Field Values

ATTR_FRAME_REFRESH

public static final String ATTR_FRAME_REFRESH
Tool session attribute name used to schedule a peer frame refresh.

See Also:
Constant Field Values

ATTR_TOP_REFRESH

public static final String ATTR_TOP_REFRESH
Tool session attribute name used to schedule a whole page refresh.

See Also:
Constant Field Values

ATTR_FRAME_FOCUS

public static final String ATTR_FRAME_FOCUS
Tool session attribute name used to schedule a focus change.

See Also:
Constant Field Values
Constructor Detail

VelocityPortletPaneledAction

public VelocityPortletPaneledAction()
Method Detail

initState

protected void initState(SessionState state,
                         VelocityPortlet portlet,
                         JetspeedRunData rundata)

clientWindowId

protected String clientWindowId(SessionState state,
                                String toolId)
Compute the deliver address for the current request. Compute the client window id, based on the float state

Parameters:
state - The tool state.
toolId - The tool instance id, which might be used as part of the client window id if floating.
Returns:
The client window id, based on the float state.

mainPanelUpdateId

public static String mainPanelUpdateId(String toolId)
Compute the courier update html element id for the main panel - add "." and other names for inner panels.

Parameters:
toolId - The tool (portlet) id.
Returns:
The courier update html element id for the main panel.

titlePanelUpdateId

public static String titlePanelUpdateId(String toolId)
Compute the courier update html element id for the title panel.

Parameters:
toolId - The tool (portlet) id.
Returns:
The courier update html element id for the title panel.

addAlert

public static void addAlert(SessionState state,
                            String message)
Add another string to the alert message.

Parameters:
state - The session state.
message - The string to add.

initState

protected void initState(SessionState state,
                         HttpServletRequest req,
                         HttpServletResponse res)
Initialize for the first time the session state for this session. If overridden in a sub-class, make sure to call super.

Overrides:
initState in class ToolServlet
Parameters:
state - The session state.
req - The current portlet request.
res - The current portlet response.

updateState

protected void updateState(SessionState state,
                           HttpServletRequest req,
                           HttpServletResponse res)
Update for this request processing the session state. If overridden in a sub-class, make sure to call super.

Overrides:
updateState in class ToolServlet
Parameters:
state - The session state.
req - The current portlet request.
res - The current portlet response.

toolModeDispatch

protected void toolModeDispatch(String methodBase,
                                String methodExt,
                                HttpServletRequest req,
                                HttpServletResponse res)
                         throws ToolException
Dispatch to a "do" method based on reflection. Override ToolServlet to support the old "build" ways.

Overrides:
toolModeDispatch in class ToolServlet
Parameters:
methodBase - The base name of the method to call.
methodExt - The end name of the method to call.
req - The HttpServletRequest.
res - The HttpServletResponse
Throws:
ToolException

processAction

public void processAction(HttpServletRequest req,
                          HttpServletResponse res)
Process a Portlet action.

Overrides:
processAction in class ToolServlet

actionDispatch

protected void actionDispatch(String methodBase,
                              String methodExt,
                              HttpServletRequest req,
                              HttpServletResponse res)
Dispatch to a "processAction" method based on reflection.

Overrides:
actionDispatch in class ToolServlet
Parameters:
methodBase - The base name of the method to call.
methodExt - The end name of the method to call.
req - The HttpServletRequest.
res - The HttpServletResponse
Throws:
PortletExcption, - IOException, just like the "do" methods.

helperActionDispatch

protected void helperActionDispatch(String methodBase,
                                    String methodExt,
                                    HttpServletRequest req,
                                    HttpServletResponse res,
                                    String className)
Dispatch to a "processAction" method based on reflection in a helper class.

Parameters:
methodBase - The base name of the method to call.
methodExt - The end name of the method to call.
req - The HttpServletRequest.
res - The HttpServletResponse
Throws:
PortletExcption, - IOException, just like the "do" methods.

getContext

protected Map getContext(RunData data)
This is used to get "template" from the map, the default template registered for the tool in chef_tools.xreg.


doOptions

public void doOptions(RunData runData,
                      Context context)
Handle a request to set options.


saveOptions

protected void saveOptions()
Complete the options process with a save.


cancelOptions

protected void cancelOptions()
Cancel the options process.


addOptionsMenu

protected void addOptionsMenu(Menu bar,
                              JetspeedRunData data)
Add the options to the menu bar, if allowed.

Parameters:
bar - The menu bar to add to,

disableObservers

public static void disableObservers(SessionState state)
Disable any observers registered in state in STATE_OBSERVER or STATE_OBSERVER2

Parameters:
state - The session state.

enableObservers

public static void enableObservers(SessionState state)
Enable any observers registered in state in STATE_OBSERVER or STATE_OBSERVER2

Parameters:
state - The session state.

justDelivered

public static void justDelivered(SessionState state)
Tell the main observer we have just delivered.

Parameters:
state - The session state.

doReset

public void doReset(RunData runData,
                    Context context)
Handle the "reset tool" option from the Title bar.


resetTool

protected void resetTool(SessionState state)
Reset the tool (state) to "home" conditions. Default here is to clear everything from state.

Parameters:
state - The tool's session state.

setVmStdRef

protected void setVmStdRef(HttpServletRequest request,
                           HttpServletResponse response)
Add some standard references to the vm context.

Overrides:
setVmStdRef in class ToolServlet
Parameters:
request - The render request.
response - The render response.

setVmCourier

protected void setVmCourier(HttpServletRequest request,
                            int refresh)
Setup the vm context for a courier

Parameters:
request -

doGet

protected void doGet(HttpServletRequest req,
                     HttpServletResponse res)
              throws ServletException
Respond to a request by dispatching to a portlet like "do" method based on the portlet mode and tool mode

Overrides:
doGet in class ToolServlet
Throws:
ServletException

scheduleTopRefresh

protected void scheduleTopRefresh()
Schedule a refresh for whole page


schedulePeerFrameRefresh

protected void schedulePeerFrameRefresh(String id)
Schedule a refresh for a peer frame.

Parameters:
id - The peer frame's id.

scheduleFocusRefresh

protected void scheduleFocusRefresh(String[] path)
Schedule a focus change.

Parameters:
path - The desired focus path elements