This commit is contained in:
Fabio Sinibaldi 2019-10-25 12:42:56 +00:00
parent 98e6ec1fdc
commit 68318fc9de
7 changed files with 112 additions and 95 deletions

12
pom.xml
View File

@ -4,11 +4,11 @@
<parent> <parent>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<version>1.0.0</version> <version>1.1.0</version>
</parent> </parent>
<groupId>org.gcube.spatial.data</groupId> <groupId>org.gcube.spatial.data</groupId>
<artifactId>gis-interface</artifactId> <artifactId>gis-interface</artifactId>
<version>2.4.1-SNAPSHOT</version> <version>2.4.2-SNAPSHOT</version>
<name>gis-interface</name> <name>gis-interface</name>
<properties> <properties>
@ -126,10 +126,10 @@
<id>GeoSolutions</id> <id>GeoSolutions</id>
<url>http://maven.research-infrastructures.eu:8081/nexus/content/repositories/geo-solutions/</url> <url>http://maven.research-infrastructures.eu:8081/nexus/content/repositories/geo-solutions/</url>
</repository> </repository>
<!-- <repository> --> <repository>
<!-- <id>GeoSolutions-SNAP</id> --> <id>GeoSolutions-SNAP</id>
<!-- <url>http://maven.research-infrastructures.eu/nexus/content/repositories/geo-solutions-snapshots/</url> --> <url>http://maven.research-infrastructures.eu/nexus/content/repositories/geo-solutions-snapshots/</url>
<!-- </repository> --> </repository>
<repository> <repository>
<id>maven.geotoolkit</id> <id>maven.geotoolkit</id>
<name>maven.geotoolkit</name> <name>maven.geotoolkit</name>

View File

@ -17,7 +17,7 @@ import org.gcube.spatial.data.geonetwork.GeoNetworkPublisher;
import org.gcube.spatial.data.geonetwork.GeoNetworkReader; import org.gcube.spatial.data.geonetwork.GeoNetworkReader;
import org.gcube.spatial.data.geonetwork.LoginLevel; import org.gcube.spatial.data.geonetwork.LoginLevel;
import org.gcube.spatial.data.geonetwork.configuration.XMLAdapter; import org.gcube.spatial.data.geonetwork.configuration.XMLAdapter;
import org.gcube.spatial.data.geonetwork.iso.BoundingBox; import org.gcube.spatial.data.geonetwork.iso.tpl.extent.BoundingBox;
import org.gcube.spatial.data.geonetwork.utils.ScopeUtils; import org.gcube.spatial.data.geonetwork.utils.ScopeUtils;
import org.gcube.spatial.data.gis.is.AbstractGeoServerDescriptor; import org.gcube.spatial.data.gis.is.AbstractGeoServerDescriptor;
import org.gcube.spatial.data.gis.is.GeoServerDescriptor; import org.gcube.spatial.data.gis.is.GeoServerDescriptor;

View File

@ -2,9 +2,9 @@ package org.gcube.spatial.data.gis;
import org.gcube.portlets.user.uriresolvermanager.exception.IllegalArgumentException; import org.gcube.portlets.user.uriresolvermanager.exception.IllegalArgumentException;
import org.gcube.portlets.user.uriresolvermanager.exception.UriResolverMapException; import org.gcube.portlets.user.uriresolvermanager.exception.UriResolverMapException;
import org.gcube.spatial.data.geonetwork.iso.BoundingBox;
import org.gcube.spatial.data.geonetwork.iso.ISOMetadataFactory; import org.gcube.spatial.data.geonetwork.iso.ISOMetadataFactory;
import org.gcube.spatial.data.geonetwork.iso.Protocol; import org.gcube.spatial.data.geonetwork.iso.Protocol;
import org.gcube.spatial.data.geonetwork.iso.tpl.extent.BoundingBox;
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder; import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;

View File

