Interface IGlobalProvider

All Superinterfaces:
IComponent, IComponentProvider, IInitializable, IURIResolver

public interface IGlobalProvider extends IComponentProvider
Provides assistance in all things global including retrieving locales for: Also provides collection support for enabled Language Packs
  • 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

      void setDefaultLocale(Locale locale)
      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

      Locale getUserLocale(IContext context)
      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 the IMessageFormatter, the IResourceLoader and uses the appropriate Locale to retrieve the relevant information
      Parameters:
      resourceBundleClass -
      messageKey - the message key for the resource bundle
      messageArgs - optional arguments
      Returns:
    • localizeMessage

      String localizeMessage(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs)
      Helper function that coordinates the IMessageFormatter, the IResourceLoader and uses the appropriate Locale
      Parameters:
      resourceBundleClass -
      messageKey - the message key for the resource bundle
      messageArgs - optional arguments
      Returns:
      the formatted localized message
      See Also:
    • localizeMessageForPortalSystem

      String localizeMessageForPortalSystem(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs)
      Helper function that coordinates the IMessageFormatter, the IResourceLoader and uses the PortalSystem locale
      Parameters:
      resourceBundleClass -
      messageKey - the message key for the resource bundle
      messageArgs - optional arguments
      Returns:
      the formatted localized message * @see #getMessageInfo
    • localizeMessageForDefault

      String localizeMessageForDefault(Class<? extends ResourceBundle> resourceBundleClass, String messageKey, Object[] messageArgs)
      Helper function that coordinates the IMessageFormatter, the IResourceLoader and uses the Default locale
      Parameters:
      resourceBundleClass -
      messageKey - the message key for the resource bundle
      messageArgs - 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

      String getLocaleLanguageWithCountry(Locale locale)
      Retrieve a string that represents the language and country of the provided locale
      Parameters:
      locale - the locale to process
      Returns:
      the calculated string