Class 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 Detail

      • UserPortalLocaleManager

        public UserPortalLocaleManager()
    • 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.