Set portlet preferences for portlet definitions
We can set the portlet preferences for portlet definitions.
To set the portlet preferences for a portlet definition...
- Obtain a modifiable instance of a portlet definition.
- Obtain the modifiable portlet preferences layer.
- Set the preferences using the appropriate methods of the ModifiablePortletPreferences interface.
Example
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 Set portlet preferences