Package pro.taskana.workbasket.rest
Class WorkbasketDefinitionController
- java.lang.Object
-
- pro.taskana.workbasket.rest.WorkbasketDefinitionController
-
@RestController @EnableHypermediaSupport(type=HAL) public class WorkbasketDefinitionController extends Object
Controller for allWorkbasketDefinitionRepresentationModelrelated endpoints.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<TaskanaPagedModel<WorkbasketDefinitionRepresentationModel>>exportWorkbaskets(String domain)org.springframework.http.ResponseEntity<Void>importWorkbaskets(org.springframework.web.multipart.MultipartFile file)This method imports a list ofWorkbasketDefinitionRepresentationModel.
-
-
-
Method Detail
-
exportWorkbaskets
@GetMapping(path="/api/v1/workbasket-definitions") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<TaskanaPagedModel<WorkbasketDefinitionRepresentationModel>> exportWorkbaskets(@RequestParam(required=false) String domain)
-
importWorkbaskets
@PostMapping(path="/api/v1/workbasket-definitions") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<Void> importWorkbaskets(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws IOException, pro.taskana.common.api.exceptions.NotAuthorizedException, pro.taskana.common.api.exceptions.DomainNotFoundException, pro.taskana.workbasket.api.exceptions.InvalidWorkbasketException, pro.taskana.workbasket.api.exceptions.WorkbasketAlreadyExistException, pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.workbasket.api.exceptions.WorkbasketAccessItemAlreadyExistException, pro.taskana.common.api.exceptions.ConcurrencyException
This method imports a list ofWorkbasketDefinitionRepresentationModel. This does not exactly match the REST norm, but we want to have an option to import all settings at once. When a logical equal (key and domain are equal) workbasket already exists an update will be executed. Otherwise a new workbasket will be created.- Parameters:
file- the list of workbasket definitions which will be imported to the current system.- Returns:
- Return answer is determined by the status code: 200 - all good 400 - list state error (referring to non existing id's) 401 - not authorized
- Throws:
IOException- if multipart file cannot be parsed.pro.taskana.common.api.exceptions.NotAuthorizedException- if the user is not authorized.pro.taskana.common.api.exceptions.DomainNotFoundException- if domain information is incorrect.pro.taskana.workbasket.api.exceptions.InvalidWorkbasketException- if workbasket has invalid information.pro.taskana.workbasket.api.exceptions.WorkbasketAlreadyExistException- if workbasket already exists when trying to create a new one.pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException- if do not exists a workbasket in the system with the used id.pro.taskana.common.api.exceptions.InvalidArgumentException- if authorization information in workbaskets definitions is incorrect.pro.taskana.workbasket.api.exceptions.WorkbasketAccessItemAlreadyExistException- if a WorkbasketAccessItem for the same workbasket and access_id already exists.pro.taskana.common.api.exceptions.ConcurrencyException- if workbasket was updated by an other user
-
-