Class LocaleContextInfo
java.lang.Object
org.exoplatform.services.resources.LocaleContextInfo
Data structure that holds the inputs for
LocalePolicy pluggable policies mechanism.- Author:
- Marko Strukelj
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for browserLocalesGetter for cookieLocalesstatic LocaleHelper method to convert String representation of Locale into Locale object.static StringgetLocaleAsString(Locale locale) Helper method to get a String representation of the LocalegetLocaleIfLangSupported(Locale locale) Helper method that returns the locale only if it's language is supported by portal.getLocaleIfSupported(Locale locale) Helper method that returns the locale only if it's supported by portal.Getter for portalLocaleGetter for remoteUserGetter for requestLocaleGetter for sessionLocaleGetter for supportedLocalesGetter for userProfileLocalevoidsetBrowserLocales(List<Locale> browserLocales) Setter for browserLocalesvoidsetCookieLocales(List<Locale> cookieLocales) Setter for cookieLocalesvoidsetPortalLocale(Locale portalLocale) Setter for portalLocalevoidsetRemoteUser(String remoteUser) Setter for remoteUservoidsetRequestLocale(Locale requestLocale) Setter for requestLocalevoidsetSessionLocale(Locale locale) Setter for sessionLocalevoidsetSupportedLocales(Set<Locale> supportedLocales) Setter for supportedLocalesvoidsetUserProfileLocale(Locale userProfileLocale) Setter for userProfileLocale
-
Constructor Details
-
LocaleContextInfo
public LocaleContextInfo()
-
-
Method Details
-
setSupportedLocales
Setter for supportedLocales- Parameters:
supportedLocales- locales supported by portal
-
getSupportedLocales
Getter for supportedLocales- Returns:
- supportedLocales
-
setBrowserLocales
Setter for browserLocales- Parameters:
browserLocales- list of locales as preferred by client's browser
-
getBrowserLocales
Getter for browserLocales- Returns:
- browserLocales
-
setCookieLocales
Setter for cookieLocales- Parameters:
cookieLocales- locales stored in user's browser cookie
-
getCookieLocales
Getter for cookieLocales- Returns:
- cookieLocales
-
setUserProfileLocale
Setter for userProfileLocale- Parameters:
userProfileLocale- locale loaded from user's profile
-
getUserProfileLocale
Getter for userProfileLocale- Returns:
- userProfileLocale
-
setRemoteUser
Setter for remoteUser- Parameters:
remoteUser- username of the currently logged in user. Null for anonymous users.
-
getRemoteUser
Getter for remoteUser- Returns:
- remoteUser
-
setPortalLocale
Setter for portalLocale- Parameters:
portalLocale- default locale configured for the portal
-
getPortalLocale
Getter for portalLocale- Returns:
- portalLocale
-
setSessionLocale
Setter for sessionLocale- Parameters:
locale- Locale stored in current session
-
getSessionLocale
Getter for sessionLocale- Returns:
- sessionLocale
-
getRequestLocale
Getter for requestLocale- Returns:
- requestLocale
-
setRequestLocale
Setter for requestLocale- Parameters:
requestLocale- default locale configured for the request
-
getLocaleIfSupported
Helper method that returns the locale only if it's supported by portal. Otherwise it returns null.- Parameters:
locale- locale to check- Returns:
- original locale if supported, null otherwise
-
getLocaleIfLangSupported
Helper method that returns the locale only if it's language is supported by portal. Otherwise it returns null.- Parameters:
locale- locale to check- Returns:
- original locale if language is supported, null otherwise
-
getLocale
Helper method to convert String representation of Locale into Locale object.- Parameters:
portalLocaleName- String representation of Locale- Returns:
- locale
-
getLocaleAsString
Helper method to get a String representation of the Locale- Parameters:
locale-- Returns:
- String representation of the locale
-