add Preprocessing features for import

This commit is contained in:
amentis 2024-06-18 10:27:48 +03:00
parent 5bf1e5a889
commit 6239b9fba0
6 changed files with 159 additions and 4 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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<DescriptionImportModel> descriptions;
FileEnvelopeModel file;
public DmpBlueprintModel getBlueprintModel() {
return blueprintModel;
}
public void setBlueprintModel(DmpBlueprintModel blueprintModel) {
this.blueprintModel = blueprintModel;
}
public List<DescriptionImportModel> getDescriptions() {
return descriptions;
}
public void setDescriptions(List<DescriptionImportModel> descriptions) {
this.descriptions = descriptions;
}
public FileEnvelopeModel getFile() {
return file;
}
public void setFile(FileEnvelopeModel file) {
this.file = file;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,26 @@
package org.opencdmp.filetransformerbase.models.misc;
import java.util.List;
public class PreprocessingDmpModel {
private String label;
private List<PreprocessingDescriptionModel> preprocessingDescriptionModels;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public List<PreprocessingDescriptionModel> getPreprocessingDescriptionModels() {
return preprocessingDescriptionModels;
}
public void setPreprocessingDescriptionModels(List<PreprocessingDescriptionModel> preprocessingDescriptionModels) {
this.preprocessingDescriptionModels = preprocessingDescriptionModels;
}
}