com.ibm.portal.model
Interface LocalizedContextHome

All Superinterfaces:
LocaleCapable
All Known Subinterfaces:
CorLocalizedContextHome, PortalLocalizedContextHome, PortletLocalizedContextHome

public interface LocalizedContextHome
extends LocaleCapable

A home interface for lookups to LocalizedContext instances.

Since:
6.1.0

Nested Class Summary
static class LocalizedContextHome.BASE_TEXT_DIRECTION
          Enumerations of the base text direction for a given locale
static interface LocalizedContextHome.ComparatorFactory
          Factory to create a comparator per locale
 
Method Summary
 java.util.Set<java.util.Locale> getAvailableLocales()
          Returns the set of all available locales in the system
 LocalizedContextHome.BASE_TEXT_DIRECTION getBaseTextDirection(java.util.Locale locale)
           Computes the base text direction for a given locale.
 LocalizedContextHome.ComparatorFactory getDefaultCollators()
          Returns the default collator factory
 java.util.Locale getDefaultLocale()
          Returns the default locale as defined by portal
 java.util.Set<java.util.Locale> getExpandedLocales(java.util.Locale locale)
           Returns a set of locales that all fall back to the provided locale, including the locale itself.
 java.util.Set<java.util.Locale> getExpandedSupportedLocales()
          Returns the set of expanded locales for the set of supported locales as returned by getSupportedLocales().
 LocalizedContext getLocalizedContext(java.util.Enumeration<java.util.Locale> aLanguageRangeEnumeration)
          Returns a context instance which uses the language ranges specified in the given locale enumeration.
 LocalizedContext getLocalizedContext(java.util.List<java.util.Locale> aLocales)
          Returns a context instance which uses the language ranges specified in the given language string.
 LocalizedContext getLocalizedContext(java.lang.String anAcceptLanguageString)
          Returns a context instance which uses the language ranges specified in the given language string.
 ResourceBundleProvider getResourceBundleProvider(java.lang.String baseName, java.lang.ClassLoader loader)
           Constructs a ResourceBundleProvider that can be used to load resource bundles in particular locales without providing a locale based fallback.
 IterableListModel<java.util.Locale> getSupportedLocales()
          Provides easy access ot the list of supported locales in WebSphere Portal
 

Method Detail

getAvailableLocales

java.util.Set<java.util.Locale> getAvailableLocales()
Returns the set of all available locales in the system

Returns:
the set of locales, not null
Since:
6.1.0.1

getBaseTextDirection

LocalizedContextHome.BASE_TEXT_DIRECTION getBaseTextDirection(java.util.Locale locale)

Computes the base text direction for a given locale.

Parameters:
locale - locale to get the direction for
Returns:
the text direction for this locale, not null
Since:
6.1.0.3

getDefaultCollators

LocalizedContextHome.ComparatorFactory getDefaultCollators()
Returns the default collator factory

Returns:
the default collators
Since:
8.0

getDefaultLocale

java.util.Locale getDefaultLocale()
Returns the default locale as defined by portal

Returns:
the default locale, not null
Since:
6.1.0.1

getExpandedLocales

java.util.Set<java.util.Locale> getExpandedLocales(java.util.Locale locale)

Returns a set of locales that all fall back to the provided locale, including the locale itself.

Example: given the locale de the method returns [de_DE, de_AT, de, de_LU, de_CH, de_BE].

Parameters:
locale - the locale
Returns:
set of locales that fall back to this locale or the empty set if the locale is null
Since:
6.1.0.1

getExpandedSupportedLocales

java.util.Set<java.util.Locale> getExpandedSupportedLocales()
Returns the set of expanded locales for the set of supported locales as returned by getSupportedLocales(). The resulting set will therefore contain locales that contain one of the supported locales on the fallback path.

Returns:
the set of expanded locales
Since:
8.0

getLocalizedContext

LocalizedContext getLocalizedContext(java.util.Enumeration<java.util.Locale> aLanguageRangeEnumeration)
Returns a context instance which uses the language ranges specified in the given locale enumeration.

All desired fallback sequences must be explicitly provided in the given enumeration. E.g. the context returned for {de-DE} will not normally find resources for de; if this is desired, {de-DE,de} should be used as argument

Parameters:
aLanguageRangeEnumeration - an enumeration providing locales which are interpreted as language ranges, in descending priority order; must not be null.
Returns:
a localized context instance working on the specified language ranges

getLocalizedContext

LocalizedContext getLocalizedContext(java.util.List<java.util.Locale> aLocales)
Returns a context instance which uses the language ranges specified in the given language string.

Parameters:
aLocales - the locales that this context is based on
Returns:
a localized context instance working on the specified language ranges
Since:
6.1.0.3

getLocalizedContext

LocalizedContext getLocalizedContext(java.lang.String anAcceptLanguageString)
Returns a context instance which uses the language ranges specified in the given language string.

Parameters:
anAcceptLanguageString - a string defining accepted language ranges as documented in RFC 2616; must not be null. Note: Currently, wildcards are ignored. This limitation may be removed in the future.
Returns:
a localized context instance working on the specified language ranges

getResourceBundleProvider

ResourceBundleProvider getResourceBundleProvider(java.lang.String baseName,
                                                 java.lang.ClassLoader loader)

Constructs a ResourceBundleProvider that can be used to load resource bundles in particular locales without providing a locale based fallback. In addition the provider exposes the list of locales the resource bundle is available in. The provider can be loaded once and stored as long as the class loader is valid.

Constructing a provider is considered to be a potentially expensive operation, so a provider should be stored and cached for the lifetime of the client of the provider.

Parameters:
baseName - basename of the bundle
loader - class loader for the bundle
Returns:
the provider, not null

getSupportedLocales

IterableListModel<java.util.Locale> getSupportedLocales()
Provides easy access ot the list of supported locales in WebSphere Portal

Specified by:
getSupportedLocales in interface LocaleCapable
Returns:
a list of the supported locales
Since:
6.1.0.1