HiRISE

HiRISE.HiWish
Class NewSuggestionAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.apache.struts.actions.BaseAction
          extended by org.apache.struts.actions.DispatchAction
              extended by HiRISE.HiWish.HiWishAction
                  extended by HiRISE.HiWish.NewSuggestionAction
Direct Known Subclasses:
CheckPairSuggestionAction, CloneSuggestionAction, PairSuggestionAction

public class NewSuggestionAction
extends HiWishAction

Handles actions from the editor, preview and suggestion creation pages.


Field Summary
protected static String RE_STL_COMMENT
          regular expression to match an STL comment in the special notes
 
Fields inherited from class HiRISE.HiWish.HiWishAction
ID, logger
 
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, methods, types
 
Fields inherited from class org.apache.struts.actions.BaseAction
messages
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
NewSuggestionAction()
           
 
Method Summary
protected  boolean checkQuota(Connection conn, javax.servlet.http.HttpServletRequest req)
          Check the quota of the user in the session.
 org.apache.struts.action.ActionForward create(org.apache.struts.action.ActionMapping map, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle creation action
 org.apache.struts.action.ActionForward edit(org.apache.struts.action.ActionMapping map, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle editor re-edit action
 org.apache.struts.action.ActionForward open(org.apache.struts.action.ActionMapping map, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle editor open action
 org.apache.struts.action.ActionForward preview(org.apache.struts.action.ActionMapping map, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle preview action
protected  org.apache.struts.action.ActionForward unspecified(org.apache.struts.action.ActionMapping map, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          What to do if no action is specified
 
Methods inherited from class HiRISE.HiWish.HiWishAction
closeConnection, generateSecureToken, getConnection, getContextURL, getContextVariable, getMailSession, getWishQuota, memorizeUser, rememberUser, sendEmail, sha1hex
 
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, dispatchMethod, execute, getMethod, getMethodName, getParameter
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, 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

RE_STL_COMMENT

protected static final String RE_STL_COMMENT
regular expression to match an STL comment in the special notes

See Also:
Constant Field Values
Constructor Detail

NewSuggestionAction

public NewSuggestionAction()
Method Detail

unspecified

protected org.apache.struts.action.ActionForward unspecified(org.apache.struts.action.ActionMapping map,
                                                             org.apache.struts.action.ActionForm form,
                                                             javax.servlet.http.HttpServletRequest req,
                                                             javax.servlet.http.HttpServletResponse res)
                                                      throws Exception
What to do if no action is specified

Overrides:
unspecified in class org.apache.struts.actions.DispatchAction
Throws:
Exception

open

public org.apache.struts.action.ActionForward open(org.apache.struts.action.ActionMapping map,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest req,
                                                   javax.servlet.http.HttpServletResponse res)
                                            throws SQLException,
                                                   NamingException
Handle editor open action

Parameters:
map - struts
form - input
req - incoming
res - outgoing
Returns:
destination
Throws:
SQLException - query problem
NamingException - lookup problem

edit

public org.apache.struts.action.ActionForward edit(org.apache.struts.action.ActionMapping map,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest req,
                                                   javax.servlet.http.HttpServletResponse res)
                                            throws SQLException,
                                                   NamingException
Handle editor re-edit action

Parameters:
map - struts
form - input
req - incoming
res - outgoing
Returns:
destination
Throws:
SQLException - query problem
NamingException - lookup problem

preview

public org.apache.struts.action.ActionForward preview(org.apache.struts.action.ActionMapping map,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest req,
                                                      javax.servlet.http.HttpServletResponse res)
                                               throws SQLException,
                                                      NamingException
Handle preview action

Parameters:
map - struts
form - input
req - incoming
res - outgoing
Returns:
destination
Throws:
SQLException - query problem
NamingException - lookup problem

create

public org.apache.struts.action.ActionForward create(org.apache.struts.action.ActionMapping map,
                                                     org.apache.struts.action.ActionForm form,
                                                     javax.servlet.http.HttpServletRequest req,
                                                     javax.servlet.http.HttpServletResponse res)
                                              throws SQLException,
                                                     NamingException
Handle creation action

Parameters:
map - struts
form - input
req - incoming
res - outgoing
Returns:
destination
Throws:
SQLException - query problem
NamingException - lookup problem

checkQuota

protected boolean checkQuota(Connection conn,
                             javax.servlet.http.HttpServletRequest req)
                      throws SQLException
Check the quota of the user in the session. Sets attributes in the request 'wishes' and 'maxWishes'

Parameters:
conn - Open database connection
req - Current HTTP request containing a reference to an active session
Returns:
true if the user is under quota
Throws:
SQLException

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona