About this task
The features.xml file specifies which user roles have access to the new menu items.
Procedure
- In an ASCII text editor,
open the configuration features.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 as described
in Defining a unique extensions directory. The default is /opt/Tomcat/tomcat.
- Create the basic template
for the features.xml by adding the following tags:
<?xml version="1.0" encoding="UTF-8"?>
<features
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="features.xsd">
</features>
- For each menu group
to be defined in configuration menu.xml, add the <category> and
</category> tags just before the </features> tag.
 | Note: |
|
For each new menu group defined in the menu.xml configuration file, you need to define the <category> and </category>
tags in the features.xml file.
|
- Specify a </feature>
tag for each new menu item after the <category> and before the
corresponding </category> tag.
 | Note: |
|
For each new menu item defined in the menu.xml configuration file, you need to define a <feature> tag within
the corresponding <category> tag in the features.xml file.
|
- For each <feature>
tag added, specify the following attributes:
|
Attributes
|
Example
|
Description
|
|
name=”itemTag”, where itemTag is the identifier defined for the menu item in the menu.xml configuration file.
|
Specify name=”newMenuItemIdentifier”
|
The identifier of the menu item defined in the configuration menu.xml file.
|
allow=”roles”, where roles is a combination of any of the following roles separated
by commas:
administration
maintenance
operations
usermanager
auditor
|
To define that this menu group is accessible only to administrator
and user manager, specify allow=”administration, usermanager”
|
This attribute defines the roles that have permission to view this
menu group.
|
 | Note: |
|
Make sure that any user role specified for a menu item is also
specified for the entire group.
|
- Make sure each of the
new <feature> tags have a corresponding</feature> tag.
- Save and close the file.
Example
For example, to specify that users with the Administration, Operations,
and Reporting user roles can view the menu item menuItemMyCustomreport for the Reports menu group, add the following lines within the category
which defines the menuGroupReports:
<?xml version="1.0" encoding="UTF-8"?>
<features
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="features.xsd">
<category name="menuGroupReports">
<feature name="menuItemMyCustomReport"
allow="administration,operations,maintenance,reporting">
</feature>
</category>
</features>