edu.internet2.middleware.grouper.ui
Class SessionInitialiser

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.SessionInitialiser

public class SessionInitialiser
extends Object

Initialises HttpSession after login.

Should probably make an interface and allow site specific initialisation

Version:
$Id: SessionInitialiser.java,v 1.24 2009-10-16 08:06:26 isgwb Exp $
Author:
Gary Brown.

Field Summary
static String RESOURCE_BUNDLE_KEY
           
 
Constructor Summary
SessionInitialiser()
           
 
Method Summary
static Locale createLocale(String localeStr)
           
static String getAuthUser(HttpSession session)
          Proper way of getting the underlying HttpSession attribute value for the currently logged in user.
static GrouperSession getGrouperSession(HttpSession session)
          Proper way to get GrouperSession from HttpSession
static Set getMenuFilters(HttpSession session)
          Proper way to get MenuFilters from HttpSession
static UiPermissions getUiPermissions(HttpSession session)
          Proper way to get UiPermissions from HttpSession
static void init(HttpServletRequest request)
          Sets locale and calls any module specific initialisation
static void init(String module, HttpSession session)
          Module specific initialisation with no locale specified
static void init(String module, String locale, HttpSession session)
          Module and locale specific initialisation
static void initThread(HttpSession session)
           
static BundleBean resourceBundles(org.apache.commons.collections.keyvalue.MultiKey multiKey)
          get the resource bundle by name and local
static javax.servlet.jsp.jstl.fmt.LocalizationContext retrieveLocalizationContext(org.apache.commons.collections.keyvalue.MultiKey multiKey, boolean isNav)
          get a resource bundle based on multikey
static MapBundleWrapper retrieveMapBundleWrapper(org.apache.commons.collections.keyvalue.MultiKey multiKey, boolean isNav, boolean returnNullsIfNotFound)
          get a resource bundle based on multikey
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_BUNDLE_KEY

public static final String RESOURCE_BUNDLE_KEY
See Also:
Constant Field Values
Constructor Detail

SessionInitialiser

public SessionInitialiser()
Method Detail

retrieveLocalizationContext

public static javax.servlet.jsp.jstl.fmt.LocalizationContext retrieveLocalizationContext(org.apache.commons.collections.keyvalue.MultiKey multiKey,
                                                                                         boolean isNav)
get a resource bundle based on multikey

Parameters:
multiKey -
isNav - true for nav, false for media
Returns:
the resource bundle

retrieveMapBundleWrapper

public static MapBundleWrapper retrieveMapBundleWrapper(org.apache.commons.collections.keyvalue.MultiKey multiKey,
                                                        boolean isNav,
                                                        boolean returnNullsIfNotFound)
get a resource bundle based on multikey

Parameters:
multiKey -
isNav - true for nav, false for media
returnNullsIfNotFound - false if normal, true, is nulls if not found (e.g. mediaNullMap)
Returns:
the resource bundle

resourceBundles

public static BundleBean resourceBundles(org.apache.commons.collections.keyvalue.MultiKey multiKey)
get the resource bundle by name and local

Parameters:
multiKey - is the module, name (nav or media), and locale
Returns:
the resource bundle

init

public static void init(HttpServletRequest request)
Sets locale and calls any module specific initialisation

Parameters:
request - current HttpServletRequest

init

public static void init(String module,
                        HttpSession session)
                 throws Exception
Module specific initialisation with no locale specified

Parameters:
module - Struts's module
session - current HttpSession
Throws:
Exception

init

public static void init(String module,
                        String locale,
                        HttpSession session)
                 throws Exception
Module and locale specific initialisation

Parameters:
module - Strut's module
locale - selected locale
session - current HttpSession
Throws:
Exception

getGrouperSession

public static GrouperSession getGrouperSession(HttpSession session)
Proper way to get GrouperSession from HttpSession

Parameters:
session - current HttpSession
Returns:
the current GrouperSession

getUiPermissions

public static UiPermissions getUiPermissions(HttpSession session)
Proper way to get UiPermissions from HttpSession

Parameters:
session - current HttpSession
Returns:
the current UiPermissions

getMenuFilters

public static Set getMenuFilters(HttpSession session)
Proper way to get MenuFilters from HttpSession

Parameters:
session - current HttpSession
Returns:
the current MenuFilters

getAuthUser

public static String getAuthUser(HttpSession session)
Proper way of getting the underlying HttpSession attribute value for the currently logged in user.

Parameters:
session -
Returns:
the id of the currently authenticated user

createLocale

public static Locale createLocale(String localeStr)

initThread

public static void initThread(HttpSession session)