From b8f99d099e53b5b183c6692bb3f23601f4e6d248 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 21 Jan 2020 12:09:14 +0100 Subject: [PATCH] ref 18291: Modify the Accounting Dashboard portlet to support the Core Services Category per gateway https://support.d4science.org/issues/18291 Fixed infra nodes scope --- .../accounting/PortalContextTreeProvider.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java index ddce2aa..9acaa02 100644 --- a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java @@ -110,8 +110,8 @@ public class PortalContextTreeProvider implements ContextTreeProvider { currUser); if (infraNode != null) { - String currScope = portalContext.getCurrentScope(gCubeGroup.getGroupId() + ""); - ScopeDescriptor infraNodeScopeDescriptor = createRelativeInfraNode(infraNode, currScope); + String gatewayScope = String.valueOf(gCubeGroup.getGroupId()); + ScopeDescriptor infraNodeScopeDescriptor = createRelativeInfraNode(infraNode, gatewayScope); if (gatewayChildren != null) { gatewayChildren.addFirst(infraNodeScopeDescriptor); } else { @@ -156,15 +156,16 @@ public class PortalContextTreeProvider implements ContextTreeProvider { PortalContext pContext = PortalContext.getConfiguration(); GCubeUser currUser = pContext.getCurrentUser(request); - String currScope = pContext.getCurrentScope(currentSiteGroupId + ""); - - InfraNode infraNode = BuildInfraNode.build(currScope); - + String portalScope = pContext.getCurrentScope(currentSiteGroupId + ""); + String gatewayScope = String.valueOf(currentSiteGroupId); + + InfraNode infraNode = BuildInfraNode.build(portalScope); + LinkedList rootChildren = null; rootChildren = retrieveGatewayChildren(request, currentSiteGroupId, currUser); if (infraNode != null) { - ScopeDescriptor infraNodeScopeDescriptor = createRelativeInfraNode(infraNode, currScope); + ScopeDescriptor infraNodeScopeDescriptor = createRelativeInfraNode(infraNode, gatewayScope); if (rootChildren != null) { rootChildren.addFirst(infraNodeScopeDescriptor); } else {