Class RecentHistoryManager

  • All Implemented Interfaces:
    JPropertiesListener

    public class RecentHistoryManager
    extends java.lang.Object
    implements JPropertiesListener
    The Recent history manager
    Since:
    jcms-9.0.0
    Author:
    Kevin Bransard
    • Field Detail

      • RECENT_HISTORY_ATTRIBUTE

        public static final java.lang.String RECENT_HISTORY_ATTRIBUTE
        See Also:
        Constant Field Values
      • RECENT_HISTORY_ENABLED_PROP

        public static final java.lang.String RECENT_HISTORY_ENABLED_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
      • isRecentHistoryEnabled

        public boolean isRecentHistoryEnabled()
        Returns:
        true if Recent History is enabled
        Since:
        jcms-9.0.3
      • updateHistory

        public void updateHistory​(Publication pub,
                                  Member loggedMember)
        Update the navigation history of the member
        Parameters:
        pub - the content or user content accessed by the member
        loggedMember - the member
        Since:
        jcms-9.0.0
      • removeHistory

        public void removeHistory​(Member loggedMember,
                                  java.lang.String workspaceId,
                                  java.lang.String pubId)
        Remove the entry in the user history entries for a workspace
        Parameters:
        loggedMember - the member
        workspaceId - the workspace identifier
        pubId - the Publication to remove from recent history
        Since:
        jcms-9.0.0
      • clearHistory

        public void clearHistory​(Member loggedMember,
                                 java.lang.String workspaceId)
        Clean the logged member history in the given workspace.
        If the workspace is empty clear, it cleans all history.
        Parameters:
        loggedMember - the member
        workspaceId - the workspace identifier
        Since:
        jcms-9.0.0
      • getPubRecentHistory

        public java.util.Set<Publication> getPubRecentHistory​(Member mbr,
                                                              java.lang.String workspaceId)
        Get the logged member recent browsed data collection.
        Parameters:
        mbr - logged member
        workspaceId - the workspace id, can be empty
        Returns:
        the collection of recent browsed publication.
        Since:
        jcms-9.0.0
      • getPubRecentHistory

        public java.util.Set<Publication> getPubRecentHistory​(Member mbr,
                                                              java.lang.String workspaceId,
                                                              int maxItemToDisplay)
        Get the member recent accessed content collection for the given workspace.
        Parameters:
        mbr - the member
        workspaceId - the workspace identifier
        maxItemToDisplay - the number of items to display
        Returns:
        the collection of recent accessed content
        Since:
        jcms-9.0.0
      • getRecentHistoryMap

        public java.util.Map<java.lang.String,​java.util.Set<RecentHistoryEntry>> getRecentHistoryMap​(Member mbr)
        Get the map of recent browsed data.
        Parameters:
        mbr - the Member
        Returns:
        the map of RecentHistoryEntry for given Member
        Since:
        jcms-9.0.0
      • getRecentWorkspaceSet

        public java.util.Set<Workspace> getRecentWorkspaceSet​(Member mbr,
                                                              java.lang.String userLang,
                                                              boolean belongsToWorkspace,
                                                              boolean isWorker,
                                                              boolean withPortal)
        Returns the set of recently browsed Workspace (Workspace is returned when at least one of its publication has been read by the member)
        Parameters:
        mbr - the Member
        userLang - the current user language
        Returns:
        the set of Workspace sorted on given member recent navigation
        Since:
        jcms-10.0.0
      • removeEntry

        public boolean removeEntry​(java.lang.String heId,
                                   java.util.Set<RecentHistoryEntry> set)
        Removes the specified history entry from this set by id if it is present.
        Parameters:
        heId - the id of the entry
        set - the set
        Returns:
        true if removed, false otherwise.
        Since:
        jcms-9.0.0