Class TaskCommentController


  • @RestController
    @EnableHypermediaSupport(type=HAL)
    public class TaskCommentController
    extends Object
    Controller for all TaskComment related endpoints.
    • 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.common.api.exceptions.NotAuthorizedException,
                                                                                                      pro.taskana.task.api.exceptions.TaskNotFoundException,
                                                                                                      pro.taskana.task.api.exceptions.TaskCommentNotFoundException,
                                                                                                      pro.taskana.common.api.exceptions.InvalidArgumentException
        This endpoint retrieves a Task Comment.
        Parameters:
        taskCommentId - the Id of the Task Comment
        Returns:
        the Task Comment
        Throws:
        pro.taskana.common.api.exceptions.NotAuthorizedException - 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
                                                                                                                 String taskId,
                                                                                                                 @RequestParam(name="sort-by",required=false)
                                                                                                                 List<pro.taskana.task.rest.TaskCommentController.TaskCommentsSortBy> sortBy,
                                                                                                                 @RequestParam(required=false)
                                                                                                                 List<pro.taskana.common.api.BaseQuery.SortDirection> order)
                                                                                                          throws pro.taskana.common.api.exceptions.NotAuthorizedException,
                                                                                                                 pro.taskana.task.api.exceptions.TaskNotFoundException,
                                                                                                                 pro.taskana.common.api.exceptions.InvalidArgumentException
        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
        sortBy - Sort the result by a given field. Multiple sort values can be declared. When the primary sort value is the same, the second one will be used.
        order - The order direction for each sort value. This value requires the use of 'sort-by'. The amount of sort-by and order declarations have to match. Alternatively the value can be omitted. In this case the default sort order (ASCENDING) will be applied to every sort-by value.
        Returns:
        a list of Task Comments
        Throws:
        pro.taskana.common.api.exceptions.NotAuthorizedException - If the current user has no authorization to retrieve a Task Comment from a certain Task or is not authorized to access the Task.
        pro.taskana.task.api.exceptions.TaskNotFoundException - If the given Task Id in the Task Comment does not refer to an existing Task
        pro.taskana.common.api.exceptions.InvalidArgumentException - if some parameters were not supplied correctly
      • 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.common.api.exceptions.NotAuthorizedException,
                                                                                                         pro.taskana.task.api.exceptions.TaskNotFoundException,
                                                                                                         pro.taskana.task.api.exceptions.TaskCommentNotFoundException,
                                                                                                         pro.taskana.common.api.exceptions.InvalidArgumentException
        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
      • 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.common.api.exceptions.NotAuthorizedException,
                                                                                                         pro.taskana.task.api.exceptions.TaskNotFoundException,
                                                                                                         pro.taskana.task.api.exceptions.TaskCommentNotFoundException,
                                                                                                         pro.taskana.common.api.exceptions.InvalidArgumentException,
                                                                                                         pro.taskana.common.api.exceptions.ConcurrencyException
        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.
      • 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.NotAuthorizedException,
                                                                                                         pro.taskana.common.api.exceptions.InvalidArgumentException,
                                                                                                         pro.taskana.task.api.exceptions.TaskNotFoundException
        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.common.api.exceptions.NotAuthorizedException - 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