Update file transformer Service and add xml transformer config

This commit is contained in:
George Kalampokis 2024-01-17 14:31:31 +02:00
parent 7b963858f2
commit aa75b3e3ab
3 changed files with 16 additions and 3 deletions

View File

@ -20,8 +20,8 @@ public class TransformerRepository implements FileTransformerClient {
}
@Override
public FileEnvelope exportDmp(DmpFileTransformerModel dmpFileTransformerModel, String format) throws InvalidApplicationException, IOException {
return transformerClient.post().uri("/export/dmp", uriBuilder -> uriBuilder.queryParam("format", format).build()).bodyValue(dmpFileTransformerModel).exchangeToMono(mono -> mono.bodyToMono(FileEnvelope.class)).block();
public FileEnvelope exportDmp(DmpFileTransformerModel dmpFileTransformerModel) throws InvalidApplicationException, IOException {
return transformerClient.post().uri("/export/dmp").bodyValue(dmpFileTransformerModel).exchangeToMono(mono -> mono.bodyToMono(FileEnvelope.class)).block();
}
@Override

View File

@ -293,7 +293,8 @@ public class FileTransformerService {
);*/
DmpQuery query = this.queryFactory.query(DmpQuery.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).ids(dmpId);
DmpFileTransformerModel dmpFileTransformerModel = this.builderFactory.builder(DmpFileTransformerBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(query.first());
FileEnvelope fileEnvelope = repository.exportDmp(dmpFileTransformerModel, format);
dmpFileTransformerModel.setVariant(format);
FileEnvelope fileEnvelope = repository.exportDmp(dmpFileTransformerModel);
eu.eudat.model.file.FileEnvelope result = new eu.eudat.model.file.FileEnvelope();
byte[] data = storageFileService.readByFileRefAsBytesSafe(fileEnvelope.getFile(), StorageType.Transformer);
File temp = new File(environment.getProperty("path.path") + UUID.randomUUID());

View File

@ -6,6 +6,18 @@ transformer:
client-id: ${IDP_APIKEY_CLIENT_ID:}
client-secret: ${IDP_APIKEY_CLIENT_SECRET:}
scope: ${IDP_APIKEY_SCOPE:}
- url: http://localhost:8086
codes: [ json ]
issuer-url: ${IDP_ISSUER_URI_TOKEN:}
client-id: ${IDP_APIKEY_CLIENT_ID:}
client-secret: ${IDP_APIKEY_CLIENT_SECRET:}
scope: ${IDP_APIKEY_SCOPE:}
- url: http://localhost:8087
codes: [ xml ]
issuer-url: ${IDP_ISSUER_URI_TOKEN:}
client-id: ${IDP_APIKEY_CLIENT_ID:}
client-secret: ${IDP_APIKEY_CLIENT_SECRET:}
scope: ${IDP_APIKEY_SCOPE:}
temp:
temp: ${TEMP_STORAGE}