...
 
Commits (286)
......@@ -2,6 +2,19 @@ variables:
GENESYS_VERSION: "2.3"
DOCKER_HOST: genesys1.swarm.genesys-pgr.org
DOCKER_VERSION: latest
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
stages:
# - compile
......@@ -19,12 +32,12 @@ stages:
# script:
# - echo "CI_COMMIT_REF_SLUG ${CI_COMMIT_REF_SLUG}"
# - echo "CI_ENVIRONMENT_SLUG ${CI_ENVIRONMENT_SLUG}"
# - MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn compile test -B -U
# - mvn compile test -B -U
.package_template: &maven_package
image: dockerhub.croptrust.org/docker/custom/maven-with-compass:latest
script:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn package -B -U
- mvn package -B -U
artifacts:
name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 day
......
......@@ -78,24 +78,6 @@ module.exports = function(grunt) {
cwd : 'node_modules/notosans-fontface/fonts/',
src : '*',
dest : '<%= app.dist1 %>/styles/fonts'
}, {
// tinyMCE
expand : true,
cwd : 'node_modules/tinymce/skins',
src : [ '**' ],
dest : '<%= app.dist1 %>/js/skins'
}, {
// leaflet
expand : true,
cwd : 'node_modules/leaflet/dist/',
src : [ 'leaflet.css', 'images/*.png' ],
dest : '<%= app.dist1 %>/styles'
}, {
// simplecolorpicker
expand : true,
cwd : 'node_modules/jquery-simplecolorpicker/',
src : [ 'jquery.simplecolorpicker.css', 'jquery.simplecolorpicker-regularfont.css' ],
dest : '<%= app.dist1 %>/styles'
}, {
expand : true,
cwd : 'node_modules/jquery-ui-dist/',
......@@ -103,13 +85,6 @@ module.exports = function(grunt) {
dest : '<%= app.dist1 %>/styles'
} ]
}
// styles : {
// expand : true,
// cwd : '<%= app.source %>/styles',
// dest : '.tmp/styles/',
// src : '{,*/}*.css'
// }
},
// Make sure code styles are up to par and there are no obvious mistakes
......@@ -133,21 +108,8 @@ module.exports = function(grunt) {
dist1 : {
src : [
'node_modules/jquery/dist/jquery.js',
'node_modules/jquery-flot/jquery.flot.js',
'node_modules/jquery-flot/jquery.flot.pie.js',
'node_modules/jquery-flot/jquery.flot.fillbetween.js',
'node_modules/jquery-simplecolorpicker/jquery.simplecolorpicker.js',
'node_modules/tinymce/tinymce.js',
'node_modules/tinymce/tinymce.jquery.js',
'node_modules/tinymce/themes/modern/theme.js',
'node_modules/tinymce/plugins/link/plugin.js',
'node_modules/tinymce/plugins/autolink/plugin.js',
'node_modules/tinymce/plugins/code/plugin.js',
'node_modules/leaflet/dist/leaflet.js',
'node_modules/leaflet.locationfilter/src/locationfilter.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap.js',
'node_modules/jquery-ui-dist/jquery-ui.js',
'node_modules/jstree/dist/jstree.js',
'node_modules/modernizr/bin/modernizr.js',
'node_modules/form-serializer/jquery.serialize-object.js'
],
......@@ -157,18 +119,9 @@ module.exports = function(grunt) {
src : [
'<%= app.source1 %>/js/prologue.js',
'<%= app.source1 %>/js/crophub.js',
'<%= app.source1 %>/js/browse.js',
'<%= app.source1 %>/js/epilogue.js'
],
dest : '<%= app.dist1 %>/js/genesys.js'
},
world1 : {
src : [
'node_modules/highmaps-release/highmaps.src.js',
'node_modules/highcharts/lib/modules/data.src.js',
'<%= app.source1 %>/js/world.js'
],
dest : '<%= app.dist1 %>/js/genesyshighcharts.js'
}
},
......@@ -196,18 +149,12 @@ module.exports = function(grunt) {
'<%= app.dist1 %>/styles/other.min.css' : [
'<%= app.dist1 %>/styles/jquery-ui.css',
'<%= app.dist1 %>/styles/forza.css',
'<%= app.dist1 %>/styles/leaflet.css',
'<%= app.dist1 %>/styles/jquery.simplecolorpicker.css',
'<%= app.dist1 %>/styles/jquery.simplecolorpicker-regularfont.css'
],
'<%= app.dist1 %>/styles/genesys.min.css' : [ '<%= app.dist1 %>/styles/genesys.css' ],
'<%= app.dist1 %>/styles/all.min.css' : [
'<%= app.dist1 %>/styles/bootstrap.css',
'<%= app.dist1 %>/styles/jquery-ui.css',
'<%= app.dist1 %>/styles/forza.css',
'<%= app.dist1 %>/styles/leaflet.css',
'<%= app.dist1 %>/styles/jquery.simplecolorpicker.css',
'<%= app.dist1 %>/styles/jquery.simplecolorpicker-regularfont.css',
'<%= app.dist1 %>/styles/genesys.css'
]
}
......@@ -251,7 +198,7 @@ module.exports = function(grunt) {
},
js1 : {
files : [ 'src/main/sourceapp/1/{,*/}*.js' ],
tasks : [ 'newer:jshint:dist1', 'concat:world1', 'concat:app1' ],
tasks : [ 'newer:jshint:dist1', 'concat:app1' ],
options : {
livereload : true
}
......@@ -265,7 +212,6 @@ module.exports = function(grunt) {
{ src : [ '<%= app.dist1 %>/js/libraries.min.js'], dest : '<%= app.dist1 %>/js/libraries.min.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/libraries.js'], dest : '<%= app.dist1 %>/js/libraries.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/genesys.js'], dest : '<%= app.dist1 %>/js/genesys.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/genesyshighcharts.min.js'], dest : '<%= app.dist1 %>/js/genesyshighcharts.min.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/styles/bootstrap.css'], dest : '<%= app.dist1 %>/styles/bootstrap.' + buildNumber + '.css' },
{ src : [ '<%= app.dist1 %>/styles/bootstrap.min.css'], dest : '<%= app.dist1 %>/styles/bootstrap.min.' + buildNumber + '.css' },
......@@ -283,7 +229,7 @@ module.exports = function(grunt) {
// grunt.loadNpmTasks('grunt-contrib-watch');
// grunt.loadNpmTasks('grunt-newer');
grunt.registerTask('build1', [ 'newer:jshint:dist1', 'compass:dist1', 'copy:dist1', 'concat:dist1', 'concat:world1', 'concat:app1', 'autoprefixer:dist1', 'uglify:dist1', 'cssmin:dist1' ]);
grunt.registerTask('build1', [ 'newer:jshint:dist1', 'compass:dist1', 'copy:dist1', 'concat:dist1', 'concat:app1', 'autoprefixer:dist1', 'uglify:dist1', 'cssmin:dist1' ]);
// grunt.registerTask('js', [ 'jshint:all', 'copy:dist', 'concat',
// 'autoprefixer', 'uglify:dist' ]);
// grunt.registerTask('css', [ 'compass:dist', 'copy:dist', 'concat',
......
#
# Build Genesys server on top of jetty-alpine
#
FROM jetty:9.4.12
FROM jetty:9-jre8
LABEL maintainer "Matija Obreza <matija.obreza@croptrust.org>"
......
<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>
<parent>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-base</artifactId>
<version>2.9.8</version>
</parent>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate-parent</artifactId>
<name>Hibernate module parent</name>
<version>2.9.9-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Parent pom for shared settings for project sub-modules
</description>
<modules>
<module>hibernate3</module>
<module>hibernate4</module>
<module>hibernate5</module>
<!--
<module>hibernate5_2-test</module>
-->
</modules>
<url>https://github.com/FasterXML/jackson-datatype-hibernate</url>
<scm>
<connection>scm:git:git@github.com:FasterXML/jackson-datatype-hibernate.git</connection>
<developerConnection>scm:git:git@github.com:FasterXML/jackson-datatype-hibernate.git</developerConnection>
<url>http://github.com/FasterXML/jackson-datatype-hibernate</url>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- But there are also some well-known test dependencies we may as well add directly -->
<!-- and for testing, JUnit is needed, as well as annotations -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Alas, need to include snapshot reference since otherwise can not find
snapshot of parent... -->
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- Inherited from oss-base. Generate PackageVersion.java.-->
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>process-packageVersion</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>com/fasterxml/jackson/**/failing/*.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<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>
<parent>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate-parent</artifactId>
<version>2.9.9-SNAPSHOT</version>
</parent>
<artifactId>jackson-datatype-hibernate4</artifactId>
<name>Jackson-datatype-Hibernate4</name>
<packaging>bundle</packaging>
<description>Add-on module for Jackson (http://jackson.codehaus.org) to support
Hibernate (http://hibernate.org) version 4.x data types.
</description>
<url>https://github.com/FasterXML/jackson-datatype-hibernate</url>
<properties>
<!-- Generate PackageVersion.java into this directory. -->
<packageVersion.dir>com/fasterxml/jackson/datatype/hibernate4</packageVersion.dir>
<packageVersion.package>${project.groupId}.hibernate4</packageVersion.package>
<!-- Hibernate with JPA 2.0 -->
<hibernate.version>4.1.0.Final</hibernate.version>
<surefire.version>2.12</surefire.version>
<osgi.export>${project.groupId}.hibernate4</osgi.export>
</properties>
<dependencies>
<!-- what would be the best scope to use here? -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.155</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Inherited from oss-base. Generate PackageVersion.java.-->
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>process-packageVersion</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -1384,16 +1384,6 @@
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"highcharts": {
"version": "4.1.10",
"resolved": "https://registry.npmjs.org/highcharts/-/highcharts-4.1.10.tgz",
"integrity": "sha1-6TgCiIp76RHRI+2VO+CqqTl/0ew="
},
"highmaps-release": {
"version": "1.1.10",
"resolved": "https://registry.npmjs.org/highmaps-release/-/highmaps-release-1.1.10.tgz",
"integrity": "sha1-6oDB29dOe0Z292LNVfAfl1LHwf8="
},
"hooker": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
......@@ -1566,16 +1556,6 @@
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.1.4.tgz",
"integrity": "sha1-IoveaYoMYUMdwmMKahVPFYkNIxc="
},
"jquery-flot": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/jquery-flot/-/jquery-flot-0.8.3.tgz",
"integrity": "sha1-onOs9D8TGQ9ueHAYae4kv+8Swio="
},
"jquery-simplecolorpicker": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/jquery-simplecolorpicker/-/jquery-simplecolorpicker-0.3.1.tgz",
"integrity": "sha1-T2vv04CrBUcPWF1UguUYBVbkYOs="
},
"jquery-ui-dist": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
......@@ -1654,16 +1634,6 @@
"invert-kv": "^1.0.0"
}
},
"leaflet": {
"version": "0.7.7",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-0.7.7.tgz",
"integrity": "sha1-HjUrpU5j0HZFH6NjyQCJDLLPde4="
},
"leaflet.locationfilter": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/leaflet.locationfilter/-/leaflet.locationfilter-0.1.0.tgz",
"integrity": "sha1-nqiQKVNkJhwKUvMcj34satVHOP4="
},
"livereload-js": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.3.0.tgz",
......@@ -2618,11 +2588,6 @@
}
}
},
"tinymce": {
"version": "4.1.10",
"resolved": "https://registry.npmjs.org/tinymce/-/tinymce-4.1.10.tgz",
"integrity": "sha1-XozIu2+9/+igw4eQb/RB96t49aA="
},
"tmp": {
"version": "0.0.28",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.28.tgz",
......
......@@ -59,45 +59,43 @@
<junit.version>4.12</junit.version>
<application.blocks.version>1.6-SNAPSHOT</application.blocks.version>
<commons.beanutils.version>1.9.2</commons.beanutils.version>
<commons.collections.version>3.2.1</commons.collections.version>
<commons.io.version>2.4</commons.io.version>
<commons.lang.version>3.7</commons.lang.version>
<commons.beanutils.version>1.9.4</commons.beanutils.version>
<commons.io.version>2.6</commons.io.version>
<commons.lang.version>3.9</commons.lang.version>
<commons.logging.version>1.2</commons.logging.version>
<commons.validator.version>1.4.0</commons.validator.version>
<commons.validator.version>1.6</commons.validator.version>
<jstl.version>1.2</jstl.version>
<servlet-api.version>2.5</servlet-api.version>
<jsp-api.version>2.1</jsp-api.version>
<servlet-api.version>4.0.1</servlet-api.version>
<jsp-api.version>2.3.3</jsp-api.version>
<spring.framework.version>4.3.18.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.11.13.RELEASE</spring-data-jpa.version>
<spring.security.version>4.1.5.RELEASE</spring.security.version>
<spring.security.oauth2.version>2.3.3.RELEASE</spring.security.oauth2.version>
<spring-security-jwt>1.0.8.RELEASE</spring-security-jwt>
<org.springframework.social-version>1.1.4.RELEASE</org.springframework.social-version>
<querydsl.version>4.1.4</querydsl.version>
<spring.framework.version>4.3.25.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.11.23.RELEASE</spring-data-jpa.version>
<spring.security.version>4.2.13.RELEASE</spring.security.version>
<spring.security.oauth2.version>2.3.4.RELEASE</spring.security.oauth2.version>
<spring-security-jwt>1.0.10.RELEASE</spring-security-jwt>
<org.springframework.social-version>1.1.6.RELEASE</org.springframework.social-version>
<querydsl.version>4.2.1</querydsl.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<hibernate.validator.version>5.2.5.Final</hibernate.validator.version>
<hsqldb.version>2.3.6</hsqldb.version>
<ehcache.version>2.7.4</ehcache.version>
<hsqldb.version>2.5.0</hsqldb.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.28</slf4j.version>
<aspectj.version>1.8.9</aspectj.version>
<aspectj.version>1.9.4</aspectj.version>
<mysql.version>5.1.46</mysql.version>
<hazelcast.version>3.8.1</hazelcast.version>
<mysql.version>5.1.48</mysql.version>
<hazelcast.version>3.8.3</hazelcast.version>
<oval.version>1.81</oval.version>
<jackson.version>2.9.8</jackson.version>
<jaxb-api.version>2.2.12</jaxb-api.version>
<oval.version>1.90</oval.version>
<jackson.version>2.9.9</jackson.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<liquibase.version>3.6</liquibase.version>
<swagger.version>2.9.2</swagger.version>
<!--Container -->
<jetty.version>9.4.12.v20180830</jetty.version>
<jetty.version>9.4.20.v20190813</jetty.version>
<maven.test.skip>false</maven.test.skip>
......@@ -127,7 +125,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.5</version>
<version>1.8</version>
</dependency>
<dependency>
......@@ -171,7 +169,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
<version>1.13</version>
</dependency>
<dependency>
......@@ -203,13 +201,13 @@
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.2-b01</version>
<version>${jsp-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
......@@ -233,12 +231,17 @@
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jsonSchema</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<version>2.9.9-SNAPSHOT</version>
<version>2.10.0.pr3</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
......@@ -310,7 +313,7 @@
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>2.2.0</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
......@@ -396,7 +399,7 @@
<dependency>
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
<artifactId>owasp-java-html-sanitizer</artifactId>
<version>r223</version>
<version>r239</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
......@@ -406,12 +409,12 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.4</version>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.2</version>
<version>4.4</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
......@@ -444,7 +447,7 @@
<dependency>
<groupId>org.jamel.dbf</groupId>
<artifactId>dbf-reader</artifactId>
<version>0.2.0</version>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
......@@ -462,7 +465,7 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>2.1.16.RELEASE</version>
<version>2.1.23.RELEASE</version>
</dependency>
<dependency>
......@@ -484,12 +487,12 @@
<dependency>
<groupId>org.ocpsoft.prettytime</groupId>
<artifactId>prettytime</artifactId>
<version>3.2.7.Final</version>
<version>4.0.2.Final</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.6</version>
<version>4.5.10</version>
</dependency>
<dependency>
<groupId>org.genesys-pgr</groupId>
......@@ -514,17 +517,17 @@
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
<version>2.3.29</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.9.1</version>
<version>1.11.3</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.8</version>
<version>4.6</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
......@@ -550,7 +553,7 @@
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId>
<version>0.28.38</version>
<version>0.36.8</version>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
......@@ -561,7 +564,7 @@
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.27.0</version>
<version>1.30.4</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
......@@ -573,15 +576,15 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.19.1</version>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......@@ -591,13 +594,13 @@
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<version>1.2.5.RELEASE</version>
<version>1.2.6.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.1.0</version>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
......@@ -609,7 +612,7 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.0.0</version>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
......@@ -619,7 +622,7 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.1-b01</version>
<version>3.0.1-b06</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
......@@ -636,6 +639,16 @@
<artifactId>validator-collection</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.genesys-pgr</groupId>
<artifactId>amphibian-client-resttemplate</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.hashids</groupId>
<artifactId>hashids</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
<build>
......@@ -666,7 +679,7 @@
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>4.1.4</version>
<version>4.2.1</version>
</dependency>
</dependencies>
</plugin>
......@@ -904,7 +917,7 @@
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<version>3.6</version>
<version>${liquibase.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
......
This diff is collapsed.
......@@ -82,7 +82,7 @@ To add images to an accession you must first upload the image to Genesys with a
[source,bash]
----
$ curl 'https://sandbox.genesys-pgr.org/api/v0/img/XXX001/acn/ACC001/?originalFilename=IMG0012.jpg' -i -X PUT -H 'Content-Type: image/jpeg' -d @path/to/IMG0012.jpg
$ curl 'https://api.sandbox.genesys-pgr.org/api/v0/img/XXX001/acn/ACC001/?originalFilename=IMG0012.jpg' -i -X PUT -H 'Content-Type: image/jpeg' -d @path/to/IMG0012.jpg
----
The request `Content-Type` header must be set to the image content type (e.g.
......
......@@ -53,7 +53,7 @@ initiated by opening the authorization URL in a browser (please substitute `CLIE
with valid data):
----
https://sandbox.genesys-pgr.org/oauth/authorize?client_id=CLIENTID&client_secret=SECRET&response_type=code&redirect_uri=oob&scope=write
https://api.sandbox.genesys-pgr.org/oauth/authorize?client_id=CLIENTID&client_secret=SECRET&response_type=code&redirect_uri=oob&scope=write
----
The server will prompt you to authorize the access to your protected resources on Genesys.
......@@ -61,7 +61,7 @@ After your confirmation, the server will present an authorization code (which wi
From a shell, execute the following `curl` command, with your authorization code in place of `THECODE`:
----
$ curl 'https://sandbox.genesys-pgr.org/oauth/token?grant_type=authorization_code&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob&code=THECODE'
$ curl 'https://api.sandbox.genesys-pgr.org/oauth/token?grant_type=authorization_code&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob&code=THECODE'
----
==== Username and password
......@@ -71,7 +71,7 @@ applications) where the user's password will not be captured or stored -- i.e.
it will be used once. A password grant can be used as follows:
----
$ curl 'https://sandbox.genesys-pgr.org/oauth/token' --data 'scope=write+read&grant_type=password&username=USERNAME&password=PASSWORD&client_id=CLIENT_ID&client_secret=CLIENT_SECRET'
$ curl 'https://api.sandbox.genesys-pgr.org/oauth/token' --data 'scope=write+read&grant_type=password&username=USERNAME&password=PASSWORD&client_id=CLIENT_ID&client_secret=CLIENT_SECRET'
----
==== Client credentials
......@@ -93,7 +93,7 @@ To obtain a valid (but short-lived) access token, a simple `POST` request to
Genesys is required:
----
$ curl -X POST 'https://sandbox.genesys-pgr.org/oauth/token?grant_type=client_credentials&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob'
$ curl -X POST 'https://api.sandbox.genesys-pgr.org/oauth/token?grant_type=client_credentials&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob'
----
This type of grant takes out the *user* authentication and authenticates the
......@@ -132,7 +132,7 @@ or by including it in the request URL as a query string parameter:
[source,bash]
----
$ curl 'https://sandbox.genesys-pgr.org/api/v0/me?access_token=OAUTH-ACCESS-TOKEN'
$ curl 'https://api.sandbox.genesys-pgr.org/api/v0/me?access_token=OAUTH-ACCESS-TOKEN'
----
=== Using the refresh token
......@@ -156,7 +156,7 @@ The refresh token must be securely persisted and can be used to request a new ac
when the previous access token expires:
----
$ curl 'https://sandbox.genesys-pgr.org/oauth/token?grant_type=refresh_token&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob&refresh_token=OAUTH-REFRESH-TOKEN'
$ curl 'https://api.sandbox.genesys-pgr.org/oauth/token?grant_type=refresh_token&client_id=CLIENTID&client_secret=SECRET&redirect_uri=oob&refresh_token=OAUTH-REFRESH-TOKEN'
----
......
......@@ -13,9 +13,9 @@ December 2015: Documentation commit {buildNumber}
All API access is over HTTPS, and accessed from the https://www.genesys-pgr.org domain or
through https://sandbox.genesys-pgr.org for testing purposes. All data is sent and received as JSON.
In this manual, all URLs are pointing to the Genesys sandbox environment at https://sandbox.genesys-pgr.org.
All API access is over HTTPS, and accessed from the https://api.genesys-pgr.org domain or
through https://api.sandbox.genesys-pgr.org for testing purposes. All data is sent and received as JSON.
In this manual, all URLs are pointing to the Genesys sandbox environment at https://api.sandbox.genesys-pgr.org.
include::api/security.adoc[]
......
......@@ -14,9 +14,9 @@ March 2017: Documentation commit {buildNumber}
Genesys implements basic <<brapiv1, BrAPI v1 specification>>
All API access is over HTTPS, and accessed from the https://www.genesys-pgr.org domain or
through https://sandbox.genesys-pgr.org for testing purposes. All data is sent and received as JSON.
In this manual, all URLs are pointing to the Genesys sandbox environment at https://sandbox.genesys-pgr.org.
All API access is over HTTPS, and accessed from the https://api.genesys-pgr.org domain or
through https://api.sandbox.genesys-pgr.org for testing purposes. All data is sent and received as JSON.
In this manual, all URLs are pointing to the Genesys sandbox environment at https://api.sandbox.genesys-pgr.org.
include::brapi/auth.adoc[]
......
......@@ -2,12 +2,16 @@
== Authentication
All BrAPI requests can be made anonymously, without providing the OAuth2
*Bearer: <TOKEN>* authentication header.
All BrAPI requests require OAuth2 authentication header in HTTP requests:
----
Authorization: Bearer <TOKEN>
----
=== Login
Genesys does not support the `/login` endpoint.
Genesys does not support the `/login` endpoint. You must obtain the OAuth access token as described
in Genesys API manual.
=== Logout
......
......@@ -34,7 +34,7 @@ Genesys returns the standard BrAPI Germplasm response:
},
"result": <1> [{
"defaultDisplayName": "DJUG 16",
"germplasmPUI": null,
"germplasmPUI": "10.0000/ABCD*",
"pedigree": null,
"seedSource": null,
"synonyms": ["DJUG 16"],
......
......@@ -3,7 +3,8 @@
== Multi-crop Passport Descriptors
The http://www.bioversityinternational.org/e-library/publications/detail/faobioversity-multi-crop-passport-descriptors-v21-mcpd-v21/[Multi-crop Passport Descriptors (MCPD) V.2.1]
were released in 2012 as an update to the MCPD V.2. The MCPD V.2, in turn, was a 2001 revision of the first FAO/IPGRI publication,
were released in 2015 as an update to the MCPD V.2 from 2012.
The MCPD V.2, in turn, was a 2001 revision of the first FAO/IPGRI publication,
expanded to accommodate emerging needs such as the broader use of GPS tools and the
implementation of the http://www.planttreaty.org[International Treaty on Plant Genetic Resources for
Food and Agriculture] Multilateral System for access and benefit sharing.
......
......@@ -51,6 +51,13 @@ public class MapColorsFilter extends PointFilter {
public int filterRGB(int x, int y, int rgb) {
if (rgb == oldColor) {
return newColor;
} else if (rgb != 0) {
int alpha = (rgb >> 24) & 0xFF; // isolate alpha
alpha &= 0xff; //keeps alpha in 0-255 range
int newRGB = newColor;
newRGB &= 0x00ffffff; //remove old alpha info
newRGB |= (alpha << 24); //add new alpha info
return newRGB;
}
return rgb;
}
......
/*
* Copyright 2017 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys.catalog.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.genesys.catalog.service.PublishValidationInterface;
import static java.lang.annotation.ElementType.FIELD;
/**
* Fields with this annotation are required fields, they have to be filled
* during publication process. You should implement
* {@link PublishValidationInterface} for parent class. That give you use
* {@link PublishValidationInterface#validation()} for validate before publish.
* And if you want use {@link PublishValidation#innerCheck()} you should
* implement {@link PublishValidationInterface} for child class and override
* {@link PublishValidationInterface#validation()} method.
*
* @author Andrey Lugovskoy.
*/
@Documented
@Target({ FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface PublishValidation {
/**
* If field is object and innerCheck=true than we have to check inner fields.
*
* @return boolean value
*/
boolean innerCheck() default false;
/**
* You should set {@link Boolean#TRUE} for this field to avoid recursive invoke
* {@link PublishValidationInterface#validation()} method if child class has
* link to parent class.
*
* @return boolean value
*/
boolean ignoreValidation() default false;
}
/*
* Copyright 2017 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys.catalog.annotations;
import java.util.HashMap;
import java.util.Map;
import org.genesys2.server.exception.InvalidApiUsageException;
/**
* The Class PublishValidationException.
*
* @author Andrey Lugovskoy.
*/
public class PublishValidationException extends InvalidApiUsageException {
private static final long serialVersionUID = 3227086532743886389L;
private Map<String, String> errorMap = new HashMap<>();
/**
* Gets the error map.
*
* @return the error map
*/
public Map<String, String> getErrorMap() {
return errorMap;
}
/**
* Adds the error.
*
* @param key the key
* @param value the value
*/
public void addError(final String key, final String value) {
errorMap.put(key, value);
}
/**
* Instantiates a new publish validation exception.
*/
public PublishValidationException() {
super();
}
/**
* Instantiates a new publish validation exception.
*
* @param errorMap the error map
*/
public PublishValidationException(final Map<String, String> errorMap) {
super();
this.errorMap = errorMap;
}
/**
* Instantiates a new publish validation exception.
*
* @param message the message
*/
public PublishValidationException(final String message) {
super(message);
}
/**
* Instantiates a new publish validation exception.
*
* @param message the message
* @param cause the cause
*/
public PublishValidationException(final String message, final Throwable cause) {
super(message, cause);