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.
-
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.
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: AddingCMItemsNonDefault.
-
Exit the Web Customization Editor.
-
Use the Eclipse IDE to create a specialized ContextMenuItem builder class. The sample, CellSimpleDrill.java, contains the entire code for this custom builder class.
-
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.
-
If the Web Customization Editor is closed, launch it again and access your plug-in.
-
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.
-
Click on Context Menus to expand the list of context menus used in MicroStrategy Web.
-
Right-click on any of the context menus and select New Shortcut-List-Set.
-
Enter customReportCellContextMenus and click OK.
-
Right-click customReportCellContextMenus and select New Shortcut-List.
-
Enter default and click OK.
-
Right-click default and select New Shortcut.
-
Enter drillGrid and click OK. The Shortcut Attributes editor for drillGrid opens in the right frame.
-
Enter [Drill] in the Descriptor text field.
-
Click Modify next to the Descriptor ID text field and select mstrWeb.145.
-
Click OK.
-
Click the Advanced Properties tab at the bottom.
-
Enter com.microstrategy.sdk.samples.transforms.contextmenus.CellSimpleDrill in the text field for Builder ClassName.
-
Save your changes.
-
Navigate to MicroStrategy Web Configuration->Styles.
-
Click on Styles to expand the list of styles used in MicroStrategy Web.
-
Double-click ReportDesignModeStyle to launch the Style Properties editor in the right frame.
-
Click the Style Parameters tab at the bottom.
-
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.
-
Save your changes.
-
Double-click ReportGridStyle to launch the Style Properties editor in the right frame.
-
Click the Style Parameters tab at the bottom.
-
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.
-
Save your changes.
-
Double-click ReportGridStyle-ForGridGraphMode to launch the Style Properties editor in the right frame.
-
Click the Style Parameters tab at the bottom.
-
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.
-
Save your changes.
-
Double-click ReportOutlineModeStyle to launch the Style Properties editor in the right frame.
-
Click the Style Parameters tab at the bottom.
-
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.
-
Save your changes.
-
Double-click ReportOutlineModeStyle-ForGridGraphMode to launch the Style Properties editor in the right frame.
-
Click the Style Parameters tab at the bottom.
-
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.
-
Save your changes.
-
Launch MicroStrategy Web to view the customization.
See Also
-
Scenarios: Customizing Existing Functionality: Adding Custom Context Menus
-
Scenarios: Customizing Existing Functionality: Removing Context Menus
-
Scenarios: Customizing Existing Functionality: Adding or Removing Context Menu Items
-
Scenarios: Customizing Existing Functionality: Displaying Objects Selected in a Report
-
Scenarios: Extending Existing or Adding New Functionality: Disabling or Removing Context Menu Items for a Specific Object
-
Scenarios: Extending Existing or Adding New Functionality: Adding Context Menu Items that Display Information about the Object