Package com.jalios.jcms.recenthistory
Class RecentHistoryManager
- java.lang.Object
-
- com.jalios.jcms.recenthistory.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 Summary
Fields Modifier and Type Field Description static java.lang.String
RECENT_HISTORY_ATTRIBUTE
static java.lang.String
RECENT_HISTORY_ENABLED_PROP
-
Fields inherited from interface com.jalios.util.JPropertiesListener
REVISION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.static RecentHistoryManager
getInstance()
java.util.Set<Publication>
getPubRecentHistory(Member mbr, java.lang.String workspaceId)
Get the logged member recent browsed data collection.java.util.Set<Publication>
getPubRecentHistory(Member mbr, java.lang.String workspaceId, int maxItemToDisplay)
Get the member recent accessed content collection for the given workspace.java.util.Map<java.lang.String,java.util.Set<RecentHistoryEntry>>
getRecentHistoryMap(Member mbr)
Get the map of recent browsed data.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)boolean
isRecentHistoryEnabled()
void
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.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.void
removeHistory(Member loggedMember, java.lang.String workspaceId, java.lang.String pubId)
Remove the entry in the user history entries for a workspacevoid
updateHistory(Publication pub, Member loggedMember)
Update the navigation history of the member
-
-
-
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
-
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
orchannel.getProperty
.- Specified by:
propertiesChange
in interfaceJPropertiesListener
- 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 memberloggedMember
- 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 memberworkspaceId
- the workspace identifierpubId
- 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 memberworkspaceId
- 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 memberworkspaceId
- 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 memberworkspaceId
- the workspace identifiermaxItemToDisplay
- 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
- theMember
- 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)
-
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 entryset
- the set- Returns:
- true if removed, false otherwise.
- Since:
- jcms-9.0.0
-
-