Datasheet
27
The Java Portlet API (JSR 168)
Attribute Name Description
user.business-info. The international access code for the user’s work mobile
telecom.mobile.intcode telephone (for example, 44 for the United Kingdom and 1 for the
United States)
user.business-info. The user’s work mobile telephone area code (for example, 703,
telecom.mobile.loccode 818, etc.)
user.business-info. The user’s work mobile telephone local number (555-1111, etc.)
telecom.mobile.number
user.business-info. The user’s work mobile telephone extension, if they have one
telecom.mobile.ext (for example, 745, 2918, etc.)
user.business-info. Comments about the user’s work mobile telephone (optional)
telecom.mobile.comment
user.business-info. The international access code for the user’s work pager (for
telecom.pager.intcode example, 44 for the United Kingdom and 1 for the United States)
user.business-info. The user’s work pager area code (for example, 703, 818, etc.)
telecom.pager.loccode
user.business-info. The user’s work pager local number (for example, 555-1111, etc.)
telecom.pager.number
user.business-info. The user’s work pager extension, if they have one (for example,
telecom.pager.ext 745, 2918, etc.)
user.business-info. Comments about the user’s work pager (optional)
telecom.pager.comment
user.business-info. The user’s work e-mail address
online.email
user.business-info. The user’s work Web page
online.uri
As you can see, the attributes are a bit repetitive, but offer a breadth of options to you as a developer in
terms of which user attributes you need to use for your portlet application.
However, it is not sufficient just to use these in your application. Your deployment descriptor must declare
which of these are used by a portlet application, and the deployer needs to map them against the related
ones available in the targeted portal server. This is where using the standard attributes comes in handy, as
it will greatly reduce, if not eliminate, the amount of mapping necessary to deploy your application.
Presuming you have done all of the appropriate mappings (and the section “Portlet Application
Deployment Descriptor” discusses how to do this in your
portlet.xml), you can gain access to user
attributes such as the following:
Map userdata = (Map) request.getAttribute(PortletRequest.USER_INFO);
String workEmail =
(String) request.getAttribute(“user.business-info.online.email”);
04 469513 Ch01.qxd 1/16/04 11:04 AM Page 27