Skip to content

Commit

Permalink
Merge branch 'release/2.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
blavenie committed Mar 27, 2023
2 parents 68a560e + 4357cea commit 0366dad
Show file tree
Hide file tree
Showing 165 changed files with 4,486 additions and 1,414 deletions.
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
Expand Down Expand Up @@ -51,6 +51,7 @@
<modules>
<module>sumaris-core-shared</module>
<module>sumaris-test-shared</module>
<module>sumaris-xml-query</module>
<module>sumaris-core</module>
<module>sumaris-importation</module>
<module>sumaris-extraction</module>
Expand Down Expand Up @@ -120,7 +121,7 @@
<cglib.version>3.3.0</cglib.version>
<ehcache.version>3.8.1</ehcache.version>
<lombok.version>1.18.24</lombok.version>
<xmlquery.version>1.8</xmlquery.version>
<xmlquery.version>3.2</xmlquery.version>
<jdom2.version>2.0.6</jdom2.version>
<jaxen.version>1.2.0</jaxen.version>
<spring.version>5.3.24</spring.version>
Expand Down Expand Up @@ -1182,13 +1183,19 @@
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgs>
<arg>--enable-preview</arg>
<!--<arg>-AgeneratedSourcesDirectory=${project.build.outputDirectory}</arg>-->
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<!--<path>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-xml-query</artifactId>
<version>2.1.1-SNAPSHOT</version>
</path>-->
</annotationProcessorPaths>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ echo "---- Prepare release [OK]"
echo ""

echo "---- Performing release..."
mvn clean deploy -DperformRelease -DskipTests -Dspring.datasource.platform=hsqldb
mvn clean deploy -DperformRelease -DskipTests -Dspring.sql.init.platform=hsqldb
[[ $? -ne 0 ]] && exit 1
echo "---- Perform release [OK]"
echo ""
Expand Down
2 changes: 1 addition & 1 deletion sumaris-core-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>sumaris-core-shared</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* #%L
* SUMARiS
* %%
* Copyright (C) 2019 SUMARiS Consortium
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/

package net.sumaris.core.config;

import org.nuiton.config.ApplicationConfig;

