com.sri.common.controller
Class LoginAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.jcorporate.expresso.core.controller.Controller
          extended by com.jcorporate.expresso.core.controller.DBController
              extended by com.jcorporate.expresso.services.controller.LoginController
                  extended by com.jcorporate.expresso.services.controller.SimpleLoginController
                      extended by com.sri.common.controller.LoginAction
All Implemented Interfaces:
Serializable

public class LoginAction
extends com.jcorporate.expresso.services.controller.SimpleLoginController

Extension of Expresso's SimpleLoginController for EMO customization.

Author:
Larry Hamel
See Also:
Serialized Form

Field Summary
static String DO_CHANGE_PASSWORD
          Constant for state do change password.
static String DO_CHANGE_PREFS
          Constant for state change preferences.
static String DO_LOGIN
          Constant for state do login.
static String DO_LOGOUT
          Constant for state do logout.
static String DO_SEND_PASSWORD
          Constant for state do send password.
static int MIN_PASSWD_LENGTH
          Minimum password length constant.
static String NEW_PASSWORD
          Constant for Input 'new password'.
static String PASS_VERIFY
          Constant for Input 'password verify'.
static String PROMPT_CHANGE_PASSWORD
          Constant for state prompt change password.
static String PROMPT_CHANGE_PREFS
          Constant for state prompt change preferences.
static String PROMPT_LOGIN
          Constant for state prompt login.
static String PROMPT_SEND_PASSWORD
          Constant for state send password.
 
Fields inherited from class com.jcorporate.expresso.services.controller.LoginController
CLASS_HANDLER_NAME, DBNAME_COOKIE, DEFAULT_CLASS_NAME, LOGINNAME_COOKIE, PASSWORD_COOKIE
 
Fields inherited from class com.jcorporate.expresso.core.controller.DBController
CACHE_NAME
 
Fields inherited from class com.jcorporate.expresso.core.controller.Controller
CONTROLLER_PARAM_KEY, CTL_SUCC_CTL, CTL_SUCC_STATE, CTL_SUCC_TRAN, mLog, NEWSTATE_EXCEPTION_KEY, ORIGINAL_URL_KEY, REQUEST_KEY, RESPONSE_KEY, RETURN_TO_SENDER_TRAN, STATE_ERR_CTL, STATE_ERR_STATE, STATE_ERR_TRAN, STATE_PARAM_KEY, STATE_SUCC_CTL, STATE_SUCC_STATE, STATE_SUCC_TRAN
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
LoginAction()
           
 
Method Summary
protected  String getPassword(ExpressoRequest request, ExpressoResponse response)
          Retrieves a password from the request and error-checks it.
 String getTitle()
          Returns the title of this controller.
protected  void runDoChangePasswordState(ExpressoRequest request, ExpressoResponse response)
           
protected  void runDoChangePrefsState(ExpressoRequest request, ExpressoResponse response)
           
protected  void runDoLoginState(ExpressoRequest request, ExpressoResponse response)
          Process a login request.
protected  void runDoLogoutState(ExpressoRequest request, ExpressoResponse response)
          Process a logout request.
protected  void runDoSendPasswordState(ExpressoRequest request, ExpressoResponse response)
          Send an email to the user with a URL to click to get their new password
protected  void runProcessLogoutState(ExpressoRequest request, ExpressoResponse response)
          override to remove dep.
protected  void runPromptChangePasswordState(ExpressoRequest request, ExpressoResponse response)
           
protected  void runPromptChangePrefsState(ExpressoRequest request, ExpressoResponse response)
           
protected  void runPromptLoginState(ExpressoRequest request, ExpressoResponse response)
           
protected  void runPromptSendPasswordState(ExpressoRequest request, ExpressoResponse response)
           
 boolean stateAllowed(String newState, ExpressoRequest request)
          Override the normal stateAllowed method to always allow access to this controller for certain states - otherwise no-one can ever log in :-)
 
Methods inherited from class com.jcorporate.expresso.services.controller.SimpleLoginController
postLogoutProcessing, runEmailValidateState, runProcessChangePasswordState, runProcessLoginState, runProcessRevalidateState, runProcessSendPasswordState, runPromptRevalidateState
 
Methods inherited from class com.jcorporate.expresso.services.controller.LoginController
attemptLogin, delayLogin, getDefaultLoginController, getDefaultRegistrationController, getLoginController, logInvalidLoginAttempt, postLoginProcessing, setCookie, setPersistentLoginAttributes, tryLogin
 
Methods inherited from class com.jcorporate.expresso.core.controller.DBController
getString, isAllowed
 
Methods inherited from class com.jcorporate.expresso.core.controller.Controller
addFinalState, addPromptTransitions, addRegDomainParamtoSession, addRequestedURLtoSession, addState, addStatePairing, endTimer, execute, findControllerForm, generateToken, getActionForward, getControllerChainingTransition, getControllerSecurityTransition, getFinalState, getInitialState, getLogger, getParamValues, getRequestURL, getSchema, getSchemaHierarchy, getSchemaInstance, getSchemaStack, getState, getStates, getString, getString, handleException, instantiate, isFinalState, isHandleState, isPromptState, isTokenValid, loadStateForm, newExpressoState, newState, nextHandleState, nextPromptState, populateStateForm, postPerform, postPerform, prePerform, prePerform, previousPromptState, processRequestTransitions, processTransitions, redirectRequest, redirectRequest, remapFromExtension, resetToken, saveToken, setControllerChainingTransition, setControllerSecurityTransition, setCurrentState, setInitialState, setSchema, setSchema, setupDefaultValues, setupReturnToSender, setupSubclassLog, transition, transition, transition, unloadStateForm
 
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, 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

