MicroStrategy ONE

Adding or Removing Context Menu Items

This customization scenario illustrates how to add context menu items to or remove context menu items from context menus on a MicroStrategy Web page. You can use the instructions in this scenario as a guide for adding or removing context menu items on other MicroStrategy Web pages.

The examples in this scenario differ from the example in the Adding Context Menu Items Not Implemented by Default scenario. In this scenario, the context menu items that you add are generic, while the context menu item added in the other scenario has a dependency on the object that is right-clicked.

Adding a context menu item that opens a page

In the first example in this scenario, you add a new context menu item, called Preferences, to the context menu on the Folder Browsing page. When you right-click an object on the Folder Browsing page after you have made these changes, a new context menu item, called Preferences, appears. When you click this menu item, the Preferences page opens.

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. 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. Click on Context Menus to expand the list of context menus used in MicroStrategy Web. 

  4. Navigate to folderContextMenus->default

  5. Right-click the default context menu and select New Shortcut

  6. Enter group3 in the text field and click OK. This launches the Shortcut Attributes editor for group3

  7. Enter - in the Descriptor text field. 

  8. Save your changes. group3 will be a horizontal line that will separate the Preferences item from the rest of the menu items. 

  9. Navigate back to folderContextMenus->default

  10. Right-click the default context menu and select New Shortcut

  11. Enter preferences in the text field and click OK. This will be the Preference context menu item. 

  12. In the Shortcut Attributes editor for preferences, enter Preferences in the Descriptor text field. 

  13. Click Modify next to the Descriptor ID text field. 

  14. Select mstrWeb.862 and click OK

  15. Click the Advanced Properties tab at the bottom of the Shortcut Attributes editor for preferences

  16. Click Add Event in the Events section. 

  17. To select the event enumeration class, click Browse and enter EnumServletEvents

  18. Select EnumServletEvents from your project and click OK

  19. Select  WebEventOpenPreferences from the drop-down menu for Event to trigger when menu element is selected

  20. Click Add in the EventArguments section.

  21. Select WebEventArgumentPreferenceGroup from the drop-down menu and click OK

  22. Enter grid in the Argument Value text field. 

  23. Click OK

  24. Save your changes. 

  25. Launch MicroStrategy Web to view the customization.

In this customization, Preferences is the last item on the context menu, and it is set apart from the other menu items by a separator. You can vary the location of the new menu item by changing the placement of the shortcut in the list of shortcuts. To change the position of Preferences, navigate to folderContextMenus->default and double-click default to launch the Shortcut Attributes editor for default. The position of context menu items can be ordered in the List of Shortcuts section.

Adding a context menu item that displays a message

In the second example in this scenario, you add a new context menu item, called View Alert, to the context menu on the Folder Browsing page. Clicking this new context menu item triggers JavaScript  that displays a message.

Before customization:

After customization:

When you click View Alert on the context menu, the following message is displayed.

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. Click on Context Menus to expand the list of context menus used in MicroStrategy Web. 

  4. Navigate to folderContextMenus -> default

  5. Right-click the default context menu and select New Shortcut

  6. Enter viewalert in the text field and click OK. This name will identify the View Alert context menu item. 

  7. In the Shortcut Attributes editor for viewalert, enter View Alert in the Descriptor text field. This is the text that will actually display on the context menu. 

  8. For the append-state text field, change the value to false

  9. Click the Advanced Properties tab at the bottom of the Shortcut Attributes editor. 

  10. For the Onclick text field, enter alert('You have chosen to view an alert!')

  11. Save your changes. 

  12. Launch MicroStrategy Web to view the customization.

When you right-click an object on the Folder Browsing page after you have made these changes, a new menu item, called View Alert, appears. When you click this menu item, a message is displayed. In this example,  View Alert is the last item on the context menu, and it is not separated from the other menu items. You can vary the location of the menu item by where you place the shortcut in the list of shortcuts.

Removing a context menu item

In the third example in this scenario, you remove the Properties context menu item from context menus on the Folder Browsing page.

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. 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. Click on Context Menus to expand the list of context menus used in MicroStrategy Web. 

  4. Navigate to folderContextMenus -> default -> properties([Properties...])

  5. Right-click the  properties([Properties...]) context menu item and select Delete

  6. A Confirm Delete dialog will be displayed, asking you whether you are sure you want to delete this shortcut. Click Yes.

  7. Save your changes. 

  8. Launch MicroStrategy Web to view the customization.

When you right-click an object on the Folder Browsing page after you have made these changes, Properties  no longer appears as a menu item on the context menu.

See Also