From 7d66c1e857876246eaba6fc84e13c0777952d492 Mon Sep 17 00:00:00 2001 From: amentis Date: Tue, 30 Jan 2024 15:24:15 +0200 Subject: [PATCH] fix dmp contact builders --- .../eudat/model/builder/dmpproperties/DmpContactBuilder.java | 2 +- .../model/builder/dmpproperties/DmpPropertiesBuilder.java | 4 +++- dmp-backend/core/src/main/java/eu/eudat/query/DmpQuery.java | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpContactBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpContactBuilder.java index dae18b8ea..cdaee4b48 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpContactBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpContactBuilder.java @@ -1,4 +1,4 @@ -package eu.eudat.model.builder.dmpContact; +package eu.eudat.model.builder.dmpproperties; import eu.eudat.authorization.AuthorizationFlags; import eu.eudat.commons.types.dmp.DmpContactEntity; diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpPropertiesBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpPropertiesBuilder.java index 69e124d7e..81fe41458 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpPropertiesBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/dmpproperties/DmpPropertiesBuilder.java @@ -46,11 +46,13 @@ public class DmpPropertiesBuilder extends BaseBuilder models = new ArrayList<>(); for (DmpPropertiesEntity d : data) { DmpProperties m = new DmpProperties(); if (!dmpBlueprintValuesFields.isEmpty() && d.getDmpBlueprintValues() != null) m.setDmpBlueprintValues(this.builderFactory.builder(DmpBlueprintValueBuilder.class).authorize(this.authorize).build(dmpBlueprintValuesFields, d.getDmpBlueprintValues())); + if (!contactsFields.isEmpty() && d.getContacts() != null) m.setContacts(this.builderFactory.builder(DmpContactBuilder.class).authorize(this.authorize).build(contactsFields, d.getContacts())); models.add(m); } this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0)); diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/DmpQuery.java b/dmp-backend/core/src/main/java/eu/eudat/query/DmpQuery.java index a85e9eb74..a4bc4fc52 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/query/DmpQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/query/DmpQuery.java @@ -337,6 +337,7 @@ public class DmpQuery extends QueryBase { else if (item.match(Dmp._version) || item.match(PublicDmp._version)) return DmpEntity._version; else if (item.match(Dmp._status)) return DmpEntity._status; else if (item.match(Dmp._properties)) return DmpEntity._properties; + else if (item.prefix(Dmp._properties)) return DmpEntity._properties; else if (item.match(Dmp._groupId)) return DmpEntity._groupId; else if (item.match(Dmp._description) || item.match(PublicDmp._description)) return DmpEntity._description; else if (item.match(Dmp._createdAt)) return DmpEntity._createdAt;