About this task
The configuration menu.xml file specifies the location and properties of the new menu group and the menu items.
Procedure
-
In an ASCII text editor, create a
configuration menu.xml file in the TomcatHome/lib/extensions/UniqueDirectoryName/config
directory.
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.
-
Create the basic template for
menu.xml by adding the following tags:
<?xml version="1.0" encoding="UTF-8"?> <navigationmenu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="menu.xsd"> </navigationmenu> - For each menu group to be defined, add the <menu> and </menu> tags just before the </navigationmenu> tag.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.
- For each menu tag you add for defining a group, specify the following menu attributes:
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.
render=[true|false], where render is either true or false.
To instruct the EPM to display the menu group, specify render=true
If you set this property to false, the EPM does not display the menu group.
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.
-
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:
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.
tag=itemTag, where itemTag is the identifier the system uses to identify the item.
Specify tag=”newMenuItemIdentifier”
The identifier of the menu item. This identifier must be unique across all menu groups and menu items in the configuration menu.xml file.
action=displayURL, where displayURL is the URL that you want the system to display when a user clicks this item.
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”
Determines what page Experience Portal displays when the user selects the menu item.
Important:Experience Portal does not validate this URL.
newWindow=“[true|false]”, where newWindow is either true or false.
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 this option is set to true, Experience Portal opens the specified URL in a new browser window.
If you do not specify this property, it defaults to false.
- For each new <item> tag, specify a </item> tag to end the menu item definition.
- Save and close the file.
Example
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>