Olaf Kock Il y a 9 années How did you know that I just needed to summarize this?Less effort for me \o/ - I'll keep this reference in my toolbox. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Ahmed Hasan Il y a 9 années Very good coverage of portlet preferences. Ahamed HasanAuthor, Liferay Cookbook Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Akash Jaisawal Il y a 9 années Good Post.All the luck Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Venkat Koppavolu Il y a 9 années Very well explained !!Thanks,Venkat Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Christophe Cariou Il y a 9 années Great explanation. When (or where) do you post the second part ? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Peter Mesotten Christophe Cariou Il y a 9 années Coming soon... :-) Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Peter Mesotten Christophe Cariou Il y a 9 années Coming soon... :-) Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Peter Mesotten Il y a 9 années Part 2 of this series was just posted: https://www.liferay.com/web/pmesotten/blog/-/blogs/user-specific-versus-shared-portlet-preferences-part-2.This part will explain a way for storing preferences for a Liferay portlet in multiple scopes at the same time. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Marko Perić Il y a 9 années Hello Peter, First of all, great post. I would really appreciate if you could see my problem I posted on forum and I think this blog post could solve my problem. Link: https://www.liferay.com/community/forums/-/message_boards/message/47911045I have used 4th option from your list, "per-user, per-portlet" but it didn't help, two users still see the same data.Please take a look on a link.Thank you very much. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Thomas Berg Il y a 9 années Hi Peter, great article!I need to be able to store preferences by instance, regardless of plid. I was hoping that this could be achieved by setting preferences-owned-by-group=true, preferences-unique-per-layout=false and instanceable=true but the _INSTANCE_xyz is "shaved off" when the preferences are stored. The portlets are embedded dynamically and can possibly be viewed on different layouts. An update to the preferences in one place must be "propagated" so that any other view of the same instance gets the same preferences.With this requirement, do you think it would be possible to "synchronize" preferences for portlets with the same id (and instance) in a model listener? I assume it's possible to update a model without notifying its listeners or the listener would be called indefinitely? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Peter Mesotten Thomas Berg Il y a 9 années @Thomas,Thanks for your feedback!What I don't get is why you want to use an instanceable portlet. I guess the preferences should be user specific but not really portlet instance specific, so you could use the combination (preferences-company-wide=false, preferences-unique-per-layout=false, preferences-owned-by-group=false). In that case however, your portlet must be non-instanceable. This is no problem as long you don't need multiple portlet instances on the same page.The approach with the model listener seems rather hacky, so I wouldn't really recommend that. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Thomas Berg Peter Mesotten Il y a 9 années @PeterMy reasons for wanting preferences by instance are these:I embed a JournalArticle and optionally a Web Form Portlet in a view. The embedded web form has default preferences set and its instance id is set by a combination of the articleId and the articles groupId. The portlet that shows this view can possibly be added to multiple layouts in multiple sites. If an administrator edits the preferences of the embedded web form, only the form on that particular layout would be affected.If I could store preferences per instance and group rather than per layout, all views would use the same preferences. Unfortunately, this is not possible as the INSTANCE-part of the portletId is cut off when preferences are stored for preferences-owned-by-group=true and preferences-unique-per-layout=false in combination with instanceable.I submitted a feature request:https://issues.liferay.com/browse/LPS-54751I agree that using a Model Listener is hacky at best and will not go that way. Perhaps I'll look into overriding com.liferay.portal.service.PortletPreferencesLocalService with a hook (or disable to possibility to edit preferences of the web form).Thanks! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Peter Mesotten Thomas Berg Il y a 9 années @Thomas,Thanks for your feedback!What I don't get is why you want to use an instanceable portlet. I guess the preferences should be user specific but not really portlet instance specific, so you could use the combination (preferences-company-wide=false, preferences-unique-per-layout=false, preferences-owned-by-group=false). In that case however, your portlet must be non-instanceable. This is no problem as long you don't need multiple portlet instances on the same page.The approach with the model listener seems rather hacky, so I wouldn't really recommend that. Veuillez vous identifier pour voter. Répondre en tant que ... Annuler Thomas Berg Peter Mesotten Il y a 9 années @PeterMy reasons for wanting preferences by instance are these:I embed a JournalArticle and optionally a Web Form Portlet in a view. The embedded web form has default preferences set and its instance id is set by a combination of the articleId and the articles groupId. The portlet that shows this view can possibly be added to multiple layouts in multiple sites. If an administrator edits the preferences of the embedded web form, only the form on that particular layout would be affected.If I could store preferences per instance and group rather than per layout, all views would use the same preferences. Unfortunately, this is not possible as the INSTANCE-part of the portletId is cut off when preferences are stored for preferences-owned-by-group=true and preferences-unique-per-layout=false in combination with instanceable.I submitted a feature request:https://issues.liferay.com/browse/LPS-54751I agree that using a Model Listener is hacky at best and will not go that way. Perhaps I'll look into overriding com.liferay.portal.service.PortletPreferencesLocalService with a hook (or disable to possibility to edit preferences of the web form).Thanks! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Thomas Berg Peter Mesotten Il y a 9 années @PeterMy reasons for wanting preferences by instance are these:I embed a JournalArticle and optionally a Web Form Portlet in a view. The embedded web form has default preferences set and its instance id is set by a combination of the articleId and the articles groupId. The portlet that shows this view can possibly be added to multiple layouts in multiple sites. If an administrator edits the preferences of the embedded web form, only the form on that particular layout would be affected.If I could store preferences per instance and group rather than per layout, all views would use the same preferences. Unfortunately, this is not possible as the INSTANCE-part of the portletId is cut off when preferences are stored for preferences-owned-by-group=true and preferences-unique-per-layout=false in combination with instanceable.I submitted a feature request:https://issues.liferay.com/browse/LPS-54751I agree that using a Model Listener is hacky at best and will not go that way. Perhaps I'll look into overriding com.liferay.portal.service.PortletPreferencesLocalService with a hook (or disable to possibility to edit preferences of the web form).Thanks! Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Parkash Kumar Il y a 7 années Hello Peter,I have came across a situation that I need to set a portlet's preferences by group (site), that it should reflect same preferences set-up, while being updated from any page of that group. But, the tricky part is that the portlet should reflect different preferences for public and private pages of same group.I have already tried with preferences-unique-per-layout and preferences-owned-by-group, but I am observing that on updating portlet's preferences from either public or private pages, it is getting reflect on both.It there any option to set separate portlet preferences for public and private (pages) of a site? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler
Malhar Jajoo Il y a 7 années After using the portletpreference object to store the prefernce , So all we need to do is configure the liferay-portlet.xml ? Veuillez vous identifier pour voter. Répondre en tant que ... Annuler