public class

ExpressionPromptEventHandlerImpl

extends SysEventHandler
implements EnumPromptBeanEvents
java.lang.Object
   ↳ com.microstrategy.web.beans.GenericEventHandler
     ↳ com.microstrategy.web.beans.SysEventHandler
       ↳ com.microstrategy.web.beans.ExpressionPromptEventHandlerImpl

Summary

Constants
String IMAGE_SUFFIX_X
String IMAGE_SUFFIX_Y
String NONE_OPTION_ID
String POSITION_MARK
String WILDCARD
[Expand]
Inherited Constants
From class com.microstrategy.web.beans.SysEventHandler
From class com.microstrategy.web.beans.GenericEventHandler
From interface com.microstrategy.web.beans.EnumPromptBeanEvents
From interface com.microstrategy.web.beans.WebEventTags
Fields
protected WebEvent _event
protected RequestKeys _keys
protected int _position
[Expand]
Inherited Fields
From class com.microstrategy.web.beans.GenericEventHandler
Public Constructors
ExpressionPromptEventHandlerImpl()
Public Methods
boolean processRequest(RequestKeys keys)
Logic to process the event.
Protected Methods
void applyLocalSettings(WebObjectSource wos)
Sets minimal flags on the WebObjectSource
boolean checkClearAnswer(String answer)
Based on the Prompt answer option and the answer string, this method calls clear prompt answer.
WebPromptAnswer getAnswerByID()
int getAnswerFormat(int position)
Returns the answer Format being used from the request keys
int getAppendedIntValue(String str, int defVal)
Return the integer value from the string.
String getIncrementalFetchParameter(int arg, int position)
Returns the incremental fetch parameter value.
int getIntValue(String str, int defaultVal)
Returns the integer value from the string
int getIntValue(String str, String msg)
Returns the int value based on the String.
WebObjectInfo getObject(AbstractPromptEventHandlerImpl.MdObject mObj)
Returns the WebObjectInfo associated with the MdObject
WebObjectSource getObjectSource()
Returns the WebObjectSource from the WebObjectsFactory
WebObjectsFactory getObjectsFactory()
Returns the WebObjectsFactory associated with the session.
WebPromptAnswer getPromptAnswer()
WebSessionInfo getSessionInfo()
Returns the WebSessionInfo object associated with the prompt This method throws an IllegalStateException if the session is null.
String[] getValuesFromRequest(int arg, int index, String delim)
Returns a string array containing values corresponding to the argument from the request keys collection.
boolean handleCancelPrompt()
Cancels the web prompt
void initUsingKeys(RequestKeys keys)
Initialize the event handler using the request keys Sets up protected variables _keys, _event,_position
void savePromptAnswer()
void setReuseOnPromptAnswer(WebPromptAnswer pa, WebUserAnswers userAnswers)
void setSavedPromptAnswer(WebPromptAnswer pa)
[Expand]
Inherited Methods
From class com.microstrategy.web.beans.SysEventHandler
From class com.microstrategy.web.beans.GenericEventHandler
From class java.lang.Object
From interface com.microstrategy.web.beans.WebEventHandler

Constants

protected static final String IMAGE_SUFFIX_X

Constant Value: ".x"

protected static final String IMAGE_SUFFIX_Y

Constant Value: ".y"

protected static final String NONE_OPTION_ID

Constant Value: "0"

protected static final String POSITION_MARK

Constant Value: "_"

protected static final String WILDCARD

Constant Value: "*"

Fields

protected WebEvent _event

protected RequestKeys _keys

protected int _position

Public Constructors

public ExpressionPromptEventHandlerImpl ()

Public Methods

public boolean processRequest (RequestKeys keys)

Logic to process the event. Specific event handler implementation extending this class will need to override the default behavior.

Parameters
keys the RequestKeys object containing event ID, sources, and any other information.
Returns
  • true if handling succeeds; false if the event is ignored and not handled.
Throws
WebException

Protected Methods

protected void applyLocalSettings (WebObjectSource wos)

Sets minimal flags on the WebObjectSource

Parameters
wos - WebObjectSource

protected boolean checkClearAnswer (String answer)

Based on the Prompt answer option and the answer string, this method calls clear prompt answer.

Parameters
answer - answer for the prompt
Returns
  • true if the method is successful

protected WebPromptAnswer getAnswerByID ()

protected int getAnswerFormat (int position)

Returns the answer Format being used from the request keys

Parameters
position the prompt position
Returns
Throws
WebException - if the answer format is unrecognized

protected int getAppendedIntValue (String str, int defVal)

Return the integer value from the string. If the string has a prefix, it removes the prefix and returns the appended integer value

Parameters
str - the String to parse
defVal - the default value if the parsing fails
Returns
  • the integer value which is appended at the end of the string

protected String getIncrementalFetchParameter (int arg, int position)

Returns the incremental fetch parameter value. The value can be either a prefixed key or it could be just a value.

Parameters
arg - int the event argument id.
position - the position of the argument.
Returns
  • String the value for the parameter.

protected int getIntValue (String str, int defaultVal)

Returns the integer value from the string

Parameters
str - the String to be parsed
defaultVal - the default value to be returned if the parsing fails
Returns
  • - the integer value from the parsed string

protected int getIntValue (String str, String msg)

Returns the int value based on the String. If there is an error, throws a WebException with the error message.

Parameters
str - String to parse.
msg - Error message when there is a parsing error.
Returns
  • the parsed integer value from the string
Throws
WebException - when the String could not be converted to integer.

protected WebObjectInfo getObject (AbstractPromptEventHandlerImpl.MdObject mObj)

Returns the WebObjectInfo associated with the MdObject

Parameters
mObj - MdObject
Returns
  • the WebObjectInfo
Throws
WebObjectsException if the object cannot be retrieved

protected WebObjectSource getObjectSource ()

Returns the WebObjectSource from the WebObjectsFactory

Returns
  • the WebObjectSource from the WebObjectsFactory

protected WebObjectsFactory getObjectsFactory ()

Returns the WebObjectsFactory associated with the session.

Returns
  • WebObjectsFactory

protected WebPromptAnswer getPromptAnswer ()

protected WebSessionInfo getSessionInfo ()

Returns the WebSessionInfo object associated with the prompt This method throws an IllegalStateException if the session is null.

Returns
  • WebSessionInfo object associated with the prompt

protected String[] getValuesFromRequest (int arg, int index, String delim)

Returns a string array containing values corresponding to the argument from the request keys collection.

Parameters
arg - the argument id for the argument
index - the position in the collection
delim - the delimiter string. If the delimiter is specified, argument value is separated by the delimiter.
Returns
  • the string array of values

protected boolean handleCancelPrompt ()

Cancels the web prompt

Returns
  • - true if there is no exception

protected void initUsingKeys (RequestKeys keys)

Initialize the event handler using the request keys Sets up protected variables _keys, _event,_position

Parameters
keys - the request keys

protected void savePromptAnswer ()

Throws
WebException

protected void setReuseOnPromptAnswer (WebPromptAnswer pa, WebUserAnswers userAnswers)

protected void setSavedPromptAnswer (WebPromptAnswer pa)