Search code examples
preferencesliferayportlet

Liferay: how to save to portlet user information?


I have at the welcome page a weather portlet, and user can configure the portlet and select his city. Is it possible to store user information in the portlet preferences, so that every user has his one stored city? Or what is the standard workflow to store user-portlet information without to develop own (persist) service?

thx


Solution

  • The portlet-preferences are in liferay per default not user specific. That can be modified in liferay-portlet.xml with next lines:

    <liferay-portlet-app>
      <portlet>
        <portlet-name>ThePortletWitchUserSpecificPreferences</portlet-name>
        <icon>/icon.png</icon>
        <preferences-unique-per-layout>false</preferences-unique-per-layout>
        <preferences-owned-by-group>false</preferences-owned-by-group>
      </portlet>
    ...
    </liferay-portlet-app>
    

    the two lines <preferences-... and the order are abbreviated.

    for more information see: http://rutvijshah.wordpress.com/2009/12/06/user-specific-preferences-in-liferay/