Class RecentHistoryManager

java.lang.Object
com.jalios.jcms.recenthistory.RecentHistoryManager
All Implemented Interfaces:
JPropertiesListener

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

  • Method Details

    • getInstance

      public static RecentHistoryManager 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
    • 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, String workspaceId, 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, 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 Set<Publication> getPubRecentHistory(Member mbr, 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 Set<Publication> getPubRecentHistory(Member mbr, 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 Map<String,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 Set<Workspace> getRecentWorkspaceSet(Member mbr, 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
      belongsToWorkspace - if true the member must belongs to the workspace
      isWorker - if true the member must be a worker in the workspace
      withPortal - if true the workspace must have a portal
      Returns:
      the set of Workspace sorted on given member recent navigation
      Since:
      jcms-10.0.0
    • removeEntry

      public boolean removeEntry(String heId, 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