public interface ApplicationConfigAliasProvider {

void addAlias(ApplicationConfig applicationConfig);
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ protected SumarisConfiguration(ConfigurableEnvironment env,

// Define Alias
addAlias(applicationConfig);
for (ApplicationConfigProvider provider : providers) {
if (provider instanceof ApplicationConfigAliasProvider) {
((ApplicationConfigAliasProvider)provider).addAlias(applicationConfig);
}
}

// parse config file and inline arguments
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public enum SumarisConfigurationOption implements ConfigOptionDef {
DB_CREATE_SCRIPT_PATH(
"sumaris.persistence.db.script",
n("sumaris.config.option.db.script.description"),
"classpath:net/sumaris/core/db/changelog/${spring.datasource.platform}/sumaris.script",
"classpath:net/sumaris/core/db/changelog/${spring.sql.init.platform}/sumaris.script",
String.class,
false),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public JmsListenerContainerFactory<?> jmsListenerContainerFactory(
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(jmsConnectionFactory);
factory.setMessageConverter(messageConverter);
factory.setPubSubDomain(true); // Use Topic instead of Queue

jmsListenerContainerFactoryConfigurer
.ifPresent(c -> c.configure(factory, jmsConnectionFactory));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class Dates extends org.apache.commons.lang3.time.DateUtils{

public static String ISO_TIMESTAMP_SPEC = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";

public static String CSV_DATE_TIME = "yyyy-MM-dd HH:mm:ss";

/**
* Remove a amount of month to a date
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ public static void playWaiting(int count) {
}
}

public static void playFinished() {
try {
SoundUtils.tone(800, 100);
Thread.sleep(200);
SoundUtils.tone(800, 700, 0.7);
Thread.sleep(350);
SoundUtils.tone(800, 1000);
Thread.sleep(3000);
}
catch (Exception e) {
log.debug("Cannot play error sound: " + e.getMessage());
}
}

private void playSound(File f) {
Preconditions.checkArgument(f.exists());

Expand Down
16 changes: 8 additions & 8 deletions sumaris-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>

<artifactId>sumaris-core</artifactId>
Expand Down Expand Up @@ -34,7 +34,7 @@
<test>AllTests</test>

<!-- Default datasource type -->
<spring.datasource.platform>hsqldb</spring.datasource.platform>
<spring.sql.init.platform>hsqldb</spring.sql.init.platform>
</properties>

<dependencies>
Expand Down Expand Up @@ -377,7 +377,7 @@
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>spring.datasource.platform</name>
<name>spring.sql.init.platform</name>
<value>hsqldb</value>
</property>
</activation>
Expand All @@ -391,7 +391,7 @@
<jdbc.password />
<jdbc.driver>org.hsqldb.jdbc.JDBCDriver</jdbc.driver>
<jdbc.schema>PUBLIC</jdbc.schema>
<spring.datasource.platform>hsqldb</spring.datasource.platform>
<spring.sql.init.platform>hsqldb</spring.sql.init.platform>
<hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.dialect.HSQLSpatialDialect</hibernate.dialect>
<hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
</properties>
Expand All @@ -408,7 +408,7 @@
<id>oracle</id>
<activation>
<property>
<name>spring.datasource.platform</name>
<name>spring.sql.init.platform</name>
<value>oracle</value>
</property>
</activation>
Expand All @@ -420,7 +420,7 @@
<jdbc.password>SUMARIS_TU</jdbc.password>
<jdbc.schema>SUMARIS_TU</jdbc.schema>
<jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
<spring.datasource.platform>oracle</spring.datasource.platform>
<spring.sql.init.platform>oracle</spring.sql.init.platform>
<hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.dialect.OracleSpatial10gDialect</hibernate.dialect>
<hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
</properties>
Expand All @@ -437,7 +437,7 @@
<id>pgsql</id>
<activation>
<property>
<name>spring.datasource.platform</name>
<name>spring.sql.init.platform</name>
<value>pgsql</value>
</property>
</activation>
Expand All @@ -449,7 +449,7 @@
<jdbc.password>sumaris</jdbc.password>
<jdbc.schema>public</jdbc.schema>
<jdbc.driver>org.postgresql.Driver</jdbc.driver>
<spring.datasource.platform>pgsql</spring.datasource.platform>
<spring.sql.init.platform>pgsql</spring.sql.init.platform>
<hibernate.dialect>net.sumaris.core.dao.technical.hibernate.spatial.dialect.PostgreSQL10Dialect</hibernate.dialect>
<hibernate.jdbcBatchSize>15</hibernate.jdbcBatchSize>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.url=@jdbc.url@
spring.datasource.platform=@env@
spring.sql.init.platform=@env@
spring.datasource.hikari.connectionTestQuery=SELECT 1 FROM STATUS WHERE ID=1
spring.datasource.hikari.initializationFailTimeout=-1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring.jpa.database-platform=net.sumaris.core.dao.technical.hibernate.spatial.di
spring.jpa.properties.hibernate.dialect=${spring.jpa.database-platform}

# Database connection
spring.datasource.platform=oracle
spring.sql.init.platform=oracle
spring.datasource.username=<USERNAME>
spring.datasource.password=
spring.jpa.properties.hibernate.default_catalog=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring.jpa.database-platform=net.sumaris.core.dao.technical.hibernate.spatial.di
spring.jpa.properties.hibernate.dialect=${spring.jpa.database-platform}

# Database connection
spring.datasource.platform=pgsql
spring.sql.init.platform=pgsql
spring.datasource.username=sumaris
spring.datasource.password=sumaris
spring.jpa.properties.hibernate.default_catalog=sumaristest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ [email protected]@
spring.datasource.username=@jdbc.username@
spring.datasource.password=@jdbc.password@
spring.datasource.url=@jdbc.url@
spring.datasource.platform=@env@
spring.sql.init.platform=@env@
spring.datasource.hikari.connectionTestQuery=SELECT 1 FROM STATUS WHERE ID=1
spring.datasource.hikari.initializationFailTimeout=-1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ public void run() {
tripService.denormalizeByFilter(filterBuilder.build(), progression);

// Play a beep
SoundUtils.playWaiting(2);
SoundUtils.playFinished();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,17 @@ default Specification<ProcessingHistory> hasStatus(String... status) {
}

default Specification<ProcessingHistory> hasJobStatus(JobStatusEnum... jobStatus) {
Integer[] statusIds = Arrays.stream(jobStatus)
if (ArrayUtils.isEmpty(jobStatus)) return null;
List<Integer> statusIds = Arrays.stream(jobStatus)
.map(JobStatusEnum::getProcessingStatus)
.filter(Objects::nonNull)
.map(ProcessingStatusEnum::getId)
.filter(id -> id != null && id >= 0)
.toArray(Integer[]::new);
if (ArrayUtils.isEmpty(statusIds)) return null;
.toList();
if (CollectionUtils.isEmpty(statusIds)) return null;
return hasInnerJoinIds(
ProcessingHistory.Fields.PROCESSING_STATUS,
statusIds);
statusIds.toArray(new Integer[0]));
}

List<JobVO> findAll(JobFilterVO filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ public Set<String> findTableNamesByPrefix(String tablePrefix, String schema, Str
if (tableName.toUpperCase().startsWith(tablePrefix.toUpperCase())) {
result.add(rs.getString("TABLE_NAME"));
}
// JDBC meta return a bad tableName: should never occur !!
// JDBC meta return a bad tableName (e.g. because '_' special character) => ignore
else {
log.warn("Invalid getTables() result: Table name '{}' should not be returned, because its not match the pattern '{}'. Please check like pattern, or Daos.getEscapedForLike() function", tableName, tablePrefix);
log.trace("Ignoring getTables() result, because table name '{}' not start with '{}'", tableName, tablePrefix);
}
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public class PhysicalGear implements IRootDataEntity<Integer>,

@ManyToOne(fetch = FetchType.LAZY, targetEntity = Gear.class)
@JoinColumn(name = "gear_fk", nullable = false)

private Gear gear;

@Column(length = LENGTH_COMMENTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public enum PmfmEnum implements IEntityEnum, Serializable {
BATCH_CALCULATED_WEIGHT_LENGTH(122, "BATCH_CALCULATED_WEIGHT_LENGTH"),
BATCH_CALCULATED_WEIGHT_LENGTH_SUM(123, "BATCH_CALCULATED_WEIGHT_LENGTH_SUM"),
BATCH_SORTING(176, "BATCH_SORTING"), // Adagio = 'SORTED' (id=200)
CHILD_GEAR(400, "CHILD_GEAR"),
CATCH_WEIGHT(57, "CATCH_WEIGHT"),
DISCARD_WEIGHT(56, "DISCARD_WEIGHT"),
BATCH_GEAR_POSITION(411, "BATCH_GEAR_POSITION"),

IS_DEAD(94, "IS_DEAD"),
DISCARD_REASON(95, "DISCARD_REASON"),
Expand All @@ -92,10 +96,11 @@ public enum PmfmEnum implements IEntityEnum, Serializable {

CONTROL_TYPE(130, "CONTROL_TYPE"),

SIZE_UNLI_CAT(141, "SIZE_UNLI_CAT"),
PRESERVATION(150, "PRESERVATION"),
DRESSING(151, "DRESSING"),
SIZE_CATEGORY(174, "SIZE_CATEGORY"),

TRAWL_SIZE_CAT(418, "TRAWL_SIZE_CAT"),
PACKAGING(177, "PACKAGING"),

TOTAL_PRICE(270, "TOTAL_PRICE"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class ProductRdbSpeciesList implements Serializable, IEntity<Integer> {
public static final String COLUMN_COMMERCIAL_SIZE_CATEGORY = "commercial_size_category";
public static final String COLUMN_SUBSAMPLING_CATEGORY = "subsampling_category";
public static final String COLUMN_WEIGHT= "weight";
public static final String COLUMN_SUBSAMPLING_WEIGHT = "subsampling_weight";
public static final String COLUMN_SUBSAMPLE_WEIGHT = "subsample_weight";
public static final String COLUMN_LENGTH_CODE = "length_code";

@Id
Expand Down Expand Up @@ -119,8 +119,8 @@ public class ProductRdbSpeciesList implements Serializable, IEntity<Integer> {
@Column(nullable = false, scale = 12, precision = 2, name = COLUMN_WEIGHT)
private Double weight;

@Column( scale = 12, precision = 2, name = COLUMN_SUBSAMPLING_WEIGHT)
private Double subsamplingWeight;
@Column( scale = 12, precision = 2, name = COLUMN_SUBSAMPLE_WEIGHT)
private Double subsampleWeight;

@Column(length = 5, name = COLUMN_LENGTH_CODE)
private String lengthCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public DenormalizedTripResultVO denormalizeByFilter(@NonNull OperationFilterVO o
// Select only operation that should be update (if not force)
operationFilter.setNeedBatchDenormalization(!baseOptions.isForce());

// DEBUG - force denormalization
//if (!this.production && !baseOptions.isForce()) operationFilter.setNeedBatchDenormalization(false);

long operationTotal = operationService.countByFilter(operationFilter);

boolean hasMoreData;
Expand Down
Loading

0 comments on commit 0366dad

Please sign in to comment.