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, _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, _getThreadByID, _getThreadRoot, serviceMethods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkUserReadingRights, _checkUserRights, _getProject, _getProjectName, _getSitemapLanguage, _getSiteName, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, 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
public Map<String,Object> createComment(String threadId, String commentText) throws IllegalAccessException Comment a thread- Parameters:
threadId- the thread idcommentText- the comment text- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
editComment
public Map<String,Object> editComment(String threadId, String commentId, String commentText) throws IllegalAccessException Edit a thread comment- Parameters:
threadId- the thread idcommentId- the comment IdcommentText- the comment text- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
deleteComment
public Map<String,Object> deleteComment(String threadId, String commentId, Boolean accepted) throws IllegalAccessException Delete a thread comment- Parameters:
threadId- the thread idcommentId- the comment idaccepted- filter by accepted answer- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
answerComment
public Map<String,Object> answerComment(String threadId, String commentId, String commentText) throws IllegalAccessException Answer to a thread comment- Parameters:
threadId- the thread idcommentId- the comment idcommentText- the comment text- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
likeOrUnlikeComment
public Map<String,Object> likeOrUnlikeComment(String threadId, String commentId, Boolean liked) throws IllegalAccessException 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
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
acceptComment
public Map<String,Object> acceptComment(String threadId, String commentId, String oldCommentId, Boolean accepted) throws IllegalAccessException 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
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
cancelAcceptComment
public Map<String,Object> cancelAcceptComment(String threadId, String commentId, Boolean accepted) throws IllegalAccessException 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
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
_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
public Map<String,Object> reportComment(String threadId, String commentId) throws IllegalAccessException Report a thread's comment- Parameters:
threadId- the thread idcommentId- the comment id of the comment to report- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-
clearReports
public Map<String,Object> clearReports(String threadId, String commentId) throws IllegalAccessException Clear reports of a thread's comment- Parameters:
threadId- the thread idcommentId- the comment id of the comment to clear- Returns:
- The thread data
- Throws:
IllegalAccessException- If an error occurs when checking the rights
-