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


 

Set portlet preferences for portlet definitions

You can set the portlet preferences for portlet definitions.

To set the portlet preferences for a portlet definition, proceed by the following steps:

  1. Obtain a modifiable instance of a portlet definition.
  2. Obtain the modifiable portlet preferences layer.
  3. Set the preferences by using the appropriate methods of the ModifiablePortletPreferences interface.
Example - Setting portlet preferences on a portlet definition:
// obtain portlet model controller
final PortletModelController pmController = getPortletModelController(portletModel);
        
// obtain modifiable instance of a portlet definition
final Modifiable modifiable = pmController.getModifiableNode(portletDefinition);

// obtain modifiable preferences layer
final ModifiablePortletPreferences preferences = ((ModifiablePortletDefinition) 
      modifiable).getModifiablePortletPreferencesLayer();

// set a single value
preferences.setStringValue("name", "value");
Parent topic: Set portlet preferences Related information
Set portlet preferences for portlet entities
Library | Support | Terms of use |