concept user preference in category java

appears as: user preferences, user preferences
Portlets in Action

This is an excerpt from Manning's book Portlets in Action.

Table 3.2. Methods defined in the PortletRequest interface

Method

Description

getParameterMap getPrivateParameterMap getPublicParameterMap Portlets make use of public render parameters (explained in chapter 11) that are shared between portlets. PortletRequest provides the getPublicParameterMap method, which returns a Map of the public render parameters, and the getPrivateParameterMap, which returns a Map of the parameters that aren’t shared between portlets. If you want to obtain a Map of all the request parameters, irrespective of whether they’re public or private, you should use the getParameterMap method.
getPortalContext Returns a PortalContext object (discussed later in this chapter) that contains information about the portal server in which the portlet is deployed.
getPreferences Returns a PortletPreferences object (discussed in chapter 10) that contains the user preferences associated with the portlet.
getProperties getProperty Obtain any properties associated with the portlet request. You can add a property to a request using the <property> tag, as described in chapter 6.
getPortletSession Returns the PortletSession associated with the current request (discussed later in this chapter).
getWindowState Returns the WindowState object representing the current window state of the portlet sending the request. (WindowState is discussed in chapter 4.)
isPortletModeAllowed Checks whether a portlet mode is allowed for the current portlet request.
isWindowStateAllowed Checks whether a window state is allowed for the current portlet request.
getPortletMode Returns the PortletMode object (discussed in chapter 4) representing the portlet mode associated with the current request.

If you’re using Java portlet technology, the portal server database provides the necessary structure to store user preferences for each portlet in the web portal. The portal server shields you from the database details of saving and retrieving the user preferences. The portal server reads the user preferences of the logged-in user from the database and makes them available to your portlets in the portlet request. As a developer, you’re only responsible for making use of the portlet API to retrieve user preferences and use them to personalize the content or behavior of the portlet.

Listing 10.2. Retrieving user preferences from request in savePreferences method