Package com.microstrategy.web.beans
Class MessagesManager
- java.lang.Object
 - 
- com.microstrategy.utils.config.AbstractConfigurationElement
 - 
- com.microstrategy.web.beans.MessagesManager
 
 
 
- 
- All Implemented Interfaces:
 ConfigurationElement,ConfigurationFile,java.lang.Cloneable
public class MessagesManager extends AbstractConfigurationElement
This class contains a list ofMessagesinstances, each of which is associated with a specificjava.util.Localeobject or a Windows LCID (Window-based locale ID). The defaultResourceBundlename is set to "resources.MessagesBundle"- Since:
 - MicroStrategy Web 7.3.1 or earlier
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringATT_RESOURCE_BUNDLEprotected static java.lang.StringATT_VERSIONprotected static java.util.LocaleDEFAULT_LOCALEThe Locale used by defaultprotected static java.lang.StringDEFAULT_MESSAGES_BUNDLEThe name of the default MessagesBundle file.static java.lang.StringLOCALES_XMLstatic java.lang.StringNODE_NAME- 
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT 
 - 
 
- 
Constructor Summary
Constructors Constructor Description MessagesManager()Constructs a MessagesManager using default values.MessagesManager(java.util.Locale locale)Deprecated.The MessagesManager should be configured using an external xml configuration file using theload(java.lang.String)method.MessagesManager(org.w3c.dom.Document doc)Deprecated.The MessagesManager should be configured using an external xml configuration file using theload(java.lang.String)method. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidapplyCustomizations()Loops through all theCustomizationInfoin theCustomizationsclass and apply the corresponding customizations.java.lang.StringgetBrowserLocale(java.lang.String browserLocale)Returns the Web browser's locale ID, a Windows-based locale ID.java.lang.StringgetBundleName()Returns the base name for the bundle holding the messages.MessagesgetCustomMessages(java.lang.String localeId)Returns the customMessagesobject with the best-match possible for the specified Windows locale ID.static MessagesManagergetInstance()protected java.lang.StringgetKeyAttribute()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 thegetKeyandsetKeymethods.static java.lang.StringgetLocaleId(java.util.Locale locale)Returns the corresponding windows-based locale ID for the given Java LocaleHashListgetMessageInfo()Deprecated.UsegetMessageInfo(String localeId)to obtain a particular MessageInfo, orgetMessageInfoList()to obtain the list of all available MessageInfo.MessageInfogetMessageInfo(java.lang.String localeId)Returns the MessageInfo objects for the given locale.AbstractConfigurationElement.FilteredListgetMessageInfoList()ReturnsFilteredlistwith the list ofMessageInfoobjects available from this MessagesManager.MessagesgetMessages()Deprecated.MessagesgetMessages(java.lang.String localeId)Returns theMessagesobject with the best-match possible for the specified Windows locale ID.MessagesgetMessages(java.util.Locale locale)Returns theMessagesobject with the best-match possible for the specifiedjava.util.Locale.AbstractConfigurationElement.FilteredListgetPartiallySupportedMessageInfoList()static voidinit(java.lang.String filePath)protected voidinitDefaultAttributes()This method can be overridden to set default values for attributes.voidload(java.lang.String fileName)Loads the file with the given name and initializes thisConfigurationElementwith its content.voidsetBundleName(java.lang.String value)Sets the base name for the bundle holding the messages.- 
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getDTDFileName, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getKey, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, isKeyAttribute, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reload, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setKey, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setStrAttribute, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation 
 - 
 
 - 
 
- 
- 
Field Detail
- 
LOCALES_XML
public static final java.lang.String LOCALES_XML
- See Also:
 - Constant Field Values
 
 
- 
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 singletongetInstance()is used instead of creating a new instance. 
- 
MessagesManager
@Deprecated public MessagesManager(java.util.Locale locale)
Deprecated.The MessagesManager should be configured using an external xml configuration file using theload(java.lang.String)method.Constructs a MessagesManager using the specifiedjava.util.Localeas default.- Parameters:
 locale- thejava.util.Localeto use.
 
