Set portlet preferences for portlet entities
We can set the portlet preferences for portlet entities.
To set the portlet preferences for a portlet entity...
- Obtain a modifiable instance of a portlet entity.
- Obtain the modifiable portlet preferences layer.
- Set the preferences using the appropriate methods of the ModifiablePortletPreferences interface.
Example
Set portlet preferences on a portlet entity:
// obtain portlet model controller final PortletModelController pmController = getPortletModelController(portletModel); // obtain modifiable instance of a portlet entity final Modifiable modifiable = pmController.getModifiableNode(portletEntity); // obtain modifiable preferences layer final ModifiablePortletPreferences preferences = ((ModifiablePortletEntity) modifiable).getModifiablePortletPreferencesLayer(); // set a single value preferences.setStringValue("name", "value");
Parent Set portlet preferences