Interface IGlobalProvider
- All Superinterfaces:
IComponent
,IComponentProvider
,IInitializable
,IURIResolver
Provides assistance in all things global including retrieving locales for:
- Portal System
getPortalSystemLocale()
- Default Locale
getDefaultLocale()
- User's Locale
getUserLocale()
-
Field Summary
Fields inherited from interface com.webmethods.portal.system.IComponentProvider
ATTR_APP_NAME, ATTR_BEG_QUERY, ATTR_END_QUERY, ATTR_MID_QUERY, BIZPOLICY_MANAGER, CACHE_PROVIDER, COMMAND_PROVIDER, COMPONENTS_QUERY, INSTALL_PROVIDER, MECH_PROVIDER, METACONTEXT_PROVIDER, PHASE_PROVIDER, POLICY_PROVIDER, SEARCH_PROVIDER
-
Method Summary
Modifier and TypeMethodDescriptionGets the default locale for this process.getLocaleLanguageWithCountry
(Locale locale) Retrieve a string that represents the language and country of the provided localegetMessageInfo
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Retrieves the message info for a given sourceObject, messageID and message Args.Returns the Locale object that the Portal System uses internallyReturns the User Perfered Time and Date object for the current user.Returns the Locale object for the current user.getUserLocale
(IContext context) Based upon the current user, get the correct Locale Informationboolean
Helper to format full name order of sir (last) and given (first) name.localizeDate
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using the current user's locale.localizeDateForDefault
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using default locale.localizeDateForPortalSystem
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using portal system locale.localizeMessage
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the appropriate LocalelocalizeMessageForDefault
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the Default localelocalizeMessageForPortalSystem
(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the PortalSystem localevoid
setDefaultLocale
(Locale locale) Sets new default locale.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.IComponentProvider
exists, getComponent, getComponent, getComponent, getComponentQueryString, getComponents, getDefaultComponent, getLogger, initDeferredWebAppComponents, lookup, registerComponent, reloadComponent, reloadComponent, unregisterComponent, upgradeComponentDataFromBootstrapComponentData
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.system.IURIResolver
acquireURI, acquireURI
-
Method Details
-
getPortalSystemLocale
Locale getPortalSystemLocale()Returns the Locale object that the Portal System uses internally -
getDefaultLocale
Locale getDefaultLocale()Gets the default locale for this process. This will come from the standard Operating System's Locale -
setDefaultLocale
Sets new default locale. It updates it immitiately and persists the value in the configuration for the next portal startup.- Parameters:
locale
- new default locale
-
getUserLocale
Locale getUserLocale()Returns the Locale object for the current user. Note if possible call instead:getUserLocale()
-
getUserDateTimeFormat
DateFormat getUserDateTimeFormat()Returns the User Perfered Time and Date object for the current user. Note if possible call instead:getUserLocale()
-
getUserLocale
Based upon the current user, get the correct Locale Information -
getMessageFormatter
IMessageFormatter getMessageFormatter()- See Also:
-
getResourceLoader
IResourceLoader getResourceLoader()- See Also:
-
getLanguagePackManager
ILanguagePackManager getLanguagePackManager()- See Also:
-
getMessageInfo
IMessageInfo getMessageInfo(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Retrieves the message info for a given sourceObject, messageID and message Args. It coordinates theIMessageFormatter
, theIResourceLoader
and uses the appropriate Locale to retrieve the relevant information- Parameters:
resourceBundleClass
-messageKey
- the message key for the resource bundlemessageArgs
- optional arguments- Returns:
-
localizeMessage
String localizeMessage(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the appropriate Locale- Parameters:
resourceBundleClass
-messageKey
- the message key for the resource bundlemessageArgs
- optional arguments- Returns:
- the formatted localized message
- See Also:
-
localizeMessageForPortalSystem
String localizeMessageForPortalSystem(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the PortalSystem locale- Parameters:
resourceBundleClass
-messageKey
- the message key for the resource bundlemessageArgs
- optional arguments- Returns:
- the formatted localized message * @see #getMessageInfo
-
localizeMessageForDefault
String localizeMessageForDefault(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs) Helper function that coordinates theIMessageFormatter
, theIResourceLoader
and uses the Default locale- Parameters:
resourceBundleClass
-messageKey
- the message key for the resource bundlemessageArgs
- optional arguments- Returns:
- the formatted localized message * @see #getMessageInfo
-
localizeDate
String localizeDate(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using the current user's locale. -
localizeDateForPortalSystem
String localizeDateForPortalSystem(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using portal system locale. -
localizeDateForDefault
String localizeDateForDefault(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Date date) Helper to format date with pattern from resource bundle, using default locale. -
isSirNameFirst
boolean isSirNameFirst()Helper to format full name order of sir (last) and given (first) name. -
getLocaleLanguageWithCountry
Retrieve a string that represents the language and country of the provided locale- Parameters:
locale
- the locale to process- Returns:
- the calculated string
-