This commit is contained in:
Fabio Sinibaldi 2014-10-16 15:07:40 +00:00
parent 41cd3446f0
commit bc646e0607
2 changed files with 16 additions and 6 deletions

View File

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.spatial.data</groupId>
<artifactId>gis-interface</artifactId>
<version>2.0.5-SNAPSHOT</version>
<version>2.0.6-SNAPSHOT</version>
<name>gis-interface</name>
<properties>

View File

@ -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<XMLAdapter> toRegisterXMLAdapters=null;
private GISInterface() throws Exception{
}
public void setToRegisterXMLAdapters(List<XMLAdapter> 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;
}