From c881102f11cfb01f3252db82debd85d090e00415 Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Thu, 16 May 2013 14:52:19 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@75002 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../geo/meta/features/FeaturesManager.java | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/geo/meta/features/FeaturesManager.java b/src/main/java/org/gcube/dataanalysis/geo/meta/features/FeaturesManager.java index a963a5b..894636c 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/meta/features/FeaturesManager.java +++ b/src/main/java/org/gcube/dataanalysis/geo/meta/features/FeaturesManager.java @@ -18,8 +18,8 @@ import org.opengis.metadata.distribution.DigitalTransferOptions; import org.opengis.metadata.identification.Identification; public class FeaturesManager { -// private String geonetworkUrl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/"; - private String geonetworkUrl = "http://geoserver.d4science-ii.research-infrastructures.eu/geonetwork/"; + private String geonetworkUrl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/"; +// private String geonetworkUrl = "http://geoserver.d4science-ii.research-infrastructures.eu/geonetwork/"; private String geonetworkUser = "admin"; private String geonetworkPwd = "admin"; private String scope = "/gcube/devsec"; @@ -32,6 +32,40 @@ public class FeaturesManager { this.scope = scope; } + public String getGeoserverLink(Metadata meta) { + String link = null; + String geoserverString = "/geoserver/"; + String wmslink = getWMSLink(meta); + if (wmslink!=null){ + int idx = wmslink.indexOf(geoserverString); + if (idx>0){ + link = wmslink.substring(0,idx+geoserverString.length()-1); + return link; + } + } + String wfslink = getWFSLink(meta); + if (wfslink!=null){ + int idx = wfslink.indexOf(geoserverString); + if (idx>0){ + link = wfslink.substring(0,idx+geoserverString.length()-1); + return link; + } + } + String wcslink = getWCSLink(meta); + if (wcslink!=null){ + int idx = wcslink.indexOf(geoserverString); + if (idx>0){ + link = wcslink.substring(0,idx+geoserverString.length()-1); + return link; + } + } + + if (link == null) + System.out.println("NO GEOSERVER LINK WAS FOUND ACCORDING TO THE CRITERION"); + + return link; + } + private String searchInUrl(Metadata meta, String criterion) { String link = null; for (DigitalTransferOptions option : meta.getDistributionInfo().getTransferOptions()) {