fix dmp contact builders

This commit is contained in:
amentis 2024-01-30 15:24:15 +02:00
parent 2f48b3bae2
commit 7d66c1e857
3 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -46,11 +46,13 @@ public class DmpPropertiesBuilder extends BaseBuilder<DmpProperties, DmpProperti
//Not Bulk Build because is XML no interaction with db
FieldSet dmpBlueprintValuesFields = fields.extractPrefixed(this.asPrefix(DmpProperties._dmpBlueprintValues));
FieldSet contactsFields = fields.extractPrefixed(this.asPrefix(DmpProperties._contacts));
List<DmpProperties> 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));

View File

@ -337,6 +337,7 @@ public class DmpQuery extends QueryBase<DmpEntity> {
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;