Package com.microstrategy.web.app
Class ErrorInfo
- java.lang.Object
-
- com.microstrategy.utils.config.AbstractConfigurationElement
-
- com.microstrategy.web.app.ErrorInfo
-
- All Implemented Interfaces:
ConfigurationElement
,ConfigurationFile
,java.lang.Cloneable
public class ErrorInfo extends AbstractConfigurationElement
This class is used by the application to change the title and message of the error, to indicate whether the error is expected by the iframe in the event of an iframe request, or to find the page to which the user is redirected when the error occurs.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ErrorInfo.ErrorMessage
Defines the message to be displayed in the error alert box.static class
ErrorInfo.ErrorTitle
Defines the title to be displayed in the error alert box.-
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NODE_ERROR
-
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessage(ErrorInfo.ErrorMessage msg)
void
addTitle(ErrorInfo.ErrorTitle title)
boolean
allowIframe()
Returns whether this error condition can happened within an iFrame request for partial page update.boolean
displayError()
Returns whether the application should render the title, message, and contact information when the error occurs.int
getErrorCode()
The code identifies the error.int
getErrorType()
The error type identifies what information will be displayed in the error message.protected java.lang.String
getKeyAttribute()
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 thegetKey
andsetKey
methods.java.lang.String
getMessage(Messages messages)
Returns the string to display as Message for this error message.AbstractConfigurationElement.FilteredList
getMessageList()
Returns the list of messages associated with this error.java.lang.String
getTarget()
The target attribute indicates the page to which the user should be redirected when the error occurs.java.lang.String
getTitle(Messages messages)
Returns the string to display as title for this error message.AbstractConfigurationElement.FilteredList
getTitleList()
Returns the list of titles to display for this error.protected void
initDefaultAttributes()
This method can be overridden to set default values for attributes.void
setAllowIframe(boolean value)
Indicates whether this error condition can happened within an iFrame request for partial page update.void
setDisplayError(boolean value)
Indicates whether the application should render the title, message, and contact information when the error occurs.void
setErrorCode(int errorCode)
Set code that identifies the error.void
setErrorType(int errorType)
Set error typevoid
setMessageElement(java.lang.Object key, ConfigurationElement child)
void
setShowContactInfo(boolean value)
Indicates whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.void
setTarget(java.lang.String target)
Set the target page.void
setUseOriginalMessage(boolean value)
Indicates whether the application should display the original error message returned by the error object.boolean
showContactInfo()
Returns whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.boolean
useOriginalMessage()
Returns whether the application should display the original error message returned by the error object.-
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, 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, load, 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
-
NODE_ERROR
public static final java.lang.String NODE_ERROR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ErrorInfo
public ErrorInfo()
- Since:
- MicroStrategy Web 9.0.0
-
ErrorInfo
public ErrorInfo(org.w3c.dom.Node root)
Creates an ErrorInfo with the information in the Xml Node. Internally it callsAbstractConfigurationElement.initFromXML(org.w3c.dom.Node)
.- Parameters:
root
- the xml node.
-
-
Method Detail
-
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 thegetKey
andsetKey
methods.- Specified by:
getKeyAttribute
in classAbstractConfigurationElement
- Since:
- MicroStrategy Web 9.0.0
-
initDefaultAttributes
protected void initDefaultAttributes()
Description copied from class:AbstractConfigurationElement
This method can be overridden to set default values for attributes. Simply extend this method and callAbstractConfigurationElement.setAttribute(java.lang.String, java.lang.Object)
- Overrides:
initDefaultAttributes
in classAbstractConfigurationElement
- Since:
- MicroStrategy Web 9.0.0
-
getTitle
public java.lang.String getTitle(Messages messages)
Returns the string to display as title for this error message. This string is the result of the concatenation of all the title nodes of this error. If a Messages instance is provided, the string will be localized using the strings bundle.
-
getMessage
public java.lang.String getMessage(Messages messages)
Returns the string to display as Message for this error message. This string is the result of the concatenation of all the title nodes of this error. If a Messages instance is provided, the string will be localized using the strings bundle. TODO: Enhance this method to properly consider useOriginalMessage option. It should either take in the original message as an additional parameter, or potentially the Exception/error. However, the errors and exceptions don't always have a common parent or common way of retrieving the original message, so passing the original string would probably be best.
-
setMessageElement
public void setMessageElement(java.lang.Object key, ConfigurationElement child)
-
getErrorCode
public int getErrorCode()
The code identifies the error. This can be an error code from the Intelligence Server or a value from the EnumWebAppErrorCodes interface.
-
setErrorCode
public void setErrorCode(int errorCode)
Set code that identifies the error. This can be an error code from the Intelligence Server or a value from the EnumWebAppErrorCodes interface.- Since:
- MicroStrategy Web 9.0.0
-
getErrorType
public int getErrorType()
The error type identifies what information will be displayed in the error message. Possible values are: 1 - system error; 2 - user error. For system errors we display the title, info, and error message where the info looks like:Your request could not be processed due to a server error.
Please try again. If the error persists, contact the server administrator.For user errors we skip the info part.
- Since:
- MicroStrategy Web 9.0.0
-
setErrorType
public void setErrorType(int errorType)
Set error type- Since:
- MicroStrategy Web 9.0.0
-
getTarget
public java.lang.String getTarget()
The target attribute indicates the page to which the user should be redirected when the error occurs. If a target is not specified (it's eithernull
or an empty string, the execution continues on the same page.
-
setTarget
public void setTarget(java.lang.String target)
Set the target page. The target indicates the page to which the user should be redirected when the error occurs. If a target is not specified (it's eithernull
or an empty string, the execution continues on the same page.- Since:
- MicroStrategy Web 9.0.0
-
showContactInfo
public boolean showContactInfo()
Returns whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.
-
setShowContactInfo
public void setShowContactInfo(boolean value)
Indicates whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.- Since:
- MicroStrategy Web 9.0.0
-
displayError
public boolean displayError()
Returns whether the application should render the title, message, and contact information when the error occurs.
-
setDisplayError
public void setDisplayError(boolean value)
Indicates whether the application should render the title, message, and contact information when the error occurs.- Since:
- MicroStrategy Web 9.0.0
-
useOriginalMessage
public boolean useOriginalMessage()
Returns whether the application should display the original error message returned by the error object. (This is the error message generated on the back-end.)
-
setUseOriginalMessage
public void setUseOriginalMessage(boolean value)
Indicates whether the application should display the original error message returned by the error object. (This is the error message generated on the back-end.)- Since:
- MicroStrategy Web 9.0.0
-
setAllowIframe
public void setAllowIframe(boolean value)
Indicates whether this error condition can happened within an iFrame request for partial page update. If "false", even if it's an iframe-request, the whole page gets refreshed.
-
allowIframe
public boolean allowIframe()
Returns whether this error condition can happened within an iFrame request for partial page update. If "false", even if it's an iframe-request, the whole page gets refreshed.
-
getMessageList
public AbstractConfigurationElement.FilteredList getMessageList()
Returns the list of messages associated with this error. The error message displayed to the user will be the linear concatenation of these.- Since:
- MicroStrategy Web 9.0.0
-
addMessage
public void addMessage(ErrorInfo.ErrorMessage msg)
- Since:
- MicroStrategy Web 9.0.0
-
getTitleList
public AbstractConfigurationElement.FilteredList getTitleList()
Returns the list of titles to display for this error. The final title displayed to the user will be the linear concatenation of them.- Since:
- MicroStrategy Web 9.0.0
-
addTitle
public void addTitle(ErrorInfo.ErrorTitle title)
- Since:
- MicroStrategy Web 9.0.0
-
-