MicroStrategy ONE

Using the URL API to Access a MicroStrategy Web Page

To access a MicroStrategy page, you use the evt and src parameters in the URL.

evt

Every out-of-the-box action in MicroStrategy Web is associated with a specific event. The evt parameter in the URL (evt is short for “event”) specifies that event. Each event corresponds to an event code— either a MicroStrategy-defined out-of-the-box event code or a user-defined custom event code. You set the evt parameter to the code of the event, or action, that you want to take place. For example, to execute a report, you would set the evt parameter to "4001", while you would set it to "3002" to display the Shared Reports page.

The event definition file, events.xml, contains information about which MicroStrategy-defined events are mapped to which event codes. It also provides information about required and optional parameters that must or can be used with each event to refine a specific request. Refer to the Event Handlers Reference for access to the information in this file. Information about user-defined events and event codes is stored in plug-ins (that is, custom user-defined XML event definition files), which can be created using the Web Customization Editor.

src

The src parameter (src is short for “source”) specifies the MicroStrategy Web application component that you wish to perform the handling of the specified event. The src parameter allows you to specify the page that should be executed, as well as the particular bean on that page that should be used, if desired. For example, if you create a custom page with multiple beans, the src parameter allows you to specify exactly which bean should be used for a particular event. The structure of the src parameter reflects the hierarchy of the page and its component beans, as shown below.

J2EE environment:

src = mstrWeb.<page>.<bean>.<child bean>.<event ID>

.NET environment:

src=Main.aspx. <page> . <bean> . <child bean> . <event ID>

This path is built using the hierarchy to a component in a page in the Page Configuration file. There can be as many nested child beans as are included in the bean hierarchy in the page.

The sample URLs below show the evt and src parameters required to display the contents of the "Customer Analysis" folder in the Shared Reports page in the MicroStrategy Tutorial.

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?evt=2001&src=mstrWeb.shared.fb.2001&folderID=78AAF4654A62E9D384D0E094BE585507&...

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?evt=2001&src=Main.aspx.shared.fb.2001&folderID=78AAF4654A62E9D384D0E094BE585507&...

While t is possible to access certain pages in certain circumstances using only the src parameter, the recommended practice is to always include the evt parameter.

The sections below describe how to use the URP API to access both an out-of-the-box MicroStrategy Web page that is provided for you and a custom page that you have built.

Accessing an Out-of-the-Box MicroStrategy Web Page

In the out-of-the-box MicroStrategy Web product, certain events specified by the evt parameter are automatically mapped to a particular MicroStrategy Web page. For example, to export a document to PDF, you need to create a URL that includes the event that accesses the "RW Fast Export PDF" page. The "RW Fast Export PDF" page is defined in the Page Configuration file as follows:

<page allow-cancel="false"desc="RW Fast Export PDF"desc-id="mstrWeb.246" feature-id="" login-required="true" name="rwFastExport" persist-mode="8" track="false">

The desc attribute for this page is set to "RW Fast Export PDF" and the name attribute is set to "rwFastExport". To find the value to use for the evt parameter in the URL (that is, the ID of the event that is mapped to this page), open events.xml and search for an event whose target attribute is set to "rwFastExport" (that is, the same value as the name attribute of the "RW Fast Export PDF" page).

<eventid="3069"name="rwFastPDFExport"target="rwFastExport">

   <arguments>

      <argument id="3001" name="documentID" />

      <argument id="3010" name="messageID" />

      <argument id="3029" name="triggerID" />

      ...

   </arguments>

</event>

Sample URLs for exporting a Report Services document to PDF are shown below. Because the ID of the event associated with the "RW Fast Export PDF" page is "3069", the evt parameter in the URL is set to "3069". When the request is received, MicroStrategy Web application uses this value to redirect the request to the target associated with this event ID— that is, the MicroStrategy Web page with the name "rwFastExport".

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?evt=3069&...other URL parameters...

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?evt=3069&...other URL parameters...

The URL can also have other optional or required parameters, identified by the <argument> child elements of the <event> element in the event definition file.

It is possible for multiple events to be mapped to the same MicroStrategy Web page (that is, target attribute). For example, there are several events in events.xml that have the name of the Report Execution page (that is, the page whose name attribute is defined as "report" in the Page Configuration file) as the value of their target attribute. In such cases, the values of the ID and name attributes specify the action that will be taken.

<event id="4001" name="runReport" target="report">

  <arguments>

     ...

  </arguments>

</event>

...

<event id="3005" name="editReport" target="report">

  <arguments>

     ...

  </arguments>

</event>

In the example shown above, the Report Execution page is accessed for both events, but the value of the ID attribute specifies the action that will be taken— evt=4001 to execute a report and evt=3005 to edit a report— and the name attribute describes that action.

In addition to the evt and src parameters, the URL can also contain general parameters, authentication parameters, and prompt-answering parameters. For general information on these parameters, see MicroStrategy URL Parameters. For information on using the other parameters, refer to the following scenarios:

The Event Handlers Reference provides a comprehensive list of all event handlers along with the names and IDs of all events and arguments.

Accessing a Custom MicroStrategy Web Page

In order to access a custom page, you must always use both the evt and src parameters as part of the request. The src parameter should contain the path to your page so the event is handled by the new page instead of the original page. For example, if you created a copy of the "Report Execution" page and named it "my_report", the src parameter would be:

J2EE environment:

src=mstrWeb.my_report.4001

.NET environment:

src=Main.aspx.my_report.4001

The URL for the custom page would be:

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.my_report.4001&...

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?evt=4001&src=Main.aspx.my_report.4001&...

The sample URLs shown above assume that you want to use the default behavior rather than specifying the bean. If you create multiple custom beans in the custom page, you can use the src parameter to specify exactly which bean should be used when the page is displayed, as illustrated in the URLs below:

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.my_report.myBean.4001&...

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?evt=4001&src=Main.aspx.my_report.myBean.4001&...

There is another parameter that can be used to access MicroStrategy Web pages, but it is not recommended that you use it. The pg parameter (pg is short for “page”) is provided primarily as a convenience for accessing non-contextual pages. The description for the pg parameter in the MicroStrategy URL Parameters topic lists all the MicroStrategy Web pages for which the pg parameter is supported. The sample URLs below illustrate how to use the pg parameter to access a custom page called "myCustomPage".

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?pg=myCustomPage

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?pg=myCustomPage

See also