Datasheet

Window States
The window state indicates to the portlet how much space is being allocated to it. This enables the port-
let to modify its rendering to suit that window state. The following table contains the window states
specified by the Portlet API.
State Definition
NORMAL The portlet will share the screen with other portlets. This means that the port-
let should limit its markup.
MINIMIZED The portlet should provide little or no output.
MAXIMIZED The portlet doesn’t share the screen with other portlets; thus, the portlet is not
limited in its markup.
Much like portlet modes, a portal can define custom window states, which must also be configured in
the portlet deployment descriptor.
Portlet Context
PortletContext is a wrapper object for your portlet application. There is one PortletContext object
per portlet application. The
PortletContext provides the following:
Accesses initialization variables
Gets and sets context attributes
Logs events
Gets application resources (such as images, XML files, and so on)
Obtains a request dispatcher to leverage servlets and JSPs in the portlet
Portal Context
A portlet can get a reference to the portal in which it is running through the PortalContext object.
Calling the
getPortalContext method of the PortletRequest object will return the PortalContext.
The
PortalContext provides the following:
The name of the portal, through
getPortalInfo
Portal properties, through getProperty and getPropertyNames
The supported portlet modes, through getSupportedPortletModes
The supported window states, through getSupportedWindowStates
Portlet Preferences
In order to perform customization or personalization of your portlet, you need some way to vary certain
parameters of the portlet. These are called portlet preferences. The classic portlet example is the weather
16
Chapter 1
04 469513 Ch01.qxd 1/16/04 11:04 AM Page 16