diff --git a/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerClient.java b/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerClient.java index 5476b93..4d05a91 100644 --- a/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerClient.java +++ b/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerClient.java @@ -4,6 +4,10 @@ import com.sun.jdi.InvalidTypeException; import org.opencdmp.commonmodels.models.dmp.DmpModel; import org.opencdmp.commonmodels.models.FileEnvelopeModel; import org.opencdmp.commonmodels.models.description.DescriptionModel; +import org.opencdmp.filetransformerbase.models.misc.DescriptionImportModel; +import org.opencdmp.filetransformerbase.models.misc.DmpImportModel; +import org.opencdmp.filetransformerbase.models.misc.PreprocessingDescriptionModel; +import org.opencdmp.filetransformerbase.models.misc.PreprocessingDmpModel; import javax.management.InvalidApplicationException; import java.io.IOException; @@ -24,11 +28,15 @@ public interface FileTransformerClient { * @throws Exception if an error occurs while trying to deposit the dmp */ FileEnvelopeModel exportDmp(DmpModel dmp, String variant) throws InvalidApplicationException, IOException, InvalidTypeException; - DmpModel importDmp(FileEnvelopeModel file); + DmpModel importDmp(DmpImportModel dmpImportModel); FileEnvelopeModel exportDescription(DescriptionModel descriptionFileTransformerModel, String format) throws InvalidApplicationException, IOException; - DescriptionModel importDescription(FileEnvelopeModel file); + DescriptionModel importDescription(DescriptionImportModel descriptionImportModel); FileTransformerConfiguration getConfiguration(); + PreprocessingDmpModel preprocessingDmp(FileEnvelopeModel fileEnvelopeModel); + + PreprocessingDescriptionModel preprocessingDescription(FileEnvelopeModel fileEnvelopeModel); + } diff --git a/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerController.java b/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerController.java index 7381812..221f743 100644 --- a/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerController.java +++ b/src/main/java/org/opencdmp/filetransformerbase/interfaces/FileTransformerController.java @@ -3,6 +3,10 @@ package org.opencdmp.filetransformerbase.interfaces; import org.opencdmp.commonmodels.models.FileEnvelopeModel; import org.opencdmp.commonmodels.models.description.DescriptionModel; import org.opencdmp.commonmodels.models.dmp.DmpModel; +import org.opencdmp.filetransformerbase.models.misc.DescriptionImportModel; +import org.opencdmp.filetransformerbase.models.misc.DmpImportModel; +import org.opencdmp.filetransformerbase.models.misc.PreprocessingDescriptionModel; +import org.opencdmp.filetransformerbase.models.misc.PreprocessingDmpModel; import org.springframework.web.bind.annotation.*; /** @@ -21,10 +25,16 @@ public interface FileTransformerController { FileEnvelopeModel exportDescription(@RequestBody DescriptionModel descriptionModel, @RequestParam(value = "format",required = false)String format) throws Exception; @PostMapping("/import/dmp") - DmpModel importFileToDmp(@RequestBody FileEnvelopeModel fileEnvelope); + DmpModel importFileToDmp(@RequestBody DmpImportModel dmpImportModel); @PostMapping("/import/description") - DescriptionModel importFileToDescription(@RequestBody FileEnvelopeModel fileEnvelope); + DescriptionModel importFileToDescription(@RequestBody DescriptionImportModel descriptionImportModel); + + @PostMapping("/preprocessing/dmp") + PreprocessingDmpModel preprocessingDmp(@RequestBody FileEnvelopeModel fileEnvelopeModel); + + @PostMapping("/preprocessing/description") + PreprocessingDescriptionModel preprocessingDescription(@RequestBody FileEnvelopeModel fileEnvelopeModel); @GetMapping("/formats") FileTransformerConfiguration getSupportedFormats(); diff --git a/src/main/java/org/opencdmp/filetransformerbase/models/misc/DescriptionImportModel.java b/src/main/java/org/opencdmp/filetransformerbase/models/misc/DescriptionImportModel.java new file mode 100644 index 0000000..5e269d6 --- /dev/null +++ b/src/main/java/org/opencdmp/filetransformerbase/models/misc/DescriptionImportModel.java @@ -0,0 +1,49 @@ +package org.opencdmp.filetransformerbase.models.misc; + +import org.opencdmp.commonmodels.models.FileEnvelopeModel; +import org.opencdmp.commonmodels.models.descriptiotemplate.DescriptionTemplateModel; + +import java.util.UUID; + +public class DescriptionImportModel { + private DescriptionTemplateModel descriptionTemplate; + + private UUID sectionId; + + private String id; + + FileEnvelopeModel file; + + + public DescriptionTemplateModel getDescriptionTemplate() { + return descriptionTemplate; + } + + public void setDescriptionTemplate(DescriptionTemplateModel descriptionTemplate) { + this.descriptionTemplate = descriptionTemplate; + } + + public UUID getSectionId() { + return sectionId; + } + + public void setSectionId(UUID sectionId) { + this.sectionId = sectionId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FileEnvelopeModel getFile() { + return file; + } + + public void setFile(FileEnvelopeModel file) { + this.file = file; + } +} diff --git a/src/main/java/org/opencdmp/filetransformerbase/models/misc/DmpImportModel.java b/src/main/java/org/opencdmp/filetransformerbase/models/misc/DmpImportModel.java new file mode 100644 index 0000000..34be869 --- /dev/null +++ b/src/main/java/org/opencdmp/filetransformerbase/models/misc/DmpImportModel.java @@ -0,0 +1,39 @@ +package org.opencdmp.filetransformerbase.models.misc; + +import org.opencdmp.commonmodels.models.FileEnvelopeModel; +import org.opencdmp.commonmodels.models.dmpblueprint.DmpBlueprintModel; + +import java.util.List; + +public class DmpImportModel { + private DmpBlueprintModel blueprintModel; + + private List descriptions; + + FileEnvelopeModel file; + + + public DmpBlueprintModel getBlueprintModel() { + return blueprintModel; + } + + public void setBlueprintModel(DmpBlueprintModel blueprintModel) { + this.blueprintModel = blueprintModel; + } + + public List getDescriptions() { + return descriptions; + } + + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; + } + + public FileEnvelopeModel getFile() { + return file; + } + + public void setFile(FileEnvelopeModel file) { + this.file = file; + } +} diff --git a/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDescriptionModel.java b/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDescriptionModel.java new file mode 100644 index 0000000..caeba73 --- /dev/null +++ b/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDescriptionModel.java @@ -0,0 +1,23 @@ +package org.opencdmp.filetransformerbase.models.misc; + +public class PreprocessingDescriptionModel { + + private String id; + private String label; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } +} diff --git a/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDmpModel.java b/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDmpModel.java new file mode 100644 index 0000000..5158ae4 --- /dev/null +++ b/src/main/java/org/opencdmp/filetransformerbase/models/misc/PreprocessingDmpModel.java @@ -0,0 +1,26 @@ +package org.opencdmp.filetransformerbase.models.misc; + + +import java.util.List; + +public class PreprocessingDmpModel { + private String label; + + private List preprocessingDescriptionModels; + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public List getPreprocessingDescriptionModels() { + return preprocessingDescriptionModels; + } + + public void setPreprocessingDescriptionModels(List preprocessingDescriptionModels) { + this.preprocessingDescriptionModels = preprocessingDescriptionModels; + } +}