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:

  1. Access the plug-in:

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

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

  1. Launch the Web Customization Editor

  2. Create a new plug-in and give it a meaningful name. For example: DisablingContextMenuItem

  3. Exit the Web Customization Editor. 

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

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

  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. Navigate to folderContextMenus->default

  10. Double-click the default context menu to expand the list of shortcuts. 

  11. Double-click the delete ([Delete...]) shortcut to launch the Shortcut Attributes editor in the right frame. 

  12. Click the Advanced Properties tab at the bottom. 

  13. Enter com.microstrategy.sdk.samples.transforms.contextmenus.CustomDelete in the text field for Builder ClassName

  14. Save your changes. 

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