Details
-
Bug
-
Status: Verified
-
Resolution: Unresolved
-
6.2.5 CE GA6
-
None
-
None
-
3
-
Ubuntu LTS 14.04
-
Oracle Sun JDK 7
-
GlassFish 4.0
-
MySQL 5.7
Description
In a postLogin Hook, trying to remove all opened portlets using the following code:
user = UserLocalServiceUtil.getUserById(userId); long privatePlid = user.getGroup().getDefaultPrivatePlid(); Layout layout = LayoutLocalServiceUtil.getLayout(privatePlid); LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet) layout .getLayoutType(); List<String> portletIds = layoutTypePortlet.getPortletIds(); for (String portletId : portletIds) { layoutTypePortlet.removePortletId(userId, portletId); } LayoutLocalServiceUtil.updateLayout(layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId(), layout.getTypeSettings());
However no portlet removed, and the layout still the same.
Liferay 6.2 deployed on glassfish 4, and java version 1.7.0_79