fix dmp contact builders
This commit is contained in:
parent
2f48b3bae2
commit
7d66c1e857
|
@ -1,4 +1,4 @@
|
||||||
package eu.eudat.model.builder.dmpContact;
|
package eu.eudat.model.builder.dmpproperties;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.types.dmp.DmpContactEntity;
|
import eu.eudat.commons.types.dmp.DmpContactEntity;
|
||||||
|
|
|
@ -46,11 +46,13 @@ public class DmpPropertiesBuilder extends BaseBuilder<DmpProperties, DmpProperti
|
||||||
|
|
||||||
//Not Bulk Build because is XML no interaction with db
|
//Not Bulk Build because is XML no interaction with db
|
||||||
FieldSet dmpBlueprintValuesFields = fields.extractPrefixed(this.asPrefix(DmpProperties._dmpBlueprintValues));
|
FieldSet dmpBlueprintValuesFields = fields.extractPrefixed(this.asPrefix(DmpProperties._dmpBlueprintValues));
|
||||||
|
FieldSet contactsFields = fields.extractPrefixed(this.asPrefix(DmpProperties._contacts));
|
||||||
|
|
||||||
List<DmpProperties> models = new ArrayList<>();
|
List<DmpProperties> models = new ArrayList<>();
|
||||||
for (DmpPropertiesEntity d : data) {
|
for (DmpPropertiesEntity d : data) {
|
||||||
DmpProperties m = new DmpProperties();
|
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 (!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);
|
models.add(m);
|
||||||
}
|
}
|
||||||
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));
|
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));
|
||||||
|
|
|
@ -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._version) || item.match(PublicDmp._version)) return DmpEntity._version;
|
||||||
else if (item.match(Dmp._status)) return DmpEntity._status;
|
else if (item.match(Dmp._status)) return DmpEntity._status;
|
||||||
else if (item.match(Dmp._properties)) return DmpEntity._properties;
|
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._groupId)) return DmpEntity._groupId;
|
||||||
else if (item.match(Dmp._description) || item.match(PublicDmp._description)) return DmpEntity._description;
|
else if (item.match(Dmp._description) || item.match(PublicDmp._description)) return DmpEntity._description;
|
||||||
else if (item.match(Dmp._createdAt)) return DmpEntity._createdAt;
|
else if (item.match(Dmp._createdAt)) return DmpEntity._createdAt;
|
||||||
|
|
Loading…
Reference in New Issue