Package pro.taskana.classification.rest
Class ClassificationDefinitionController
- java.lang.Object
-
- pro.taskana.classification.rest.ClassificationDefinitionController
-
@RestController @EnableHypermediaSupport(type=HAL) public class ClassificationDefinitionController extends Object
Controller for Importing / Exporting classifications.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<ClassificationDefinitionCollectionRepresentationModel>exportClassifications(String[] domain)This endpoint exports all configured Classifications.org.springframework.http.ResponseEntity<Void>importClassifications(org.springframework.web.multipart.MultipartFile file)This endpoint imports all Classifications.
-
-
-
Method Detail
-
exportClassifications
@GetMapping(path="/api/v1/classification-definitions") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<ClassificationDefinitionCollectionRepresentationModel> exportClassifications(@RequestParam(required=false) String[] domain)This endpoint exports all configured Classifications.- Parameters:
domain- Filter the export by domain- Returns:
- the configured Classifications.
-
importClassifications
@PostMapping(path="/api/v1/classification-definitions") @Transactional(rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<Void> importClassifications(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.ConcurrencyException, pro.taskana.classification.api.exceptions.ClassificationNotFoundException, pro.taskana.classification.api.exceptions.ClassificationAlreadyExistException, pro.taskana.common.api.exceptions.DomainNotFoundException, IOException, pro.taskana.classification.api.exceptions.MalformedServiceLevelException, pro.taskana.common.api.exceptions.NotAuthorizedException
This endpoint imports all Classifications. Existing Classifications will not be removed. Existing Classifications with the same key/domain will be overridden.- Parameters:
file- the file containing the Classifications which should be imported.- Returns:
- nothing
- Throws:
pro.taskana.common.api.exceptions.InvalidArgumentException- if any Classification within the import file is invalidpro.taskana.common.api.exceptions.NotAuthorizedException- if the current user is not authorized to import Classificationspro.taskana.common.api.exceptions.ConcurrencyException- TODO: this makes no sensepro.taskana.classification.api.exceptions.ClassificationNotFoundException- TODO: this makes no sensepro.taskana.classification.api.exceptions.ClassificationAlreadyExistException- TODO: this makes no sensepro.taskana.common.api.exceptions.DomainNotFoundException- if the domain for a specific Classification does not existIOException- if the import file could not be parsedpro.taskana.classification.api.exceptions.MalformedServiceLevelException- if theserviceLevelproperty does not comply * with the ISO 8601 specification
-
-