Created
August 15, 2015 21:41
-
-
Save bmvakili/251413f0ae3fb8f66314 to your computer and use it in GitHub Desktop.
Liferay Portlet Configuration Edit Scope Action Update Scope Method
This file contains hidden or 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
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute( | |
WebKeys.THEME_DISPLAY); | |
String oldScopeName = getOldScopeName(actionRequest, portlet); | |
PortletPreferences portletPreferences = actionRequest.getPreferences(); | |
String scopeType = ParamUtil.getString(actionRequest, "scopeType"); | |
portletPreferences.setValue("lfrScopeType", scopeType); | |
String scopeLayoutUuid = ParamUtil.getString( | |
actionRequest, "scopeLayoutUuid"); | |
if (!scopeType.equals("layout")) { | |
scopeLayoutUuid = StringPool.BLANK; | |
} | |
portletPreferences.setValue("lfrScopeLayoutUuid", scopeLayoutUuid); | |
String portletTitle = getPortletTitle( | |
actionRequest, portlet, portletPreferences); | |
Tuple newScopeTuple = getNewScope(actionRequest); | |
String newScopeName = (String)newScopeTuple.getObject(1); | |
String newPortletTitle = PortalUtil.getNewPortletTitle( | |
portletTitle, oldScopeName, newScopeName); | |
if (!newPortletTitle.equals(portletTitle)) { | |
portletPreferences.setValue( | |
"portletSetupTitle_" + themeDisplay.getLanguageId(), | |
newPortletTitle); | |
portletPreferences.setValue( | |
"portletSetupUseCustomTitle", Boolean.TRUE.toString()); | |
} | |
portletPreferences.store(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment