diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java index 1d961a033..445413f89 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/BaseBuilder.java @@ -35,34 +35,34 @@ public abstract class BaseBuilder implements Builder { return models.stream().findFirst().orElse(null); //TODO } - public abstract List build(FieldSet directives, List datas) throws MyApplicationException; + public abstract List build(FieldSet directives, List data) throws MyApplicationException; public Map asForeignKey(QueryBase query, FieldSet directives, Function keySelector) throws MyApplicationException { this.logger.trace("Building references from query"); - List datas = query.collectAs(directives); - this.logger.debug("collected {} items to build", Optional.ofNullable(datas).map(e -> e.size()).orElse(0)); - return this.asForeignKey(datas, directives, keySelector); + List data = query.collectAs(directives); + this.logger.debug("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0)); + return this.asForeignKey(data, directives, keySelector); } - public Map asForeignKey(List datas, FieldSet directives, Function keySelector) throws MyApplicationException { + public Map asForeignKey(List data, FieldSet directives, Function keySelector) throws MyApplicationException { this.logger.trace("building references"); - List models = this.build(directives, datas); - this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(e -> e.size()).orElse(0), Optional.ofNullable(datas).map(e -> e.size()).orElse(0)); - Map map = models.stream().collect(Collectors.toMap(o -> keySelector.apply(o), o -> o)); + List models = this.build(directives, data); + this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0)); + Map map = models.stream().collect(Collectors.toMap(keySelector, o -> o)); return map; } public Map> asMasterKey(QueryBase query, FieldSet directives, Function keySelector) throws MyApplicationException { this.logger.trace("Building details from query"); - List datas = query.collectAs(directives); - this.logger.debug("collected {} items to build", Optional.ofNullable(datas).map(e -> e.size()).orElse(0)); - return this.asMasterKey(datas, directives, keySelector); + List data = query.collectAs(directives); + this.logger.debug("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0)); + return this.asMasterKey(data, directives, keySelector); } - public Map> asMasterKey(List datas, FieldSet directives, Function keySelector) throws MyApplicationException { + public Map> asMasterKey(List data, FieldSet directives, Function keySelector) throws MyApplicationException { this.logger.trace("building details"); - List models = this.build(directives, datas); - this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(e -> e.size()).orElse(0), Optional.ofNullable(datas).map(e -> e.size()).orElse(0)); + List models = this.build(directives, data); + this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0)); Map> map = new HashMap<>(); for (M model : models) { K key = keySelector.apply(model); @@ -74,9 +74,9 @@ public abstract class BaseBuilder implements Builder { public Map asEmpty(List keys, Function mapper, Function keySelector) { this.logger.trace("building static references"); - List models = keys.stream().map(x -> mapper.apply(x)).collect(Collectors.toList()); - this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(x -> x.size()).orElse(0), Optional.ofNullable(keys).map(x -> x.size())); - Map map = models.stream().collect(Collectors.toMap(o -> keySelector.apply(o), o -> o)); + List models = keys.stream().map(mapper).collect(Collectors.toList()); + this.logger.debug("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(keys).map(List::size)); + Map map = models.stream().collect(Collectors.toMap(keySelector, o -> o)); return map; } diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateBuilder.java index 197d2470d..6a1183014 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DescriptionTemplateBuilder.java @@ -51,21 +51,21 @@ public class DescriptionTemplateBuilder extends BaseBuilder build(FieldSet fields, List datas) throws MyApplicationException { - this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(datas).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); + public List build(FieldSet fields, List data) throws MyApplicationException { + this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); this.logger.trace(new DataLogEntry("requested fields", fields)); - if (fields == null || datas == null || fields.isEmpty()) + if (fields == null || data == null || fields.isEmpty()) return new ArrayList<>(); FieldSet descriptionTemplateTypeFields = fields.extractPrefixed(this.asPrefix(DescriptionTemplate._type)); - Map descriptionTemplateTypeMap = this.collectDescriptionTemplateTypes(descriptionTemplateTypeFields, datas); + Map descriptionTemplateTypeMap = this.collectDescriptionTemplateTypes(descriptionTemplateTypeFields, data); FieldSet usersFields = fields.extractPrefixed(this.asPrefix(DescriptionTemplate._users)); - Map> usersMap = this.collectUserDescriptionTemplates(usersFields, datas); + Map> usersMap = this.collectUserDescriptionTemplates(usersFields, data); FieldSet definitionFields = fields.extractPrefixed(this.asPrefix(DescriptionTemplate._definition)); List models = new ArrayList<>(); - for (DescriptionTemplateEntity d : datas) { + for (DescriptionTemplateEntity d : data) { DescriptionTemplate m = new DescriptionTemplate(); if (fields.hasField(this.asIndexer(DescriptionTemplate._id))) m.setId(d.getId()); if (fields.hasField(this.asIndexer(DescriptionTemplate._label))) m.setLabel(d.getLabel()); @@ -90,14 +90,14 @@ public class DescriptionTemplateBuilder extends BaseBuilder collectDescriptionTemplateTypes(FieldSet fields, List datas) throws MyApplicationException { - if (fields.isEmpty() || datas.isEmpty()) return null; + private Map collectDescriptionTemplateTypes(FieldSet fields, List data) throws MyApplicationException { + if (fields.isEmpty() || data.isEmpty()) return null; this.logger.debug("checking related - {}", DescriptionTemplateType.class.getSimpleName()); Map itemMap = null; if (!fields.hasOtherField(this.asIndexer(DescriptionTemplateType._id))) { itemMap = this.asEmpty( - datas.stream().map(DescriptionTemplateEntity::getTypeId).distinct().collect(Collectors.toList()), + data.stream().map(DescriptionTemplateEntity::getTypeId).distinct().collect(Collectors.toList()), x -> { DescriptionTemplateType item = new DescriptionTemplateType(); item.setId(x); @@ -106,7 +106,7 @@ public class DescriptionTemplateBuilder extends BaseBuilder x.getId()); } else { FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(DescriptionTemplateType._id); - DescriptionTemplateTypeQuery q = this.queryFactory.query(DescriptionTemplateTypeQuery.class).ids(datas.stream().map(DescriptionTemplateEntity::getTypeId).distinct().collect(Collectors.toList())); + DescriptionTemplateTypeQuery q = this.queryFactory.query(DescriptionTemplateTypeQuery.class).ids(data.stream().map(DescriptionTemplateEntity::getTypeId).distinct().collect(Collectors.toList())); itemMap = this.builderFactory.builder(DescriptionTemplateTypeBuilder.class).asForeignKey(q, clone, DescriptionTemplateType::getId); } if (!fields.hasField(DescriptionTemplateType._id)) { @@ -119,13 +119,13 @@ public class DescriptionTemplateBuilder extends BaseBuilder> collectUserDescriptionTemplates(FieldSet fields, List datas) throws MyApplicationException { - if (fields.isEmpty() || datas.isEmpty()) return null; + private Map> collectUserDescriptionTemplates(FieldSet fields, List data) throws MyApplicationException { + if (fields.isEmpty() || data.isEmpty()) return null; this.logger.debug("checking related - {}", UserDescriptionTemplate.class.getSimpleName()); Map> itemMap = null; FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(this.asIndexer(UserDescriptionTemplate._descriptionTemplate, DescriptionTemplate._id)); - UserDescriptionTemplateQuery query = this.queryFactory.query(UserDescriptionTemplateQuery.class).authorize(this.authorize).descriptionTemplateIds(datas.stream().map(DescriptionTemplateEntity::getId).distinct().collect(Collectors.toList())); + UserDescriptionTemplateQuery query = this.queryFactory.query(UserDescriptionTemplateQuery.class).authorize(this.authorize).descriptionTemplateIds(data.stream().map(DescriptionTemplateEntity::getId).distinct().collect(Collectors.toList())); itemMap = this.builderFactory.builder(UserDescriptionTemplateBuilder.class).authorize(this.authorize).authorize(this.authorize).asMasterKey(query, clone, x -> x.getDescriptionTemplate().getId()); if (!fields.hasField(this.asIndexer(UserDescriptionTemplate._descriptionTemplate, DescriptionTemplate._id))) { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDescriptionTemplateBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDescriptionTemplateBuilder.java index f841ca8d7..b3119ba68 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDescriptionTemplateBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDescriptionTemplateBuilder.java @@ -41,13 +41,13 @@ public class PublicDescriptionTemplateBuilder extends BaseBuilder build(FieldSet fields, List datas) throws MyApplicationException { - this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(datas).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); + public List build(FieldSet fields, List data) throws MyApplicationException { + this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); this.logger.trace(new DataLogEntry("requested fields", fields)); - if (fields == null || datas == null || fields.isEmpty()) + if (fields == null || data == null || fields.isEmpty()) return new ArrayList<>(); List models = new ArrayList<>(); - for (DescriptionTemplateEntity d : datas) { + for (DescriptionTemplateEntity d : data) { PublicDescriptionTemplate m = new PublicDescriptionTemplate(); if (fields.hasField(this.asIndexer(PublicDescriptionTemplate._id))) m.setId(d.getId()); if (fields.hasField(this.asIndexer(PublicDescriptionTemplate._label))) m.setLabel(d.getLabel()); diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDmpBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDmpBuilder.java index bc91b0b11..039939be9 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDmpBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/PublicDmpBuilder.java @@ -75,13 +75,13 @@ public class PublicDmpBuilder extends BaseBuilder { return models; } - private Map> collectDmpReferences(FieldSet fields, List datas) throws MyApplicationException { - if (fields.isEmpty() || datas.isEmpty()) return null; + private Map> collectDmpReferences(FieldSet fields, List data) throws MyApplicationException { + if (fields.isEmpty() || data.isEmpty()) return null; this.logger.debug("checking related - {}", PublicDmpReference.class.getSimpleName()); Map> itemMap = null; FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(this.asIndexer(PublicDmpReference._dmp, PublicDmp._id)); - DmpReferenceQuery query = this.queryFactory.query(DmpReferenceQuery.class).authorize(this.authorize).dmpIds(datas.stream().map(DmpEntity::getId).distinct().collect(Collectors.toList())); + DmpReferenceQuery query = this.queryFactory.query(DmpReferenceQuery.class).authorize(this.authorize).dmpIds(data.stream().map(DmpEntity::getId).distinct().collect(Collectors.toList())); itemMap = this.builderFactory.builder(PublicDmpReferenceBuilder.class).authorize(this.authorize).authorize(this.authorize).asMasterKey(query, clone, x -> x.getDmp().getId()); if (!fields.hasField(this.asIndexer(PublicDmpReference._dmp, PublicDmp._id))) { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java index c120175c6..d329512ce 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java @@ -90,13 +90,13 @@ public class ReferenceBuilder extends BaseBuilder{ return models; } - private Map> collectDmpReferences(FieldSet fields, List datas) throws MyApplicationException { - if (fields.isEmpty() || datas.isEmpty()) return null; + private Map> collectDmpReferences(FieldSet fields, List data) throws MyApplicationException { + if (fields.isEmpty() || data.isEmpty()) return null; this.logger.debug("checking related - {}", DmpReference.class.getSimpleName()); Map> itemMap = null; FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(this.asIndexer(DmpReference._reference, Reference._id)); - DmpReferenceQuery query = this.queryFactory.query(DmpReferenceQuery.class).authorize(this.authorize).referenceIds(datas.stream().map(x -> x.getId()).distinct().collect(Collectors.toList())); + DmpReferenceQuery query = this.queryFactory.query(DmpReferenceQuery.class).authorize(this.authorize).referenceIds(data.stream().map(ReferenceEntity::getId).distinct().collect(Collectors.toList())); itemMap = this.builderFactory.builder(DmpReferenceBuilder.class).authorize(this.authorize).authorize(this.authorize).asMasterKey(query, clone, x -> x.getReference().getId()); if (!fields.hasField(this.asIndexer(DmpReference._reference, Reference._id))) { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/UserDescriptionTemplateBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/UserDescriptionTemplateBuilder.java index 22bf107f3..c9357c4bb 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/UserDescriptionTemplateBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/UserDescriptionTemplateBuilder.java @@ -47,18 +47,18 @@ public class UserDescriptionTemplateBuilder extends BaseBuilder build(FieldSet fields, List datas) throws MyApplicationException { - this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(datas).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); + public List build(FieldSet fields, List data) throws MyApplicationException { + this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0)); this.logger.trace(new DataLogEntry("requested fields", fields)); - if (fields == null || datas == null || fields.isEmpty()) + if (fields == null || data == null || fields.isEmpty()) return new ArrayList<>(); FieldSet descriptionTemplateFields = fields.extractPrefixed(this.asPrefix(UserDescriptionTemplate._descriptionTemplate)); - Map descriptionTemplateMap = this.collectDescriptionTemplates(descriptionTemplateFields, datas); + Map descriptionTemplateMap = this.collectDescriptionTemplates(descriptionTemplateFields, data); List models = new ArrayList<>(); - for (UserDescriptionTemplateEntity d : datas) { + for (UserDescriptionTemplateEntity d : data) { UserDescriptionTemplate m = new UserDescriptionTemplate(); if (fields.hasField(this.asIndexer(UserDescriptionTemplate._id))) m.setId(d.getId()); if (fields.hasField(this.asIndexer(UserDescriptionTemplate._createdAt))) m.setCreatedAt(d.getCreatedAt()); @@ -73,14 +73,14 @@ public class UserDescriptionTemplateBuilder extends BaseBuilder collectDescriptionTemplates(FieldSet fields, List datas) throws MyApplicationException { - if (fields.isEmpty() || datas.isEmpty()) return null; + private Map collectDescriptionTemplates(FieldSet fields, List data) throws MyApplicationException { + if (fields.isEmpty() || data.isEmpty()) return null; this.logger.debug("checking related - {}", DescriptionTemplate.class.getSimpleName()); Map itemMap = null; if (!fields.hasOtherField(this.asIndexer(DescriptionTemplate._id))) { itemMap = this.asEmpty( - datas.stream().map(UserDescriptionTemplateEntity::getDescriptionTemplate).distinct().collect(Collectors.toList()), + data.stream().map(UserDescriptionTemplateEntity::getDescriptionTemplate).distinct().collect(Collectors.toList()), x -> { DescriptionTemplate item = new DescriptionTemplate(); item.setId(x); @@ -89,7 +89,7 @@ public class UserDescriptionTemplateBuilder extends BaseBuilder x.getId()); } else { FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(DescriptionTemplate._id); - DescriptionTemplateQuery q = this.queryFactory.query(DescriptionTemplateQuery.class).ids(datas.stream().map(UserDescriptionTemplateEntity::getDescriptionTemplate).distinct().collect(Collectors.toList())); + DescriptionTemplateQuery q = this.queryFactory.query(DescriptionTemplateQuery.class).ids(data.stream().map(UserDescriptionTemplateEntity::getDescriptionTemplate).distinct().collect(Collectors.toList())); itemMap = this.builderFactory.builder(DescriptionTemplateBuilder.class).asForeignKey(q, clone, DescriptionTemplate::getId); } if (!fields.hasField(DescriptionTemplate._id)) { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionDeleter.java b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionDeleter.java index c02f33d5e..2313ff7ed 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionDeleter.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionDeleter.java @@ -66,14 +66,14 @@ public class DescriptionDeleter implements Deleter { logger.trace("changes saved"); } - public void delete(List datas) throws InvalidApplicationException { - logger.debug("will delete {} items", Optional.ofNullable(datas).map(List::size).orElse(0)); - if (datas == null || datas.isEmpty()) + public void delete(List data) throws InvalidApplicationException { + logger.debug("will delete {} items", Optional.ofNullable(data).map(List::size).orElse(0)); + if (data == null || data.isEmpty()) return; Instant now = Instant.now(); - List ids = datas.stream().map(DescriptionEntity::getId).distinct().collect(Collectors.toList()); + List ids = data.stream().map(DescriptionEntity::getId).distinct().collect(Collectors.toList()); { logger.debug("checking related - {}", DescriptionReferenceEntity.class.getSimpleName()); List items = this.queryFactory.query(DescriptionReferenceQuery.class).descriptionIds(ids).collect(); @@ -87,7 +87,7 @@ public class DescriptionDeleter implements Deleter { deleter.delete(items); } - for (DescriptionEntity item : datas) { + for (DescriptionEntity item : data) { logger.trace("deleting item {}", item.getId()); item.setIsActive(IsActive.Inactive); item.setUpdatedAt(now); diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionTemplateTypeDeleter.java b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionTemplateTypeDeleter.java index e9b562018..775cccf1a 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionTemplateTypeDeleter.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/DescriptionTemplateTypeDeleter.java @@ -65,12 +65,12 @@ public class DescriptionTemplateTypeDeleter implements Deleter { logger.trace("changes saved"); } - public void delete(List datas) throws InvalidApplicationException { - logger.debug("will delete {} items", Optional.ofNullable(datas).map(List::size).orElse(0)); - if (datas == null || datas.isEmpty()) + public void delete(List data) throws InvalidApplicationException { + logger.debug("will delete {} items", Optional.ofNullable(data).map(List::size).orElse(0)); + if (data == null || data.isEmpty()) return; - List ids = datas.stream().map(DescriptionTemplateTypeEntity::getId).distinct().collect(Collectors.toList()); + List ids = data.stream().map(DescriptionTemplateTypeEntity::getId).distinct().collect(Collectors.toList()); { logger.debug("checking related - {}", DescriptionTemplateEntity.class.getSimpleName()); List items = this.queryFactory.query(DescriptionTemplateQuery.class).typeIds(ids).collect(); @@ -80,7 +80,7 @@ public class DescriptionTemplateTypeDeleter implements Deleter { Instant now = Instant.now(); - for (DescriptionTemplateTypeEntity item : datas) { + for (DescriptionTemplateTypeEntity item : data) { logger.trace("deleting item {}", item.getId()); item.setIsActive(IsActive.Inactive); item.setUpdatedAt(now); diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/ReferenceDeleter.java b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/ReferenceDeleter.java index 7e3f76a67..b522035b4 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/ReferenceDeleter.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/ReferenceDeleter.java @@ -64,12 +64,12 @@ public class ReferenceDeleter implements Deleter { logger.trace("changes saved"); } - public void delete(List datas) throws InvalidApplicationException { - logger.debug("will delete {} items", Optional.ofNullable(datas).map(List::size).orElse(0)); - if (datas == null || datas.isEmpty()) + public void delete(List data) throws InvalidApplicationException { + logger.debug("will delete {} items", Optional.ofNullable(data).map(List::size).orElse(0)); + if (data == null || data.isEmpty()) return; - List ids = datas.stream().map(ReferenceEntity::getId).distinct().collect(Collectors.toList()); + List ids = data.stream().map(ReferenceEntity::getId).distinct().collect(Collectors.toList()); { logger.debug("checking related - {}", DescriptionReferenceEntity.class.getSimpleName()); List items = this.queryFactory.query(DescriptionReferenceQuery.class).referenceIds(ids).collect(); @@ -84,7 +84,7 @@ public class ReferenceDeleter implements Deleter { } Instant now = Instant.now(); - for (ReferenceEntity item : datas) { + for (ReferenceEntity item : data) { logger.trace("deleting item {}", item.getId()); item.setIsActive(IsActive.Inactive); item.setUpdatedAt(now); diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/TagDeleter.java b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/TagDeleter.java index ecfc79a86..55aa92e01 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/deleter/TagDeleter.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/deleter/TagDeleter.java @@ -61,11 +61,11 @@ public class TagDeleter implements Deleter { logger.trace("changes saved"); } - public void delete(List datas) throws InvalidApplicationException { - logger.debug("will delete {} items", Optional.ofNullable(datas).map(List::size).orElse(0)); - if (datas == null || datas.isEmpty()) + public void delete(List data) throws InvalidApplicationException { + logger.debug("will delete {} items", Optional.ofNullable(data).map(List::size).orElse(0)); + if (data == null || data.isEmpty()) return; - List ids = datas.stream().map(TagEntity::getId).distinct().collect(Collectors.toList()); + List ids = data.stream().map(TagEntity::getId).distinct().collect(Collectors.toList()); { logger.debug("checking related - {}", DescriptionTagEntity.class.getSimpleName()); List items = this.queryFactory.query(DescriptionTagQuery.class).tagIds(ids).collect(); @@ -74,7 +74,7 @@ public class TagDeleter implements Deleter { } Instant now = Instant.now(); - for (TagEntity item : datas) { + for (TagEntity item : data) { logger.trace("deleting item {}", item.getId()); item.setIsActive(IsActive.Inactive); item.setUpdatedAt(now); diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/AutoCompleteFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/AutoCompleteFieldDataHelperService.java index 4505b488d..6f43aa446 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/AutoCompleteFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/AutoCompleteFieldDataHelperService.java @@ -82,8 +82,8 @@ public class AutoCompleteFieldDataHelperService extends BaseFieldDataHelperServi } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(AutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(AutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BaseFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BaseFieldDataHelperService.java index db1afd356..876fb0b90 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BaseFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BaseFieldDataHelperService.java @@ -21,7 +21,7 @@ public abstract class BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags); + protected abstract List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags); protected abstract D applyPersistInternal(PM persist, D data); protected abstract PM importExportMapDataToPersistInternal(IE data, PM persist); protected abstract IE dataToImportExportXmlInternal(D data, IE xml); @@ -78,7 +78,7 @@ public abstract class BaseFieldDataHelperService build(FieldSet fieldSet, List> datas, EnumSet authorizationFlags) { - return this.buildInternal(fieldSet, datas.stream().map(x-> (D) x).collect(Collectors.toList()), authorizationFlags).stream().map(x-> (M)x).collect(Collectors.toList()); + public List build(FieldSet fieldSet, List> data, EnumSet authorizationFlags) { + return this.buildInternal(fieldSet, data.stream().map(x-> (D) x).collect(Collectors.toList()), authorizationFlags).stream().map(x-> (M)x).collect(Collectors.toList()); } } diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BooleanDecisionFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BooleanDecisionFieldDataHelperService.java index e7c948c60..267be13de 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BooleanDecisionFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/BooleanDecisionFieldDataHelperService.java @@ -74,8 +74,8 @@ public class BooleanDecisionFieldDataHelperService extends BaseFieldDataHelperSe } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(BooleanDecisionDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(BooleanDecisionDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CheckBoxFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CheckBoxFieldDataHelperService.java index 7baf19bea..99094543e 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CheckBoxFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CheckBoxFieldDataHelperService.java @@ -78,8 +78,8 @@ public class CheckBoxFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(CheckBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(CheckBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CurrencyFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CurrencyFieldDataHelperService.java index f84253948..2b788cd29 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CurrencyFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/CurrencyFieldDataHelperService.java @@ -76,8 +76,8 @@ public class CurrencyFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(CurrencyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(CurrencyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override protected CurrencyDataEntity applyPersistInternal(CurrencyDataPersist persist, CurrencyDataEntity data) { diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DataRepositoryFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DataRepositoryFieldDataHelperService.java index a2a2c306e..098459eea 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DataRepositoryFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DataRepositoryFieldDataHelperService.java @@ -75,8 +75,8 @@ public class DataRepositoryFieldDataHelperService extends BaseFieldDataHelperSer } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(DataRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(DataRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetAutoCompleteFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetAutoCompleteFieldDataHelperService.java index 09d920c9a..a05d7b351 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetAutoCompleteFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetAutoCompleteFieldDataHelperService.java @@ -78,8 +78,8 @@ public class DatasetAutoCompleteFieldDataHelperService extends BaseFieldDataHelp } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(DatasetAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(DatasetAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetIdentifierFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetIdentifierFieldDataHelperService.java index c29c88aad..c46acd74b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetIdentifierFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatasetIdentifierFieldDataHelperService.java @@ -76,8 +76,8 @@ public class DatasetIdentifierFieldDataHelperService extends BaseFieldDataHelper } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(DatasetIdentifierDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(DatasetIdentifierDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatePickerFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatePickerFieldDataHelperService.java index 72f9fc27d..ce972e2d9 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatePickerFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DatePickerFieldDataHelperService.java @@ -76,8 +76,8 @@ public class DatePickerFieldDataHelperService extends BaseFieldDataHelperService } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(DatePickerDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(DatePickerDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DmpAutoCompleteFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DmpAutoCompleteFieldDataHelperService.java index c4942314a..003367dfe 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DmpAutoCompleteFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/DmpAutoCompleteFieldDataHelperService.java @@ -78,8 +78,8 @@ public class DmpAutoCompleteFieldDataHelperService extends BaseFieldDataHelperSe } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(DmpAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(DmpAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ExternalDatasetFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ExternalDatasetFieldDataHelperService.java index f6860b8ff..0792745b8 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ExternalDatasetFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ExternalDatasetFieldDataHelperService.java @@ -77,8 +77,8 @@ public class ExternalDatasetFieldDataHelperService extends BaseFieldDataHelperSe } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(ExternalDatasetDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(ExternalDatasetDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FieldDataHelperService.java index f0e6ae7b7..1d726c3fa 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FieldDataHelperService.java @@ -21,7 +21,7 @@ public interface FieldDataHelperService { Class getModelClass(); Class getPersistModelClass(); Class getImportExportClass(); - List build(gr.cite.tools.fieldset.FieldSet fieldSet, List> datas, EnumSet authorizationFlags); + List build(gr.cite.tools.fieldset.FieldSet fieldSet, List> data, EnumSet authorizationFlags); BaseFieldData buildOne(FieldSet fieldSet, BaseFieldDataEntity data, EnumSet authorizationFlags); BaseFieldDataEntity applyPersist(BaseFieldDataPersist persist); BaseFieldDataEntity applyPersist(BaseFieldDataPersist persist, BaseFieldDataEntity data); diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FreeTextFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FreeTextFieldDataHelperService.java index aec2eefee..f7399f1a5 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FreeTextFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/FreeTextFieldDataHelperService.java @@ -78,8 +78,8 @@ public class FreeTextFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(FreeTextDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(FreeTextDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/JournalRepositoryFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/JournalRepositoryFieldDataHelperService.java index 6e6113a9f..57d65407f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/JournalRepositoryFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/JournalRepositoryFieldDataHelperService.java @@ -79,8 +79,8 @@ public class JournalRepositoryFieldDataHelperService extends BaseFieldDataHelper } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(JournalRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(JournalRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/LicenseFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/LicenseFieldDataHelperService.java index 9af161772..156d031f0 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/LicenseFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/LicenseFieldDataHelperService.java @@ -77,8 +77,8 @@ public class LicenseFieldDataHelperService extends BaseFieldDataHelperService
  • buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(LicenseDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(LicenseDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/OrganizationFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/OrganizationFieldDataHelperService.java index 6b8b4071b..e566db02b 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/OrganizationFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/OrganizationFieldDataHelperService.java @@ -77,8 +77,8 @@ public class OrganizationFieldDataHelperService extends BaseFieldDataHelperServi } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(OrganizationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(OrganizationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationFieldDataHelperService.java index 8e90ca426..020758a14 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationFieldDataHelperService.java @@ -77,8 +77,8 @@ public class PublicationFieldDataHelperService extends BaseFieldDataHelperServic } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(PublicationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(PublicationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationRepositoryFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationRepositoryFieldDataHelperService.java index d4c51ce01..5a0248b53 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationRepositoryFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/PublicationRepositoryFieldDataHelperService.java @@ -79,8 +79,8 @@ public class PublicationRepositoryFieldDataHelperService extends BaseFieldDataHe } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(PublicationRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(PublicationRepositoryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RadioBoxFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RadioBoxFieldDataHelperService.java index 58c76b39b..a607fd275 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RadioBoxFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RadioBoxFieldDataHelperService.java @@ -82,8 +82,8 @@ public class RadioBoxFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(RadioBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(RadioBoxDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RegistryFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RegistryFieldDataHelperService.java index d539c2b5e..d18281b5f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RegistryFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RegistryFieldDataHelperService.java @@ -77,8 +77,8 @@ public class RegistryFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(RegistryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(RegistryDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherAutoCompleteFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherAutoCompleteFieldDataHelperService.java index fc47abaa9..736872661 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherAutoCompleteFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherAutoCompleteFieldDataHelperService.java @@ -77,8 +77,8 @@ public class ResearcherAutoCompleteFieldDataHelperService extends BaseFieldDataH } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(ResearcherAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(ResearcherAutoCompleteDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherFieldDataHelperService.java index 60689ba06..f7b95293a 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ResearcherFieldDataHelperService.java @@ -77,8 +77,8 @@ public class ResearcherFieldDataHelperService extends BaseFieldDataHelperService } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(ResearcherDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(ResearcherDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RichTextAreaDataFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RichTextAreaDataFieldDataHelperService.java index 1e4c6cfac..43e82fba2 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RichTextAreaDataFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/RichTextAreaDataFieldDataHelperService.java @@ -78,8 +78,8 @@ public class RichTextAreaDataFieldDataHelperService extends BaseFieldDataHelperS } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(RichTextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(RichTextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ServiceFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ServiceFieldDataHelperService.java index f412e4915..ee79978a4 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ServiceFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ServiceFieldDataHelperService.java @@ -77,8 +77,8 @@ public class ServiceFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(ServiceDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(ServiceDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TagFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TagFieldDataHelperService.java index 95befae3b..25aae449e 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TagFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TagFieldDataHelperService.java @@ -78,8 +78,8 @@ public class TagFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(TagDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(TagDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TaxonomyFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TaxonomyFieldDataHelperService.java index d6e3e80eb..5137899f3 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TaxonomyFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TaxonomyFieldDataHelperService.java @@ -77,8 +77,8 @@ public class TaxonomyFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(TaxonomyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(TaxonomyDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TextAreaFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TextAreaFieldDataHelperService.java index 9d62529f3..783a096bb 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TextAreaFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/TextAreaFieldDataHelperService.java @@ -77,8 +77,8 @@ public class TextAreaFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(TextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(TextAreaDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/UploadFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/UploadFieldDataHelperService.java index 2c6c1145b..4be7cc38a 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/UploadFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/UploadFieldDataHelperService.java @@ -80,8 +80,8 @@ public class UploadFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(UploadDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(UploadDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ValidationFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ValidationFieldDataHelperService.java index 3c58ca698..abca0c250 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ValidationFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/ValidationFieldDataHelperService.java @@ -77,8 +77,8 @@ public class ValidationFieldDataHelperService extends BaseFieldDataHelperService } @Override - public List buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(ValidationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(ValidationDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/WordListFieldDataHelperService.java b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/WordListFieldDataHelperService.java index 277ffa0ae..752f0a4cb 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/WordListFieldDataHelperService.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/fielddatahelper/WordListFieldDataHelperService.java @@ -78,8 +78,8 @@ public class WordListFieldDataHelperService extends BaseFieldDataHelperService buildInternal(FieldSet fieldSet, List datas, EnumSet authorizationFlags){ - return this.builderFactory.builder(WordListDataBuilder.class).authorize(authorizationFlags).build(fieldSet, datas); + public List buildInternal(FieldSet fieldSet, List data, EnumSet authorizationFlags){ + return this.builderFactory.builder(WordListDataBuilder.class).authorize(authorizationFlags).build(fieldSet, data); } @Override diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/supportivematerial/SupportiveMaterialServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/supportivematerial/SupportiveMaterialServiceImpl.java index ea1b6cb8e..962d80d71 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/supportivematerial/SupportiveMaterialServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/supportivematerial/SupportiveMaterialServiceImpl.java @@ -122,35 +122,35 @@ public class SupportiveMaterialServiceImpl implements SupportiveMaterialService{ Boolean isUpdate = this.conventionService.isValidGuid(model.getId()); - SupportiveMaterialEntity data; + SupportiveMaterialEntity d; if (isUpdate) { - data = this.entityManager.find(SupportiveMaterialEntity.class, model.getId()); - if (data == null) + d = this.entityManager.find(SupportiveMaterialEntity.class, model.getId()); + if (d == null) throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), SupportiveMaterial.class.getSimpleName()}, LocaleContextHolder.getLocale())); } else { - List datas = this.queryFactory.query(SupportiveMaterialQuery.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).languageCodes(model.getLanguageCode()).types(model.getType()).collect(); + List data = this.queryFactory.query(SupportiveMaterialQuery.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).languageCodes(model.getLanguageCode()).types(model.getType()).collect(); - if(datas != null && !datas.isEmpty()){ + if(data != null && !data.isEmpty()){ throw new MyApplicationException("Could not create a new Data with same type and lang code !"); } - data = new SupportiveMaterialEntity(); - data.setId(UUID.randomUUID()); - data.setIsActive(IsActive.Active); - data.setCreatedAt(Instant.now()); + d = new SupportiveMaterialEntity(); + d.setId(UUID.randomUUID()); + d.setIsActive(IsActive.Active); + d.setCreatedAt(Instant.now()); } - data.setType(model.getType()); - data.setLanguageCode(model.getLanguageCode()); - data.setPayload(model.getPayload()); - data.setUpdatedAt(Instant.now()); + d.setType(model.getType()); + d.setLanguageCode(model.getLanguageCode()); + d.setPayload(model.getPayload()); + d.setUpdatedAt(Instant.now()); - if (isUpdate) this.entityManager.merge(data); - else this.entityManager.persist(data); + if (isUpdate) this.entityManager.merge(d); + else this.entityManager.persist(d); this.entityManager.flush(); - return this.builderFactory.builder(SupportiveMaterialBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(BaseFieldSet.build(fields, SupportiveMaterial._id), data); + return this.builderFactory.builder(SupportiveMaterialBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(BaseFieldSet.build(fields, SupportiveMaterial._id), d); } public void deleteAndSave(UUID id) throws MyForbiddenException, InvalidApplicationException { diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java index e3820362d..9040462d4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java @@ -89,8 +89,8 @@ public class ReferenceController extends BaseController { this.censorFactory.censor(ReferenceCensor.class).censor(lookup.getProject(), null); ReferenceQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic); - List datas = query.collectAs(lookup.getProject()); - List models = this.builderFactory.builder(ReferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), datas); + List data = query.collectAs(lookup.getProject()); + List models = this.builderFactory.builder(ReferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), data); long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size(); this.auditService.track(AuditableAction.Reference_Query, "lookup", lookup); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java index 76ebb99f5..10c6cbdcd 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java @@ -79,8 +79,8 @@ public class ReferenceTypeController extends BaseController { this.censorFactory.censor(ReferenceTypeCensor.class).censor(lookup.getProject(), null); ReferenceTypeQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic); - List datas = query.collectAs(lookup.getProject()); - List models = this.builderFactory.builder(ReferenceTypeBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), datas); + List data = query.collectAs(lookup.getProject()); + List models = this.builderFactory.builder(ReferenceTypeBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), data); long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size(); this.auditService.track(AuditableAction.ReferenceType_Query, "lookup", lookup); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java index 94dbb3d80..b9d7c4dbb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java @@ -81,8 +81,8 @@ public class SupportiveMaterialController { this.censorFactory.censor(SupportiveMaterialCensor.class).censor(lookup.getProject(), null); SupportiveMaterialQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic); - List datas = query.collectAs(lookup.getProject()); - List models = this.builderFactory.builder(SupportiveMaterialBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), datas); + List data = query.collectAs(lookup.getProject()); + List models = this.builderFactory.builder(SupportiveMaterialBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), data); long count = (lookup.getMetadata() != null && lookup.getMetadata().getCountAll()) ? query.count() : models.size(); this.auditService.track(AuditableAction.SupportiveMaterial_Query, "lookup", lookup); @@ -116,9 +116,9 @@ public class SupportiveMaterialController { this.censorFactory.censor(SupportiveMaterialCensor.class).censor(lookup.getProject(), null); SupportiveMaterialQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic); - List datas = query.collectAs(lookup.getProject()); - if (datas.size() == 1){ - return new ResponseEntity<>(datas.get(0).getPayload().getBytes(), HttpStatus.OK); + List data = query.collectAs(lookup.getProject()); + if (data.size() == 1){ + return new ResponseEntity<>(data.get(0).getPayload().getBytes(), HttpStatus.OK); } try (Stream paths = Files.walk(Paths.get(Objects.requireNonNull(this.environment.getProperty(lookup.getTypes().stream().toList().get(0).name().toLowerCase() +".path"))))) { diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java index b61b8a095..f1c7cfd51 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java @@ -199,8 +199,8 @@ public class ReferenceService { lookup.setProject(new BaseFieldSet(fields)); ReferenceQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic); - List datas = query.collectAs(lookup.getProject()); - return this.builderFactory.builder(ReferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), datas); + List data = query.collectAs(lookup.getProject()); + return this.builderFactory.builder(ReferenceBuilder.class).authorize(AuthorizationFlags.OwnerOrPermissionOrMemberOrPublic).build(lookup.getProject(), data); } // private List fetchFromDb(ReferenceType externalType, String query, String type, List> remoteRepos) throws InvalidApplicationException {