Portlet Factory, Version 6.1.2
Localization and the Profile Custom Value class
The Profile Custom Value class can be used as a value setter to determine the Users Locale settings from WPS. Its name is: com.bowstreet.ibmportal.profiles.WPSLocaleProfileValue. This class is located in the portlet_adapter.jar.
This class expects the profile entry names to match the Locale bean style access method names (that is, country, displayCountry, language, displayLanguage).
The following rules are used to determine the Locale:
- The class will first check the users WPS preferred language setting.
- If no preferred language is set for the user, the preferred locale that the client will accept content in, based on the Accept-Language header will be used (using HttpServletRequest getLocale()).
- If the client request does not provide an Accept-Language header, then the default locale for the server will be used.
Also included is a profile set named wps.locale.value.pset that has its Profile Value Setter class set to com.bowstreet.ibmportal.profiles.WPSLocaleProfileValue, and contains entries for "country" and "language".
The combination of the WPSLocaleProfileValue class and its associated wps.locale.value.pset profile set is useful when using the Localized Resource builder and you want to determine the Language, and Country based on individual users preferences. In place of selecting the Language, and Country in the builders inputs you can instead profile the Language, and Country inputs using the wps.locale.value.pset profile set and selecting the proper profile entry name.
Parent topic: Specifying a value setter for the profile set
Library | Support |