From 8cdea5917576611321bd2db27285d1b17591d0fd Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 19 Sep 2019 14:02:36 +0000 Subject: [PATCH] ref 17434: Workspace - info panel hide root VO and VO names in shared with part https://support.d4science.org/issues/17434 Updated Info Panel to show only VRE info git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@181744 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 3 +- .../server/GWTWorkspaceSharingBuilder.java | 29 +++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/distro/changelog.xml b/distro/changelog.xml index 8f177e0..21d2f84 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,9 +1,10 @@ + Updated Info Panel to show only VRE info [ticket: #17434] Added support to workspace users discovery by VREs [ticket: #17169] Added support for users in different Gateway [ticket: #17080] - Update the list of shared classes with the tree widget + Updated the list of shared classes with the tree widget 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 d5dbc9b..9931027 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 @@ -47,6 +47,7 @@ import org.gcube.vomanagement.usermanagement.model.GCubeUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * The Class GWTWorkspaceSharingBuilder. * @@ -417,7 +418,7 @@ public class GWTWorkspaceSharingBuilder { } } }); - logger.debug("VRE retrieved: "+contexts.size()); + logger.debug("VRE retrieved: " + contexts.size()); return contexts; } catch (Exception e) { @@ -805,7 +806,11 @@ public class GWTWorkspaceSharingBuilder { String html = "
"; - logger.trace("Formatting " + acls.size() + " ACL/s"); + logger.info("ACL/s found " + acls.size()); + PortalContext context = PortalContext.getConfiguration(); + + logger.info("context.getInfrastructureName(): " + context.getInfrastructureName()); + String infrastructureName = context.getInfrastructureName(); Map> aclOwner = new HashMap<>(); @@ -840,15 +845,29 @@ public class GWTWorkspaceSharingBuilder { for (String login : listLogins) { logger.trace("Adding login " + login); String fullName = UserUtil.getUserFullName(login); - if (fullName != null && !fullName.isEmpty()) - html += fullName + "; "; - else + if (fullName != null && !fullName.isEmpty()) { + if (infrastructureName != null && !infrastructureName.isEmpty() + && fullName.startsWith(infrastructureName) && infrastructureName.length()-1&&fullName.length()>indexOfFirstDash){ + fullName = fullName.substring(indexOfFirstDash+1); + html += fullName + "; "; + } else { + html += fullName + "; "; + } + } else { + html += fullName + "; "; + } + } else { html += login + "; "; + } } html += "
"; } html += "
"; + logger.info("Retrieved: " + html); return html; }