SigPath

org.sigpath.action
Class ActionRoot

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.sigpath.action.ActionRoot
Direct Known Subclasses:
ChangeDBStatus, CreateAlias, CreateExternalReference, CreateModel, CreatePathway, CreateReaction, CreateReview, DeleteAlias, DeleteConcentration, DeleteExternalReference, DisplayJSP, EditExternalReference, EditReaction, EditSigPathEntity, ExportJSimModel, ExportModelKK, GetAllPendingReviews, GetConcentration, GetModel, GetPendingReview, GetSpidRange, Login, PopulateUserData, RetrieveChemical, SaveConcentration, SaveEditAlias, SaveEditReaction, SaveUpdatedReaction, SaveXML, SearchChemicals, SearchModels, SearchPathways, SearchReactions, SpecifyReactions, StoreAffiliation, StoreConcentration, StoreNextPage, StoreReaction, StoreReactionParameters, StoreUserData, TurnXDebugOn_Off, UpdateAffiliation, UpdateReactionParameters, UpdateUserData, UploadXML, ViewDBInfo, ViewDetails, ViewModelImage, ViewModelImageNone, ViewModelImageYFiles, ViewNamedChemicalImageYFiles, ViewSPEBaseInfo

public abstract class ActionRoot
extends org.apache.struts.action.Action

Base class for all Action classes. Centralizes all live debugging, http snooping and exception handling. All action classes should extend from this class and implement the _perform() method.

Note: According to the Struts documentation:

Uses the Command Pattern (Gang of Four)

Version:
$Revision: 8115 $
Author:
Ethan Cerami

Field Summary
protected static String ERROR
          Forward Request to Error Page.
protected static String FAILURE
          Forward Request to Failure Page.
protected static String NOT_AUTHENTICATED
          User is not authenticated.
protected static String SESSION_XDEBUG
          Session String for XDebug Object.
protected static String SIGPATH_MAINPAGE
          Session String for mapping of Sigpath Main Homepage.
protected static String SUCCESS
          Forward Request to Success Page.
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ActionRoot()
          Default constructor.
 
Method Summary
protected abstract  org.apache.struts.action.ActionForward _perform(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response, org.apache.struts.action.ActionForward actionForward, XDebug xdebug)
          Perform actual action work.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          This is the main action called from the struts framework.
protected  org.apache.struts.action.ActionForward redirectToNextPage(org.apache.struts.action.ActionForward forward, HttpServletRequest request, XDebug xdebug)
          Redirects to nextPage if it is in session.
protected  void setUserMessage(String msg, HttpServletRequest request, XDebug xdebug)
          Sets the User Message.
protected  org.apache.struts.action.ActionForward tapestryExternalPage(String page, Object[] parameters)
          Forwards to a tapestry external page with an optional set of parameters.
protected  org.apache.struts.action.ActionForward tapestryPage(String page)
          Forwards to a tapestry page.
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

protected static final String SUCCESS
Forward Request to Success Page.

See Also:
Constant Field Values

FAILURE

protected static final String FAILURE
Forward Request to Failure Page.

See Also:
Constant Field Values

ERROR

protected static final String ERROR
Forward Request to Error Page.

See Also:
Constant Field Values

NOT_AUTHENTICATED

protected static final String NOT_AUTHENTICATED
User is not authenticated.

See Also:
Constant Field Values

SESSION_XDEBUG

protected static final String SESSION_XDEBUG
Session String for XDebug Object.

See Also:
Constant Field Values

SIGPATH_MAINPAGE

protected static final String SIGPATH_MAINPAGE
Session String for mapping of Sigpath Main Homepage.

See Also:
Constant Field Values
Constructor Detail

ActionRoot

public ActionRoot()
Default constructor.

Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      HttpServletRequest request,
                                                      HttpServletResponse response)
                                               throws IOException,
                                                      ServletException
This is the main action called from the struts framework. The base implementation instantiates a new XDebug object, performs snooping on the HTTP Request, and captures all Exceptions.

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The HTTP request we are processing
response - The HTTP response we are creating
Returns:
where control will be forwarded to after request is processed
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

redirectToNextPage

protected org.apache.struts.action.ActionForward redirectToNextPage(org.apache.struts.action.ActionForward forward,
                                                                    HttpServletRequest request,
                                                                    XDebug xdebug)
Redirects to nextPage if it is in session. nextPage is a relative url String stored in the session with the setAttribute method.

Parameters:
request - The HTTP request we are processing
xdebug - XDebug object to write log messages to
Returns:
where control will be forwarded to after request is processed

_perform

protected abstract org.apache.struts.action.ActionForward _perform(org.apache.struts.action.ActionMapping mapping,
                                                                   org.apache.struts.action.ActionForm form,
                                                                   HttpServletRequest request,
                                                                   HttpServletResponse response,
                                                                   org.apache.struts.action.ActionForward actionForward,
                                                                   XDebug xdebug)
                                                            throws Exception
Perform actual action work. Must be implemented by subclass.

Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The HTTP request we are processing
response - The HTTP response we are creating
xdebug - XDebug object to write log messages to
Returns:
where control will be forwarded to after request is processed
Throws:
Exception

setUserMessage

protected void setUserMessage(String msg,
                              HttpServletRequest request,
                              XDebug xdebug)
Sets the User Message. This message usually appears in red at the top of the SigPath JSP page.

Parameters:
request - The HTTP request we are processing
xdebug - XDebug object to write log messages to

tapestryPage

protected org.apache.struts.action.ActionForward tapestryPage(String page)
Forwards to a tapestry page.

Parameters:
page - The tapestry page name
Returns:
The appropriate struts action to forward to

tapestryExternalPage

protected org.apache.struts.action.ActionForward tapestryExternalPage(String page,
                                                                      Object[] parameters)
Forwards to a tapestry external page with an optional set of parameters.

Parameters:
page - The tapestry external page name
parameters - Array of parameters
Returns:
The appropriate struts action to forward to

SigPath

Copyright © 2002-2005 Institute for Computational Biomedicine, All Rights Reserved.