@ -63,80 +63,80 @@ public class Environment {
//*************************** PRODUCTION //*************************** PRODUCTION
scopes.add("/d4science.research-infrastructures.eu"); // scopes.add("/d4science.research-infrastructures.eu");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/InfraScience"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/InfraScience");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICES_TCRE"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICES_TCRE");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TabularDataLab"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TabularDataLab");
scopes.add("/d4science.research-infrastructures.eu/FARM/AquaMaps"); // scopes.add("/d4science.research-infrastructures.eu/FARM/AquaMaps");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/PGFA-UFMT"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/PGFA-UFMT");
scopes.add("/d4science.research-infrastructures.eu/FARM"); // scopes.add("/d4science.research-infrastructures.eu/FARM");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EuBrazilOpenBio"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EuBrazilOpenBio");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EcologicalModelling"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EcologicalModelling");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBRIDGE-PSC"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBRIDGE-PSC");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ENVRIPlus"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ENVRIPlus");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ENVRI"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ENVRI");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BOBLME_HilsaAWG"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BOBLME_HilsaAWG");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ScalableDataMining"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ScalableDataMining");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/DESCRAMBLE"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/DESCRAMBLE");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/FAO_TunaAtlas"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/FAO_TunaAtlas");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StocksAndFisheriesKB"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StocksAndFisheriesKB");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueCommons"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueCommons");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICES_TCSSM"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICES_TCSSM");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBRIDGE-EAB"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBRIDGE-EAB");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ARIADNE"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ARIADNE");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ProtectedAreaImpactMaps"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ProtectedAreaImpactMaps");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/OpenIt"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/OpenIt");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/AquacultureAtlasGeneration"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/AquacultureAtlasGeneration");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/Parthenos"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/Parthenos");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/IGDI"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/IGDI");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EGIEngage"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EGIEngage");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/RStudioLab"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/RStudioLab");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TimeSeries"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TimeSeries");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TCom"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/TCom");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICCAT_BFT-E"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICCAT_BFT-E");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/SoBigData.it"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/SoBigData.it");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBridgeProject"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueBridgeProject");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueUptake"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BlueUptake");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/gCube"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/gCube");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/KnowledgeBridging"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/KnowledgeBridging");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EFG"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/EFG");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StockAssessment"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StockAssessment");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/iSearch"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/iSearch");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICOS_ETC"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/ICOS_ETC");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/VesselActivitiesAnalyzer"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/VesselActivitiesAnalyzer");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BiOnym"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/BiOnym");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/SoBigData.eu"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/SoBigData.eu");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/PerformanceEvaluationInAquaculture"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/PerformanceEvaluationInAquaculture");
scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StrategicInvestmentAnalysis"); // scopes.add("/d4science.research-infrastructures.eu/gCubeApps/StrategicInvestmentAnalysis");
//******************** DEVELOPMENT //******************** DEVELOPMENT
scopes.add("/gcube"); // scopes.add("/gcube");
scopes.add("/gcube/devsec"); // scopes.add("/gcube/devsec");
scopes.add("/gcube/devsec/BasicVRETest"); // scopes.add("/gcube/devsec/BasicVRETest");
scopes.add("/gcube/devsec/GSTProcessingTest"); // scopes.add("/gcube/devsec/GSTProcessingTest");
scopes.add("/gcube/devsec/StaTabTest"); // scopes.add("/gcube/devsec/StaTabTest");
scopes.add("/gcube/devsec/USTORE_VRE"); // scopes.add("/gcube/devsec/USTORE_VRE");
scopes.add("/gcube/devsec/TestTue10May_1822"); // scopes.add("/gcube/devsec/TestTue10May_1822");
scopes.add("/gcube/devsec/OpenAireDevVRE"); // scopes.add("/gcube/devsec/OpenAireDevVRE");
scopes.add("/gcube/devsec/StaTabTest"); // scopes.add("/gcube/devsec/StaTabTest");
scopes.add("/gcube/devsec/TabProcessing"); // scopes.add("/gcube/devsec/TabProcessing");
scopes.add("/gcube/devsec/devVRE"); // scopes.add("/gcube/devsec/devVRE");
scopes.add("/gcube/devsec/TestFri26Feb2016"); // scopes.add("/gcube/devsec/TestFri26Feb2016");
scopes.add("/gcube/devsec/USTORE_VRE"); // scopes.add("/gcube/devsec/USTORE_VRE");
scopes.add("/gcube/devsec/RMinerDev"); // scopes.add("/gcube/devsec/RMinerDev");
scopes.add("/gcube/devsec/TabProcessing"); // scopes.add("/gcube/devsec/TabProcessing");
scopes.add("/gcube/devsec/devVRE"); // scopes.add("/gcube/devsec/devVRE");
scopes.add("/gcube/devsec/BlueVRE"); // scopes.add("/gcube/devsec/BlueVRE");
scopes.add("/gcube/devsec/TestFri26Feb2016"); // scopes.add("/gcube/devsec/TestFri26Feb2016");
scopes.add("/gcube/devsec/LucioVRE"); // scopes.add("/gcube/devsec/LucioVRE");
//
scopes.add("/gcube/preprod"); // scopes.add("/gcube/preprod");
scopes.add("/gcube/preprod/Dorne"); // scopes.add("/gcube/preprod/Dorne");
scopes.add("/gcube/preprod/preVRE"); // scopes.add("/gcube/preprod/preVRE");
scopes.add("/gcube/devNext"); scopes.add("/gcube/devNext");
scopes.add("/gcube/devNext/NextNext"); scopes.add("/gcube/devNext/NextNext");

View File

@ -30,13 +30,13 @@ public class PublishTable {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String scope="/gcube/devsec/devVRE"; String scope="/gcube/preprod/preVRE";
String toPublishTable="shp_bf4c1d947fd4469ab6d9077bb21216cc"; String toPublishTable="database_archeo";
String datastore="shp_bf4c1d947fd4469ab6d9077bb21216cc"; String datastore="archeo";
String defaultStyle="defaultStyle"; String defaultStyle="defaultStyle";
String workspace="aquamaps"; String workspace="ariadne";
@ -69,19 +69,19 @@ public class PublishTable {
meta.setExtent((DefaultExtent) DefaultExtent.WORLD); meta.setExtent((DefaultExtent) DefaultExtent.WORLD);
meta.setGeometricObjectType(GeometricObjectType.SURFACE); meta.setGeometricObjectType(GeometricObjectType.SURFACE);
meta.setPresentationForm(PresentationForm.MAP_DIGITAL); meta.setPresentationForm(PresentationForm.MAP_DIGITAL);
meta.setPurpose("Purpose of this layer is to test the library"); meta.setPurpose("Purpose of this layer is to test Ariadne");
meta.setResolution(0.5d); meta.setResolution(0.5d);
meta.setTitle("My Test Layer"); meta.setTitle("ARIADNE Archeo");
meta.setTopologyLevel(TopologyLevel.GEOMETRY_ONLY); meta.setTopologyLevel(TopologyLevel.GEOMETRY_ONLY);
meta.setUser("fabio.sinibaldi"); meta.setUser("fabio.sinibaldi");
meta.addCredits("Thanks to me"); meta.addCredits("generics");
meta.addGraphicOverview("http://www.d4science.org/D4ScienceOrg-Social-theme/images/custom/D4ScienceInfrastructure.png"); meta.addGraphicOverview("http://www.d4science.org/D4ScienceOrg-Social-theme/images/custom/D4ScienceInfrastructure.png");
Thesaurus generalThesaurus=meta.getConfig().getThesauri().get("General"); Thesaurus generalThesaurus=meta.getConfig().getThesauri().get("General");
meta.addKeyword("TEST", generalThesaurus); meta.addKeyword("ARIADNE", generalThesaurus);
meta.addKeyword("Geoserverinterface", generalThesaurus); meta.addKeyword("ARCHEO", generalThesaurus);
meta.addTopicCategory(TopicCategory.BIOTA); meta.addTopicCategory(TopicCategory.BIOTA);
return meta; return meta;

View File

@ -6,6 +6,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.gcube.spatial.data.gis.symbology.ClassStyleDef; import org.gcube.spatial.data.gis.symbology.ClassStyleDef;
@ -20,13 +21,29 @@ public class StyleTest {
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
TokenSetter.set("/gcube/devsec"); TokenSetter.set("/gcube/preprod/preVRE");
String name="TDM_Style_"+System.currentTimeMillis(); String name="ariadne_localita_"+System.currentTimeMillis();
String attribute="fbokpc"; String attribute="localita";
Color c1=Color.RED; Color c1=Color.RED;
Color c2=Color.YELLOW; Color c2=Color.BLUE;
List<ClassStyleDef> classes=loadFromCSV("/home/fabio/distinct.sql"); // List<ClassStyleDef> classes=loadFromCSV("/home/fabio/distinct.sql");
String sld=StyleUtils.createStyle(name, attribute, (ArrayList<ClassStyleDef>) classes, c1, c2);
ClassStyleDef[] classArray=new ClassStyleDef[] {
new ClassStyleDef("Borgo Grappa"),
new ClassStyleDef("Borgo Sabotino"),
new ClassStyleDef("BorgoSabotino"),
new ClassStyleDef("Capoportiere"),
new ClassStyleDef("Cerreto Alto"),
new ClassStyleDef("Colle Parito"),
new ClassStyleDef("Foce Vecchia"),
new ClassStyleDef("Foceverd"),
new ClassStyleDef("Foceverde"),
new ClassStyleDef("Fogliano"),
new ClassStyleDef("La Fossella")
};
String sld=StyleUtils.createStyle(name, attribute, new ArrayList<ClassStyleDef>(Arrays.asList(classArray)), c1, c2);
GISInterface gis= GISInterface.get(); GISInterface gis= GISInterface.get();
System.out.println(gis.publishStyle(sld, name)); System.out.println(gis.publishStyle(sld, name));
System.out.println("Published "+name+" on "+gis.getCurrentGeoServerDescriptor()); System.out.println("Published "+name+" on "+gis.getCurrentGeoServerDescriptor());

View File

@ -1,4 +1,4 @@
#log4j.rootLogger=DEBUG, stdout log4j.rootLogger=DEBUG, stdout
#CONSOLE #CONSOLE
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender