The Enterprise Sample allows users to personalize their portal content in a number of ways such as, adding or removing channels, modifying the layout of the Portal Desktop, and customizing the presentation of each channel. The last item - customizing the presentation of each channel - can be done using the channel menu which appears as a pull down menu. To activate the menu, click the menu on the inverted triangle at the right top corner of each channel.
By default, each channel menu has the following options:
Makes the current channel as the only visible channel on the desktop. All other channels on the desktop are hidden. The full page state can be removed by clicking on the “Show normal view” option in the channel menu.
This is similar to the minimized state of a window. In this state, only the title bar of the channel displays. The content of the channel is not fetched. Users can use this option to stack up a number of channels on the desktop and view the content of each channel selectively. The minimized state can be reversed by clicking on Show normal view option in the channel menu.
Detaches a channel from the desktop and shows it in a new popup browser window. The detached channel can be reattached to the desktop by clicking Close Channel in the detached channel’s menu.
Allows the user to remove a channel from the desktop. The channel can be restored on the desktop by reselecting it for display from the Page Content & Layout page.
Displays channel help.
The channel menu is implemented using DHTML layers. The Javascript API for creating and manipulating menus is implemented in popup.js which can be found at PortalServer-DataDir/portal/portal-ID/web-src/enterprise/js directory. This is the deployed copy of the Javascript file. Any changes to this file should be made here. Then redeploy Portal Server using PortalServer-base/bin/psadmin redeploy (Solaris).
The menu Javascript API provides methods to create new menus, add menu items, and specify actions for each menu item.
The channel menu for the Enterprise Sample can be customized to add new menu items or remove menu items. Customizing the channel menu requires modification of JSP files shipped in the JSPTableContainerProvider located, by default, in the PortalServer-DataDir/portal/portal-ID/desktop/enterprise_sample/JSPTableContainerProvider directory. The menu for channels displayed in the desktop is created in channelMenubar.jsp file. The menu for the channels in the popup window state is created in popupChannelMenubar.jsp file. Any modifications to the channel menu should be made in both the above files so that the changes are reflected in regular desktop channels as well as in the popup channels.
To create a new pull down menu from a JSP file
window.<%=channelName% >= new Menu(); |
The variable, channelName, is a String that contains the unique name of the channel. This is required so that each channel menu has a unique identifier. Menu items can be added using the addMenuItem(String name, String action) method.
To add items which are not links
window.<%=channelName%>. addMenuItem("— Channel Menu —"); |
To add menu items with an associated action
window.<%=channelName%>.addMenuItem("Update Channel", "location=’<dtpc:getDesktopURL pathinfo="$pathInfo"/>’"); |
The above line shows how to add a menu item that redirects the browser to a different location when clicked.
To add a menu item that will open a popup window when clicked
window.<%=channelName%>.addMenuItem("Attach Channel",onClick="openUrlInParent(<dtpc:getDesktopURL/>?action=process&provider=<%=containerName%>&<%=containerName%>channelAction=attach&<%=containerName%>.targetProvider=<%=leafChannel%>’, true); windowClosed(window.name); window.close();"); |
Similar Javascript actions can be associated with each menu item. Actions are invoked when you click on the menu item. Here are some examples.
To add menu item separators use addMenuSeparator() method. For example:
window.<%=channelName%>.addMenuSeparator(); |
To modify the appearance and operations, customize the following properties:
window.<%=channelName%>.fontColorHilite = "#FFFFFF"; window.<%=channelName%>.menuHiliteBgColor = "#F68947"; window.<%=channelName%>.disableDrag = true; |
To invoke the menu:
<a href="javascript://" onClick="showMenu(window.<%=channelName%>);" title=" Click to view or modify channel options"><img src="<dt:scontent/>/enterprise/images/channel-button.gif" ></a> |
In the above example, when you click an image, the pull down menu displays. You may have to delete the compiled JSP class cache under PortalServer-DataDir/portal/portal-ID/desktop/compiled directory to force recompilation of the changed JSPs.