Vipin Bardia 9 Years Ago Both parts of this article are very nice.Thanks Please sign in to reply. Reply as... Cancel
Peter Drábik 9 Years Ago Tried with Liferay 6.1.2, I got stuck on getting NullPointerException. After replacing "LIFERAY_SHARED_THEME_DISPLAY" with WebKeys.THEME_DISPLAY on line 76 in the Impl class, everthing works fine yet. Please sign in to reply. Reply as... Cancel Peter Mesotten Peter Drábik 9 Years Ago Thanks for experimenting! Indeed, the web key for ThemeDisplay was changed between 6.1 and 6.2, so it is better to use the static variable. I don't know why I didn't do that in the first place. Please sign in to reply. Reply as... Cancel
Peter Mesotten Peter Drábik 9 Years Ago Thanks for experimenting! Indeed, the web key for ThemeDisplay was changed between 6.1 and 6.2, so it is better to use the static variable. I don't know why I didn't do that in the first place. Please sign in to reply. Reply as... Cancel
Peter Drábik 9 Years Ago Another fix It is possible that I am not doing everything well, but here's the problem: if I save the preferences, it is saved with id 86 and not with id of my portlet. Long story short - here is modified body of getPreferences:long companyId = portal.getCompanyId(portletRequest); String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID); String portletResource = ParamUtil.getString(portletRequest, "portletResource"); if (Validator.isNotNull(portletResource)) { portletId = portletResource; } return portletPreferencesService.getPreferences(companyId, ownerId, ownerType, plid, portletId); Please sign in to reply. Reply as... Cancel Peter Mesotten Peter Drábik 9 Years Ago Hi Peter,The code was only tested for Liferay 6.2, so it may be possible that the behavior is different in 6.1. If I found some time I'll do some 6.1 testing as well and take your patch into consideration. Thanks again! Please sign in to reply. Reply as... Cancel
Peter Mesotten Peter Drábik 9 Years Ago Hi Peter,The code was only tested for Liferay 6.2, so it may be possible that the behavior is different in 6.1. If I found some time I'll do some 6.1 testing as well and take your patch into consideration. Thanks again! Please sign in to reply. Reply as... Cancel
Nagadeep cs 6 Years Ago This is a great blog. I would like to know if there are any performance considerations . If we use the preferences will there be any performance benefits or side effects? . I am looking for a user specific (or user scoped) preferences . Would it be better to have a servicebuilder create a table and have these user specific preferences managed or is it better to use the way this article explained? please let me know. Please sign in to reply. Reply as... Cancel