git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/spatial-data/gis-interface@128775 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
87d230f2e8
commit
707a3bf894
4
pom.xml
4
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>gis-interface</artifactId>
|
<artifactId>gis-interface</artifactId>
|
||||||
<version>2.1.5-SNAPSHOT</version>
|
<version>2.2.0-SNAPSHOT</version>
|
||||||
<name>gis-interface</name>
|
<name>gis-interface</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>geonetwork</artifactId>
|
<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>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.geosolutions</groupId>
|
<groupId>it.geosolutions</groupId>
|
||||||
|
|
|
@ -104,12 +104,42 @@ public class GISInterface {
|
||||||
return null;
|
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[])
|
* @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,
|
public PublishResponse addGeoTIFF(String workspace, String storeName, String coverageName,
|
||||||
File toPublishFile,String srs,
|
File toPublishFile,String srs,
|
||||||
ProjectionPolicy policy,String defaultStyle, double[] bbox,
|
ProjectionPolicy policy,String defaultStyle, double[] bbox,
|
||||||
|
@ -179,7 +209,7 @@ public class GISInterface {
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public PublishResponse publishDBTable(String workspace, String storeName, GSFeatureTypeEncoder fte,GSLayerEncoder layerEncoder,Metadata geoNetworkMeta, GNInsertConfiguration config,LoginLevel level){
|
public PublishResponse publishDBTable(String workspace, String storeName, GSFeatureTypeEncoder fte,GSLayerEncoder layerEncoder,Metadata geoNetworkMeta, GNInsertConfiguration config,LoginLevel level){
|
||||||
boolean publishResult = false;
|
boolean publishResult = false;
|
||||||
PublishResponse toReturn=new PublishResponse(geoNetworkMeta);
|
PublishResponse toReturn=new PublishResponse(geoNetworkMeta);
|
||||||
|
|
|
@ -59,9 +59,8 @@ public class PublishTable {
|
||||||
|
|
||||||
|
|
||||||
GISInterface gis=GISInterface.get();
|
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);
|
System.out.println(resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue