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<WorkbasketDefinitionCollectionRepresentationModel>exportWorkbaskets(String[] domain)This endpoint exports all Workbaskets with the corresponding Workbasket Access Items and Distribution Targets.org.springframework.http.ResponseEntity<Void>importWorkbaskets(org.springframework.web.multipart.MultipartFile file)This endpoint imports a list of Workbasket Definitions.
-
-
-
Method Detail
-
exportWorkbaskets
@GetMapping(path="/api/v1/workbasket-definitions") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<WorkbasketDefinitionCollectionRepresentationModel> exportWorkbaskets(@RequestParam(required=false) String[] domain)This endpoint exports all Workbaskets with the corresponding Workbasket Access Items and Distribution Targets. We call this data structure Workbasket Definition.- Parameters:
domain- Filter the export for a specific domain.- Returns:
- all workbaskets.
-
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.DomainNotFoundException, pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.workbasket.api.exceptions.WorkbasketAlreadyExistException, pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException, pro.taskana.workbasket.api.exceptions.WorkbasketAccessItemAlreadyExistException, pro.taskana.common.api.exceptions.ConcurrencyException, pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException, pro.taskana.common.api.exceptions.NotAuthorizedException
This endpoint imports a list of Workbasket Definitions.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:
- no content
- 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.WorkbasketAlreadyExistException- if any 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 any Workbasket has invalid information or 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 userpro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException- if the current user has not correct permissions
-
-