Interface WebEvent
-
- All Known Implementing Classes:
FolderViewTransform.ClientEvent,GenericMultipleEvents,GenericWebEvent,ServletEvent
public interface WebEventThis interface abstracts user interaction with aWebComponentin a Web application. Any user interaction may be viewed as an event. In a Web application, aWebEventcould appear as a URL link or a HTML form data, or whatever appropriate to the Web application.A
WebEventis attached to aWebEventHandler, which in turn is associated with a particularWebComponent. TheWebEventHandlerknows how to generate and handle its event.A
WebEventhas a list ofWebEvent.Argumentidentified by their unique ID within an event handler, which could also be uniquely identified by its own ID within an application. EachArgumentmay have many values.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceWebEvent.ArgumentTheArgumentinterface represents aWebEventargument.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetArgumentName(int id)Returns the argument name with the specifiedidat index 0.java.lang.StringgetArgumentName(int id, int index)Returns the argument name with the specifiedidat the specifiedindex.java.util.EnumerationgetArguments()Returns an Enumeration over all theWebEvent.Argumentin thisWebEvent.java.lang.StringgetArgumentValue(int argumentID)Returns the current value of the argument.java.lang.StringgetArgumentValue(int argumentID, int index)Returns the current value of the argument.intgetArgumentValueCount(int argumentID)Returns the number of values at different indices for the argument.java.lang.StringgetDeprecatedMessage()If this event has been marked deprecated, this method returns instructions on the new usage (usually the alternate event).java.lang.StringgetFlatState()FlatStateSerializerrepresentation of event.java.lang.StringgetHiddenInputs(int paramType, int howMuchChildState)Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int).intgetID()Returns the event ID of this event.java.lang.StringgetName()Returns the name of this event.WebComponentgetSource()Returns the event source, aWebComponentobject which knows how to generate and handle this event.java.lang.StringgetSourcePath()Returns the path of aWebComponentwhich knows how to generate and handle this WebEvent.java.lang.StringgetTargetWindow()returns the target specified for this eventjava.lang.StringgetURLLink()Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int).java.lang.StringgetURLLink(int paramType)Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int).java.lang.StringgetURLParameters()Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int).voidinitFromKeys(RequestKeys keys)Initialize the event with the given request keysbooleaninitFromXML(java.lang.String xml)Initializes this event based on its specified XML definition.voidputArgument(int id, java.lang.String name)voidputArgument(int id, java.lang.String name, int required)voidputArgument(int id, java.lang.String name, java.lang.String value)voidsetArgumentValue(int id, int index, java.lang.String value)Sets a value to the argument with the specifiedidat the specifiedindex.voidsetArgumentValue(int id, java.lang.String value)Sets a value to the argument with the specifiedidat index 0.voidsetID(int id)Sets an event id to the currentWebEvent.voidsetSource(WebComponent source)Sets aWebComponentinstance which knows how to generate and handle this WebEvent.voidsetSourcePath(java.lang.String source)Sets the path of aWebComponentwhich knows how to generate and handle this WebEvent.voidsetTargetWindow(java.lang.String target)Sets the target attribute for this event.
-
-
-
Method Detail
-
getID
int getID()
Returns the event ID of this event. The ID is unique within an event handler.- Returns:
- the unique ID of this event.
-
setID
void setID(int id)
Sets an event id to the currentWebEvent.- Parameters:
id- an event id to set.
-
getName
java.lang.String getName()
Returns the name of this event.- Returns:
- the name of this event.
-
getArgumentName
java.lang.String getArgumentName(int id)
Returns the argument name with the specifiedidat index 0. AWebEventHandleruses this argument name to retrieve its value from anRequestKeysinstance.- Parameters:
id- the argument ID.- Returns:
- the argument name with the specified id at index 0. null if there is no such an argument existing.
-
getArgumentName
java.lang.String getArgumentName(int id, int index)Returns the argument name with the specifiedidat the specifiedindex. AWebEventHandleruses this argument name to retrieve its value from anRequestKeysinstance.By default, if the an argument name at the given index is null, this method returns the string concatenation of the argument name at index 0, the underscore character '_', and the index value, i.e. arg_1. If the argument name at index 0 is also null, then a null string is returned.
- Parameters:
id- an argument ID.index- the index to an argument name.- Returns:
- the argument name with the specified id and index.
-
setArgumentValue
void setArgumentValue(int id, java.lang.String value)Sets a value to the argument with the specifiedidat index 0. A new argument withnullname is created if there is no such an argument at index 0.- Parameters:
id- an argument ID.value- the argument value to set.
-
setArgumentValue
void setArgumentValue(int id, int index, java.lang.String value)Sets a value to the argument with the specifiedidat the specifiedindex. A new argument is created if there is no such an argument.The name of the new argument by default is the string concatenation of the argument name at index 0, the character underscore '_' and the index value, i.e. arg_1. If the argument at index 0 does not exist either, null is assigned.
- Parameters:
id- an argument ID.index- an index where the value is set.value- an argument value to set.
-
getArgumentValue
java.lang.String getArgumentValue(int argumentID)
Returns the current value of the argument. The default value is returned if one is specified in the definition of this event.If not, the value set explicitly is returned. If the value is set with multiple indices, then the value at index 0 is returned
If the argument is not found or no value is set, null is returned
- Parameters:
argumentID- the ID of the argument- Returns:
- the value of the argument
-
getArgumentValue
java.lang.String getArgumentValue(int argumentID, int index)Returns the current value of the argument. The default value is returned if one is specified in the definition of this event.If not, the value set explicitly is returned.
If the argument is not found or no value is set, null is returned
- Parameters:
argumentID- ID of the argumentindex- the index into the set of argument values- Returns:
- the value of the argument
-
getArgumentValueCount
int getArgumentValueCount(int argumentID)
Returns the number of values at different indices for the argument.- Parameters:
argumentID- ID of the argument- Returns:
- the count of the values
-
getSource
WebComponent getSource()
Returns the event source, aWebComponentobject which knows how to generate and handle this event.- Returns:
- source a WebComponent object.
-
setSource
void setSource(WebComponent source)
Sets aWebComponentinstance which knows how to generate and handle this WebEvent.- Parameters:
source- a WebComponent instance.
-
getSourcePath
java.lang.String getSourcePath()
Returns the path of aWebComponentwhich knows how to generate and handle this WebEvent.- Returns:
- the path of a WebComponent
-
setSourcePath
void setSourcePath(java.lang.String source)
Sets the path of aWebComponentwhich knows how to generate and handle this WebEvent.- Parameters:
source- the path of a WebComponent
-
getURLLink
@Deprecated java.lang.String getURLLink()
Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int). Callers should first access aParameterBuilderand pass it intoParameterBuilder.addEventInfo(WebEvent, int, int)to be populated with event information. To get aParameterBuilderobject, seeContainerServices.newURIParameterBuilder(),ContainerServices.newHiddenInputParameterBuilder(),DefaultHiddenInputBuilderImplorDefaultURIBuilderImpl. The caller can then use theParameterBuilder.toString()method to retrieve the string representation of all the parameters Depending on the type of ParameterBuilder that is used, the string representation varies. For getting a url link, the caller should use theDefaultURIBuilderImplReturns a URL link representing the currentWebEvent. The generated URL link includes the target name, event id, event source, as well as non-null arguments.This method is equivalent to call
getURLLink(EnumParameterType.ParameterTypeSystem + EnumParameterType.ParameterTypeUserNonNull, EnumWebPersistableState.TYPICAL_STATE_INFO)- Returns:
- an URL link representing this event.
-
getURLLink
@Deprecated java.lang.String getURLLink(int paramType)
Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int). Callers should first access aParameterBuilderand pass it intoParameterBuilder.addEventInfo(WebEvent, int, int)to be populated with event information. To get aParameterBuilderobject, seeContainerServices.newURIParameterBuilder(),ContainerServices.newHiddenInputParameterBuilder(),DefaultHiddenInputBuilderImplorDefaultURIBuilderImpl.Returns a URL link representing the currentWebEventwith the specifiedparamType.This method is equivalent to call
getURLLink(paramType, EnumWebPersistableState.TYPICAL_STATE_INFO)- Parameters:
paramType- a bitwise value indicating what to include in the generated URL link.- Returns:
- an URL link representing this event.
-
getHiddenInputs
@Deprecated java.lang.String getHiddenInputs(int paramType, int howMuchChildState)Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int). Callers should first access aParameterBuilderand pass it intoParameterBuilder.addEventInfo(WebEvent, int, int)to be populated with event information. To get aParameterBuilderobject, seeContainerServices.newURIParameterBuilder(),ContainerServices.newHiddenInputParameterBuilder(),DefaultHiddenInputBuilderImplorDefaultURIBuilderImpl.Returns HTML form hidden inputs for the currentWebEvent. The format is like: <INPUT TYPE=HIDDEN NAME="" VALUE="" ID="" >.If the
paramTypeis equal toEnumParameterType.ParameterTypeEventOnly, no source component's state is included; otherwise, the states of the sourceWebComponentalong with all its descendants are included.- Parameters:
paramType- a bitwise value fromEnumParameterTypeindicating what to include in the generated URL link.howMuchChildState- how much state ofEnumWebPersistableStateto return from its children- Returns:
- HTML form hidden inputs for the current WebEvent.
-
getURLParameters
@Deprecated java.lang.String getURLParameters()
Deprecated.As of WU 8.0, replaced byParameterBuilder.addEventInfo(WebEvent, int, int). Callers should first access aParameterBuilderand pass it intoParameterBuilder.addEventInfo(WebEvent, int, int)to be populated with event information.Returns a URL link including event id, event source and user arguments whose value is not null, but excluding the source component's state.This method call is equivalent to call
getURLParameters(EnumParameterType.ParameterTypeSystem + EnumParameterType.ParameterTypeUserNonNull)- Returns:
- an URL link for arguments.
- See Also:
ContainerServices.newURIParameterBuilder(),ContainerServices.newHiddenInputParameterBuilder(),DefaultHiddenInputBuilderImpl,DefaultURIBuilderImpl
-
getArguments
java.util.Enumeration getArguments()
Returns an Enumeration over all theWebEvent.Argumentin thisWebEvent. The enumeration is backed up this event.- Returns:
- an Enumeration over all the
WebEvent.Argument.
-
initFromXML
boolean initFromXML(java.lang.String xml)
Initializes this event based on its specified XML definition.- Parameters:
xml- an XML string representing aWebEvent.- Returns:
- true if initialization succeeds; false otherwise.
-
getTargetWindow
java.lang.String getTargetWindow()
returns the target specified for this event- Returns:
- the target associated with this event.
-
setTargetWindow
void setTargetWindow(java.lang.String target)
Sets the target attribute for this event. This is useful in redirecting the result of an action into a separate browser When a link for this event is generated, the target attribute is included if a non null value is set.- Parameters:
target-
-
initFromKeys
void initFromKeys(RequestKeys keys)
Initialize the event with the given request keys- Parameters:
keys- the request keys to be used by this event
-
getDeprecatedMessage
java.lang.String getDeprecatedMessage()
If this event has been marked deprecated, this method returns instructions on the new usage (usually the alternate event). Null is returned if the event hasn't been deprecated.
- Returns:
- further instructions if this event has been been deprecated
- Since:
- MicroStrategy Web 8.0.0
-
getFlatState
java.lang.String getFlatState()
FlatStateSerializerrepresentation of event. Structure is as follows:id:nextStr, src:nextStr, [argName:nextStr, argValue:nextStr]*
- Returns:
- the flat state of this event.
- Since:
- MicroStrategy Web 8.0.0
-
putArgument
void putArgument(int id, java.lang.String name)- Since:
- MicroStrategy Web 9.0.0
-
putArgument
void putArgument(int id, java.lang.String name, java.lang.String value)- Since:
- MicroStrategy Web 9.0.0
-
putArgument
void putArgument(int id, java.lang.String name, int required)- Since:
- MicroStrategy Web 9.0.0
-
-