Package com.microstrategy.web.beans
Class GenericMultipleEvents
- java.lang.Object
-
- com.microstrategy.web.beans.GenericWebEvent
-
- com.microstrategy.web.beans.GenericMultipleEvents
-
- All Implemented Interfaces:
WebEvent,WebEvents,WebEventTags,java.lang.Cloneable
public class GenericMultipleEvents extends GenericWebEvent implements WebEvents
TheGenericMultipleEventsclass represents an event that encompasses multiple events. You can add and manage various events throught this helper class.Here is an example of using this
GenericMultipleEventsclass to create a HTML URL link to execute a report and answer its prompts with their default prompt answers in one shot.
Since we do not have a Web application to test the above HTML URL link, let's try to mimic a Web application by creating a// Suppose you have created an Intelligence Server session WebIServerSession wiss = null; // Create a report bean with the default report event handler ReportBean rb = WebBeanFactory.getInstance().newReportBean(); rb.setSessionInfo(wiss); // Create a multiple-events event helper and set an event source on it GenericMultipleEvents gme = WebEventHandlerFactory.getInstance().newMultipleEventHelper(); gme.setSource(rb); // Create an execute-report event and add it to the multiple events WebEvent execReportEvent = rb.getWebEventHandler().getWebEvent(EnumReportBeanEvents.REPORT_EVENT_EXECUTE); execReportEvent.setArgumentValue(EnumReportBeanEvents.REPORT_EVENT_ARGUMENT_REPORT_ID, REPORT_ID); gme.addEvent(execReportEvent); // add the execute report event // Create an answer-all-prompts event, use the default answers for all prompts WebEvent answerPromptEvent = rb.getPromptsBean().getWebEvent(EnumPromptsBeanEvents.PROMPTS_EVENT_ANSWER_ALL_PROMPTS); gme.addEvent(answerPromptEvent); // add the answer prompt event // Build an HTML URL link using the ParameterBuilder ParameterBuilder builder = new DefaultURIBuilderImpl(); builder.addEventInfo(gme, EnumEventElement.EventElementTypicalURLLink, EnumWebPersistableState.MINIMAL_STATE_INFO); System.out.println(builder.toString()); // This the URL link for the multiple-events eventRequestKeysobject.// Create a RequestKeys object RequestKeys keys = new GenericRequestKeys() { protected void initializeRequestKeys() { }; }; // Mimic the URL link to add the event information into the RequestKeys object keys.add(GenericWebEvent.URL_EVENT_NAME, String.valueOf(EnumGenericEvents.GENERIC_EVENT_PROCESS_MULTIPLE_EVENTS)); keys.add("events", gme.getArgumentValue(EnumGenericEvents.GENERIC_EVENT_ARGUMENT_MULTIPLE_EVENTS)); // Handle the event and then collect data on the report bean rb.handleRequest(keys); rb.collectData();- Since:
- MicroStrategy Web 8.0.0
-
-
Field Summary
-
Fields inherited from class com.microstrategy.web.beans.GenericWebEvent
URL_DEFAULT_EVENT_LIST, URL_EVENT_NAME, URL_EVENT_ORDER_NAME, URL_SOURCE_NAME
-
Fields inherited from interface com.microstrategy.web.beans.WebEventTags
ATT_ARGUMENT_ENUMERATOR, ATT_ARGUMENT_ID, ATT_ARGUMENT_INDEX, ATT_ARGUMENT_NAME, ATT_ARGUMENT_REQUIRED, ATT_ARGUMENT_TYPE, ATT_ARGUMENT_VALIDATOR, ATT_ARGUMENT_VALUE, ATT_EVENT_DEPRECATED, ATT_EVENT_ENUMERATOR, ATT_EVENT_HANDLER_ENUMERATOR, ATT_EVENT_HANDLER_NAME, ATT_EVENT_HANDLER_TYPE, ATT_EVENT_ID, ATT_EVENT_NAME, ATT_EVENT_TARGET, TAG_ARGUMENT, TAG_ARGUMENTS, TAG_EVENT, TAG_EVENT_HANDLER, TAG_EVENT_HANDLERS, TAG_EVENTS
-
-
Constructor Summary
Constructors Constructor Description GenericMultipleEvents()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvent(WebEvent event)Adds an event to the event collection of this object.voidclear()Clears the event collection held by this object.java.lang.Objectclone()Returns a copy of this object.WebEventget(int index)Returns aWebEventobject at the specified index.java.util.EnumerationgetArguments()Returns an Enumeration over all theWebEvent.Argumentin thisGenericMultipleEvents.java.lang.StringgetArgumentValue(int argumentID, int index)Returns the current value of the argument.java.util.ListgetEvents()Returns a list ofWebEventobjects encompassed in this object.WebEventremove(int index)Removes aWebEventobject at the specified index.-
Methods inherited from class com.microstrategy.web.beans.GenericWebEvent
areAllBitsSet, getArgumentName, getArgumentName, getArgumentValue, getArgumentValueCount, getDeprecatedMessage, getFlatState, getHandlerType, getHiddenInputs, getID, getName, getSource, getSourcePath, getTargetWindow, getURLLink, getURLLink, getURLParameters, getURLParameters, getURLParameters, init, initFromKeys, initFromXML, initFromXML, isAnyBitSet, putArgument, putArgument, putArgument, setArgumentValue, setArgumentValue, setDeprecationMessage, setHandlerType, setID, setName, setSource, setSourcePath, setTargetWindow, toString, validateRequiredArguments
-
-
-
-
Method Detail
-
addEvent
public void addEvent(WebEvent event)
Adds an event to the event collection of this object.
-
getEvents
public java.util.List getEvents()
Returns a list ofWebEventobjects encompassed in this object.
-
clear
public void clear()
Clears the event collection held by this object.
-
clone
public java.lang.Object clone()
Returns a copy of this object. The event collection in the cloned object is empty.- Overrides:
clonein classGenericWebEvent- Returns:
- a cloned
GenericMultipleEvents
-
getArguments
public java.util.Enumeration getArguments()
Returns an Enumeration over all theWebEvent.Argumentin thisGenericMultipleEvents. The enumeration is backed up this event.- Specified by:
getArgumentsin interfaceWebEvent- Overrides:
getArgumentsin classGenericWebEvent- Returns:
- an Enumeration over all the
WebEvent.Argument.
-
getArgumentValue
public 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
- Specified by:
getArgumentValuein interfaceWebEvent- Overrides:
getArgumentValuein classGenericWebEvent- Parameters:
argumentID- ID of the argumentindex- the index into the set of argument values- Returns:
- the value of the argument
-
-