PROMPT_LOGIN

public static final String PROMPT_LOGIN
Constant for state prompt login.

See Also:
Constant Field Values

DO_LOGIN

public static final String DO_LOGIN
Constant for state do login.

See Also:
Constant Field Values

DO_LOGOUT

public static final String DO_LOGOUT
Constant for state do logout.

See Also:
Constant Field Values

PROMPT_SEND_PASSWORD

public static final String PROMPT_SEND_PASSWORD
Constant for state send password.

See Also:
Constant Field Values

DO_SEND_PASSWORD

public static final String DO_SEND_PASSWORD
Constant for state do send password.

See Also:
Constant Field Values

PROMPT_CHANGE_PREFS

public static final String PROMPT_CHANGE_PREFS
Constant for state prompt change preferences.

See Also:
Constant Field Values

DO_CHANGE_PREFS

public static final String DO_CHANGE_PREFS
Constant for state change preferences.

See Also:
Constant Field Values

PROMPT_CHANGE_PASSWORD

public static final String PROMPT_CHANGE_PASSWORD
Constant for state prompt change password.

See Also:
Constant Field Values

DO_CHANGE_PASSWORD

public static final String DO_CHANGE_PASSWORD
Constant for state do change password.

See Also:
Constant Field Values

NEW_PASSWORD

public static final String NEW_PASSWORD
Constant for Input 'new password'.

See Also:
Constant Field Values

PASS_VERIFY

public static final String PASS_VERIFY
Constant for Input 'password verify'.

See Also:
Constant Field Values

MIN_PASSWD_LENGTH

public static final int MIN_PASSWD_LENGTH
Minimum password length constant.

See Also:
Constant Field Values
Constructor Detail

LoginAction

public LoginAction()
Method Detail

runPromptLoginState

protected void runPromptLoginState(ExpressoRequest request,
                                   ExpressoResponse response)
                            throws ControllerException,
                                   DBException
Overrides:
runPromptLoginState in class com.jcorporate.expresso.services.controller.SimpleLoginController
Throws:
ControllerException
DBException

runDoLoginState

protected void runDoLoginState(ExpressoRequest request,
                               ExpressoResponse response)
                        throws ControllerException,
                               NonHandleableException
Process a login request.

Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.
NonHandleableException - upon fatal error.

runDoLogoutState

protected void runDoLogoutState(ExpressoRequest request,
                                ExpressoResponse response)
                         throws ControllerException,
                                NonHandleableException,
                                DBException
Process a logout request.

Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.
NonHandleableException - upon fatal error.
DBException - upon database object error.

getTitle

public String getTitle()
Returns the title of this controller.

Overrides:
getTitle in class com.jcorporate.expresso.services.controller.SimpleLoginController
Returns:
java.lang.String

runPromptSendPasswordState

protected void runPromptSendPasswordState(ExpressoRequest request,
                                          ExpressoResponse response)
                                   throws ControllerException
Overrides:
runPromptSendPasswordState in class com.jcorporate.expresso.services.controller.SimpleLoginController
Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.

runPromptChangePasswordState

protected void runPromptChangePasswordState(ExpressoRequest request,
                                            ExpressoResponse response)
                                     throws ControllerException
Overrides:
runPromptChangePasswordState in class com.jcorporate.expresso.services.controller.SimpleLoginController
Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.

runPromptChangePrefsState

protected void runPromptChangePrefsState(ExpressoRequest request,
                                         ExpressoResponse response)
                                  throws ControllerException
Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.

runDoChangePrefsState

protected void runDoChangePrefsState(ExpressoRequest request,
                                     ExpressoResponse response)
                              throws ControllerException
Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.

runDoChangePasswordState

protected void runDoChangePasswordState(ExpressoRequest request,
                                        ExpressoResponse response)
                                 throws ControllerException
Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.

runDoSendPasswordState

protected void runDoSendPasswordState(ExpressoRequest request,
                                      ExpressoResponse response)
                               throws ControllerException,
                                      NonHandleableException
Send an email to the user with a URL to click to get their new password

Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Throws:
ControllerException - upon error.
NonHandleableException - upon fatal error.

runProcessLogoutState

protected void runProcessLogoutState(ExpressoRequest request,
                                     ExpressoResponse response)
                              throws ControllerException,
                                     DBException
override to remove dep. on registration

Logs a user out of the system and invalidates their session.

Overrides:
runProcessLogoutState in class com.jcorporate.expresso.services.controller.SimpleLoginController
Parameters:
request - The framework controller request
response - The framework ExpressoResponse object
Throws:
ControllerException - upon logic error
DBException - upon database object error.

getPassword

protected String getPassword(ExpressoRequest request,
                             ExpressoResponse response)
                      throws ControllerException,
                             DBException,
                             NonHandleableException
Retrieves a password from the request and error-checks it. Returns null if an invalid password is found. Does NOT trim the password.

Parameters:
request - the ExpressoRequest object.
response - the ExpressoResponse object.
Returns:
The password
Throws:
ControllerException - upon error.
NonHandleableException - upon fatal error.
DBException - upon database access error

stateAllowed

public boolean stateAllowed(String newState,
                            ExpressoRequest request)
                     throws ControllerException
Override the normal stateAllowed method to always allow access to this controller for certain states - otherwise no-one can ever log in :-)

Overrides:
stateAllowed in class com.jcorporate.expresso.services.controller.SimpleLoginController
Parameters:
newState - the state to transition to.
request - The controllerRequest object
Returns:
true if the state is allowed for the currently logged in user.
Throws:
ControllerException - if there is an error while looking up the sercurity permissions


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.