|
A tree pop-up menu is one that is displayed on right-clicking a panel tree node in the tree view of the Web NMS Client. This tree pop-up menu can be customized as per the requirement for both user-defined panels and Web NMS panels. The parameter for which the tree pop-up menu can be specified is defined in the Tree.xml file located in <Web NMS Home>/users/<username> directory.
Ways to Define your own Tree Pop-up menus
You can define your own tree pop-up menu/menus either dynamically by using the specific API or by making a static entry for a specific attribute defined in the Tree.xml file. The two ways of defining tree pop-up menus are as follows :
Dynamic Handling
You must override the method getTreePopupMenu ( ) of com.adventnet.nms.startclient.AbstractBaseNmsPanel class. Here, in this method you can return your own menu as tree pop-up menu/menus, which is displayed on right-clicking the particular tree node. The default implementation is provided in this AbstractBaseNmsPanel class, which ensures displaying of the tree pop-up menu based on the entry of the Tree.xml file.
Static Entry
The tree pop-up menu list can be specified in the Tree.xml file located under <Web NMS Home>/users/<username> directory. The attribute for which the tree pop-up menu list is specified in the Tree.xml file is given below :
TREE-POPUP-MENU ="tree popup menu name"
|
|
Note: When no value for the attribute TREE_POPUP_MENU is given then a message saying "The specified menu is not present" is printed |
Defining the 'TREE-POPUP-MENU' Attribute
The attribute TREE-POPUP-MENU can take multiple .xml files (The .xml files must be present in <Web NMS Home>/user/<username> directory) and multiple JMenus, which are specified in the panel specific menu configuration file (defined in the MENU-FILE-NAME attribute of Tree.xml file). A combination of both can also be given. In the case of multiple menus, the menus are shown as different sub-menu items in the tree pop-up menu.
Therefore, as per the values specified for the MENU-FILE-NAME and the TREE-POPUP-MENU attributes in <Web NMS Home>/users/<username >/Tree.xml file a corresponding tree pop-up menu list is displayed on right-clicking a panel node in the client tree view. If the specified value for the TREE-POPUP-MENU attribute is incorrect or null, then a right-click on one of the respective panel node, brings up the list of menus/menu items as specified for the MENU-FILE-NAME attribute in the Tree.xml file.
It is possible that the parent tree node and the children tree nodes have different tree pop-up menus. You can understand it better from the below given example :
An Example : Let us create a tree pop-up menu for the Network Events panel and for its children nodes by making entries in the Tree.xml file. The respective entries of the Tree.xml file are as shown below :
Entries for the Network Events panel
<DEVICE ID="Events"
TREE-NAME="Network Events"
PANEL-NAME="com.adventnet.nms.eventui.EventBrowser"
MENU-FILE-NAME=eventsmenu.xml"
TABLE-POPUP-MENU="View"
TREE-POPUP-MENU="eventsmenu.xml,temp1.xml,Custom Views,View"
HTML-client="true"
TABLE-COLUMNS="Class = severity = 55; Source = source = 135; Date = date = 155";
ICON-FILE="images/event.png">
</DEVICE>
Here, we see that the entries include the menu configuration file name (eventsmenu.xml) and names of other menu items, which are specified in this panel specific menu configuration file (i.e.eventsmenu.xml). As per the above scenario, on right-clicking the "Network Events" in the client tree, the tree pop-up menus (as defined in the eventsmenu.xml and temp1.xml files) along with the "Custom Views" and "View" menu (as defined for the MENU-FILE-NAME attribute) as submenu items, are displayed.
Entries for the children Nodes
<PANEL-TREE ID="Events">
<LEVEL-1 ICON-FILE="images/redDot.png"
TABLE-COLUMNS="Class=severity = 189;Source=source = 189"
DEVICE-REF="Events"
TREE-POPUP-MENU="temp2.xml,Edit,Actions,temp3.xml"
VIEW-LENGTH="25"
VIEW-CRITERIA=""
PANEL-NAME=quot;com.adventnet.nms.eventui.EventBrowser"
TREE-NAME="Filter1"
ID="Events.1477699975" />
</PANEL-TREE>
As per the above snippet, for the created custom view (namely Filter1), a tree pop-up menu is constructed. The tree pop-up menus created for this custom view are those specified in the temp2.xml and temp3.xml menu configuration files along with the sub menu items namely "Edit" and "Actions", which are defined in the eventsmenu.xml (which is defined for MENU-FILE-NAME of the Parent tree node "Network Events").
Manipulating the Web NMS default Panel and Icon file names
The names of the default panels viz., Network Events, Alarms, etc., and the respective icon files can be modified as per your requirement by editing the TREE-NAME and ICON-FILE tags in the Tree.xml file. This is explained with an example as shown below :
Example :
<DEVICE ID ="Events"
TREE-NAME="Network Events"
ICON-FILE ="images/event.png">
The above entry can be modified as follows to display the panel name as "Actions" and the Icon file name as "usericon.png" (user-defined icon to represent the events panel).
<DEVICE ID ="Events"
TREE-NAME="Actions"
ICON-FILE ="images/usericon.png">
</DEVICE>
|