Custom tabs in the Enterprise console
You can add your own custom tabs to the Enterprise console.
Adding a tab implies:
- Registering your tab
To name and configure the behavior of your tab.
- Establishing the navigation rules
To establish what happens when the tab is clicked.
- Creating the holder for your page
To prepare the page that holds the contents that make up your tab.
Registering your tab
To register your tab, add a teamserver:tab tag to /custom/tabs.jsp, which contains by default:
<teamserver:tab name="home" model="#{LinkBean.home}"/>
<teamserver:tab name="explore" model="#{LinkBean.explore}"/>
<teamserver:tab name="compose" model="#{LinkBean.compose}"/>
<teamserver:tab name="query" model="#{LinkBean.query}"/>
<teamserver:tab name="analyze" model="#{LinkBean.analyze}"/>
<teamserver:tab name="project" model="#{LinkBean.project}"/>
<teamserver:tab name="configure" model="#{LinkBean.configure}"/>
<teamserver:tab name="install" model="#{LinkBean.install}"/>
The default tabs use the model attribute to regroup required parameters in a Bean that implements the IlrUICommandModel interface. You can do the same or specify the required title, action, and matches attributes directly in the tag, for example:
<teamserver:tab name="customTab" title="My Tab" action="customAction" matches="/mypages/.*">
where:
- title
The title displayed on the tab.
- action
A name for the action that is executed when the tab is clicked. You must then declare any custom actions in WEB-INF/extended-faces-config.xml when establishing the navigation rules.
- matches
All pages that match this regular expression have the custom tab activated when they are displayed. If this attribute remains empty, pages displayed through the action attribute do not activate the tab.
See /WEB-INF/teamserver.tld for the other attributes of teamserver:tab.
These include:
- icon
To show an icon next to the tab name.
- enabled
To gray out the tab.
- rendered
Whether the tab is visible. Use this attribute to limit access to a tab to certain users, such as the Administrator:
<teamserver:tab name="customAdminTab" action="customAdminAction" title="My Admin Tab" matches="/mypages/customadmin/.*" rendered="#{ManagerBean.administrator}"/>- tooltip
To show a tooltip when hovering on the tab name.
Establishing the navigation rules
The action attribute of the teamserver:tab tag in custom/tabs.jsp establishes the page to navigate to when you click the tab. This page location is described as a navigation case in the navigation rule part of WEB-INF/extended-faces-config.xml. For example:
<navigation-rule>
<from-view-id>/*</from-view-id>
<navigation-case>
<from-outcome>customAction</from-outcome>
<to-view-id>/mypages/myholderpage.jsp</to-view-id>
</navigation-case>
</navigation-rule>
In this example, clicking the tab displays the /mypages/myholderpage.jsp page.
This page must also match the regular expression of the matches attribute for the tab to be activated when displaying this page.
Creating the holder for your page
Before you can add content to your tab, you must create the holder page in the location you specified in the navigation rules, as follows:
<%@taglib uri="http://www.ilog.com/jrules/teamserver" prefix="teamserver" %>
<teamserver:page content="/mypages/mycontentpage.jsp">
</teamserver:page>
The teamserver:page tag in the holder page defines the location of the JSP file in which you place the actual contents when customizing the content pages, such as toolbars, links, or an HTML or JSF file.
The holder page handles the top banner with all the tabs, as well as the footer, so you do not need repeat them in any of the content pages. You can place the breadcrumbs, which appear just under the tabs, in the holder page within the teamserver:page tag:
<teamserver:breadcrumb title="Custom Action" action="customAction"/>
All JSP pages under the new tab must match the regular expression pattern /mypages/.* for the tab to be active.
When complete, you must repackage these pages in the EAR, as described in the overview.