Class WorkspaceExplorerResourceCommentsDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceDAO
org.ametys.plugins.workspaces.documents.WorkspaceExplorerResourceCommentsDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
DAO for resources of a project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DocumentsJSONHelper
The task JSON helperstatic final String
Right id to comment a resourceFields 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 TypeMethodDescriptionaddComment
(String resourceId, String commentText) Comment a resourceanswerCommentResource
(String resourceId, String commentId, String commentText) Answer to a resource's commenteditCommentResource
(String resourceId, String commentId, String commentText) Edit a resource commentgetComments
(String resourceId) Get commentsvoid
service
(ServiceManager manager) 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
-
RIGHTS_RESOURCE_COMMENT
Right id to comment a resource- See Also:
-
_documentsJSONHelper
The task JSON helper
-
-
Constructor Details
-
WorkspaceExplorerResourceCommentsDAO
public WorkspaceExplorerResourceCommentsDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceDAO
- Throws:
ServiceException
-
addComment
public List<Map<String,Object>> addComment(String resourceId, String commentText) throws IllegalAccessException Comment a resource- Parameters:
resourceId
- the resource idcommentText
- the comment text- Returns:
- The resource data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
getComments
Get comments- Parameters:
resourceId
- the resource id- Returns:
- The resource data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
editCommentResource
public List<Map<String,Object>> editCommentResource(String resourceId, String commentId, String commentText) throws IllegalAccessException Edit a resource comment- Parameters:
resourceId
- the resource idcommentId
- the comment IdcommentText
- the comment text- Returns:
- The resource data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-
answerCommentResource
public List<Map<String,Object>> answerCommentResource(String resourceId, String commentId, String commentText) throws IllegalAccessException Answer to a resource's comment- Parameters:
resourceId
- the resource idcommentId
- the comment idcommentText
- the comment text- Returns:
- The resource data
- Throws:
IllegalAccessException
- If an error occurs when checking the rights
-