Defining a new menu group and its items

Last Updated : Sep 22, 2021 |
Prolog information
The configuration menu.xml file specifies the location and properties of the new menu group and the menu items.
  1. In an ASCII text editor, create a configuration menu.xml file in the TomcatHome/lib/extensions/UniqueDirectoryName/config directory.
    ADDITIONAL INFORMATION:
    Where, TomcatHome is the directory in which the Tomcat servlet engine software is installed and UniqueDirectoryName is the directory defined in Defining a unique extensions directory. The default is /opt/Tomcat/tomcat.
  2. Create the basic template for menu.xml by adding the following tags:
    ADDITIONAL INFORMATION:
    <?xml version="1.0" encoding="UTF-8"?>
    <navigationmenu 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:noNamespaceSchemaLocation="menu.xsd">
    </navigationmenu>
  3. For each menu group to be defined, add the <menu> and </menu> tags just before the </navigationmenu> tag.
    ADDITIONAL INFORMATION:
    Note:
    A menu group is defined by a <menu> tag followed by one or more <item> tags. The <menu> tag must end with a </menu> tag.
  4. For each menu tag you add for defining a group, specify the following menu attributes:
    ADDITIONAL INFORMATION:
    Attributes
    Example
    Description
    type=”group”, where type defines the type of the menu.
    To specify the type of menu as group, specify type=”group”
    This attribute defines the type of the menu tag.
    To instruct the EPM to display the menu group, specify render=true
    tag=”groupTag”, where groupTag is the identifier the system uses to identify the group.
    To assign the name specify, tag=“newMenuGroupIdentifier”
    The identifier of the menu group. This identifier must be unique across all menu groups and menu items in the configuration menu.xml file.
  5. For each menu item you want to add, specify the <item> tag after the <menu> tag but before the corresponding </menu> tag, and specify the following attributes:
    ADDITIONAL INFORMATION:
    Note:
    A menu item within a menu group is defined by an <item> tag.
    Attributes
    Example
    Description
    type=“item”, where type defines the type of the item.
    To specify the type of the menu item as item, specify type=”item”.
    This attribute defines the type of the item tag.
    render=[true|false], where render is either true or false.
    To instruct the EPM to display the item in the menu group, specify render=true
    If you set this property to false, the EPM does not display the menu group.
    Specify tag=”newMenuItemIdentifier”
    To instruct the EPM to open admin.ops.page.html when the user clicks on the second item of the fifth menu group, specify action=“http://my.site.com/custom_pages/admin.ops.page.html”
    To instruct the EPM to open a new page when the user clicks on the menu item of the menu group, specify newWindow=true
    If you do not specify this property, it defaults to false.
  6. For each new <item> tag, specify a </item> tag to end the menu item definition.
  7. Save and close the file.
For example, if you have a group called myMenuGroup with menu items myUsersItem, myAdminItem, and myUserMgrItem, the entire section might look like this:
<?xml version="1.0" encoding="UTF-8"?>
<navigationmenu
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="menu.xsd">
<menu type="group" render="true" tag="myMenuGroup">
   <item type="item" render="true" tag="myUsersItem"
      action="http://my.site.com/custom/users.page.html" newWindow="true">
   </item>
   <item type="item" render="true" tag="myAdminItem"
      action="http://my.site.com/custom/admin.page.html" newWindow="true">
   </item>
   <item type="item" render="true" tag="myUserMgrItem"
      action="http://my.site.com/custom/usermgr.page.html" newWindow="true">
   </item>
</menu>
</navigationmenu>