This commit is contained in:
Fabio Sinibaldi 2016-05-23 10:38:09 +00:00
parent 87d230f2e8
commit 707a3bf894
3 changed files with 34 additions and 5 deletions

View File

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.spatial.data</groupId>
<artifactId>gis-interface</artifactId>
<version>2.1.5-SNAPSHOT</version>
<version>2.2.0-SNAPSHOT</version>
<name>gis-interface</name>
<properties>
@ -28,7 +28,7 @@
<dependency>
<groupId>org.gcube.spatial.data</groupId>
<artifactId>geonetwork</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>it.geosolutions</groupId>

View File

@ -104,12 +104,42 @@ public class GISInterface {
return null;
}
public PublishResponse addGeoTIFF(String workspace, String storeName, String coverageName,
File toPublishFile,String srs,
ProjectionPolicy policy,String defaultStyle, double[] bbox,
Metadata geoNetworkMeta, String gnCategory,String gnStylesheet, LoginLevel level){
try{
GeoNetworkPublisher gn=getGN();
gn.login(level);
GNInsertConfiguration config=gn.getCurrentUserConfiguration(gnCategory, gnStylesheet);
return addGeoTIFF(workspace, storeName, coverageName, toPublishFile, srs, policy, defaultStyle, bbox, geoNetworkMeta, config, level);
}catch(Exception e){
PublishResponse response=new PublishResponse(geoNetworkMeta);
response.getMetaOperationMessages().add("Unable to get GN Configuration , cause :"+e.getMessage());
return response;
}
}
public PublishResponse publishDBTable(String workspace, String storeName, GSFeatureTypeEncoder fte,GSLayerEncoder layerEncoder,
Metadata geoNetworkMeta, String gnCategory,String gnStylesheet,LoginLevel level){
try{
GeoNetworkPublisher gn=getGN();
gn.login(level);
GNInsertConfiguration config=gn.getCurrentUserConfiguration(gnCategory, gnStylesheet);
return publishDBTable(workspace, storeName, fte, layerEncoder, geoNetworkMeta, config, level);
}catch(Exception e){
PublishResponse response=new PublishResponse(geoNetworkMeta);
response.getMetaOperationMessages().add("Unable to get GN Configuration , cause :"+e.getMessage());
return response;
}
}
/**
* @see it.geosolutions.geoserver.rest.GeoServerRESTPublisher#publishGeoTIFF(String, String, String, File, String, ProjectionPolicy, String, double[])
*
*/
@Deprecated
public PublishResponse addGeoTIFF(String workspace, String storeName, String coverageName,
File toPublishFile,String srs,
ProjectionPolicy policy,String defaultStyle, double[] bbox,
@ -179,7 +209,7 @@ public class GISInterface {
return toReturn;
}
@Deprecated
public PublishResponse publishDBTable(String workspace, String storeName, GSFeatureTypeEncoder fte,GSLayerEncoder layerEncoder,Metadata geoNetworkMeta, GNInsertConfiguration config,LoginLevel level){
boolean publishResult = false;
PublishResponse toReturn=new PublishResponse(geoNetworkMeta);

View File

@ -59,9 +59,8 @@ public class PublishTable {
GISInterface gis=GISInterface.get();
Configuration gnConfig=gis.getGeoNetworkReader().getConfiguration();
PublishResponse resp=gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), new GNInsertConfiguration(gnConfig.getScopeGroup()+"", "datasets", "_none_", true), LoginLevel.DEFAULT);
PublishResponse resp=gis.publishDBTable(workspace, datastore, fte, le, meta.getMetadata(), "datasets", "_none_", LoginLevel.DEFAULT);
System.out.println(resp);
}