EMC Developer Network

Adding menu items to the menubar in Webtop 5.3

January 2006

Software Environment

FeatureTested on
Operating SystemWindows 2000 Server SP4
CompilerSun JDK 1.4.2_08
RuntimeSun JRE 1.4.2_08
DFC5.3 SP1
WDK5.3 SP1
Webtop5.3 SP1
Content Server5.3 SP1

Abstract

This article discusses the process of adding custom menu items to the menubar in Webtop 5.3. The menubar JSP structure has changed slightly in Webtop 5.3 and this article would benefit developers trying to migrate from WDK 5.2.x to 5.3.

Steps

  • Create the following XML component definition in the file VIRTUAL_ROOT/custom/config/menubar_component.xml. If the file does not exist, create it and add the standard xml header.

    
    <config version="1.0">
    <scope>
    <component extends="menubar:/webtop/config/menubar_component.xml" id="menubar">
        <nlsbundle>com.documentum.custom.MenuBarNls</nlsbundle>
        <pages>
            <start>/custom/menubar/menubar.jsp</start>
        </pages>
    </component>
    </scope>
    </config>
    
    

  • Copy the file VIRTUAL_ROOT/webtop/classic/menubar/menubar.jsp to VIRTUAL_ROOT/custom/menubar/menubar.jsp. Open the copied file and change the included file path in it to /custom/menubar/menubar_body.jsp (i.e. change the JSP tag @include). Webtop 5.3 menubar.jsp now includes another file that contains the menu items unlike Webtop 5.2.x, where all the menus items were contained in the main menubar.jsp.
  • Copy the file VIRTUAL_ROOT/webcomponent/library/menubar/menubar_body.jsp to VIRTUAL_ROOT/custom/menubar/menubar_body.jsp. The menubar.jsp in WDK 5.3 includes this file. It contains all the menu definitions.
  • Open the file VIRTUAL_ROOT/custom/menubar/menubar_body.jsp and add any custom menu items there. E.g.

    
    <dmfx:actionmenuitem dynamic='singleselect' name='tools_launchpas' 
             nlsid='MSG_LAUNCH_PAS' action='comment' showifinvalid='true'/>
    
    

  • Create a new properties file VIRTUAL_ROOT/custom/strings/com/documentum/custom/MenuBarNls.properties
  • Add the NLS_INCLUDES property followed by any of your custom NLS ids to the properties file created in the previous step.

    NLS_INCLUDES=com.documentum.webtop.webcomponent.menubar.MenuBarNlsProp
    
    MSG_LAUNCH_PAS=Launch PAS
    

  • Save all files.
  • Refresh the WDK config definitions by calling the URL http://[SERVERNAME]:[PORT_NUM]/[VIRTUAL_ROOT]/wdk/refresh.jsp. Example, http://localhost:8080/webtop53sp1/wdk/refresh.jsp
  • Open Webtop. The new menu items should show up in the menubar.