Class MessagesManager

  • All Implemented Interfaces:
    ConfigurationElement, ConfigurationFile, java.lang.Cloneable

    public class MessagesManager
    extends AbstractConfigurationElement
    This class contains a list of Messages instances, each of which is associated with a specific java.util.Locale object or a Windows LCID (Window-based locale ID). The default ResourceBundle name is set to "resources.MessagesBundle"
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Field Detail

      • NODE_NAME

        public static final java.lang.String NODE_NAME
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • ATT_RESOURCE_BUNDLE

        protected static final java.lang.String ATT_RESOURCE_BUNDLE
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • ATT_VERSION

        protected static final java.lang.String ATT_VERSION
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • DEFAULT_MESSAGES_BUNDLE

        protected static final java.lang.String DEFAULT_MESSAGES_BUNDLE
        The name of the default MessagesBundle file.
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • DEFAULT_LOCALE

        protected static final java.util.Locale DEFAULT_LOCALE
        The Locale used by default
        Since:
        MicroStrategy Web 9.0.0
    • Constructor Detail

      • MessagesManager

        public MessagesManager()
        Constructs a MessagesManager using default values. It's strongly recommended that the singleton getInstance() is used instead of creating a new instance.
      • MessagesManager

        public MessagesManager​(java.util.Locale locale)
        Deprecated.
        The MessagesManager should be configured using an external xml configuration file using the load(java.lang.String) method.
        Constructs a MessagesManager using the specified java.util.Locale as default.
        Parameters:
        locale - the java.util.Locale to use.
      • MessagesManager

        public MessagesManager​(org.w3c.dom.Document doc)
        Deprecated.
        The MessagesManager should be configured using an external xml configuration file using the load(java.lang.String) method.
        Constructs a MessagesManager with the specified org.w3c.dom.Document object.
        Parameters:
        doc - a org.w3c.dom.Document object.
    • Method Detail

      • init

        public static void init​(java.lang.String filePath)
      • getMessages

        public Messages getMessages​(java.util.Locale locale)
        Returns the Messages object with the best-match possible for the specified java.util.Locale.
        Parameters:
        locale - a java.util.Locale.
        Returns:
        a Messages object.
      • getMessages

        public Messages getMessages​(java.lang.String localeId)
        Returns the Messages object with the best-match possible for the specified Windows locale ID.
        Parameters:
        localeId - a Window-based locale ID.
        Returns:
        a Messages object
      • getMessages

        public Messages getMessages()
        Deprecated.
        Returns the Messages object with the java.util.Locale specified at initialization time.
        Returns:
        a Messages object.
      • getCustomMessages

        public Messages getCustomMessages​(java.lang.String localeId)
        Returns the custom Messages object with the best-match possible for the specified Windows locale ID.
        Parameters:
        localeId - a Window-based locale ID.
        Returns:
        a Messages object
      • getBundleName

        public java.lang.String getBundleName()
        Returns the base name for the bundle holding the messages.
        Since:
        MicroStrategy Web 9.0.0
      • setBundleName

        public void setBundleName​(java.lang.String value)
        Sets the base name for the bundle holding the messages.
        Since:
        MicroStrategy Web 9.0.0
      • getMessageInfo

        public HashList getMessageInfo()
        Deprecated.
        Use getMessageInfo(String localeId) to obtain a particular MessageInfo, or getMessageInfoList() to obtain the list of all available MessageInfo.
        Returns Hashlist over the collection of MessageInfo objects from this MessagesManager, keyed by the Windows LCID.
        Returns:
        a Hashlist over the collection of MessageInfo
      • getMessageInfo

        public MessageInfo getMessageInfo​(java.lang.String localeId)
        Returns the MessageInfo objects for the given locale.
        Parameters:
        localeId - The locale id identifying the MessageInfo
        Returns:
        MessageInfo associated with the given locale, null if it doesn't exist.
        Since:
        MicroStrategy Web 9.0.0
      • getPartiallySupportedMessageInfoList

        public AbstractConfigurationElement.FilteredList getPartiallySupportedMessageInfoList()
        Returns:
        the list of partially supported locales, in that they are recognized by this application, but are not fully localized.
        Since:
        MicroStrategy Web 9.0.0
      • getBrowserLocale

        public java.lang.String getBrowserLocale​(java.lang.String browserLocale)
        Returns the Web browser's locale ID, a Windows-based locale ID. This method first extracts the country and language from the parameter browserLocale and then tries to use them to find out the Windows locale ID and returns it. If not found, the default one used when initializing this MessagesManager is returned.
        Parameters:
        browserLocale - a browser's locale information
        Returns:
        a Windows-based locale ID
      • getKeyAttribute

        protected java.lang.String getKeyAttribute()
        Description copied from class: AbstractConfigurationElement
        This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
        Specified by:
        getKeyAttribute in class AbstractConfigurationElement
        Since:
        MicroStrategy Web 9.0.0