import rda implementation

This commit is contained in:
amentis 2024-06-18 12:53:26 +03:00
parent 772eb7664c
commit bb57e49056
3 changed files with 1024 additions and 30 deletions

View File

@ -32,7 +32,7 @@
<dependency>
<groupId>org.opencdmp</groupId>
<artifactId>file-transformer-base</artifactId>
<version>0.0.22</version>
<version>0.0.23</version>
</dependency>
<dependency>
<groupId>gr.cite</groupId>

View File

@ -9,6 +9,10 @@ import org.opencdmp.commonmodels.models.dmp.DmpModel;
import org.opencdmp.filetransformer.rda.audit.AuditableAction;
import org.opencdmp.filetransformerbase.interfaces.FileTransformerClient;
import org.opencdmp.filetransformerbase.interfaces.FileTransformerConfiguration;
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.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -55,25 +59,46 @@ public class FileTransformerController implements org.opencdmp.filetransformerba
return model;
}
public DmpModel importFileToDmp(@RequestBody FileEnvelopeModel fileEnvelope) {
public PreprocessingDmpModel preprocessingDmp(FileEnvelopeModel fileEnvelopeModel) {
logger.debug(new MapLogEntry("preprocessingDmp " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", fileEnvelopeModel));
logger.debug(new MapLogEntry("importFileToDmp " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", fileEnvelope));
DmpModel model = fileTransformerExecutor.importDmp(fileEnvelope);
PreprocessingDmpModel model = fileTransformerExecutor.preprocessingDmp(fileEnvelopeModel);
this.auditService.track(AuditableAction.FileTransformer_ImportFileToDmp, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>("fileEnvelope", fileEnvelope)
new AbstractMap.SimpleEntry<String, Object>("fileEnvelope", fileEnvelopeModel)
));
return model;
}
public DescriptionModel importFileToDescription(@RequestBody FileEnvelopeModel fileEnvelope) {
logger.debug(new MapLogEntry("importFileToDescription " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", fileEnvelope));
public DmpModel importFileToDmp(@RequestBody DmpImportModel dmpImportModel) {
logger.debug(new MapLogEntry("importFileToDmp " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", dmpImportModel.getFile()));
DescriptionModel model = fileTransformerExecutor.importDescription(fileEnvelope);
DmpModel model = fileTransformerExecutor.importDmp(dmpImportModel);
this.auditService.track(AuditableAction.FileTransformer_ImportFileToDmp, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>("fileEnvelope", dmpImportModel.getFile())
));
return model;
}
public PreprocessingDescriptionModel preprocessingDescription(FileEnvelopeModel fileEnvelopeModel) {
logger.debug(new MapLogEntry("preprocessingDescription " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", fileEnvelopeModel));
PreprocessingDescriptionModel model = fileTransformerExecutor.preprocessingDescription(fileEnvelopeModel);
this.auditService.track(AuditableAction.FileTransformer_ImportFileToDmp, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>("fileEnvelope", fileEnvelopeModel)
));
return model;
}
public DescriptionModel importFileToDescription(@RequestBody DescriptionImportModel descriptionImportModel) {
logger.debug(new MapLogEntry("importFileToDescription " + FileEnvelopeModel.class.getSimpleName()).And("fileEnvelope", descriptionImportModel.getFile()));
DescriptionModel model = fileTransformerExecutor.importDescription(descriptionImportModel);
this.auditService.track(AuditableAction.FileTransformer_ImportFileToDescription, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>("importFileToDescription ", fileEnvelope)
new AbstractMap.SimpleEntry<String, Object>("importFileToDescription ", descriptionImportModel.getFile())
));
return model;
}