From 9c7d0f94419a12cf4d523e08870bca02704238e6 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Mon, 27 Dec 2021 15:59:59 +0100 Subject: [PATCH] fixed bug that returne all gateways list not only where VRE is --- .../server/ServiceProxyImpl.java | 14 +++++- src/main/webapp/WEB-INF/xml/scopedata.xml | 50 ++++--------------- .../webapp/conf/resourcemanagement.properties | 2 +- 3 files changed, 23 insertions(+), 43 deletions(-) diff --git a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java b/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java index d72aeb2..b2005db 100644 --- a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java +++ b/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java @@ -553,8 +553,11 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro */ @Override public List getGatewayURLsGivenVREContext(String vreContext) { - + + String vreNameToLookfor = new ScopeBean(vreContext).name(); + List theGateways= getGateways(new LiferayGroupManager()); + List gatewayURLs = new ArrayList<>(); for (Gateway gateway : theGateways) { LayoutSet layoutSet = null; @@ -571,7 +574,14 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro e.printStackTrace(); } String theURL = "https://"+vHost+"/"; - gatewayURLs.add(theURL); + + ArrayList vres = gateway.getVres(); + for (String vreName : vres) { + if (vreNameToLookfor.compareTo(vreName) == 0) { + gatewayURLs.add(theURL); + break; + } + } } return gatewayURLs; } diff --git a/src/main/webapp/WEB-INF/xml/scopedata.xml b/src/main/webapp/WEB-INF/xml/scopedata.xml index 5f40ea6..25d8cd1 100644 --- a/src/main/webapp/WEB-INF/xml/scopedata.xml +++ b/src/main/webapp/WEB-INF/xml/scopedata.xml @@ -2,52 +2,22 @@ - d4science + gcube - d4science - ServiceMap_d4science.research-infrastructures.eu.xml - /d4science.research-infrastructures.eu + gcube + ServiceMap_gcube.xml + /gcube - d4science/D4OS - ServiceMap_D4OS.xml - /d4science.research-infrastructures.eu/D4OS + gcube/devsec + ServiceMap_devsec.xml + /gcube/devsec - d4science/D4Research - ServiceMap_D4Research.xml - /d4science.research-infrastructures.eu/D4Research - - - d4science/FARM - ServiceMap_FARM.xml - /d4science.research-infrastructures.eu/FARM - - - d4science/gCubeApps - ServiceMap_gCubeApps.xml - /d4science.research-infrastructures.eu/gCubeApps - - - d4science/OpenAIRE - ServiceMap_OpenAIRE.xml - /d4science.research-infrastructures.eu/OpenAIRE - - - d4science/ParthenosVO - ServiceMap_ParthenosVO.xml - /d4science.research-infrastructures.eu/ParthenosVO - - - d4science/SmartArea - ServiceMap_SmartArea.xml - /d4science.research-infrastructures.eu/SmartArea - - - d4science/SoBigData - ServiceMap_SoBigData.xml - /d4science.research-infrastructures.eu/SoBigData + gcube/devNext + ServiceMap_devNext.xml + /gcube/devNext diff --git a/src/main/webapp/conf/resourcemanagement.properties b/src/main/webapp/conf/resourcemanagement.properties index dd05aa9..1c60db9 100644 --- a/src/main/webapp/conf/resourcemanagement.properties +++ b/src/main/webapp/conf/resourcemanagement.properties @@ -11,7 +11,7 @@ RUNNING_MODE = STANDALONE DEFAULT_USER = massimiliano.assante # The scope that will be used as default -DEFAULT_SCOPE =/d4science.research-infrastructures.eu +DEFAULT_SCOPE =/gcube # the target of update notification (if in singleton mode) # mails MUST be separated by ; USERMAIL_TO = m.assante@gmail.com