Class TaskCommentController

java.lang.Object
pro.taskana.task.rest.TaskCommentController

@RestController @EnableHypermediaSupport(type=HAL) public class TaskCommentController extends Object
Controller for all TaskComment related endpoints.
  • Method Details

    • getTaskComment

      @GetMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> getTaskComment(@PathVariable("taskCommentId") 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.NotAuthorizedOnWorkbasketException
      This 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 Comment
      pro.taskana.task.api.exceptions.TaskNotFoundException - TODO: this is never thrown
      pro.taskana.task.api.exceptions.TaskCommentNotFoundException - if the requested Task Comment is not found
      pro.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("taskId") String taskId, jakarta.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 requested
      request - the HTTP request
      filterParameter - the filter parameters
      sortParameter - the sort parameters
      pagingParameter - the paging parameters
      Returns:
      a list of Task Comments
    • deleteTaskComment

      @DeleteMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> deleteTaskComment(@PathVariable("taskCommentId") 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.NotAuthorizedOnWorkbasketException
      This 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 Comment
      pro.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 exist
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the requested Task Comment Id is null or empty
      pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException - if the current user has not correct permissions
      pro.taskana.task.api.exceptions.NotAuthorizedOnTaskCommentException - if the current user has not correct permissions
    • updateTaskComment

      @PutMapping(path="/api/v1/tasks/comments/{taskCommentId}") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskCommentRepresentationModel> updateTaskComment(@PathVariable("taskCommentId") 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.NotAuthorizedOnWorkbasketException
      This 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 Comment
      pro.taskana.task.api.exceptions.TaskNotFoundException - if the referenced Task within the Task Comment does not exist
      pro.taskana.task.api.exceptions.TaskCommentNotFoundException - if the requested Task Comment does not exist
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the Id in the path and in the request body does not match
      pro.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 permissions
      pro.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("taskId") String taskId, @RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.task.api.exceptions.TaskNotFoundException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException
      This 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 Comment
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the Task Comment Id is null or empty
      pro.taskana.task.api.exceptions.TaskNotFoundException - if the requested task does not exist