Last active
June 26, 2016 19:36
-
-
Save chingovan/f58b2c4b38be94f3e4cb9f2b88451d0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { | |
super.processAction(portletConfig, actionRequest, actionResponse); | |
// Get current preference of portlet | |
String portletResource = ParamUtil.getString(actionRequest, "portletResource"); | |
PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource); | |
// Get value of parameter(s) | |
String greeting = ParamUtil.getString(actionRequest, "greeting"); | |
// Add parameter's value into preference | |
preferences.setValue("greeting", greeting); | |
// Store | |
preferences.store(); | |
// Send successful message | |
SessionMessages.add(actionRequest, "success"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment