Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.action
Class BaseLoginAction  view BaseLoginAction download BaseLoginAction.java

java.lang.Object
  extended byorg.mentawai.core.BaseAction
      extended byorg.mentawai.action.BaseLoginAction
All Implemented Interfaces:
org.mentawai.core.Action, org.mentawai.filter.AuthenticationFree

public abstract class BaseLoginAction
extends org.mentawai.core.BaseAction
implements org.mentawai.filter.AuthenticationFree

This action implements the basic functionality for a Login action. You should override this class to create your Login action. You should also use its static methods for retrieving the session user and for checking if the user is logged.


Field Summary
static java.lang.String GROUPS_KEY
          The default key used to store the user authorization groups in the session
static java.lang.String LOCALE_KEY
          The default key used to store the user locale in the session
static java.lang.String USER_KEY
          The default key used to store the user object in the session
 
Fields inherited from class org.mentawai.core.BaseAction
application, input, loc, output, session
 
Fields inherited from interface org.mentawai.core.Action
ERROR, SUCCESS
 
Constructor Summary
BaseLoginAction()
           
 
Method Summary
 java.util.List getUserGroups()
          Return the user authorization groups.
static java.util.List getUserGroups(org.mentawai.core.Context session)
          Return the user authorization groups.
static java.util.List getUserGroups(javax.servlet.http.HttpSession session)
          Return the user authorization groups.
 java.util.Locale getUserLocale()
          Return the user locale.
static java.util.Locale getUserLocale(org.mentawai.core.Context session)
          Return the user locale.
 java.lang.Object getUserSession()
          Return the user session object.
static java.lang.Object getUserSession(org.mentawai.core.Context session)
          Return the user session object.
 boolean isLogged()
          Check if the user is logged.
static boolean isLogged(org.mentawai.core.Context session)
          Check if the user is logged.
static boolean isLogged(javax.servlet.http.HttpSession session)
          Check if the user is logged.
 void setUserGroups(java.util.List groups)
          Place the user authorization groups in the session.
static void setUserGroups(java.util.List groups, org.mentawai.core.Context session)
          Place the user authorization groups in the session.
 void setUserGroups(java.lang.String groups)
          Place the user authorization groups in the session.
static void setUserGroups(java.lang.String groups, org.mentawai.core.Context session)
          Place the user authorization groups in the session.
 void setUserLocale(java.util.Locale loc)
          Place the user locale in the session.
static void setUserLocale(java.util.Locale loc, org.mentawai.core.Context session)
          Place the user locale in the session.
 void setUserSession(java.lang.Object value)
          Place an user object in the session.
static void setUserSession(java.lang.Object value, org.mentawai.core.Context session)
          Place an user object in the session.
 
Methods inherited from class org.mentawai.core.BaseAction
addError, addError, addError, addError, addError, addError, addError, addError, addError, addError, addMessage, addMessage, addMessage, addMessage, addMessage, getApplication, getInput, getLocale, getOutput, getSession, setApplication, setInput, setLocale, setMessageContext, setOutput, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mentawai.core.Action
execute
 

Field Detail

USER_KEY

public static java.lang.String USER_KEY
The default key used to store the user object in the session


GROUPS_KEY

public static java.lang.String GROUPS_KEY
The default key used to store the user authorization groups in the session


LOCALE_KEY

public static java.lang.String LOCALE_KEY
The default key used to store the user locale in the session

Constructor Detail

BaseLoginAction

public BaseLoginAction()
Method Detail

setUserSession

public void setUserSession(java.lang.Object value)
Place an user object in the session. Note that this can be any object. The session context is reset when you call this method.


setUserSession

public static void setUserSession(java.lang.Object value,
                                  org.mentawai.core.Context session)
Place an user object in the session. Note that this can be any object. The session context is reset when you call this method.

Since:
1.1.1

setUserLocale

public void setUserLocale(java.util.Locale loc)
Place the user locale in the session. If you call this method, the web application will follow this locale and not the one sent by the browser.


setUserLocale

public static void setUserLocale(java.util.Locale loc,
                                 org.mentawai.core.Context session)
Place the user locale in the session. If you call this method, the web application will follow this locale and not the one sent by the browser.

Since:
1.1.1

setUserGroups

public void setUserGroups(java.util.List groups)
Place the user authorization groups in the session.


setUserGroups

public static void setUserGroups(java.util.List groups,
                                 org.mentawai.core.Context session)
Place the user authorization groups in the session.

Since:
1.1.1

setUserGroups

public void setUserGroups(java.lang.String groups)
Place the user authorization groups in the session.


setUserGroups

public static void setUserGroups(java.lang.String groups,
                                 org.mentawai.core.Context session)
Place the user authorization groups in the session.

Since:
1.1.1

isLogged

public boolean isLogged()
Check if the user is logged.


getUserSession

public java.lang.Object getUserSession()
Return the user session object.


getUserLocale

public java.util.Locale getUserLocale()
Return the user locale.


getUserGroups

public java.util.List getUserGroups()
Return the user authorization groups.


isLogged

public static boolean isLogged(org.mentawai.core.Context session)
Check if the user is logged.


isLogged

public static boolean isLogged(javax.servlet.http.HttpSession session)
Check if the user is logged.


getUserSession

public static java.lang.Object getUserSession(org.mentawai.core.Context session)
Return the user session object.


getUserLocale

public static java.util.Locale getUserLocale(org.mentawai.core.Context session)
Return the user locale.


getUserGroups

public static java.util.List getUserGroups(org.mentawai.core.Context session)
Return the user authorization groups.


getUserGroups

public static java.util.List getUserGroups(javax.servlet.http.HttpSession session)
Return the user authorization groups.