From 057f444ff1af8ea5813a281f18933a24a469bce1 Mon Sep 17 00:00:00 2001 From: amentis Date: Tue, 20 Feb 2024 09:38:32 +0200 Subject: [PATCH] description template semantics small fix --- .../descriptiontemplate/DescriptionTemplateServiceImpl.java | 6 +++--- dmp-backend/web/src/main/resources/config/storage-devel.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java index a6bd2b11e..8e440ba1b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/descriptiontemplate/DescriptionTemplateServiceImpl.java @@ -905,11 +905,11 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic //region @Override - public List getSemantics(String query) throws IOException { + public List getSemantics(String like) throws IOException { List semantics = this.getSemantics(); List filteredSemantics = semantics.stream().map(Semantic::getName).collect(Collectors.toList()); - if (query != null && !query.isEmpty()) { - filteredSemantics = semantics.stream().filter(x -> x.getCategory().contains(query) || x.getName().contains(query)).map(Semantic::getName).collect(Collectors.toList()); + if (like != null && !like.isEmpty()) { + filteredSemantics = semantics.stream().filter(x -> x.getCategory().contains(like.replaceAll("%", "")) || x.getName().contains(like.replaceAll("%", ""))).map(Semantic::getName).collect(Collectors.toList()); } return filteredSemantics; } diff --git a/dmp-backend/web/src/main/resources/config/storage-devel.yml b/dmp-backend/web/src/main/resources/config/storage-devel.yml index 1e2173850..5bd3e9916 100644 --- a/dmp-backend/web/src/main/resources/config/storage-devel.yml +++ b/dmp-backend/web/src/main/resources/config/storage-devel.yml @@ -10,7 +10,7 @@ storage: basePath: ${TRANSFORMER_BASE_PATH} static-files: externalUrls: dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml - semantics: Semantics.json + semantics: dmp-backend/web/src/main/resources/Semantics.json h2020Template: documents/h2020.docx h2020DescriptionTemplate: documents/h2020_dataset.docx pidLinks: pidLinks.json