Commit a57281e8 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.8.1'

parents fdaf226d 950da33d
......@@ -3,7 +3,7 @@
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<artifactId>sumaris-core-extraction</artifactId>
......
......@@ -13,7 +13,7 @@ spring.main.banner-mode=off
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.url=jdbc:hsqldb:hsql://localhost/sumaris
#spring.datasource.url=jdbc:hsqldb:hsql://localhost/sumaris
spring.datasource.platform=hsqldb
spring.datasource.initialization-mode=always
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -223,7 +223,7 @@
<jdbc.driver.jar>${settings.localRepository}/org/hsqldb/hsqldb/${hsqldb.version}/hsqldb-${hsqldb.version}.jar</jdbc.driver.jar>
<jdbc.username>sa</jdbc.username>
<jdbc.password />
<jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
<jdbc.driver>org.hsqldb.jdbc.JDBCDriver</jdbc.driver>
<jdbc.schema>PUBLIC</jdbc.schema>
<hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.HSQLSpatialDialect</hibernate.dialect>
<hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<artifactId>sumaris-core-shared</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<artifactId>sumaris-core</artifactId>
......@@ -364,7 +364,7 @@
<jdbc.driver.jar>${settings.localRepository}/org/hsqldb/hsqldb/${hsqldb.version}/hsqldb-${hsqldb.version}.jar</jdbc.driver.jar>
<jdbc.username>sa</jdbc.username>
<jdbc.password />
<jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
<jdbc.driver>org.hsqldb.jdbc.JDBCDriver</jdbc.driver>
<jdbc.schema>PUBLIC</jdbc.schema>
<hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.HSQLSpatialDialect</hibernate.dialect>
<hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
......
......@@ -50,8 +50,6 @@ public class ConfigurationVO extends SoftwareVO {
// TODO: add a map by resolution (e.g. hdpi, mdpi, ...)
//private Map<String, String> logo;
private Date updateDate;
private Map<String, String> properties;
private List<String> backgroundImages;
......
......@@ -17,8 +17,8 @@ spring.main.banner-mode=off
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.username=sa
spring.datasource.password=
# TODO comment this line:
spring.datasource.url=jdbc:hsqldb:hsql://localhost/sumaris
# For DEV ONLY:
#spring.datasource.url=jdbc:hsqldb:hsql://localhost/sumaris
spring.datasource.platform=hsqldb
spring.datasource.initialization-mode=always
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<artifactId>sumaris-server</artifactId>
......
......@@ -32,6 +32,8 @@ server.url=@server.url@
spring.main.web-application-type=servlet
spring.mvc.publish-request-handled-events=false
spring.cache.enabled=true
# HSQLDB configuration
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.username=sa
......
......@@ -22,54 +22,39 @@ package net.sumaris.server.http.graphql.technical;
* #L%
*/
import com.fasterxml.jackson.databind.ObjectMapper;
import io.leangen.graphql.annotations.GraphQLArgument;
import io.leangen.graphql.annotations.GraphQLEnvironment;
import io.leangen.graphql.annotations.GraphQLMutation;
import io.leangen.graphql.annotations.GraphQLQuery;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.dao.technical.cache.Caches;
import net.sumaris.core.service.administration.DepartmentService;
import net.sumaris.core.service.technical.ConfigurationService;
import net.sumaris.core.service.technical.SoftwareService;
import net.sumaris.core.vo.administration.user.DepartmentVO;
import net.sumaris.core.vo.technical.ConfigurationVO;
import net.sumaris.core.vo.technical.SoftwareVO;
import net.sumaris.server.config.SumarisServerConfigurationOption;
import net.sumaris.server.http.graphql.administration.AdministrationGraphQLService;
import net.sumaris.server.http.security.IsAdmin;
import net.sumaris.server.service.administration.ImageService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.jena.ext.com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.cache.Cache;
import javax.cache.CacheManager;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@Transactional
@Slf4j
@ConditionalOnBean({CacheManager.class})
@ConditionalOnProperty(
name = "spring.cache.enabled",
havingValue = "true",
matchIfMissing = true
)
public class CacheGraphQLService {
@Autowired
@Autowired(required = false)
private CacheManager cacheManager;
@GraphQLQuery(name = "cacheStatistics", description = "Get cache statistics")
@IsAdmin
public Map<String, Map<String, Long>> getCacheStats() {
if (cacheManager == null) return Maps.newHashMap();
return Caches.getStatistics(cacheManager);
}
......@@ -78,6 +63,8 @@ public class CacheGraphQLService {
public boolean clearCache(
@GraphQLArgument(name = "name") String name
) {
if (cacheManager == null) return false;
try {
if (StringUtils.isBlank(name)) {
log.info("Clearing caches...");
......
......@@ -85,8 +85,14 @@ public class ConfigurationGraphQLService {
@GraphQLQuery(name = "configuration", description = "Load pod configuration")
public ConfigurationVO getConfiguration(
@GraphQLArgument(name = "id") Integer id, // /!\ Deprecated !
@GraphQLArgument(name = "label") String label, // /!\ Deprecated !
@GraphQLEnvironment Set<String> fields
) {
if (id != null || label != null) {
log.warn("Deprecated used of GraphQL 'configuration' query. Since version 1.8.0, arguments 'id' and 'label' have been deprecated, and will be ignored.");
}
SoftwareVO software = configurationService.getCurrentSoftware();
// Transform to configuration (fill images, etc.)
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.0</version>
<version>1.8.1</version>
</parent>
<artifactId>sumaris-test-shared</artifactId>
......
......@@ -1573,6 +1573,7 @@
<PROGRAM2LOCATION/>
<PROGRAM2DEPARTMENT/>
<PROGRAM2PERSON/>
<PROGRAM2LOCATION_CLASSIF/>
<STRATEGY/>
<STRATEGY2GEAR/>
<STRATEGY2DEPARTMENT/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment