MicroStrategy ONE

Adding Context Menu Items Not Implemented by Default

This customization scenario illustrates how to modify the menu items available on the drilling context menu for a report grid on the Report Execution page. By default, the context menu for drilling shows all possible drilling options. After you perform this customization, the context menu for drilling includes only one option— the ability to drill to the default drill map (that is, the same drilling option used by users when they click on an element).

Because the new drill map context menu item is not implemented by default and because it has a dependency with individual objects, you need to create a new builder class for this context menu item, but you do not need to create a custom transform. The three transforms that render a report grid on the Report Execution page— ReportDesignModeTransform, ReportGridTransform, and ReportOutlineModeTransform— already contain the logic to determine whether drilling is available for an object and know how to create the necessary Web event.

In this scenario, you are adding a context menu item that uses functionality that already exists (that is, the ability to drill to the drill map). However, you can also write custom code, such as events and transforms, to create new functionality and then add a context menu item to use that new functionality.

The example in this scenario differs from the examples in the Adding or Removing Context Menu Items scenario. In this scenario, the context menu item that you add has a dependency on the object that is right-clicked. Instead, the context menu items in the other scenario are generic and have no dependency on objects.

Before customization:

After customization:

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. Create a new plug-in and give it a meaningful name. For example: AddingCMItemsNonDefault

  3. Exit the Web Customization Editor. 

  4. Use the Eclipse IDE to create a specialized ContextMenuItem builder class.  The sample, CellSimpleDrill.java, contains the entire code for this custom builder class. 

  5. Compile CellSimpleDrill.java and place the class file inside the classes folder of this customization plug-in adhering to the package structure. For example: plugins\AddingCMItemsNonDefault\WEB-INF\classes\com\microstrategy\sdk\samples\transforms\contextmenus

  6. If the Web Customization Editor is closed, launch it again and access your plug-in

  7. 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. 

  8. Click on Context Menus to expand the list of context menus used in MicroStrategy Web. 

  9. Right-click on any of the context menus and select New Shortcut-List-Set

  10. Enter customReportCellContextMenus and click OK

  11. Right-click customReportCellContextMenus and select New Shortcut-List

  12. Enter default and click OK.

  13. Right-click default and select New Shortcut

  14. Enter drillGrid and click OK. The Shortcut Attributes editor for drillGrid opens in the right frame. 

  15. Enter [Drill] in the Descriptor text field. 

  16. Click Modify next to the Descriptor ID text field and select mstrWeb.145

  17. Click OK

  18. Click the Advanced Properties tab at the bottom. 

  19. Enter com.microstrategy.sdk.samples.transforms.contextmenus.CellSimpleDrill in the text field for Builder ClassName

  20. Save your changes. 

  21. Navigate to MicroStrategy Web Configuration->Styles

  22. Click on Styles to expand the list of styles used in MicroStrategy Web. 

  23. Double-click ReportDesignModeStyle to launch the Style Properties editor in the right frame. 

  24. Click the Style Parameters tab at the bottom. 

  25. Select contextMenus from the list of available transform parameters and update the value to /plugins/pluginName/WEB-INF/xml/config/customReportCellContextMenus.xml. For example: /plugins/AddingCMItemsNonDefault/WEB-INF/xml/config/customReportCellContextMenus.xml

  26. Save your changes.

  27. Double-click ReportGridStyle to launch the Style Properties editor in the right frame. 

  28. Click the Style Parameters tab at the bottom. 

  29. Select contextMenus from the list of available transform parameters and update the value to /plugins/pluginName/WEB-INF/xml/config/customReportCellContextMenus.xml. For example: /plugins/AddingCMItemsNonDefault/WEB-INF/xml/config/customReportCellContextMenus.xml

  30. Save your changes.

  31. Double-click ReportGridStyle-ForGridGraphMode to launch the Style Properties editor in the right frame.

  32. Click the Style Parameters tab at the bottom.

  33. Select contextMenus from the list of available transform parameters and update the value to /plugins/pluginName/WEB-INF/xml/config/customReportCellContextMenus.xml. For example: /plugins/AddingCMItemsNonDefault/WEB-INF/xml/config/customReportCellContextMenus.xml

  34. Save your changes. 

  35. Double-click ReportOutlineModeStyle to launch the Style Properties editor in the right frame.

  36. Click the Style Parameters tab at the bottom.

  37. Select contextMenus from the list of available transform parameters and update the value to /plugins/pluginName/WEB-INF/xml/config/customReportCellContextMenus.xml. For example: /plugins/AddingCMItemsNonDefault/WEB-INF/xml/config/customReportCellContextMenus.xml

  38. Save your changes. 

  39. Double-click ReportOutlineModeStyle-ForGridGraphMode to launch the Style Properties editor in the right frame.

  40. Click the Style Parameters tab at the bottom.

  41. Select contextMenus from the list of available transform parameters and update the value to /plugins/pluginName/WEB-INF/xml/config/customReportCellContextMenus.xml. For example: /plugins/AddingCMItemsNonDefault/WEB-INF/xml/config/customReportCellContextMenus.xml

  42. Save your changes. 

  43. Launch MicroStrategy Web to view the customization.

See Also