Class ClassificationDefinitionController


  • @RestController
    @EnableHypermediaSupport(type=HAL)
    public class ClassificationDefinitionController
    extends Object
    Controller for Importing / Exporting 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.NotAuthorizedException,
                                                                                   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
        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 invalid
        pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not authorized to import Classifications
        pro.taskana.common.api.exceptions.ConcurrencyException - TODO: this makes no sense
        pro.taskana.classification.api.exceptions.ClassificationNotFoundException - TODO: this makes no sense
        pro.taskana.classification.api.exceptions.ClassificationAlreadyExistException - TODO: this makes no sense
        pro.taskana.common.api.exceptions.DomainNotFoundException - if the domain for a specific Classification does not exist
        IOException - if the import file could not be parsed