diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java index d86f677b9..43dddd194 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java @@ -30,7 +30,9 @@ public class DMPDaoImpl extends DatabaseAccess implements DMPDao { public QueryableList getWithCriteria(DataManagementPlanCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(DMP.getHints(), DMP.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))); if (criteria.getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd())); if (criteria.getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java index f2eec9e0a..119e8f881 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPProfileDaoImpl.java @@ -61,7 +61,7 @@ public class DMPProfileDaoImpl extends DatabaseAccess implements DMP public QueryableList getWithCriteria(DataManagementPlanProfileCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(DMPProfile.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); return query; } } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java index cc1e10544..81f5646e1 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java @@ -28,7 +28,9 @@ public class DatasetDaoImpl extends DatabaseAccess implements DatasetDa public QueryableList getWithCriteria(DatasetCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(Dataset.getHints(), Dataset.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))); if (criteria.getStatus() != null) query.where((builder, root) -> builder.equal(root.get("status"), criteria.getStatus())); if (criteria.getPeriodEnd() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java index a9f684c7d..454431f29 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetProfileDaoImpl.java @@ -24,7 +24,7 @@ public class DatasetProfileDaoImpl extends DatabaseAccess implem public QueryableList getWithCriteria(DatasetProfileCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(DatasetProfile.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java index 76105609f..76b1ec4f7 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ExternalDatasetDaoImpl.java @@ -25,7 +25,7 @@ public class ExternalDatasetDaoImpl extends DatabaseAccess impl public QueryableList getWithCriteria(ExternalDatasetCriteria criteria) { QueryableList query = this.getDatabaseService().getQueryable(ExternalDataset.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java index bc5930802..b9f8c845c 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/ProjectDaoImpl.java @@ -28,7 +28,9 @@ public class ProjectDaoImpl extends DatabaseAccess implements ProjectDa public QueryableList getWithCriteria(ProjectCriteria criteria) { QueryableList query = getDatabaseService().getQueryable(Project.class); if (criteria.getLike() != null && !criteria.getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%")); + query.where((builder, root) -> + builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"), + builder.or(builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%")))); if (criteria.getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("enddate"), criteria.getPeriodEnd())); if (criteria.getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java index 46e2c0861..584516d3c 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/UserInfoDaoImpl.java @@ -26,7 +26,7 @@ public class UserInfoDaoImpl extends DatabaseAccess implements UserInf if (criteria.getAppRoles() != null && !criteria.getAppRoles().isEmpty()) users.where((builder, root) -> root.join("userRoles").get("role").in(criteria.getAppRoles())); if (criteria.getLike() != null) - users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + criteria.getLike() + "%"), builder.like(root.get("email"), "%" + criteria.getLike() + "%"))); + users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + criteria.getLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + criteria.getLike() + "%"))); if (criteria.getEmail() != null) users.where((builder, root) -> builder.equal(root.get("email"), criteria.getEmail())); return users; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dataset/DatasetWizardAutocompleteRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dataset/DatasetWizardAutocompleteRequest.java index 5b0316ee7..cd02e9e2e 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dataset/DatasetWizardAutocompleteRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dataset/DatasetWizardAutocompleteRequest.java @@ -13,7 +13,7 @@ public class DatasetWizardAutocompleteRequest extends Query applyCriteria() { QueryableList query = this.getQuery().where((builder, root) -> builder.or(builder.equal(root.get("creator"), this.getCriteria().getUserInfo()), builder.isMember(this.getCriteria().getUserInfo(), root.get("users")))); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) { - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%")); } return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/datasetprofile/DatasetProfileAutocompleteRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/datasetprofile/DatasetProfileAutocompleteRequest.java index 06999e09f..7418102b6 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/datasetprofile/DatasetProfileAutocompleteRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/datasetprofile/DatasetProfileAutocompleteRequest.java @@ -12,7 +12,7 @@ public class DatasetProfileAutocompleteRequest extends Query applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%")); return query; } } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmp/DataManagementPlanCriteriaRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmp/DataManagementPlanCriteriaRequest.java index 1b88b8872..da491fdb0 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmp/DataManagementPlanCriteriaRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmp/DataManagementPlanCriteriaRequest.java @@ -16,7 +16,9 @@ public class DataManagementPlanCriteriaRequest extends Query applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("created"), this.getCriteria().getPeriodEnd())); if (this.getCriteria().getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmpprofile/DataManagementPlanProfileCriteriaRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmpprofile/DataManagementPlanProfileCriteriaRequest.java index 91ba08b42..a87d09532 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmpprofile/DataManagementPlanProfileCriteriaRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/dmpprofile/DataManagementPlanProfileCriteriaRequest.java @@ -13,7 +13,7 @@ public class DataManagementPlanProfileCriteriaRequest extends Query applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%")); return query; } } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java index ace533150..1e11d9526 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/project/ProjectCriteriaRequest.java @@ -5,9 +5,7 @@ import eu.eudat.data.entities.Project; import eu.eudat.data.query.definition.Query; import eu.eudat.queryable.QueryableList; -import java.util.UUID; - -public class ProjectCriteriaRequest extends Query { +public class ProjectCriteriaRequest extends Query { private Integer length; public Integer getLength() { @@ -25,7 +23,9 @@ public class ProjectCriteriaRequest extends Query { public QueryableList applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("enddate"), this.getCriteria().getPeriodEnd())); if (this.getCriteria().getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/userinfo/UserInfoRequestItem.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/userinfo/UserInfoRequestItem.java index de2386979..c7dcbff8d 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/userinfo/UserInfoRequestItem.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/item/userinfo/UserInfoRequestItem.java @@ -13,7 +13,7 @@ public class UserInfoRequestItem extends Query { if (this.getCriteria().getAppRoles() != null && !this.getCriteria().getAppRoles().isEmpty()) users.where((builder, root) -> root.join("userRoles").get("role").in(this.getCriteria().getAppRoles())); if (this.getCriteria().getLike() != null) - users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + this.getCriteria().getLike() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%"))); + users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%"))); if (this.getCriteria().getEmail() != null) users.where((builder, root) -> builder.equal(root.get("email"), this.getCriteria().getEmail())); return users; diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java index 27546ccae..ad959b6bb 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetPublicTableRequest.java @@ -21,14 +21,16 @@ public class DatasetPublicTableRequest extends TableQuerysubQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class))); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().projects != null && !this.getCriteria().projects.isEmpty()) query.where(((builder, root) -> root.get("dmp").get("project").get("id").in(this.getCriteria().projects))); if (this.getCriteria().projectStatus != null) query .where(((builder, root) -> builder.equal(root.get("dmp").get("project").get("status"), this.getCriteria().projectStatus.getValue()))); if (this.getCriteria().datasetProfile != null && !this.getCriteria().datasetProfile.isEmpty()) query .where(((builder, root) -> root.get("profile").get("id").in(this.getCriteria().datasetProfile))); - if(this.getCriteria().dmpOrganisations != null && !this.getCriteria().dmpOrganisations.isEmpty())query + if (this.getCriteria().dmpOrganisations != null && !this.getCriteria().dmpOrganisations.isEmpty()) query .where(((builder, root) -> root.join("dmp").join("organisations").get("reference").in(this.getCriteria().dmpOrganisations))); return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetTableRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetTableRequest.java index 928741ce4..a752014cd 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetTableRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dataset/DatasetTableRequest.java @@ -10,12 +10,14 @@ import eu.eudat.queryable.types.SelectionField; import java.util.Arrays; import java.util.UUID; -public class DatasetTableRequest extends TableQuery { +public class DatasetTableRequest extends TableQuery { @Override public QueryableList applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().getStatus() != null) query.where((builder, root) -> builder.equal(root.get("status"), this.getCriteria().getStatus())); if (this.getCriteria().getPeriodEnd() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/datasetprofile/DatasetProfileTableRequestItem.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/datasetprofile/DatasetProfileTableRequestItem.java index 2d4fb0a94..1ff6faa88 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/datasetprofile/DatasetProfileTableRequestItem.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/datasetprofile/DatasetProfileTableRequestItem.java @@ -12,7 +12,7 @@ public class DatasetProfileTableRequestItem extends TableQuery applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%")); return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dmp/DataManagementPlanTableRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dmp/DataManagementPlanTableRequest.java index c595618c5..766a1875f 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dmp/DataManagementPlanTableRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/dmp/DataManagementPlanTableRequest.java @@ -16,7 +16,9 @@ public class DataManagementPlanTableRequest extends TableQuery applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("created"), this.getCriteria().getPeriodEnd())); if (this.getCriteria().getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/externaldataset/ExternalDatasetTableRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/externaldataset/ExternalDatasetTableRequest.java index 5dd302e09..1c0c4199b 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/externaldataset/ExternalDatasetTableRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/externaldataset/ExternalDatasetTableRequest.java @@ -13,7 +13,7 @@ public class ExternalDatasetTableRequest extends TableQuery applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%")); return query; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/project/ProjectTableRequest.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/project/ProjectTableRequest.java index 92bcd9daa..430be9752 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/project/ProjectTableRequest.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/project/ProjectTableRequest.java @@ -13,7 +13,9 @@ public class ProjectTableRequest extends TableQuery applyCriteria() { QueryableList query = this.getQuery(); if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty()) - query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%")); + query.where((builder, root) -> builder.or( + builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), + builder.like(builder.upper(root.get("description")), "%" + this.getCriteria().getLike().toUpperCase() + "%"))); if (this.getCriteria().getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("enddate"), this.getCriteria().getPeriodEnd())); if (this.getCriteria().getPeriodStart() != null) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/userinfo/UserInfoTableRequestItem.java b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/userinfo/UserInfoTableRequestItem.java index f1435e366..a4a3fc38f 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/userinfo/UserInfoTableRequestItem.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/query/items/table/userinfo/UserInfoTableRequestItem.java @@ -16,7 +16,7 @@ public class UserInfoTableRequestItem extends TableQuery root.join("userRoles").get("role").in(this.getCriteria().getAppRoles())); if (this.getCriteria().getLike() != null) - users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + this.getCriteria().getLike() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%"))); + users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + this.getCriteria().getLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + this.getCriteria().getLike() + "%"))); if (this.getCriteria().getEmail() != null) users.where((builder, root) -> builder.equal(root.get("email"), this.getCriteria().getEmail())); return users; diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index e1878abc0..b34ba9bf4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -317,6 +317,29 @@ public class DataManagementPlanManager { Document xmlDoc = XmlBuilder.getDocument(); Element root = xmlDoc.createElement("root"); Element dmpElement = xmlDoc.createElement("dmp"); + Element dmpName = xmlDoc.createElement("dmpName"); + dmpName.setTextContent(dmp.getLabel()); + dmpElement.appendChild(dmpName); + Element projectName = xmlDoc.createElement("projectName"); + projectName.setTextContent(dmp.getProject().getLabel()); + dmpElement.appendChild(projectName); + Element organisationsElement = xmlDoc.createElement("organisations"); + for(Organisation organisation : dmp.getOrganisations()){ + Element organisationElement = xmlDoc.createElement("organisation"); + organisationElement.setAttribute("name", organisation.getLabel()); + organisationElement.setAttribute("reference", organisation.getReference()); + organisationsElement.appendChild(organisationElement); + } + dmpElement.appendChild(organisationsElement); + + Element researchersElement = xmlDoc.createElement("researchers"); + for(Researcher researcher : dmp.getResearchers()){ + Element researcherElement = xmlDoc.createElement("organisation"); + researcherElement.setAttribute("name", researcher.getLabel()); + researcherElement.setAttribute("reference", researcher.getReference()); + organisationsElement.appendChild(researcherElement); + } + dmpElement.appendChild(researchersElement); Element datasetsElement = xmlDoc.createElement("datasets"); for (Dataset dataset : datasets) {