IM Developer Guide – Right Click Menu Provider
About this guide
This document gives an overview of the installation of PhenixID Identity Manager. Additional information is found on PhenixID web site or through PhenixID support.
Summary
This document explains Right Click Menu Providers in PhenixID Identity Manager. It is assumed reader is familiar with both the Identity Manager and Identity Manager Configurator. The document is a part of a collection of documents explaining how to extend and customize Identity Manager. In addition there is also Javadoc and sample code.
Mentioning of abstract base class assumes these are used when developing custom code.
First time readers are recommended to read overview document, IM Developer Overview.
Definition
In the Main view, the administrator can right click on the tree nodes as well as on the rows in the result grid. In both places, a right click menu will be shown.
In the Browse view, the administrator can right click on the tree nodes where a right click menu will appear. Also, in both the Browse view and the Predefined Search view, the administrator can right click on the rows in the result grid to show a right click menu.
Adding custom menu items to the right click menu requires development of a Right Click Menu Provider.
Developing Right Click Menu Provider
A Right Click Menu Provider is a Java class. Required source level is version 8. An right click menu provider must implement se.nordicedge.interfaces.MenuProvider
A base class is provided through:
se.nordicedge.BaseMenuProvider
Flow of Execution
- IM first creates the standard right click menu. Then it calls createMenu. Here custom logic is placed for manipulating the standard menu and/or adding new custom items to the menu.
Configuration
Configuration is done by setting the following policies in DSEditor.properties:
BROWSE_RIGHT_CLICK_MENU_PROVIDER for the right click menu at the tree nodes.
GRID_RIGHT_CLICK_MENU_PROVIDER for the right click menu at the rows in the result grid.
BROWSE_RIGHT_CLICK_MENU_PROVIDER=mypackage.MyRightClickMenuProvider GRID_RIGHT_CLICK_MENU_PROVIDER=mypackage.MyRightClickMenuProvider
Sample Code
An example of a custom right click menu provider can be found here.
Navigate to item in main view
To create a menu item that navigates the user to a specific item in the browse tree in the main view there is a javascript function prepared to use:
function triggerMainBrowseNavigation(viewUUID, viewOnClickAction, objectId)
The parameters should be:
- viewUUID: the id for the view to open the tree in (should be the id of either Main or the BrowseOnly version of main)
- viewOnClickAction: should be the click action to open the view
- objectId: should be the PIM internal object id (not the dn)
This is a code example on how to create such a right click option:
//Get the item id String[] rowId = request.getParameterValues("rowID"); if(rowId == null){ String rID = (String)request.getAttribute("rowID"); rowId = rID.split(","); } String itemId = rowId[0]; //Create the menu item DojoMenuComponent menuItem = DojoMenuComponentFactory.getComponent(DojoGrfxType.MENUITEM); menuItem.setLabel("Open in main"); menuItem.setIconClass("neMenuEditIcon"); //Get the view to open View v = userSession.getViewByLabel("Main"); String id = v.getUUID(); String action = v.getOnClickAction(); var onClickAction = "triggerMainBrowseNavigation(" + id + " ," +action+"," + itemId + ")"; menuItem.setEvent(Event.ONCLICK, onClickAction);