Package pro.taskana.task.rest
Class TaskCommentController
- java.lang.Object
-
- pro.taskana.task.rest.TaskCommentController
-
@RestController @EnableHypermediaSupport(type=HAL) public class TaskCommentController extends Object
Controller for allTaskCommentrelated endpoints.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskCommentController.TaskCommentQuerySortBystatic classTaskCommentController.TaskCommentQuerySortParameter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<TaskCommentRepresentationModel>createTaskComment(String taskId, TaskCommentRepresentationModel taskCommentRepresentationModel)This endpoint creates a Task Comment.org.springframework.http.ResponseEntity<TaskCommentRepresentationModel>deleteTaskComment(String taskCommentId)This endpoint deletes a given Task Comment.org.springframework.http.ResponseEntity<TaskCommentRepresentationModel>getTaskComment(String taskCommentId)This endpoint retrieves a Task Comment.org.springframework.http.ResponseEntity<TaskCommentCollectionRepresentationModel>getTaskComments(String taskId, javax.servlet.http.HttpServletRequest request, TaskCommentQueryFilterParameter filterParameter, TaskCommentController.TaskCommentQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.task.api.models.TaskComment,pro.taskana.task.api.TaskCommentQuery> pagingParameter)This endpoint retrieves all Task Comments for a specific Task.org.springframework.http.ResponseEntity<TaskCommentRepresentationModel>updateTaskComment(String taskCommentId, TaskCommentRepresentationModel taskCommentRepresentationModel)This endpoint updates a given Task Comment.
-
-
-
Method Detail
-
getTaskComment
@GetMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> getTaskComment(@PathVariable String taskCommentId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.TaskCommentNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketExceptionThis endpoint retrieves a Task Comment.- Parameters:
taskCommentId- the Id of the Task Comment- Returns:
- the Task Comment
- Throws:
pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the user is not authorized for the requested Task Commentpro.taskana.task.api.exceptions.TaskNotFoundException- TODO: this is never thrownpro.taskana.task.api.exceptions.TaskCommentNotFoundException- if the requested Task Comment is not foundpro.taskana.common.api.exceptions.InvalidArgumentException- if the requested Id is null or empty
-
getTaskComments
@GetMapping(path="/api/v1/tasks/{taskId}/comments") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentCollectionRepresentationModel> getTaskComments(@PathVariable String taskId, javax.servlet.http.HttpServletRequest request, TaskCommentQueryFilterParameter filterParameter, TaskCommentController.TaskCommentQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.task.api.models.TaskComment,pro.taskana.task.api.TaskCommentQuery> pagingParameter)This endpoint retrieves all Task Comments for a specific Task. Further filters can be applied.- Parameters:
taskId- the Id of the Task whose comments are requestedrequest- the HTTP requestfilterParameter- the filter parameterssortParameter- the sort parameterspagingParameter- the paging parameters- Returns:
- a list of Task Comments
-
deleteTaskComment
@DeleteMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> deleteTaskComment(@PathVariable String taskCommentId) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.TaskCommentNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.task.api.exceptions.NotAuthorizedOnTaskCommentException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketExceptionThis endpoint deletes a given Task Comment.- Parameters:
taskCommentId- the Id of the Task Comment which should be deleted- Returns:
- no content, if everything went well.
- Throws:
pro.taskana.common.api.exceptions.NotAuthorizedException- if the current user is not authorized to delete a Task Commentpro.taskana.task.api.exceptions.TaskNotFoundException- If the given Task Id in the Task Comment does not refer to an existing task.pro.taskana.task.api.exceptions.TaskCommentNotFoundException- if the requested Task Comment does not existpro.taskana.common.api.exceptions.InvalidArgumentException- if the requested Task Comment Id is null or emptypro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correct permissionspro.taskana.task.api.exceptions.NotAuthorizedOnTaskCommentException- if the current user has not correct permissions
-
updateTaskComment
@PutMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> updateTaskComment(@PathVariable String taskCommentId, @RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel) throws pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.task.api.exceptions.TaskCommentNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.ConcurrencyException, pro.taskana.task.api.exceptions.NotAuthorizedOnTaskCommentException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketExceptionThis endpoint updates a given Task Comment.- Parameters:
taskCommentId- the Task Comment which should be updated.taskCommentRepresentationModel- the new comment for the requested id.- Returns:
- the updated Task Comment
- Throws:
pro.taskana.common.api.exceptions.NotAuthorizedException- if the current user does not have access to the Task Commentpro.taskana.task.api.exceptions.TaskNotFoundException- if the referenced Task within the Task Comment does not existpro.taskana.task.api.exceptions.TaskCommentNotFoundException- if the requested Task Comment does not existpro.taskana.common.api.exceptions.InvalidArgumentException- if the Id in the path and in the request body does not matchpro.taskana.common.api.exceptions.ConcurrencyException- if the requested Task Comment has been updated in the meantime by a different process.pro.taskana.task.api.exceptions.NotAuthorizedOnTaskCommentException- if the current user has not correct permissionspro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correct permissions
-
createTaskComment
@PostMapping(path="/api/v1/tasks/{taskId}/comments") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> createTaskComment(@PathVariable String taskId, @RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketExceptionThis endpoint creates a Task Comment.- Parameters:
taskId- the Id of the Task where a Task Comment should be created.taskCommentRepresentationModel- the Task Comment to create.- Returns:
- the created Task Comment
- Throws:
pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user is not authorized to create a Task Commentpro.taskana.common.api.exceptions.InvalidArgumentException- if the Task Comment Id is null or emptypro.taskana.task.api.exceptions.TaskNotFoundException- if the requested task does not exist
-
-