Class TaskController


  • @RestController
    @RequestMapping("/api/task")
    @ConditionalOnProperty(value="nae.task.web.enabled",
                           havingValue="true",
                           matchIfMissing=true)
    public class TaskController
    extends AbstractTaskController
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger log  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> assign​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> cancel​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.util.Locale locale)  
      CountResponse count​(SingleElasticTaskSearchRequestAsList query, MergeFilterOperation operation, org.springframework.security.core.Authentication auth, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> delegate​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.lang.String delegatedId, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteFile​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.lang.String fieldId, java.lang.String parentTaskId)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteNamedFile​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.lang.String fieldId, java.lang.String name, java.lang.String parentTaskId)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> finish​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.util.Locale locale)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> getAll​(org.springframework.security.core.Authentication auth, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> getAllByCases​(java.util.List<java.lang.String> cases, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> getData​(java.lang.String taskId, java.util.Locale locale)  
      org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFile​(java.lang.String taskId, java.lang.String fieldId, javax.servlet.http.HttpServletResponse response)  
      org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFilePreview​(java.lang.String taskId, java.lang.String fieldId, javax.servlet.http.HttpServletResponse response)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> getMy​(org.springframework.security.core.Authentication auth, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> getMyFinished​(org.springframework.data.domain.Pageable pageable, org.springframework.security.core.Authentication auth, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getNamedFile​(java.lang.String taskId, java.lang.String fieldId, java.lang.String name, javax.servlet.http.HttpServletResponse response)  
      LocalisedTaskResource getOne​(java.lang.String taskId, java.util.Locale locale)  
      java.util.List<TaskReference> getTasksOfCase​(java.lang.String caseId, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFile​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.lang.String fieldId, java.util.Map<java.lang.String,​java.lang.String> dataBody, org.springframework.web.multipart.MultipartFile multipartFile, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFiles​(org.springframework.security.core.Authentication auth, java.lang.String taskId, java.lang.String fieldId, java.util.Map<java.lang.String,​java.lang.String> dataBody, org.springframework.web.multipart.MultipartFile[] multipartFiles)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> search​(org.springframework.security.core.Authentication auth, org.springframework.data.domain.Pageable pageable, SingleTaskSearchRequestAsList searchBody, MergeFilterOperation operation, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.hateoas.PagedModel<LocalisedTaskResource> searchElastic​(org.springframework.security.core.Authentication auth, org.springframework.data.domain.Pageable pageable, SingleElasticTaskSearchRequestAsList searchBody, MergeFilterOperation operation, org.springframework.data.web.PagedResourcesAssembler<Task> assembler, java.util.Locale locale)  
      org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> setData​(org.springframework.security.core.Authentication auth, java.lang.String taskId, com.fasterxml.jackson.databind.node.ObjectNode dataBody, java.util.Locale locale)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        public static final org.slf4j.Logger log
    • Method Detail

      • getAll

        @GetMapping(produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> getAll​(org.springframework.security.core.Authentication auth,
                                                                                    org.springframework.data.domain.Pageable pageable,
                                                                                    org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                    java.util.Locale locale)
        Overrides:
        getAll in class AbstractTaskController
      • getAllByCases

        @PostMapping(value="/case",
                     consumes="application/json",
                     produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> getAllByCases​(@RequestBody
                                                                                           java.util.List<java.lang.String> cases,
                                                                                           org.springframework.data.domain.Pageable pageable,
                                                                                           org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                           java.util.Locale locale)
        Overrides:
        getAllByCases in class AbstractTaskController
      • getTasksOfCase

        @GetMapping(value="/case/{id}",
                    produces="application/json")
        public java.util.List<TaskReference> getTasksOfCase​(@PathVariable("id")
                                                            java.lang.String caseId,
                                                            java.util.Locale locale)
        Overrides:
        getTasksOfCase in class AbstractTaskController
      • assign

        @PreAuthorize("@taskAuthorizationService.canCallAssign(#auth.getPrincipal(), #taskId)")
        @GetMapping(value="/assign/{id}",
                    produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> assign​(org.springframework.security.core.Authentication auth,
                                                                                       @PathVariable("id")
                                                                                       java.lang.String taskId,
                                                                                       java.util.Locale locale)
      • delegate

        @PreAuthorize("@taskAuthorizationService.canCallDelegate(#auth.getPrincipal(), #taskId)")
        @PostMapping(value="/delegate/{id}",
                     consumes="text/plain",
                     produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> delegate​(org.springframework.security.core.Authentication auth,
                                                                                         @PathVariable("id")
                                                                                         java.lang.String taskId,
                                                                                         @RequestBody
                                                                                         java.lang.String delegatedId,
                                                                                         java.util.Locale locale)
      • finish

        @PreAuthorize("@taskAuthorizationService.canCallFinish(#auth.getPrincipal(), #taskId)")
        @GetMapping(value="/finish/{id}",
                    produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> finish​(org.springframework.security.core.Authentication auth,
                                                                                       @PathVariable("id")
                                                                                       java.lang.String taskId,
                                                                                       java.util.Locale locale)
      • cancel

        @PreAuthorize("@taskAuthorizationService.canCallCancel(#auth.getPrincipal(), #taskId)")
        @GetMapping(value="/cancel/{id}",
                    produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> cancel​(org.springframework.security.core.Authentication auth,
                                                                                       @PathVariable("id")
                                                                                       java.lang.String taskId,
                                                                                       java.util.Locale locale)
      • getMy

        @GetMapping(value="/my",
                    produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> getMy​(org.springframework.security.core.Authentication auth,
                                                                                   org.springframework.data.domain.Pageable pageable,
                                                                                   org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                   java.util.Locale locale)
        Overrides:
        getMy in class AbstractTaskController
      • getMyFinished

        @GetMapping(value="/my/finished",
                    produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> getMyFinished​(org.springframework.data.domain.Pageable pageable,
                                                                                           org.springframework.security.core.Authentication auth,
                                                                                           org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                           java.util.Locale locale)
        Overrides:
        getMyFinished in class AbstractTaskController
      • search

        @PostMapping(value="/search",
                     consumes="application/json",
                     produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> search​(org.springframework.security.core.Authentication auth,
                                                                                    org.springframework.data.domain.Pageable pageable,
                                                                                    @RequestBody
                                                                                    SingleTaskSearchRequestAsList searchBody,
                                                                                    @RequestParam(defaultValue="OR")
                                                                                    MergeFilterOperation operation,
                                                                                    org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                    java.util.Locale locale)
        Overrides:
        search in class AbstractTaskController
      • searchElastic

        @PostMapping(value="/search_es",
                     consumes="application/json",
                     produces="application/hal+json")
        public org.springframework.hateoas.PagedModel<LocalisedTaskResource> searchElastic​(org.springframework.security.core.Authentication auth,
                                                                                           org.springframework.data.domain.Pageable pageable,
                                                                                           @RequestBody
                                                                                           SingleElasticTaskSearchRequestAsList searchBody,
                                                                                           @RequestParam(defaultValue="OR")
                                                                                           MergeFilterOperation operation,
                                                                                           org.springframework.data.web.PagedResourcesAssembler<Task> assembler,
                                                                                           java.util.Locale locale)
        Overrides:
        searchElastic in class AbstractTaskController
      • getData

        @GetMapping(value="/{id}/data",
                    produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> getData​(@PathVariable("id")
                                                                                        java.lang.String taskId,
                                                                                        java.util.Locale locale)
        Overrides:
        getData in class AbstractTaskController
      • setData

        @PreAuthorize("@taskAuthorizationService.canCallSaveData(#auth.getPrincipal(), #taskId)")
        @PostMapping(value="/{id}/data",
                     consumes="application/json",
                     produces="application/json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> setData​(org.springframework.security.core.Authentication auth,
                                                                                        @PathVariable("id")
                                                                                        java.lang.String taskId,
                                                                                        @RequestBody
                                                                                        com.fasterxml.jackson.databind.node.ObjectNode dataBody,
                                                                                        java.util.Locale locale)
      • saveFile

        @PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)")
        @PostMapping(value="/{id}/file/{field}",
                     produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFile​(org.springframework.security.core.Authentication auth,
                                                                                         @PathVariable("id")
                                                                                         java.lang.String taskId,
                                                                                         @PathVariable("field")
                                                                                         java.lang.String fieldId,
                                                                                         @RequestPart("data")
                                                                                         java.util.Map<java.lang.String,​java.lang.String> dataBody,
                                                                                         @RequestPart("file")
                                                                                         org.springframework.web.multipart.MultipartFile multipartFile,
                                                                                         java.util.Locale locale)
      • getFile

        @GetMapping(value="/{id}/file/{field}",
                    produces="application/octet-stream")
        public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFile​(@PathVariable("id")
                                                                                                     java.lang.String taskId,
                                                                                                     @PathVariable("field")
                                                                                                     java.lang.String fieldId,
                                                                                                     javax.servlet.http.HttpServletResponse response)
                                                                                              throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • deleteFile

        @PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)")
        @DeleteMapping(value="/{id}/file/{field}",
                       produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteFile​(org.springframework.security.core.Authentication auth,
                                                                                           @PathVariable("id")
                                                                                           java.lang.String taskId,
                                                                                           @PathVariable("field")
                                                                                           java.lang.String fieldId,
                                                                                           @RequestParam("parentTaskId")
                                                                                           java.lang.String parentTaskId)
      • saveFiles

        @PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)")
        @PostMapping(value="/{id}/files/{field}",
                     produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFiles​(org.springframework.security.core.Authentication auth,
                                                                                          @PathVariable("id")
                                                                                          java.lang.String taskId,
                                                                                          @PathVariable("field")
                                                                                          java.lang.String fieldId,
                                                                                          @RequestPart("data")
                                                                                          java.util.Map<java.lang.String,​java.lang.String> dataBody,
                                                                                          @RequestPart("files")
                                                                                          org.springframework.web.multipart.MultipartFile[] multipartFiles)
      • getNamedFile

        @GetMapping(value="/{id}/file/{field}/{name}",
                    produces="application/octet-stream")
        public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getNamedFile​(@PathVariable("id")
                                                                                                          java.lang.String taskId,
                                                                                                          @PathVariable("field")
                                                                                                          java.lang.String fieldId,
                                                                                                          @PathVariable("name")
                                                                                                          java.lang.String name,
                                                                                                          javax.servlet.http.HttpServletResponse response)
                                                                                                   throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • deleteNamedFile

        @PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)")
        @DeleteMapping(value="/{id}/file/{field}/{name}",
                       produces="application/hal+json")
        public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteNamedFile​(org.springframework.security.core.Authentication auth,
                                                                                                @PathVariable("id")
                                                                                                java.lang.String taskId,
                                                                                                @PathVariable("field")
                                                                                                java.lang.String fieldId,
                                                                                                @PathVariable("name")
                                                                                                java.lang.String name,
                                                                                                @RequestParam("parentTaskId")
                                                                                                java.lang.String parentTaskId)
      • getFilePreview

        @GetMapping(value="/{id}/file_preview/{field}",
                    produces="application/octet-stream")
        public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFilePreview​(@PathVariable("id")
                                                                                                            java.lang.String taskId,
                                                                                                            @PathVariable("field")
                                                                                                            java.lang.String fieldId,
                                                                                                            javax.servlet.http.HttpServletResponse response)
                                                                                                     throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException