Class TaskController
- java.lang.Object
-
- com.netgrif.application.engine.workflow.web.AbstractTaskController
-
- com.netgrif.application.engine.workflow.web.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.Loggerlog
-
Constructor Summary
Constructors Constructor Description TaskController(ITaskService taskService, IDataService dataService, IElasticTaskService searchService)
-
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)CountResponsecount(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, FileFieldRequest requestBody)org.springframework.hateoas.EntityModel<EventOutcomeWithMessage>deleteNamedFile(org.springframework.security.core.Authentication auth, java.lang.String taskId, FileFieldRequest requestBody)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)org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>getFilePreview(java.lang.String taskId, java.lang.String fieldId)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 fileName)LocalisedTaskResourcegetOne(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, FileFieldRequest 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, FileFieldRequest requestBody, 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 com.netgrif.application.engine.workflow.web.AbstractTaskController
assign, cancel, delegate, deleteFile, deleteNamedFile, finish, saveFile, saveFiles, searchPublic, setData
-
-
-
-
Constructor Detail
-
TaskController
public TaskController(ITaskService taskService, IDataService dataService, IElasticTaskService searchService)
-
-
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:
getAllin classAbstractTaskController
-
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:
getAllByCasesin classAbstractTaskController
-
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:
getTasksOfCasein classAbstractTaskController
-
getOne
@GetMapping(value="/{id}", produces="application/hal+json") public LocalisedTaskResource getOne(@PathVariable("id") java.lang.String taskId, java.util.Locale locale)- Overrides:
getOnein classAbstractTaskController
-
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:
getMyin classAbstractTaskController
-
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:
getMyFinishedin classAbstractTaskController
-
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:
searchin classAbstractTaskController
-
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:
searchElasticin classAbstractTaskController
-
count
@PostMapping(value="/count", consumes="application/json", produces="application/json") public CountResponse count(@RequestBody SingleElasticTaskSearchRequestAsList query, @RequestParam(defaultValue="OR") MergeFilterOperation operation, org.springframework.security.core.Authentication auth, java.util.Locale locale)- Overrides:
countin classAbstractTaskController
-
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:
getDatain classAbstractTaskController
-
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", produces="application/hal+json") public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFile(org.springframework.security.core.Authentication auth, @PathVariable("id") java.lang.String taskId, @RequestPart("data") FileFieldRequest dataBody, @RequestPart("file") org.springframework.web.multipart.MultipartFile multipartFile, java.util.Locale locale)
-
getFile
@GetMapping(value="/{id}/file", produces="application/octet-stream") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFile(@PathVariable("id") java.lang.String taskId, @RequestParam("fieldId") java.lang.String fieldId) throws java.io.FileNotFoundException- Overrides:
getFilein classAbstractTaskController- Throws:
java.io.FileNotFoundException
-
deleteFile
@PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)") @DeleteMapping(value="/{id}/file", produces="application/hal+json") public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteFile(org.springframework.security.core.Authentication auth, @PathVariable("id") java.lang.String taskId, @RequestBody FileFieldRequest requestBody)
-
saveFiles
@PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)") @PostMapping(value="/{id}/files", produces="application/hal+json") public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> saveFiles(org.springframework.security.core.Authentication auth, @PathVariable("id") java.lang.String taskId, @RequestPart("data") FileFieldRequest requestBody, @RequestPart("files") org.springframework.web.multipart.MultipartFile[] multipartFiles)
-
getNamedFile
@GetMapping(value="/{id}/file/named", produces="application/octet-stream") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getNamedFile(@PathVariable("id") java.lang.String taskId, @RequestParam("fieldId") java.lang.String fieldId, @RequestParam("fileName") java.lang.String fileName) throws java.io.FileNotFoundException- Overrides:
getNamedFilein classAbstractTaskController- Throws:
java.io.FileNotFoundException
-
deleteNamedFile
@PreAuthorize("@taskAuthorizationService.canCallSaveFile(#auth.getPrincipal(), #taskId)") @DeleteMapping(value="/{id}/file/named", produces="application/hal+json") public org.springframework.hateoas.EntityModel<EventOutcomeWithMessage> deleteNamedFile(org.springframework.security.core.Authentication auth, @PathVariable("id") java.lang.String taskId, @RequestBody FileFieldRequest requestBody)
-
getFilePreview
@GetMapping(value="/{id}/file_preview", produces="application/octet-stream") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getFilePreview(@PathVariable("id") java.lang.String taskId, @RequestParam("fieldId") java.lang.String fieldId) throws java.io.FileNotFoundException- Overrides:
getFilePreviewin classAbstractTaskController- Throws:
java.io.FileNotFoundException
-
-