- 
MessagesManager
@Deprecated public MessagesManager(org.w3c.dom.Document doc)
Deprecated.The MessagesManager should be configured using an external xml configuration file using theload(java.lang.String)method.Constructs a MessagesManager with the specifiedorg.w3c.dom.Documentobject.- Parameters:
 doc- aorg.w3c.dom.Documentobject.
 
 - 
 
- 
Method Detail
- 
getInstance
public static MessagesManager getInstance()
 
- 
init
public static void init(java.lang.String filePath)
 
- 
initDefaultAttributes
protected void initDefaultAttributes()
Description copied from class:AbstractConfigurationElementThis method can be overridden to set default values for attributes. Simply extend this method and callAbstractConfigurationElement.setAttribute(java.lang.String, java.lang.Object)- Overrides:
 initDefaultAttributesin classAbstractConfigurationElement- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
getMessages
public Messages getMessages(java.util.Locale locale)
Returns theMessagesobject with the best-match possible for the specifiedjava.util.Locale.- Parameters:
 locale- ajava.util.Locale.- Returns:
 - a 
Messagesobject. 
 
- 
getMessages
public Messages getMessages(java.lang.String localeId)
Returns theMessagesobject with the best-match possible for the specified Windows locale ID.- Parameters:
 localeId- a Window-based locale ID.- Returns:
 - a 
Messagesobject 
 
- 
getMessages
@Deprecated public Messages getMessages()
Deprecated.Returns theMessagesobject with thejava.util.Localespecified at initialization time.- Returns:
 - a 
Messagesobject. 
 
- 
getCustomMessages
public Messages getCustomMessages(java.lang.String localeId)
Returns the customMessagesobject with the best-match possible for the specified Windows locale ID.- Parameters:
 localeId- a Window-based locale ID.- Returns:
 - a 
Messagesobject 
 
- 
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
@Deprecated public HashList getMessageInfo()
Deprecated.UsegetMessageInfo(String localeId)to obtain a particular MessageInfo, orgetMessageInfoList()to obtain the list of all available MessageInfo.ReturnsHashlistover the collection ofMessageInfoobjects from this MessagesManager, keyed by the Windows LCID.- Returns:
 - a 
Hashlistover the collection ofMessageInfo 
 
- 
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
 
 
- 
getMessageInfoList
public AbstractConfigurationElement.FilteredList getMessageInfoList()
ReturnsFilteredlistwith the list ofMessageInfoobjects available from this MessagesManager.- 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
 
 
- 
getLocaleId
public static java.lang.String getLocaleId(java.util.Locale locale)
Returns the corresponding windows-based locale ID for the given Java Locale- Since:
 - MicroStrategy Web 9.0.0
 - See Also:
 LocaleInfo.convertJavaLocaleToLCID(java.util.Locale)
 
- 
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElementThis method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKeyandsetKeymethods.- Specified by:
 getKeyAttributein classAbstractConfigurationElement- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
load
public void load(java.lang.String fileName) throws ConfigExceptionDescription copied from class:AbstractConfigurationElementLoads the file with the given name and initializes thisConfigurationElementwith its content.- Specified by:
 loadin interfaceConfigurationFile- Overrides:
 loadin classAbstractConfigurationElement- Parameters:
 fileName- The path to the configuration file. This path will be resolved by theFileLoader- Throws:
 ConfigException- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
applyCustomizations
public void applyCustomizations() throws ConfigExceptionDescription copied from class:AbstractConfigurationElementLoops through all theCustomizationInfoin theCustomizationsclass and apply the corresponding customizations.- Specified by:
 applyCustomizationsin interfaceConfigurationFile- Overrides:
 applyCustomizationsin classAbstractConfigurationElement- Throws:
 ConfigException
 
 - 
 
 -