WebSphere Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows


Customizing person menu actions

You can add custom menu items to the Person menu provided by the person tag.

You can add items to the menu in any portlet that uses the person tag, whether the portlet is provided with IBM® WebSphere® Portal Express or is a custom portlet you created and modified to use the person tag.

To add a custom menu item, you create a new Java class that implements:
com.ibm.workplace.people.portal.workspace.PersonMenuItem

The lwp.peoplePortalAPI.jar file contains the necessary interface.

Perform the following steps:

The stage needs to be set just so.
  1. Create a new Java class that implements com.ibm.workplace.people.portal.workspace.PersonMenuItem, found on the WebSphere Portal Express server in the following location:
    Windows:
    portal_server_root\shared\app\
    lotusworkplacelib\lwp.peoplePortalAPI.jar
    Linux:
    portal_server_root/shared/app/
    lotusworkplacelib/lwp.peoplePortalAPI.jar
    i5/OS:
    portal_server_root_user/shared/app/
    lotusworkplacelib/lwp.peoplePortalAPI.jar
  2. In your new class, implement the following method:
    public MenuData getMenuData(PageContext pageContext, Member id);
    Notes:
    • The Member object represents the person who is being displayed in the tag.
    • The Member object is populated with the following WMM attributes: ibm-primary-email, displayName.
    • The MemberDN and the WMMID can be retrieved from the MemberIdentifier object.
    • Returning null causes no menu item to be added.
    • MenuData (if returned) contains a display label and a URI to execute when the menuitem is clicked.

    The method needs to return the following class, which already exists in lwp.peoplePortalAPI.jar:

    com.ibm.wkplc.people.tag.MenuData

    The constructor for this class is:

    public MenuData(String mURI, String mDisplayName) {
    		this(mURI, mDisplayName, false);
    	}
    Notes:
    • The mURI argument is the URI that will be launched when the menu item is selected.
    • The mDisplayName argument is the label that will appear for the menu item.
  3. Compile your new class and package it as a .jar file. At a minimum, the .jar files required on your classpath to compile the menuitem are wmm.jar and j2ee.jar, found in the following directory:
    Windows:
    app_server_root\lib
    Linux:
    app_server_root/lib
    i5/OS:
    app_server_root/lib

    and lwp.peoplePortalAPI.jar, found in the following directory:

    Windows:
    portal_server_root\shared\app\
    lotusworkplacelib\
    Linux:
    portal_server_root/shared/app/
    lotusworkplacelib/
    i5/OS:
    portal_server_root_user/shared/app/
    lotusworkplacelib/
  4. Copy the .jar file you created to the following directory:
    Windows:
    portal_server_root\shared\app\
    lotusworkplacelib
    Linux:
    portal_server_root/shared/app/
    lotusworkplacelib
    i5/OS:
    portal_server_root_user/shared/app/
    lotusworkplacelib
  5. Locate the lwp.commoninfrautil.jar file in the following directory:
    Windows:
    portal_server_root\
    shared\ext
    Linux:
    portal_server_root/
    shared/ext
    i5/OS:
    portal_server_root_user/
    shared/ext
  6. Edit the file and search for the key "CS_SERVER_PERSONTAG.menuclasses," which is a comma-separated list of menuitem class names. The following example shows the default value of that key, with a sample menu item appended to the end and shown in bold.

    CS_SERVER_PERSONTAG.menuclasses=
    com.ibm.wkplc.people.tag.menuitems.
       ClassicChatPersonMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       PortalMailPersonMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       PortalShowProfileMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       PortalFindDocsMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       ClassicAddToContactListMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       ViewPersonRecordMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       ViewOrganizationViewMenuItem,
    com.ibm.wkplc.people.tag.menuitems.
       SampleMenuItem

    Tip: If you copy and paste the example of the key value, remove the line breaks before pasting.
  7. Restart the portal server.
Related tasks
Providing online awareness for a custom portlet
Logging for Collaborative Services

Library | Support | Terms of use |

Last updated: Wednesday, February 20, 2008 10:51am EST

Copyright IBM Corporation 2000, 2008. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)