From 310dfa05cf4248039f55f051bd62d3047affe09a Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 31 Jul 2019 13:45:24 +0000 Subject: [PATCH] ref 17169: Selection of users in the Sharing panel https://support.d4science.org/issues/17169 Updated VREs by user discovery git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181373 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/GWTWorkspaceSharingBuilder.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/GWTWorkspaceSharingBuilder.java b/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/GWTWorkspaceSharingBuilder.java index 84d650e..f3f4f96 100644 --- a/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/GWTWorkspaceSharingBuilder.java +++ b/src/main/java/org/gcube/portlets/widgets/workspacesharingwidget/server/GWTWorkspaceSharingBuilder.java @@ -394,22 +394,13 @@ public class GWTWorkspaceSharingBuilder { List listOfGroups = getGroupManager().listGroupsByUser(userId); if (listOfGroups != null && !listOfGroups.isEmpty()) { for (GCubeGroup gCubeGroup : listOfGroups) { - // Get VOs - List voGroups = gCubeGroup.getChildren(); - if (voGroups != null && !voGroups.isEmpty()) { - for (GCubeGroup voGroup : voGroups) { - // Get VREs - List vreGroups = voGroup.getChildren(); - if (vreGroups != null && !vreGroups.isEmpty()) { - for (GCubeGroup vreGroup : vreGroups) { - UserVRE gGroup = new UserVRE(vreGroup.getGroupId(), vreGroup.getParentGroupId(), - vreGroup.getGroupName(), vreGroup.getDescription()); - contexts.add(gGroup); - - } - } - } + // Test is VRE + if (getGroupManager().isVRE(gCubeGroup.getGroupId())) { + UserVRE gGroup = new UserVRE(gCubeGroup.getGroupId(), gCubeGroup.getParentGroupId(), + gCubeGroup.getGroupName(), gCubeGroup.getDescription()); + contexts.add(gGroup); } + } } @@ -427,6 +418,7 @@ public class GWTWorkspaceSharingBuilder { } } }); + logger.debug("VRE retrieved: "+contexts.size()); return contexts; } catch (Exception e) {