Fix issue of new DMPs not showing on the user's listing with elasticsearch active (#7010)

This commit is contained in:
George Kalampokis 2021-10-05 12:56:20 +03:00
parent 67b10528e3
commit b66bde871a
1 changed files with 9 additions and 0 deletions

View File

@ -151,6 +151,7 @@ public class DataManagementPlanManager {
}
if (items == null) {
items = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().getWithCriteria(dataManagementPlanTableRequest.getCriteria());
}
List<Integer> roles = new LinkedList<>();
if (!dataManagementPlanTableRequest.getCriteria().isOnlyPublic()) {
if (dataManagementPlanTableRequest.getCriteria().getRole() != null)
@ -159,8 +160,11 @@ public class DataManagementPlanManager {
} else {
authItems = items;
}
if (items == null) {
totalData = authItems.count();
items = PaginationManager.applyPaging(authItems, dataManagementPlanTableRequest);
} else {
items = authItems;
}
@ -532,6 +536,9 @@ public class DataManagementPlanManager {
if (dataManagementPlan.getAssociatedUsers().size() == 0)
assignUser(newDmp, user);
UUID dmpId = newDmp.getId();
newDmp.setUsers(new HashSet<>(apiContext.getOperationsContext().getDatabaseRepository().getUserDmpDao().asQueryable().where((builder, root) -> builder.equal(root.get("dmp").get("id"), dmpId)).toList()));
this.updateIndex(newDmp);
if (setNotification) {
@ -586,6 +593,8 @@ public class DataManagementPlanManager {
datasets.add(dataset);
}
this.updateIndex(result);
return result;
}