public class

GenericMultipleEvents

extends GenericWebEvent
implements WebEvents
java.lang.Object
   ↳ com.microstrategy.web.beans.GenericWebEvent
     ↳ com.microstrategy.web.beans.GenericMultipleEvents

Class Overview

The GenericMultipleEvents class 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 GenericMultipleEvents class to create a HTML URL link to execute a report and answer its prompts with their default prompt answers in one shot.


 			// 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 event
 
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 RequestKeys object.

			// 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();
 

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.beans.WebEventTags
[Expand]
Inherited Fields
From class com.microstrategy.web.beans.GenericWebEvent
Public Constructors
GenericMultipleEvents()
Public Methods
void addEvent(WebEvent event)
Adds an event to the event collection of this object.
void clear()
Clears the event collection held by this object.
Object clone()
Returns a copy of this object.
WebEvent get(int index)
Returns a WebEvent object at the specified index.
String getArgumentValue(int argumentID, int index)
Returns the current value of the argument.
Enumeration getArguments()
Returns an Enumeration over all the WebEvent.Argument in this GenericMultipleEvents.
List getEvents()
Returns a list of WebEvent objects encompassed in this object.
WebEvent remove(int index)
Removes a WebEvent object at the specified index.
[Expand]
Inherited Methods
From class com.microstrategy.web.beans.GenericWebEvent
From class java.lang.Object
From interface com.microstrategy.web.beans.WebEvent
From interface com.microstrategy.web.beans.WebEvents

Public Constructors

public GenericMultipleEvents ()

Public Methods

public void addEvent (WebEvent event)

Adds an event to the event collection of this object.

Parameters
event an event to add.

public void clear ()

Clears the event collection held by this object.

public Object clone ()

Returns a copy of this object. The event collection in the cloned object is empty.

Returns
  • a cloned GenericMultipleEvents

public WebEvent get (int index)

Returns a WebEvent object at the specified index.

Parameters
index the position of the event to retrieve.
Returns
  • a WebEvent object at the specified index.

public 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 argument
index the index into the set of argument values
Returns
  • the value of the argument

public Enumeration getArguments ()

Returns an Enumeration over all the WebEvent.Argument in this GenericMultipleEvents. The enumeration is backed up this event.

Returns
  • an Enumeration over all the WebEvent.Argument.

public List getEvents ()

Returns a list of WebEvent objects encompassed in this object.

Returns

public WebEvent remove (int index)

Removes a WebEvent object at the specified index.

Parameters
index the position of the event to be removed.
Returns