Class WorkspaceThreadCommentDAO
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.WorkspaceThreadCommentDAO
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,Serviceable
DAO for manipulating thread comments
-
Field Summary
FieldsFields inherited from class org.ametys.plugins.workspaces.forum.AbstractWorkspaceThreadDAO
_threadJSONHelper, _workspaceThreadUserPrefDAOFields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectRightHelper, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RichTextComment_setAcceptedComment(CommentableAmetysObject<RichTextComment> commentableAmetysObject, String commentId, ModifiableTraversableAmetysObject moduleRoot, boolean isAccepted) Cancel a comment set as accepted answeracceptComment(String threadId, String commentId, String oldCommentId, Boolean accepted) Accept a thread's commentanswerComment(String threadId, String commentId, String commentText) Answer to a thread commentcancelAcceptComment(String threadId, String commentId, Boolean accepted) Cancel a comment set as accepted answerclearReports(String threadId, String commentId) Clear reports of a thread's commentcreateComment(String threadId, String commentText) Comment a threaddeleteComment(String threadId, String commentId, Boolean accepted) Delete a thread commenteditComment(String threadId, String commentId, String commentText) Edit a thread commentlikeOrUnlikeComment(String threadId, String commentId, Boolean liked) Like or unlike a thread's commentreportComment(String threadId, String commentId) Report a thread's commentMethods inherited from class org.ametys.plugins.workspaces.forum.AbstractWorkspaceThreadDAO
_checkUserRights, _getModuleRoot, _getModuleRoot, _getThreadRoot, serviceMethods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkReadAccess, _checkUserReadingRights, _checkUserRights, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, getProjectName, getSitemapLanguage, getSiteName, likeOrUnlikeCommentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role
-
-
Constructor Details
-
WorkspaceThreadCommentDAO
public WorkspaceThreadCommentDAO()
-
-
Method Details
-
createComment
Comment a thread- Parameters:
threadId- the thread idcommentText- the comment text- Returns:
- The thread data
-
editComment
Edit a thread comment- Parameters:
threadId- the thread idcommentId- the comment IdcommentText- the comment text- Returns:
- The thread data
-
deleteComment
Delete a thread comment- Parameters:
threadId- the thread idcommentId- the comment idaccepted- filter by accepted answer- Returns:
- The thread data
-
answerComment
Answer to a thread comment- Parameters:
threadId- the thread idcommentId- the comment idcommentText- the comment text- Returns:
- The thread data
-
likeOrUnlikeComment
Like or unlike a thread's comment- Parameters:
threadId- the thread idcommentId- the comment idliked- true if the comment is liked, otherwise the comment is unliked- Returns:
- The thread data
-
acceptComment
public Map<String,Object> acceptComment(String threadId, String commentId, String oldCommentId, Boolean accepted) Accept a thread's comment- Parameters:
threadId- the thread idcommentId- the comment id to set as new accepted answeroldCommentId- the comment id of the old accepted answer, to set to false if it existsaccepted- filter by accepted answer- Returns:
- The thread data
-
cancelAcceptComment
Cancel a comment set as accepted answer- Parameters:
threadId- the thread idcommentId- the comment id to remove as accepted answeraccepted- filter by accepted answer- Returns:
- The thread data
-
_setAcceptedComment
protected RichTextComment _setAcceptedComment(CommentableAmetysObject<RichTextComment> commentableAmetysObject, String commentId, ModifiableTraversableAmetysObject moduleRoot, boolean isAccepted) Cancel a comment set as accepted answer- Parameters:
commentableAmetysObject- the commentableAmetysObjectcommentId- the comment id to remove as accepted answermoduleRoot- the module rootisAccepted- true to set the comment as accepted answer.- Returns:
- The commentableAmetysObject
-
reportComment
Report a thread's comment- Parameters:
threadId- the thread idcommentId- the comment id of the comment to report- Returns:
- The thread data
-
clearReports
Clear reports of a thread's comment- Parameters:
threadId- the thread idcommentId- the comment id of the comment to clear- Returns:
- The thread data
-