From bc646e0607ece02ac7c325df6c516ab2de31d512 Mon Sep 17 00:00:00 2001 From: "fabio.sinibaldi" Date: Thu, 16 Oct 2014 15:07:40 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/spatial-data/gis-interface@100759 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 2 +- .../gcube/spatial/data/gis/GISInterface.java | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index df8d9de..9f795a1 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.spatial.data gis-interface - 2.0.5-SNAPSHOT + 2.0.6-SNAPSHOT gis-interface diff --git a/src/main/java/org/gcube/spatial/data/gis/GISInterface.java b/src/main/java/org/gcube/spatial/data/gis/GISInterface.java index 5d6dc40..2cd5791 100644 --- a/src/main/java/org/gcube/spatial/data/gis/GISInterface.java +++ b/src/main/java/org/gcube/spatial/data/gis/GISInterface.java @@ -14,6 +14,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Date; +import java.util.List; import java.util.NoSuchElementException; import java.util.SortedSet; import java.util.concurrent.ConcurrentSkipListSet; @@ -23,6 +24,7 @@ import org.gcube.spatial.data.geonetwork.GeoNetwork; import org.gcube.spatial.data.geonetwork.GeoNetworkPublisher; import org.gcube.spatial.data.geonetwork.GeoNetworkReader; import org.gcube.spatial.data.geonetwork.LoginLevel; +import org.gcube.spatial.data.geonetwork.configuration.XMLAdapter; import org.gcube.spatial.data.gis.is.GeoServerDescriptor; import org.gcube.spatial.data.gis.is.InfrastructureCrawler; import org.gcube.spatial.data.gis.meta.MetadataEnricher; @@ -47,17 +49,20 @@ public class GISInterface { } + + //************ INSTANCE - + private List toRegisterXMLAdapters=null; private GISInterface() throws Exception{ } - - - + public void setToRegisterXMLAdapters(List toRegisterXMLAdapters) { + this.toRegisterXMLAdapters = toRegisterXMLAdapters; + } + //*******************READER getter METHODS public GeoNetworkReader getGeoNetworkReader() throws Exception{ @@ -394,7 +399,12 @@ public class GISInterface { } private synchronized GeoNetworkPublisher getGN() throws Exception{ - if(geoNetwork==null) geoNetwork=GeoNetwork.get(); + if(geoNetwork==null) { + geoNetwork=GeoNetwork.get(); + if(toRegisterXMLAdapters!=null) + for(XMLAdapter adapter:toRegisterXMLAdapters) + geoNetwork.registerXMLAdapter(adapter); + } return geoNetwork; }