Package de.xima.fc.user_portal.session
Class UserPortalLocaleManager
- java.lang.Object
-
- de.xima.fc.user_portal.session.UserPortalLocaleManager
-
- All Implemented Interfaces:
Serializable
@Named @SessionScoped public class UserPortalLocaleManager extends Object implements Serializable
Session-scoped manager for the current locale of the user portal.- Since:
- 8.2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UserPortalLocaleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Locale
getLocale()
Gets the current locale for the user portal frontend.Set<Locale>
getSupportedLocales()
Gets a set of the supported locales for the user portal frontend, i.e.List<Locale>
getSupportedLocalesSorted()
Gets a sorted list with the supported locales for the user portal frontend, i.e.void
setLocale(Locale locale)
Alias for #setRequestedLocale(Locale), intended to be used in facelet pages as an EL value binding.void
setRequestedLocale(Locale requestedLocale)
Sets the locale that was requested, which may not be the current locale and may not be part of the currently supported locales.void
setSupportedLocalesForPortal(String portalAlias, Collection<Locale> supportedLocales)
Set the supported locales for a given user portal.
-
-
-
Method Detail
-
getLocale
public Locale getLocale()
Gets the current locale for the user portal frontend.- Returns:
- The current locale.
-
setLocale
public void setLocale(Locale locale)
Alias for #setRequestedLocale(Locale), intended to be used in facelet pages as an EL value binding.- Parameters:
locale
- The locale to set.
-
getSupportedLocales
public Set<Locale> getSupportedLocales()
Gets a set of the supported locales for the user portal frontend, i.e. the locales from which the user can select one.- Returns:
- The supported locales.
-
getSupportedLocalesSorted
public List<Locale> getSupportedLocalesSorted()
Gets a sorted list with the supported locales for the user portal frontend, i.e. the locales from which the user can select one.- Returns:
- The supported locales.
-
setRequestedLocale
public void setRequestedLocale(Locale requestedLocale)
Sets the locale that was requested, which may not be the current locale and may not be part of the currently supported locales.- Parameters:
requestedLocale
- The requested locale.
-
setSupportedLocalesForPortal
public void setSupportedLocalesForPortal(String portalAlias, Collection<Locale> supportedLocales)
Set the supported locales for a given user portal.- Parameters:
portalAlias
- The portal alias.supportedLocales
- The supported locales.
-
-