Class WorkspaceThreadUserPreferencesDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceDAO
org.ametys.plugins.workspaces.forum.AbstractWorkspaceThreadDAO
org.ametys.plugins.workspaces.forum.WorkspaceThreadUserPreferencesDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
DAO for thread's user prefrerences
-
Field Summary
Modifier and TypeFieldDescriptionprotected UserPreferencesManager
The user preferencesstatic final String
the user preferences context for activity streamstatic final String
Avalon RoleFields inherited from class org.ametys.plugins.workspaces.forum.AbstractWorkspaceThreadDAO
_threadJSONHelper, _workspaceThreadUserPrefDAO
Fields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearUnopenedThreadNotification
(String threadId) Update the user prefs of current user, so we can know that he has opened the threadvoid
clearUnreadCommentsNotification
(String threadId, String commentId) Update the user prefs of current usergetLastReadDate
(Thread thread) Get the last read date of a thread for the current userlong
getUnreadCommentNumber
(Thread thread) Get how many unread comments a user who has already opened a thread hasboolean
hasNotification
(Thread thread) Check if the thread has been currently read by the current user since the last contribution (creation or new comment)boolean
hasOpenedThread
(Thread thread) Check if the thread has been opened by the current uservoid
service
(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.forum.AbstractWorkspaceThreadDAO
_checkUserRights, _getModuleRoot, _getModuleRoot, _getThreadByID, _getThreadRoot
Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkUserReadingRights, _checkUserRights, _getProject, _getProjectName, _getSitemapLanguage, _getSiteName, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, likeOrUnlikeComment
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
LAST_THREAD_READ_USER_PREF_CONTEXT
the user preferences context for activity stream- See Also:
-
_userPrefsManager
The user preferences
-
-
Constructor Details
-
WorkspaceThreadUserPreferencesDAO
public WorkspaceThreadUserPreferencesDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceThreadDAO
- Throws:
ServiceException
-
clearUnopenedThreadNotification
Update the user prefs of current user, so we can know that he has opened the thread- Parameters:
threadId
- the thread id
-
clearUnreadCommentsNotification
Update the user prefs of current user- Parameters:
threadId
- the thread idcommentId
- last seen comment id
-
hasNotification
Check if the thread has been currently read by the current user since the last contribution (creation or new comment)- Parameters:
thread
- the thread- Returns:
- true if the thread has been currently read by the current user
-
hasOpenedThread
Check if the thread has been opened by the current user- Parameters:
thread
- the thread- Returns:
- true if the thread has been opened by the current user
-
getUnreadCommentNumber
Get how many unread comments a user who has already opened a thread has- Parameters:
thread
- the thread- Returns:
- the number of unread comments
-
getLastReadDate
Get the last read date of a thread for the current user- Parameters:
thread
- the thread- Returns:
- the last read date of a thread for the current user
-