org.jasig.portal.portlets.localization
Class UserLocaleHelper

java.lang.Object
  extended by org.jasig.portal.portlets.localization.UserLocaleHelper

public class UserLocaleHelper
extends Object

UserLocaleHelper contains helper methods for the user locales webflow.

Version:
$Revision: 19776 $
Author:
Jen Bourey

Constructor Summary
UserLocaleHelper()
           
 
Method Summary
 Locale getCurrentUserLocale(HttpServletRequest request)
          Return the current user's locale.
 List<LocaleBean> getLocales(Locale currentLocale)
          Return a list of LocaleBeans matching the currently available locales for the portal.
protected  Locale[] getPortalLocales()
          Get the available portal locales.
protected  Locale parseLocale(String localeString)
          Parse a string representation of a locale and return the matching Locale.
 void setUserInstanceManager(IUserInstanceManager userInstanceManager)
          Set the UserInstanceManager
 void updateUserLocale(HttpServletRequest request, String localeString)
          Update the current user's locale to match the selected locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLocaleHelper

public UserLocaleHelper()
Method Detail

setUserInstanceManager

public void setUserInstanceManager(IUserInstanceManager userInstanceManager)
Set the UserInstanceManager

Parameters:
userInstanceManager -

getLocales

public List<LocaleBean> getLocales(Locale currentLocale)
Return a list of LocaleBeans matching the currently available locales for the portal.

Parameters:
currentLocale -
Returns:

getCurrentUserLocale

public Locale getCurrentUserLocale(HttpServletRequest request)
Return the current user's locale.

Parameters:
request -
Returns:

updateUserLocale

public void updateUserLocale(HttpServletRequest request,
                             String localeString)
Update the current user's locale to match the selected locale. This implementation will update the session locale, and if the user is not a guest, will also update the locale in the user's persisted preferences.

Parameters:
request -
localeString -

getPortalLocales

protected Locale[] getPortalLocales()
Get the available portal locales.

Returns:

parseLocale

protected Locale parseLocale(String localeString)
Parse a string representation of a locale and return the matching Locale.

Parameters:
localeString -
Returns:


Copyright © 2010 Jasig. All Rights Reserved.