Class MemberPreferenceManager

    • Field Detail

      • CACHE_ENABLED_PROP

        public static final java.lang.String CACHE_ENABLED_PROP
        See Also:
        Constant Field Values
      • CACHE_MAX_ENTRIES_PROP

        public static final java.lang.String CACHE_MAX_ENTRIES_PROP
        See Also:
        Constant Field Values
    • Method Detail

      • 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 java.lang.String getPreference​(Member mbr,
                                              java.lang.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 java.lang.String getPreference​(Member mbr,
                                              java.lang.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 java.lang.String getDefaultPreference​(java.lang.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 java.util.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,
                                   java.lang.String key,
                                   java.lang.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​(java.lang.String key,
                                          java.lang.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,
                                     java.lang.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