MicroStrategy ONE

Adding Extra Arguments to All Links

There may be instances when you want all the links on the Folder Browsing page to pass a parameter/value combination, such as the current session, to MicroStrategy Web. This is a typical customization in a portal implementation. If each portlet in the portal accesses a separate MicroStrategy project, each request originating from the Folder Browsing page within the portlet needs to contain information about the session (such as sessionID) such that MicroStrategy Web can access the correct MicroStrategy project for the request.

In this customization scenario, you modify the <a> (anchor) tag so that custom parameters and their values (param1=value1andparam2=value2) are passed in the request (URL) when any link on the Folder Browsing page is clicked.

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. 

  1. Access the plug-in: JSP version or ASP .NET version

  2. Extract the plug-in to the plugins subfolder inside the MicroStrategy Web installation folder.   

  3. Launch MicroStrategy Web to view the customization.

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. 

  1. Launch the Web Customization Editor

  2. Click on MicroStrategy Web Configuration inside the Application Settings view to expand the hierarchical tree. The expanded list comprises the different settings that can be modified to perform customizations. 

  3. Right-click Styles and select Create Transform to launch the Transform Creation Wizard

  4. Click Browse... next to the Source folder text field to select the src folder and click OK

  5. Enter the following information for the rest of the text fields.:

    Package: com.microstrategy.sdk.samples.transforms
    Name
    : FolderTransformExtraURLParams
    Transform description
    : This transform adds a couple of extra arguments to all hyperlinks.
    Superclass
    : com.microstrategy.web.app.transforms.FolderViewTransform 

  6. Click Next

  7. Click the radio button for Uncheck all methods

  8. Click Next

  9. Click Finish. FolderTransformExtraURLParams.java opens in the editor. 

  10. For this scenario, you override the generateAnchor(WebEvent event) method, and make other modifications as required. The sample, FolderTransformExtraURLParams.java, contains the entire code for this custom transform. You can use this code in FolderTransformExtraURLParameters.java that is open for editing. There is no limit to the number of parameters and values that you can specify to be passed in the URL request. Simply add additional lines of code that specify a parameter name and value, using the syntax illustrated in the code sample. 

  11. Save your changes. 

  12. Click on Styles in the Web Customization Editor to expand the list of styles used in MicroStrategy Web. 

  13. Double-click the FolderStyleIcon style. 

  14. Click the Change button next to the Transform text field. 

  15. Enter the name of the transform you created (FolderTransformExtraURLParams), select it from the Matching Types results and click OK

  16. Save your changes. 

  17. Double-click the FolderStyleList style. 

  18. Click the Change button next to the Transform text field. 

  19. Enter the name of the transform you created (FolderTransformExtraURLParams), select it from the Matching Types results and click OK

  20. Save your changes. 

  21. Launch MicroStrategy Web to view the customization.