diff --git a/enunciate.xml b/enunciate.xml index db71c4be2b8f8b49001cf2ad2fd77ed60b8cf8c0..53627989c31b982f5807f3a57b23e5903c740567 100644 --- a/enunciate.xml +++ b/enunciate.xml @@ -5,7 +5,7 @@ The VIPSLogic service API gives access to stored pest predictions and organisms </description> <copyright>NIBIO</copyright> - <contact>Tor-Einar Skog</contact> + <contact><a href="https://www.nibio.no/ansatte/tor-einar-skog" target="new">Tor-Einar Skog</a></contact> <application root="/"/> diff --git a/pom.xml b/pom.xml index bc623282a18e2fb8fb19c881278bb40481004a43..a36c5cd6fb0e794472a08a3dc3dd9aeb8c7342ae 100755 --- a/pom.xml +++ b/pom.xml @@ -1,376 +1,376 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>no.nibio.vips.</groupId> - <artifactId>VIPSLogic</artifactId> - <packaging>war</packaging> - <version>1.0-SNAPSHOT</version> -<properties> + <groupId>no.nibio.vips.</groupId> + <artifactId>VIPSLogic</artifactId> + <packaging>war</packaging> + <version>1.0-SNAPSHOT</version> + <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <geotools.version>13.4</geotools.version> </properties> - <name>VIPSLogic</name> - <url>http://maven.apache.org</url> + <name>VIPSLogic</name> + <url>http://maven.apache.org</url> -<repositories> - <repository> - <id>jitpack.io</id> - <url>https://jitpack.io</url> - </repository> - <repository> - <id>bedatadriven</id> - <name>bedatadriven public repo</name> - <url>https://nexus.bedatadriven.com/content/groups/public/</url> - </repository> - <repository> - <id>unidata-releases</id> - <name>Unidata Releases</name> - <url>https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/</url> - </repository> -</repositories> - <dependencies> - <dependency> - <groupId>edu.ucar</groupId> - <artifactId>cdm</artifactId> - <version>4.6.10</version> - </dependency> - <dependency> - <groupId>org.flywaydb</groupId> - <artifactId>flyway-core</artifactId> - <version>4.2.0</version> -</dependency> - <dependency> - <groupId>com.github.bjornharrtell</groupId> - <!--groupId>org.wololo</groupId--> - <artifactId>jts2geojson</artifactId> - <version>0.10.0</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-spatial</artifactId> - <version>5.0.10.Final</version> - <exclusions> - <exclusion> - <artifactId>postgresql</artifactId> - <groupId>postgresql</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.6.1</version> - <scope>provided</scope> - </dependency> + <repositories> + <repository> + <id>jitpack.io</id> + <url>https://jitpack.io</url> + </repository> + <repository> + <id>bedatadriven</id> + <name>bedatadriven public repo</name> + <url>https://nexus.bedatadriven.com/content/groups/public/</url> + </repository> + <repository> + <id>unidata-releases</id> + <name>Unidata Releases</name> + <url>https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>edu.ucar</groupId> + <artifactId>cdm</artifactId> + <version>4.6.10</version> + </dependency> + <dependency> + <groupId>org.flywaydb</groupId> + <artifactId>flyway-core</artifactId> + <version>4.2.0</version> + </dependency> + <dependency> + <groupId>com.github.bjornharrtell</groupId> + <!--groupId>org.wololo</groupId--> + <artifactId>jts2geojson</artifactId> + <version>0.10.0</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-spatial</artifactId> + <version>5.0.10.Final</version> + <exclusions> + <exclusion> + <artifactId>postgresql</artifactId> + <groupId>postgresql</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + <scope>provided</scope> + </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-jaxrs</artifactId> - <version>3.0.9.Final</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-client</artifactId> - <version>3.0.9.Final</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>no.nibio.vips.common</groupId> - <artifactId>VIPSCommon</artifactId> - <version>1.0-SNAPSHOT</version> - <type>jar</type> - <exclusions> - <exclusion> - <groupId>org.python</groupId> - <artifactId>jython-standalone</artifactId> - </exclusion> - <exclusion> - <groupId>org.renjin</groupId> - <artifactId>renjin-script-engine</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.reflections</groupId> - <artifactId>reflections</artifactId> - <version>0.9.9</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.5</version> - <type>jar</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.10</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.5</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>de.micromata.jak</groupId> - <artifactId>JavaAPIforKml</artifactId> - <version>2.2.0</version> - </dependency> - <!-- https://mvnrepository.com/artifact/net.postgis/postgis-jdbc --> -<dependency> - <groupId>net.postgis</groupId> - <artifactId>postgis-jdbc</artifactId> - <version>2.2.1</version> -</dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-jaxrs</artifactId> + <version>3.0.9.Final</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.jboss.resteasy</groupId> + <artifactId>resteasy-client</artifactId> + <version>3.0.9.Final</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>no.nibio.vips.common</groupId> + <artifactId>VIPSCommon</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <exclusions> + <exclusion> + <groupId>org.python</groupId> + <artifactId>jython-standalone</artifactId> + </exclusion> + <exclusion> + <groupId>org.renjin</groupId> + <artifactId>renjin-script-engine</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.reflections</groupId> + <artifactId>reflections</artifactId> + <version>0.9.9</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.5</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.10</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.5</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>de.micromata.jak</groupId> + <artifactId>JavaAPIforKml</artifactId> + <version>2.2.0</version> + </dependency> + <!-- https://mvnrepository.com/artifact/net.postgis/postgis-jdbc --> + <dependency> + <groupId>net.postgis</groupId> + <artifactId>postgis-jdbc</artifactId> + <version>2.2.1</version> + </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>2.7.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>2.7.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.7.4</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.14</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>org.passay</groupId> - <artifactId>passay</artifactId> - <version>1.1.0</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-core</artifactId> - <version>5.0.10.Final</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>9.4.1211</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-csv</artifactId> - <version>2.6.2</version> - <type>jar</type> - </dependency> - <dependency> - <groupId>javax</groupId> - <artifactId>javaee-web-api</artifactId> - <version>7.0</version> - <type>jar</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax</groupId> - <artifactId>javaee-api</artifactId> - <version>7.0</version> - <type>jar</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.freemarker</groupId> - <artifactId>freemarker</artifactId> - <version>2.3.24-incubating</version> - </dependency> - <dependency> - <groupId>it.sauronsoftware.cron4j</groupId> - <artifactId>cron4j</artifactId> - <version>2.2.5</version> -</dependency> -<!--dependency> - <groupId>org.openid4java</groupId> - <artifactId>openid4java</artifactId> - <version>0.9.8</version> -</dependency--> -<dependency> - <groupId>com.google.api-client</groupId> - <artifactId>google-api-client</artifactId> - <version>1.19.1</version> -</dependency> - <!--dependency> - <groupId>edu.vt.middleware</groupId> - <artifactId>vt-password</artifactId> - <version>3.1.2</version> - </dependency--> -<dependency> - <groupId>commons-fileupload</groupId> - <artifactId>commons-fileupload</artifactId> - <version>1.3.1</version> -</dependency> -<dependency> - <groupId>com.ibm.icu</groupId> - <artifactId>icu4j</artifactId> - <version>52.1</version> -</dependency> -<dependency> -<groupId>jaxen</groupId> -<artifactId>jaxen</artifactId> -<version>1.1.1</version> -</dependency> -<!--dependency> - <groupId>org.postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>9.4-1211</version> - <scope>provided</scope> -</dependency--> -<dependency> - <groupId>org.openjdk.jol</groupId> - <artifactId>jol-core</artifactId> - <version>0.9</version> -</dependency> -<dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>2.7.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>2.7.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.7.4</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.14</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.passay</groupId> + <artifactId>passay</artifactId> + <version>1.1.0</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-core</artifactId> + <version>5.0.10.Final</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>9.4.1211</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-csv</artifactId> + <version>2.6.2</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>7.0</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-api</artifactId> + <version>7.0</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.freemarker</groupId> + <artifactId>freemarker</artifactId> + <version>2.3.24-incubating</version> + </dependency> + <dependency> + <groupId>it.sauronsoftware.cron4j</groupId> + <artifactId>cron4j</artifactId> + <version>2.2.5</version> + </dependency> + <!--dependency> + <groupId>org.openid4java</groupId> + <artifactId>openid4java</artifactId> + <version>0.9.8</version> + </dependency--> + <dependency> + <groupId>com.google.api-client</groupId> + <artifactId>google-api-client</artifactId> + <version>1.19.1</version> + </dependency> + <!--dependency> + <groupId>edu.vt.middleware</groupId> + <artifactId>vt-password</artifactId> + <version>3.1.2</version> + </dependency--> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.3.1</version> + </dependency> + <dependency> + <groupId>com.ibm.icu</groupId> + <artifactId>icu4j</artifactId> + <version>52.1</version> + </dependency> + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.1.1</version> + </dependency> + <!--dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>9.4-1211</version> + <scope>provided</scope> + </dependency--> + <dependency> + <groupId>org.openjdk.jol</groupId> + <artifactId>jol-core</artifactId> + <version>0.9</version> + </dependency> + <dependency> <groupId>org.geotools</groupId> <artifactId>gt-api</artifactId> <version>17.2</version> </dependency> <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-epsg-hsql</artifactId> - <version>17.2</version> - </dependency> - <dependency> - <groupId>com.webcohesion.enunciate</groupId> - <artifactId>enunciate-core-annotations</artifactId> - <version>2.10.1</version> - </dependency> + <groupId>org.geotools</groupId> + <artifactId>gt-epsg-hsql</artifactId> + <version>17.2</version> + </dependency> + <dependency> + <groupId>com.webcohesion.enunciate</groupId> + <artifactId>enunciate-core-annotations</artifactId> + <version>2.10.1</version> + </dependency> - <dependency> - <groupId>com.webcohesion.enunciate</groupId> - <artifactId>enunciate-rt-util</artifactId> - <version>2.10.1</version> - </dependency> - <dependency> - <groupId>com.bedatadriven</groupId> - <artifactId>jackson-datatype-jts</artifactId> - <version>2.2</version> - </dependency> - </dependencies> + <dependency> + <groupId>com.webcohesion.enunciate</groupId> + <artifactId>enunciate-rt-util</artifactId> + <version>2.10.1</version> + </dependency> + <dependency> + <groupId>com.bedatadriven</groupId> + <artifactId>jackson-datatype-jts</artifactId> + <version>2.2</version> + </dependency> + </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.jvnet.jax-ws-commons</groupId> - <artifactId>jaxws-maven-plugin</artifactId> - <version>2.3</version> - <executions> - <execution> - <goals> - <goal>wsimport</goal> - </goals> - <configuration> - <wsdlFiles> - <wsdlFile>dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.wsdl</wsdlFile> - </wsdlFiles> - <packageName>no.nibio.vips.util.weather.dnmipointweb</packageName> - <vmArgs> - <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> - </vmArgs> - <wsdlLocation>https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl</wsdlLocation> - <staleFile>${project.build.directory}/jaxws/stale/DMIWeatherService.svc.stale</staleFile> - <keep>true</keep> - </configuration> - <id>wsimport-generate-DMIWeatherService.svc</id> - <phase>generate-sources</phase> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>javax.xml</groupId> - <artifactId>webservices-api</artifactId> - <version>2.0</version> - </dependency> - </dependencies> - <configuration> - <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir> - <xnocompile>true</xnocompile> - <verbose>true</verbose> - <extension>true</extension> - <catalog>${basedir}/src/jax-ws-catalog.xml</catalog> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>2.0.2</version> - <configuration> - <webResources> - <resource> - <directory>src</directory> - <targetPath>WEB-INF</targetPath> - <includes> - <include>jax-ws-catalog.xml</include> - <include>wsdl/**</include> - </includes> - </resource> - <resource> - <directory>src</directory> - <targetPath>WEB-INF/classes/META-INF</targetPath> - <includes> - <include>jax-ws-catalog.xml</include> - <include>wsdl/**</include> - </includes> - </resource> - </webResources> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.10</version> - <configuration> - <argLine>-Xmx6048m</argLine> - </configuration> - </plugin> - <plugin> - <groupId>com.webcohesion.enunciate</groupId> - <artifactId>enunciate-maven-plugin</artifactId> - <version>2.10.1</version> - <executions> - <execution> - <goals> - <!--goal>assemble</goal--> - <goal>docs</goal> - </goals> - <configuration> - <docsDir>${project.build.directory}/${project.build.finalName}/public/RESTdocs</docsDir> - </configuration> - </execution> - </executions> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + <plugin> + <groupId>org.jvnet.jax-ws-commons</groupId> + <artifactId>jaxws-maven-plugin</artifactId> + <version>2.3</version> + <executions> + <execution> + <goals> + <goal>wsimport</goal> + </goals> + <configuration> + <wsdlFiles> + <wsdlFile>dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.wsdl</wsdlFile> + </wsdlFiles> + <packageName>no.nibio.vips.util.weather.dnmipointweb</packageName> + <vmArgs> + <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> + </vmArgs> + <wsdlLocation>https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl</wsdlLocation> + <staleFile>${project.build.directory}/jaxws/stale/DMIWeatherService.svc.stale</staleFile> + <keep>true</keep> + </configuration> + <id>wsimport-generate-DMIWeatherService.svc</id> + <phase>generate-sources</phase> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>javax.xml</groupId> + <artifactId>webservices-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + <configuration> + <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir> + <xnocompile>true</xnocompile> + <verbose>true</verbose> + <extension>true</extension> + <catalog>${basedir}/src/jax-ws-catalog.xml</catalog> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <webResources> + <resource> + <directory>src</directory> + <targetPath>WEB-INF</targetPath> + <includes> + <include>jax-ws-catalog.xml</include> + <include>wsdl/**</include> + </includes> + </resource> + <resource> + <directory>src</directory> + <targetPath>WEB-INF/classes/META-INF</targetPath> + <includes> + <include>jax-ws-catalog.xml</include> + <include>wsdl/**</include> + </includes> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.10</version> + <configuration> + <argLine>-Xmx6048m</argLine> + </configuration> + </plugin> + <plugin> + <groupId>com.webcohesion.enunciate</groupId> + <artifactId>enunciate-maven-plugin</artifactId> + <version>2.10.1</version> + <executions> + <execution> + <goals> + <!--goal>assemble</goal--> + <goal>docs</goal> + </goals> + <configuration> + <docsDir>${project.build.directory}/${project.build.finalName}/public/RESTdocs</docsDir> + </configuration> + </execution> + </executions> - </plugin> - </plugins> - </build> + </plugin> + </plugins> + </build> </project> diff --git a/src/main/java/no/nibio/vips/logic/service/LogicService.java b/src/main/java/no/nibio/vips/logic/service/LogicService.java index 5e171c638249e5ec2e992a91839677efe1647224..8de4c36b950ec9b9ad16238cb21c3da4f9824595 100755 --- a/src/main/java/no/nibio/vips/logic/service/LogicService.java +++ b/src/main/java/no/nibio/vips/logic/service/LogicService.java @@ -86,9 +86,30 @@ public class LogicService { /** * Get all results for one pest prediction - * @param forecastConfigurationId + * @param forecastConfigurationId Database id of the configured forecast * @param userUUID if the forecast is private, the correct userUUID must be supplied. - * @return + * @return JSON with result data. A list of ForecastResult objects. Example: + * <pre> + * { + "forecastResultId": 5710137, + "validTimeStart": "2019-01-22T23:00:00.000+0000", + "validTimeEnd": null, + "warningStatus": 0, + "forecastConfigurationId": -1000, + "validGeometry": { // NORMALLY SET ONLY IF the result set contains results for multiple locations + "type": "Point", + "coordinates": [ + 10.333252, + 57.179002 + ] + }, + "keys": [ // A list of the existing parameter names in this result object + "GRIDZYMOSE.WHS" + ], + "allValues": { // Parameters with values. Everything is a String. Client must convert to numbers if necessary + "GRIDZYMOSE.WHS": "0" + } + }</pre> */ @GET @Path("forecastresults/{forecastConfigurationId}")