From 3ac4ed12378852ee1a620d824ec6b0b351c8c761 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 6 Feb 2024 09:40:28 +0200 Subject: [PATCH] Apply minor file transformer fixes --- .../DescriptionTemplateDefinitionFileTransformerBuilder.java | 4 +++- .../eu/eudat/service/transformer/FileTransformerService.java | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/filetransformer/DescriptionTemplateDefinitionFileTransformerBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/filetransformer/DescriptionTemplateDefinitionFileTransformerBuilder.java index f31135094..cf0463d02 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/filetransformer/DescriptionTemplateDefinitionFileTransformerBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/filetransformer/DescriptionTemplateDefinitionFileTransformerBuilder.java @@ -229,7 +229,9 @@ public class DescriptionTemplateDefinitionFileTransformerBuilder extends BaseFil m.setMethod(d.getMethod()); m.setHasAuth(d.getHasAuth()); m.setOptionsRoot(d.getOptionsRoot()); - m.setAuth(convertAuthData(d.getAuth())); + if (d.getAuth() != null) { + m.setAuth(convertAuthData(d.getAuth())); + } m.setSourceBinding(convertComboBoxOption(d.getSourceBinding())); result.add(m); } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerService.java b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerService.java index a70090103..15d6e13d5 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/transformer/FileTransformerService.java @@ -111,7 +111,6 @@ public class FileTransformerService { List repositories = transformerProperties.getSources().stream().map(depositSource -> getRepository(depositSource.getCodes().get(0))).toList(); repositories = new ArrayList<>(repositories); - List toDelete = new ArrayList<>(); repositories.forEach((client) -> { try { FileTransformerConfiguration repositoryConfigs = client.getConfiguration(); @@ -119,12 +118,10 @@ public class FileTransformerService { configurations.addAll(repositoryConfigs.getExportVariants()); } } catch (Exception e) { - toDelete.add(client); + logger.warn(e.getLocalizedMessage(), e); } }); - repositories.removeAll(toDelete); - configs = new TransformerCacheModel(configurations); this.fileTransformerConfigurationCache.put("base", configs); }