MicroStrategy ONE
Disabling or Removing Context Menu Items for a Specific Object
This customization scenario illustrates how to disable or remove the context menu item for a specific object on a MicroStrategy Web page. In this example, you disable the Delete context menu item on the Folder Browsing page, but only when the context object is a document. Instructions are also provided for deleting the Delete context menu item so it is not displayed at all.
Before customization:
After customization (disabling "Delete" context menu item):
After customization (removing "Delete" context menu item):
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:
-
Disabling Context Menu Item: JSP version or ASP .NET version
-
Removing Context Menu Item: 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.
For specific settings that affect whether customization changes are applied automatically or require a restart of the Web server, see Applying customization changes to the application.
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: DisablingContextMenuItem.
-
Exit the Web Customization Editor.
-
Use the Eclipse IDE to create a specialized ContextMenuItem builder class. The sample, CustomDelete.java, contains the entire code for this custom builder class. This builder class can be extended in two different ways, depending on whether you want to completely remove the Delete context menu item or simply disable it. Make one of the following modifications to the custom builder class:
-
If you simply want to disable the Delete context-menu item for documents, you need to extend the createItem method. Delete the code that completely removes the Delete context menu item) and leave the code that simply disables the Delete context menu item. The inline comments in the code sample provide directions.
-
If you do not want theDelete context-menu item to display at all for documents, you need to extend the isItemAvailable method. Delete the code that simply disables the Delete context menu item) and leave the code that completely removes the Delete context menu item. The inline comments in the code sample provide directions.
-
-
Compile CustomDelete.java and place the class file inside the classes folder of this customization plug-in adhering to the package structure. For example: plugins\pluginName\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.
-
Navigate to folderContextMenus->default.
-
Double-click the default context menu to expand the list of shortcuts.
-
Double-click the delete ([Delete...]) shortcut to launch the Shortcut Attributes editor in the right frame.
-
Click the Advanced Properties tab at the bottom.
-
Enter com.microstrategy.sdk.samples.transforms.contextmenus.CustomDelete in the text field for Builder ClassName.
-
Save your changes.
-
Launch MicroStrategy Web to view the customization.
For specific settings that affect whether customization changes are applied automatically or require a restart of the Web server, see Applying customization changes to the application.
-
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: Adding Context Menu Items Not Implemented by Default
-
Scenarios: Extending Existing or Adding New Functionality: Adding Context Menu Items that Display Information about the Object