Class MemberPreferenceManager

java.lang.Object
com.jalios.jcms.memberpreference.MemberPreferenceManager
All Implemented Interfaces:
DBConstants, JPropertiesListener

public class MemberPreferenceManager extends Object implements JPropertiesListener, DBConstants
  • Field Details

  • Method Details

    • getInstance

      public static MemberPreferenceManager getInstance()
    • propertiesChange

      public void propertiesChange(JProperties properties)
      Description copied from interface: JPropertiesListener
      Invoked after properties have been modified in JCMS and save on disk.

      You cannot alter the value received in parameters.

      Note that properties parameter may be null, a limited set of site properties, or all site properties.

      To check that a property has been modified, reload the "current" property instead using channel.getProperties or channel.getProperty.

      Specified by:
      propertiesChange in interface JPropertiesListener
      Parameters:
      properties - the properties which have been submitted to change
    • getPreference

      public String getPreference(Member mbr, String key)
      Returns the given preference for the given member (use default if any)
      Parameters:
      mbr - the member
      key - the key of the preference
      Returns:
      the given preference for the given member
      Since:
      jcms-10.0.0
    • getPreference

      public String getPreference(Member mbr, String key, boolean useDefault)
      Returns the given preference for the given member
      Parameters:
      mbr - the member
      key - the key of the preference
      useDefault - if true and there is no preference fo the given member, search for a default preference
      Returns:
      the given preference for the given member
      Since:
      jcms-10.0.0
    • getDefaultPreference

      public String getDefaultPreference(String key)
      Returns the default value for the given preference
      Parameters:
      key - the key of the preference
      Returns:
      the given preference for the given member
      Since:
      jcms-10.0.0
    • getMemberPreferenceList

      public List<MemberPreference> getMemberPreferenceList(Member mbr)
      Returns all the MemberPreference of the given member.
      Parameters:
      mbr - the member.
      Returns:
      all the MemberPreference of the given member.
      Since:
      jcms-10.0.0
    • savePreference

      public void savePreference(Member mbr, String key, String value)
      Save the preference (key/value) for the given member.
      Parameters:
      mbr - the member
      key - the key of the preference
      value - the value of the preference
      Since:
      jcms-10.0.0
    • saveDefaultPreference

      public void saveDefaultPreference(String key, String value)
    • removeAllPreferences

      public void removeAllPreferences(Member mbr)
      Remove all the preferences of the given member.
      Parameters:
      mbr - the member
      Since:
      jcms-10.0.0
    • removePreference

      public void removePreference(Member mbr, String key)
      Remove a member preference for a given member
      Parameters:
      mbr - the member
      key - the key of the preference
      Since:
      jcms-10.0.3
    • resetCache

      public void resetCache()
      Reset the cache. A new cache is initialized.
      Since:
      jcms-10.0.1
    • hasMemberPreference

      public boolean hasMemberPreference(Member mbr, String key)
    • getDefaultMemberPreferences

      public Map<String,String> getDefaultMemberPreferences()
      Method that returns default memberprefences This method does not include cached memberpreferences
      Returns:
    • getDefaultMemberPreferenceList

      public List<MemberPreference> getDefaultMemberPreferenceList()
      Returns all the default MemberPreference.
      Returns:
      all the default MemberPreference.
      Since:
      jcms-10.0.8