MicroStrategy ONE
Persisting Information in Every Request
In some instances, you may want certain information to be persisted from page to page, link to link, in the application. For example, in a portal environment, you may want to persist the session ID so that session information can be retrieved. You may also want to persist other information such as the browser or user preference locale information, regardless of the environment. The application can then use this information to customize certain aspects of the page presented to the user.
In this scenario, you will persist locale information specifying that Spanish is the language of the locale. You will accomplish this by creating a simple text file that specifies the name of the parameter whose name/value pair you want to persist and then passing this parameter name/value pair in a URL. When MicroStrategy Web finds this parameter name/value pair in a URL, it automatically passes it in every subsequent request, ensuring that the value associated with the parameter name remains available at all times. This scenario does not illustrate how this persisted information is actually used. You would need to write your own code to use the information.
This customization can be accomplished using either of the following methods:
Deploying the plug-in provided with MicroStrategy SDK
MicroStrategy SDK provides a plug-in (ZIP file) that can simply be extracted to thepluginsfolder to view the customization in MicroStrategy Web. The following steps guide you in locating the plug-in and deploying it.
-
Access the plug-in: JSP version or ASP .NET version.
-
Extract the plug-in to the plugins subfolder inside the MicroStrategy Web installation folder.
-
Launch MicroStrategy Web to view the customization.
-
Add the following parameter name/value pair to the request URL: localeInfo=3082.
localeInfo is the user-specified name of the parameter to be persisted and 3082 is the value that identifies the code page for the Spanish language. This value, which is associated with the parameter specified in the properties file, will be persisted after MicroStrategy Web finds it in a request.
A sample URL that passes this information is shown below:
J2EE environment:
mstrWeb?evt=3010&src=mstrWeb.3010&Project=MicroStrategy+Tutorial&loginReq=true&Port=0&Server=MYISERVER1&...0_&localeInfo=3082
.NET environment:
Main.aspx?evt=3010&src=Main.aspx.3010&Project=MicroStrategy+Tutorial&loginReq=true&Port=0&Server=MYISERVER&...0_&localeInfo=3082
After you have created and saved the properties file and passed the parameter in a URL, the application automatically persists the parameters specified in the file. By default, the application looks for the properties file, and, if it exists, checks each request for the parameter names listed in the file. If it finds a matching parameter name in a URL, it persists that parameter name/value pair in every subsequent request in the session.
Unless you are persisting information that the application can handle by default, you must provide the code to handle the custom information that you are persisting.
Using the Web Customization Editor to create a plug-in
MicroStrategy SDK provides a Web Customization Editor that can be used to create a customization plug-in. The following steps guide you in creating the plug-in and deploying it.
-
Create a new plug-in and give it a meaningful name. For example: PersistingInfoEveryRequest.
-
Exit the Web Customization Editor.
-
Create a properties file, ParameterBuilder.properties, with the following code. Note that localeInfo is the user-specified name of a parameter whose name/value pair should be persisted.
persist=localeInfo
Unless you specifically want to change the default behavior of the application, you should not use a MicroStrategy Web reserved parameter name as the value for persist in the ParameterBuilder.properties file.
-
Save this properties file, ParameterBuilder.properties, in the plugins\pluginName\WEB-INF\classes subfolder inside the MicroStrategy Web installation folder. For example: plugins\PersistingInfoEveryRequest\WEB-INF\classes.
-
Launch MicroStrategy Web and add the following parameter name/value pair to the request URL: localeInfo=3082.
localeInfois the user-specified name of the parameter to be persisted and 3082 is the value that identifies the code page for the Spanish language. This value, which is associated with the parameter specified in the properties file, will be persisted after MicroStrategy Web finds it in a request.
A sample URL that passes this information is shown below:
J2EE environment:
mstrWeb?evt=3010&src=mstrWeb.3010&Project=MicroStrategy+Tutorial&loginReq=true&Port=0&Server=MYISERVER1&...0_&localeInfo=3082
.NET environment:
Main.aspx?evt=3010&src=Main.aspx.3010&Project=MicroStrategy+Tutorial&loginReq=true&Port=0&Server=MYISERVER&...0_&localeInfo=3082
After you have created and saved the properties file and passed the parameter in a URL, the application automatically persists the parameters specified in the file. By default, the application looks for the properties file, and, if it exists, checks each request for the parameter names listed in the file. If it finds a matching parameter name in a URL, it persists that parameter name/value pair in every subsequent request in the session.
Unless you are persisting information that the application can handle by default, you must provide the code to handle the custom information that you are persisting.
See Also