Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
May 2018
- 1 participants
- 144 discussions
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
404f16a6 by Tony CHEMIT at 2018-05-11T19:22:05Z
use last toolkit
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>3.4-SNAPSHOT</observeToolkitVersion>
+ <observeToolkitVersion>3.4</observeToolkitVersion>
<!--<lib.version.java4all.jaxx>3.0-alpha-31</lib.version.java4all.jaxx>-->
<!--<lib.version.nuiton.topia>3.4.2-SNAPSHOT</lib.version.nuiton.topia>-->
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/404f16a67d1d1e6ab03ae94ce20…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/404f16a67d1d1e6ab03ae94ce20…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
2132fbc7 by Tony CHEMIT at 2018-05-11T12:55:30Z
use new SqlScriptXXX API
- - - - -
19 changed files:
- client-configuration/src/license/THIRD-PARTY.properties
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
- − persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java
- − persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
- pom.xml
- server-configuration/src/license/THIRD-PARTY.properties
- services-client/src/license/THIRD-PARTY.properties
- − services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java
- services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
- services/pom.xml
- services/src/license/THIRD-PARTY.properties
- services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
- services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
- services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
- test/src/main/resources/log4j.properties
- validation/src/license/THIRD-PARTY.properties
Changes:
=====================================
client-configuration/src/license/THIRD-PARTY.properties
=====================================
--- a/client-configuration/src/license/THIRD-PARTY.properties
+++ b/client-configuration/src/license/THIRD-PARTY.properties
@@ -3,8 +3,17 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
+# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -13,13 +22,14 @@
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
# - MPL 1.1
+# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
-# - The New BSD License
-# - WTFPL
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Aug 17 16:45:44 CEST 2017
+#Fri May 11 14:26:25 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
@@ -10,12 +10,12 @@ package fr.ird.observe.persistence;
* 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>.
@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaDao;
import org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContextConstructorParameter;
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
+import org.nuiton.topia.persistence.util.SqlScriptConsumer;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -129,14 +130,14 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
}
- public void setShowSql(boolean showSql) {
- this.showSql = showSql;
- }
-
public boolean isShowSql() {
return showSql;
}
+ public void setShowSql(boolean showSql) {
+ this.showSql = showSql;
+ }
+
public <E extends ObserveEntity> E newEntity(Class<E> entityType) {
TopiaDao<E> dao = getDao(entityType);
return dao.newInstance();
@@ -167,6 +168,16 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
}
+ public void executeSqlScript(byte... content) {
+ getSqlSupport().doSqlWork(SqlScriptConsumer.builder(content).batchSize(1000).build());
+ }
+
+ public void executeSqlScripts(byte[]... contents) {
+ for (byte[] content : contents) {
+ executeSqlScript(content);
+ }
+ }
+
protected class CountTableSqlWork extends TopiaSqlQuery<Long> {
private final String fullyTableName;
@@ -189,14 +200,4 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
return set.getLong(1);
}
}
-
- public void executeSqlScript(byte... content) {
-
- getSqlSupport().doSqlWork(new RunScriptTopiaSqlWork(1000, showSql, content));
- }
-
- public void executeSqlScripts(byte[]... contents) {
-
- getSqlSupport().doSqlWork(new RunScriptsTopiaSqlWork(1000, showSql, contents));
- }
}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package fr.ird.observe.persistence;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.support.TopiaSqlWork;
-import org.nuiton.util.GZUtil;
-import org.nuiton.util.sql.SqlFileReader;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.zip.GZIPInputStream;
-
-/**
- * TODO Move this in ToPIA.
- * <p>
- * Created on 09/01/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class RunScriptTopiaSqlWork implements TopiaSqlWork {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(RunScriptTopiaSqlWork.class);
-
- protected final byte[] content;
- protected final boolean gzip;
- protected final int batchSize;
- protected final boolean showSql;
-
- public RunScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content) {
- this.batchSize = batchSize;
- this.showSql = showSql;
- this.content = content;
-
- if (content == null || content.length == 0) {
- gzip = false;
- } else {
- try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(content)) {
- gzip = GZUtil.isGzipStream(byteArrayInputStream);
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
- }
-
- @Override
- public void execute(Connection connection) throws SQLException {
-
- boolean autoCommit = connection.getAutoCommit();
-
- try {
- connection.setAutoCommit(false);
-
- execute0(connection);
- } finally {
- connection.setAutoCommit(autoCommit);
- }
- }
-
- protected void execute0(Connection connection) throws SQLException {
- try (BufferedReader reader = createReader()) {
-
- try (Statement statement = connection.createStatement()) {
-
- int batchSize = 0;
-
- for (String statementStr : new SqlFileReader(reader)) {
-
- String trimLine = statementStr.trim();
-
- if (trimLine.isEmpty() || trimLine.startsWith("--")) {
- continue;
- }
- if (showSql || log.isDebugEnabled()) {
- log.info(trimLine);
- }
- statement.addBatch(trimLine);
- batchSize++;
-
- if (batchSize % this.batchSize == 0) {
- flushStatement(statement);
- }
-
- }
-
- flushStatement(statement);
- }
-
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
-
- protected void flushStatement(Statement statement) throws SQLException {
-
- statement.executeBatch();
- statement.clearBatch();
-
- }
-
- private BufferedReader createReader() {
- try {
- return new BufferedReader(new InputStreamReader(new BufferedInputStream(gzip ? new GZIPInputStream(new ByteArrayInputStream(content)) : new ByteArrayInputStream(content))));
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package fr.ird.observe.persistence;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-/**
- * TODO Move this in ToPIA.
- * <p>
- * Created on 09/01/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class RunScriptsTopiaSqlWork extends RunScriptTopiaSqlWork {
-
- protected final byte[][] contents;
-
- public RunScriptsTopiaSqlWork(int batchSize, boolean showSql, byte[][] contents) {
- super(batchSize, showSql, null);
- this.contents = contents;
- }
-
- @Override
- protected void execute0(Connection connection) throws SQLException {
-
- for (byte[] content : contents) {
- new RunScriptTopiaSqlWork(batchSize, showSql, content).execute0(connection);
- }
-
- }
-
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package fr.ird.observe.persistence.migration;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Created on 04/11/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- * @since 6.0
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-public @interface MigrationVersion {
-
- String version();
-
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
@@ -46,6 +46,9 @@ public class ObserveTopiaMigrationServiceAskUserToMigrate implements TopiaMigrat
@Override
public boolean canIMigrate(Version dbVersion, List<Version> versions) {
// on autorise les migrations dès quelles sont demandée pour une version égale ou superieur à la V3.0.
+ //FIXME On devrait peut-être à ce niveau demander réellement à l'utilisateur, car dans le cas de création
+ //FIXME d'une base via un script, la migration est effectuée sans demande, mais d'un autre côté si on charge une
+ //FIXME backup, alors la source n'est pas altérée donc une migration automatique est possible...
return dbVersion.afterOrEquals(getMinimumVersion());
// boolean headless = GraphicsEnvironment.isHeadless();
//
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>3.3</observeToolkitVersion>
+ <observeToolkitVersion>3.4-SNAPSHOT</observeToolkitVersion>
<!--<lib.version.java4all.jaxx>3.0-alpha-31</lib.version.java4all.jaxx>-->
<!--<lib.version.nuiton.topia>3.4.2-SNAPSHOT</lib.version.nuiton.topia>-->
=====================================
server-configuration/src/license/THIRD-PARTY.properties
=====================================
--- a/server-configuration/src/license/THIRD-PARTY.properties
+++ b/server-configuration/src/license/THIRD-PARTY.properties
@@ -3,8 +3,17 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
+# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -16,11 +25,11 @@
# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
-# - The New BSD License
-# - WTFPL
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Aug 17 16:45:41 CEST 2017
+#Fri May 11 14:26:13 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services-client/src/license/THIRD-PARTY.properties
=====================================
--- a/services-client/src/license/THIRD-PARTY.properties
+++ b/services-client/src/license/THIRD-PARTY.properties
@@ -2,9 +2,18 @@
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - Apache 2.0
+# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -12,12 +21,15 @@
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Sep 04 00:38:17 CEST 2017
+#Fri May 11 14:26:07 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java deleted
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package fr.ird.observe.services.local.service.data;
-
-/*-
- * #%L
- * ObServe :: Services local implementation
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
-import fr.ird.observe.persistence.RunScriptTopiaSqlWork;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.sql.rowset.serial.SerialBlob;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Map;
-
-/**
- * Created on 24/08/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class ImportTripScriptTopiaSqlWork extends RunScriptTopiaSqlWork {
-
- /** Logger */
- private static final Log log = LogFactory.getLog(ImportTripScriptTopiaSqlWork.class);
-
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
-
- public ImportTripScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
- super(batchSize, showSql, content);
- this.blobsContainers = blobsContainers;
- }
-
- @Override
- public void execute(Connection connection) throws SQLException {
- super.execute(connection);
-
- for (ObserveBlobsContainer blobsContainer : blobsContainers) {
-
- String tableName = blobsContainer.getTableName();
- String columnName = blobsContainer.getColumnName();
- int batchSize = 0;
-
- String sql = String.format("update %s SET %s = ? WHERE topiaId= ?", tableName, columnName);
- if (showSql) {
- if (log.isInfoEnabled()) {
- log.info(sql);
- }
- }
- try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
-
- for (Map.Entry<String, byte[]> containerEntry : blobsContainer.getBlobsById().entrySet()) {
-
- String topiaId = containerEntry.getKey();
- byte[] content = containerEntry.getValue();
-
- preparedStatement.clearParameters();
- preparedStatement.setBlob(1, new SerialBlob(content));
- preparedStatement.setString(2, topiaId);
- preparedStatement.addBatch();
-
- batchSize++;
-
- if (batchSize % this.batchSize == 0) {
- flushStatement(preparedStatement);
- }
-
- }
-
-
- flushStatement(preparedStatement);
-
- }
-
- }
-
-
- }
-
-}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
+++ b/services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.local.service.data;
* 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>.
@@ -24,7 +24,6 @@ package fr.ird.observe.services.local.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.IdHelper;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
import fr.ird.observe.persistence.ObserveTopiaPersistenceContext;
import fr.ird.observe.services.local.ObserveServiceContextLocal;
import fr.ird.observe.services.local.service.ObserveServiceLocal;
@@ -41,6 +40,8 @@ import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest;
import fr.ird.observe.services.service.sql.SqlScriptProducerService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.util.SqlScriptConsumer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
import org.nuiton.util.StringUtil;
import org.nuiton.version.Version;
@@ -84,7 +85,7 @@ public class TripManagementServiceLocal extends ObserveServiceLocal implements T
.dataIdsToAdd(ImmutableSet.of(tripId));
AddSqlScriptProducerResult producerResult = sqlScriptProducerService.produceAddSqlScript(request);
byte[] tripContent = producerResult.getSqlCode();
- ImmutableSet<ObserveBlobsContainer> blobsContainers = producerResult.getBlobsContainers();
+ ImmutableSet<TopiaBlobsContainer> blobsContainers = producerResult.getBlobsContainers();
long time = System.nanoTime() - t0;
@@ -151,18 +152,13 @@ public class TripManagementServiceLocal extends ObserveServiceLocal implements T
log.info("Start import of trip: " + request.getTripId());
}
- ImmutableSet<ObserveBlobsContainer> blobsContainers = request.getBlobsContainers();
-
- if (blobsContainers.isEmpty()) {
-
- persistenceContext.executeSqlScript(request.getSqlContent());
-
- } else {
-
- boolean showSql = serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql();
- persistenceContext.getSqlSupport().doSqlWork(new ImportTripScriptTopiaSqlWork(1000, showSql, request.getSqlContent(), blobsContainers));
+ ImmutableSet<TopiaBlobsContainer> blobsContainers = request.getBlobsContainers();
+ SqlScriptConsumer.Builder consumerBuilder = SqlScriptConsumer.builder(request.getSqlContent()).batchSize(1000);
+ if (!blobsContainers.isEmpty()) {
+ consumerBuilder.blobs(blobsContainers);
}
+ persistenceContext.getSqlSupport().doSqlWork(consumerBuilder.build());
persistenceContext.commit();
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
+++ b/services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
@@ -24,7 +24,7 @@ package fr.ird.observe.services.local.service.sql;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
import fr.ird.observe.dto.reference.ReferentialDtoReference;
import fr.ird.observe.persistence.Entities;
import fr.ird.observe.persistence.ObserveEntityEnum;
@@ -75,7 +75,7 @@ public class SqlScriptProducerServiceLocal extends ObserveServiceLocal implement
}
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- ImmutableSet.Builder<ObserveBlobsContainer> observeBlobContainers = ImmutableSet.builder();
+ ImmutableSet.Builder<TopiaBlobsContainer> observeBlobContainers = ImmutableSet.builder();
try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out), StandardCharsets.UTF_8)) {
TopiaSqlBatchService sqlBatchService = serviceContext.getTopiaApplicationContext().getSqlBatchService();
@@ -85,7 +85,7 @@ public class SqlScriptProducerServiceLocal extends ObserveServiceLocal implement
SqlResult sqlResult = sqlBatchService.execute(sqlRequests);
ImmutableSet<BlobsContainer> blobsContainers = sqlResult.getBlobsContainers();
for (BlobsContainer blobsContainer : blobsContainers) {
- observeBlobContainers.add(new ObserveBlobsContainer(blobsContainer.getTableName(),
+ observeBlobContainers.add(new TopiaBlobsContainer(blobsContainer.getTableName(),
blobsContainer.getColumnName(),
blobsContainer.getBlobsById()));
}
=====================================
services/pom.xml
=====================================
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -58,6 +58,10 @@
<groupId>fr.ird.observe.toolkit</groupId>
<artifactId>common-service</artifactId>
</dependency>
+ <dependency>
+ <groupId>fr.ird.observe.toolkit</groupId>
+ <artifactId>topia-extension</artifactId>
+ </dependency>
<!-- nuiton dependencies -->
<dependency>
=====================================
services/src/license/THIRD-PARTY.properties
=====================================
--- a/services/src/license/THIRD-PARTY.properties
+++ b/services/src/license/THIRD-PARTY.properties
@@ -1,12 +1,21 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
-# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
@@ -15,9 +24,12 @@
# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
+# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Sep 07 10:22:53 CEST 2015
+#Fri May 11 14:22:56 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
+++ b/services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 27/08/16.
@@ -37,12 +37,12 @@ public class ExportTripResult implements ObserveDto {
private final String programId;
private final String tripId;
private final byte[] sqlContent;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
private final long time;
public ExportTripResult(ExportTripRequest request,
byte[] sqlContent,
- ImmutableSet<ObserveBlobsContainer> blobsContainers,
+ ImmutableSet<TopiaBlobsContainer> blobsContainers,
long time) {
this.programId = request.getProgramId();
this.tripId = request.getTripId();
@@ -63,7 +63,7 @@ public class ExportTripResult implements ObserveDto {
return sqlContent;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
=====================================
services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
+++ b/services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.service.data;
* 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>.
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 27/08/16.
@@ -37,7 +37,7 @@ public class ImportTripRequest implements ObserveDto {
private final String programId;
private final String tripId;
private final byte[] sqlContent;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
public ImportTripRequest(ExportTripResult exportTripResult) {
this.programId = exportTripResult.getProgramId();
@@ -58,7 +58,7 @@ public class ImportTripRequest implements ObserveDto {
return sqlContent;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
=====================================
services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
+++ b/services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.service.sql;
* 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>.
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.sql;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 24/08/16.
@@ -35,9 +35,9 @@ public class AddSqlScriptProducerResult implements ObserveDto {
private final byte[] sqlCode;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
- public AddSqlScriptProducerResult(byte[] sqlCode, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
+ public AddSqlScriptProducerResult(byte[] sqlCode, ImmutableSet<TopiaBlobsContainer> blobsContainers) {
this.sqlCode = sqlCode;
this.blobsContainers = blobsContainers;
}
@@ -46,7 +46,7 @@ public class AddSqlScriptProducerResult implements ObserveDto {
return sqlCode;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
}
=====================================
test/src/main/resources/log4j.properties
=====================================
--- a/test/src/main/resources/log4j.properties
+++ b/test/src/main/resources/log4j.properties
@@ -26,7 +26,6 @@ log4j.appender.stdout.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %d{ISO8601} [%t] %40C{1} :%4L - %m%n
log4j.logger.fr.ird.observe=INFO
-#log4j.logger.fr.ird.observe.persistence.RunScriptTopiaSqlWork=DEBUG
log4j.logger.org.nuiton.topia=INFO
#log4j.logger.org.nuiton.topia.service.sql=DEBUG
#log4j.logger.fr.ird.observe.client.validators=WARN
=====================================
validation/src/license/THIRD-PARTY.properties
=====================================
--- a/validation/src/license/THIRD-PARTY.properties
+++ b/validation/src/license/THIRD-PARTY.properties
@@ -3,11 +3,19 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
-# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
@@ -16,9 +24,12 @@
# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
+# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Aug 01 17:25:22 CEST 2016
+#Fri May 11 14:23:09 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/2132fbc72634188e7a5576c9933…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/2132fbc72634188e7a5576c9933…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b2c87822 by Tony CHEMIT at 2018-05-11T12:41:13Z
use new SqlScriptXXX API
- - - - -
19 changed files:
- client-configuration/src/license/THIRD-PARTY.properties
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
- − persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java
- − persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
- pom.xml
- server-configuration/src/license/THIRD-PARTY.properties
- services-client/src/license/THIRD-PARTY.properties
- − services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java
- services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
- services/pom.xml
- services/src/license/THIRD-PARTY.properties
- services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
- services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
- services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
- test/src/main/resources/log4j.properties
- validation/src/license/THIRD-PARTY.properties
Changes:
=====================================
client-configuration/src/license/THIRD-PARTY.properties
=====================================
--- a/client-configuration/src/license/THIRD-PARTY.properties
+++ b/client-configuration/src/license/THIRD-PARTY.properties
@@ -3,8 +3,17 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
+# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -13,13 +22,14 @@
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
# - MPL 1.1
+# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
-# - The New BSD License
-# - WTFPL
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Aug 17 16:45:44 CEST 2017
+#Fri May 11 14:26:25 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaPersistenceContext.java
@@ -10,12 +10,12 @@ package fr.ird.observe.persistence;
* 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>.
@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaDao;
import org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContextConstructorParameter;
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
+import org.nuiton.topia.persistence.util.SqlScriptConsumer;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -129,14 +130,14 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
}
- public void setShowSql(boolean showSql) {
- this.showSql = showSql;
- }
-
public boolean isShowSql() {
return showSql;
}
+ public void setShowSql(boolean showSql) {
+ this.showSql = showSql;
+ }
+
public <E extends ObserveEntity> E newEntity(Class<E> entityType) {
TopiaDao<E> dao = getDao(entityType);
return dao.newInstance();
@@ -167,6 +168,18 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
}
+ public void executeSqlScript(byte... content) {
+
+ getSqlSupport().doSqlWork(SqlScriptConsumer.of(content));
+ }
+
+ public void executeSqlScripts(byte[]... contents) {
+ for (byte[] content : contents) {
+ executeSqlScript(content);
+ }
+// getSqlSupport().doSqlWork(new RunScriptsTopiaSqlWork(1000, showSql, contents));
+ }
+
protected class CountTableSqlWork extends TopiaSqlQuery<Long> {
private final String fullyTableName;
@@ -189,14 +202,4 @@ public class ObserveTopiaPersistenceContext extends AbstractObserveTopiaPersiste
return set.getLong(1);
}
}
-
- public void executeSqlScript(byte... content) {
-
- getSqlSupport().doSqlWork(new RunScriptTopiaSqlWork(1000, showSql, content));
- }
-
- public void executeSqlScripts(byte[]... contents) {
-
- getSqlSupport().doSqlWork(new RunScriptsTopiaSqlWork(1000, showSql, contents));
- }
}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/RunScriptTopiaSqlWork.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package fr.ird.observe.persistence;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.persistence.TopiaException;
-import org.nuiton.topia.persistence.support.TopiaSqlWork;
-import org.nuiton.util.GZUtil;
-import org.nuiton.util.sql.SqlFileReader;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.zip.GZIPInputStream;
-
-/**
- * TODO Move this in ToPIA.
- * <p>
- * Created on 09/01/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class RunScriptTopiaSqlWork implements TopiaSqlWork {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(RunScriptTopiaSqlWork.class);
-
- protected final byte[] content;
- protected final boolean gzip;
- protected final int batchSize;
- protected final boolean showSql;
-
- public RunScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content) {
- this.batchSize = batchSize;
- this.showSql = showSql;
- this.content = content;
-
- if (content == null || content.length == 0) {
- gzip = false;
- } else {
- try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(content)) {
- gzip = GZUtil.isGzipStream(byteArrayInputStream);
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
- }
-
- @Override
- public void execute(Connection connection) throws SQLException {
-
- boolean autoCommit = connection.getAutoCommit();
-
- try {
- connection.setAutoCommit(false);
-
- execute0(connection);
- } finally {
- connection.setAutoCommit(autoCommit);
- }
- }
-
- protected void execute0(Connection connection) throws SQLException {
- try (BufferedReader reader = createReader()) {
-
- try (Statement statement = connection.createStatement()) {
-
- int batchSize = 0;
-
- for (String statementStr : new SqlFileReader(reader)) {
-
- String trimLine = statementStr.trim();
-
- if (trimLine.isEmpty() || trimLine.startsWith("--")) {
- continue;
- }
- if (showSql || log.isDebugEnabled()) {
- log.info(trimLine);
- }
- statement.addBatch(trimLine);
- batchSize++;
-
- if (batchSize % this.batchSize == 0) {
- flushStatement(statement);
- }
-
- }
-
- flushStatement(statement);
- }
-
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
-
- protected void flushStatement(Statement statement) throws SQLException {
-
- statement.executeBatch();
- statement.clearBatch();
-
- }
-
- private BufferedReader createReader() {
- try {
- return new BufferedReader(new InputStreamReader(new BufferedInputStream(gzip ? new GZIPInputStream(new ByteArrayInputStream(content)) : new ByteArrayInputStream(content))));
- } catch (IOException e) {
- throw new TopiaException(e);
- }
- }
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/RunScriptsTopiaSqlWork.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package fr.ird.observe.persistence;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-/**
- * TODO Move this in ToPIA.
- * <p>
- * Created on 09/01/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class RunScriptsTopiaSqlWork extends RunScriptTopiaSqlWork {
-
- protected final byte[][] contents;
-
- public RunScriptsTopiaSqlWork(int batchSize, boolean showSql, byte[][] contents) {
- super(batchSize, showSql, null);
- this.contents = contents;
- }
-
- @Override
- protected void execute0(Connection connection) throws SQLException {
-
- for (byte[] content : contents) {
- new RunScriptTopiaSqlWork(batchSize, showSql, content).execute0(connection);
- }
-
- }
-
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package fr.ird.observe.persistence.migration;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Created on 04/11/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- * @since 6.0
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-public @interface MigrationVersion {
-
- String version();
-
-}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
@@ -46,6 +46,9 @@ public class ObserveTopiaMigrationServiceAskUserToMigrate implements TopiaMigrat
@Override
public boolean canIMigrate(Version dbVersion, List<Version> versions) {
// on autorise les migrations dès quelles sont demandée pour une version égale ou superieur à la V3.0.
+ //FIXME On devrait peut-être à ce niveau demander réellement à l'utilisateur, car dans le cas de création
+ //FIXME d'une base via un script, la migration est effectuée sans demande, mais d'un autre côté si on charge une
+ //FIXME backup, alors la source n'est pas altérée donc une migration automatique est possible...
return dbVersion.afterOrEquals(getMinimumVersion());
// boolean headless = GraphicsEnvironment.isHeadless();
//
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <observeToolkitVersion>3.3</observeToolkitVersion>
+ <observeToolkitVersion>3.4-SNAPSHOT</observeToolkitVersion>
<!--<lib.version.java4all.jaxx>3.0-alpha-31</lib.version.java4all.jaxx>-->
<!--<lib.version.nuiton.topia>3.4.2-SNAPSHOT</lib.version.nuiton.topia>-->
=====================================
server-configuration/src/license/THIRD-PARTY.properties
=====================================
--- a/server-configuration/src/license/THIRD-PARTY.properties
+++ b/server-configuration/src/license/THIRD-PARTY.properties
@@ -3,8 +3,17 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
+# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -16,11 +25,11 @@
# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
-# - The New BSD License
-# - WTFPL
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Aug 17 16:45:41 CEST 2017
+#Fri May 11 14:26:13 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services-client/src/license/THIRD-PARTY.properties
=====================================
--- a/services-client/src/license/THIRD-PARTY.properties
+++ b/services-client/src/license/THIRD-PARTY.properties
@@ -2,9 +2,18 @@
#-------------------------------------------------------------------------------
# Already used licenses in project :
# - Apache 2.0
+# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
@@ -12,12 +21,15 @@
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
+# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Sep 04 00:38:17 CEST 2017
+#Fri May 11 14:26:07 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java deleted
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/data/ImportTripScriptTopiaSqlWork.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package fr.ird.observe.services.local.service.data;
-
-/*-
- * #%L
- * ObServe :: Services local implementation
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import com.google.common.collect.ImmutableSet;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
-import fr.ird.observe.persistence.RunScriptTopiaSqlWork;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.sql.rowset.serial.SerialBlob;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Map;
-
-/**
- * Created on 24/08/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- */
-public class ImportTripScriptTopiaSqlWork extends RunScriptTopiaSqlWork {
-
- /** Logger */
- private static final Log log = LogFactory.getLog(ImportTripScriptTopiaSqlWork.class);
-
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
-
- public ImportTripScriptTopiaSqlWork(int batchSize, boolean showSql, byte[] content, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
- super(batchSize, showSql, content);
- this.blobsContainers = blobsContainers;
- }
-
- @Override
- public void execute(Connection connection) throws SQLException {
- super.execute(connection);
-
- for (ObserveBlobsContainer blobsContainer : blobsContainers) {
-
- String tableName = blobsContainer.getTableName();
- String columnName = blobsContainer.getColumnName();
- int batchSize = 0;
-
- String sql = String.format("update %s SET %s = ? WHERE topiaId= ?", tableName, columnName);
- if (showSql) {
- if (log.isInfoEnabled()) {
- log.info(sql);
- }
- }
- try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
-
- for (Map.Entry<String, byte[]> containerEntry : blobsContainer.getBlobsById().entrySet()) {
-
- String topiaId = containerEntry.getKey();
- byte[] content = containerEntry.getValue();
-
- preparedStatement.clearParameters();
- preparedStatement.setBlob(1, new SerialBlob(content));
- preparedStatement.setString(2, topiaId);
- preparedStatement.addBatch();
-
- batchSize++;
-
- if (batchSize % this.batchSize == 0) {
- flushStatement(preparedStatement);
- }
-
- }
-
-
- flushStatement(preparedStatement);
-
- }
-
- }
-
-
- }
-
-}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
+++ b/services-local/src/main/java/fr/ird/observe/services/local/service/data/TripManagementServiceLocal.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.local.service.data;
* 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>.
@@ -24,7 +24,6 @@ package fr.ird.observe.services.local.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.IdHelper;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
import fr.ird.observe.persistence.ObserveTopiaPersistenceContext;
import fr.ird.observe.services.local.ObserveServiceContextLocal;
import fr.ird.observe.services.local.service.ObserveServiceLocal;
@@ -41,6 +40,8 @@ import fr.ird.observe.services.service.sql.DeleteSqlScriptProducerRequest;
import fr.ird.observe.services.service.sql.SqlScriptProducerService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.util.SqlScriptConsumer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
import org.nuiton.util.StringUtil;
import org.nuiton.version.Version;
@@ -84,7 +85,7 @@ public class TripManagementServiceLocal extends ObserveServiceLocal implements T
.dataIdsToAdd(ImmutableSet.of(tripId));
AddSqlScriptProducerResult producerResult = sqlScriptProducerService.produceAddSqlScript(request);
byte[] tripContent = producerResult.getSqlCode();
- ImmutableSet<ObserveBlobsContainer> blobsContainers = producerResult.getBlobsContainers();
+ ImmutableSet<TopiaBlobsContainer> blobsContainers = producerResult.getBlobsContainers();
long time = System.nanoTime() - t0;
@@ -151,7 +152,7 @@ public class TripManagementServiceLocal extends ObserveServiceLocal implements T
log.info("Start import of trip: " + request.getTripId());
}
- ImmutableSet<ObserveBlobsContainer> blobsContainers = request.getBlobsContainers();
+ ImmutableSet<TopiaBlobsContainer> blobsContainers = request.getBlobsContainers();
if (blobsContainers.isEmpty()) {
@@ -159,8 +160,8 @@ public class TripManagementServiceLocal extends ObserveServiceLocal implements T
} else {
- boolean showSql = serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql();
- persistenceContext.getSqlSupport().doSqlWork(new ImportTripScriptTopiaSqlWork(1000, showSql, request.getSqlContent(), blobsContainers));
+// boolean showSql = serviceContext.getTopiaApplicationContext().getConfiguration().isShowSql();
+ persistenceContext.getSqlSupport().doSqlWork(SqlScriptConsumer.builder(request.getSqlContent()).blobs(blobsContainers).build());
}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
=====================================
--- a/services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
+++ b/services-local/src/main/java/fr/ird/observe/services/local/service/sql/SqlScriptProducerServiceLocal.java
@@ -24,7 +24,7 @@ package fr.ird.observe.services.local.service.sql;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
import fr.ird.observe.dto.reference.ReferentialDtoReference;
import fr.ird.observe.persistence.Entities;
import fr.ird.observe.persistence.ObserveEntityEnum;
@@ -75,7 +75,7 @@ public class SqlScriptProducerServiceLocal extends ObserveServiceLocal implement
}
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- ImmutableSet.Builder<ObserveBlobsContainer> observeBlobContainers = ImmutableSet.builder();
+ ImmutableSet.Builder<TopiaBlobsContainer> observeBlobContainers = ImmutableSet.builder();
try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(out), StandardCharsets.UTF_8)) {
TopiaSqlBatchService sqlBatchService = serviceContext.getTopiaApplicationContext().getSqlBatchService();
@@ -85,7 +85,7 @@ public class SqlScriptProducerServiceLocal extends ObserveServiceLocal implement
SqlResult sqlResult = sqlBatchService.execute(sqlRequests);
ImmutableSet<BlobsContainer> blobsContainers = sqlResult.getBlobsContainers();
for (BlobsContainer blobsContainer : blobsContainers) {
- observeBlobContainers.add(new ObserveBlobsContainer(blobsContainer.getTableName(),
+ observeBlobContainers.add(new TopiaBlobsContainer(blobsContainer.getTableName(),
blobsContainer.getColumnName(),
blobsContainer.getBlobsById()));
}
=====================================
services/pom.xml
=====================================
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -58,6 +58,10 @@
<groupId>fr.ird.observe.toolkit</groupId>
<artifactId>common-service</artifactId>
</dependency>
+ <dependency>
+ <groupId>fr.ird.observe.toolkit</groupId>
+ <artifactId>topia-extension</artifactId>
+ </dependency>
<!-- nuiton dependencies -->
<dependency>
=====================================
services/src/license/THIRD-PARTY.properties
=====================================
--- a/services/src/license/THIRD-PARTY.properties
+++ b/services/src/license/THIRD-PARTY.properties
@@ -1,12 +1,21 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
+# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
-# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
@@ -15,9 +24,12 @@
# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
+# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Sep 07 10:22:53 CEST 2015
+#Fri May 11 14:22:56 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
=====================================
services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
+++ b/services/src/main/java/fr/ird/observe/services/service/data/ExportTripResult.java
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 27/08/16.
@@ -37,12 +37,12 @@ public class ExportTripResult implements ObserveDto {
private final String programId;
private final String tripId;
private final byte[] sqlContent;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
private final long time;
public ExportTripResult(ExportTripRequest request,
byte[] sqlContent,
- ImmutableSet<ObserveBlobsContainer> blobsContainers,
+ ImmutableSet<TopiaBlobsContainer> blobsContainers,
long time) {
this.programId = request.getProgramId();
this.tripId = request.getTripId();
@@ -63,7 +63,7 @@ public class ExportTripResult implements ObserveDto {
return sqlContent;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
=====================================
services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
+++ b/services/src/main/java/fr/ird/observe/services/service/data/ImportTripRequest.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.service.data;
* 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>.
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.data;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 27/08/16.
@@ -37,7 +37,7 @@ public class ImportTripRequest implements ObserveDto {
private final String programId;
private final String tripId;
private final byte[] sqlContent;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
public ImportTripRequest(ExportTripResult exportTripResult) {
this.programId = exportTripResult.getProgramId();
@@ -58,7 +58,7 @@ public class ImportTripRequest implements ObserveDto {
return sqlContent;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
=====================================
services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
+++ b/services/src/main/java/fr/ird/observe/services/service/sql/AddSqlScriptProducerResult.java
@@ -10,12 +10,12 @@ package fr.ird.observe.services.service.sql;
* 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>.
@@ -24,7 +24,7 @@ package fr.ird.observe.services.service.sql;
import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.ObserveDto;
-import fr.ird.observe.dto.db.ObserveBlobsContainer;
+import org.nuiton.topia.persistence.util.TopiaBlobsContainer;
/**
* Created on 24/08/16.
@@ -35,9 +35,9 @@ public class AddSqlScriptProducerResult implements ObserveDto {
private final byte[] sqlCode;
- private final ImmutableSet<ObserveBlobsContainer> blobsContainers;
+ private final ImmutableSet<TopiaBlobsContainer> blobsContainers;
- public AddSqlScriptProducerResult(byte[] sqlCode, ImmutableSet<ObserveBlobsContainer> blobsContainers) {
+ public AddSqlScriptProducerResult(byte[] sqlCode, ImmutableSet<TopiaBlobsContainer> blobsContainers) {
this.sqlCode = sqlCode;
this.blobsContainers = blobsContainers;
}
@@ -46,7 +46,7 @@ public class AddSqlScriptProducerResult implements ObserveDto {
return sqlCode;
}
- public ImmutableSet<ObserveBlobsContainer> getBlobsContainers() {
+ public ImmutableSet<TopiaBlobsContainer> getBlobsContainers() {
return blobsContainers;
}
}
=====================================
test/src/main/resources/log4j.properties
=====================================
--- a/test/src/main/resources/log4j.properties
+++ b/test/src/main/resources/log4j.properties
@@ -26,7 +26,6 @@ log4j.appender.stdout.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %d{ISO8601} [%t] %40C{1} :%4L - %m%n
log4j.logger.fr.ird.observe=INFO
-#log4j.logger.fr.ird.observe.persistence.RunScriptTopiaSqlWork=DEBUG
log4j.logger.org.nuiton.topia=INFO
#log4j.logger.org.nuiton.topia.service.sql=DEBUG
#log4j.logger.fr.ird.observe.client.validators=WARN
=====================================
validation/src/license/THIRD-PARTY.properties
=====================================
--- a/validation/src/license/THIRD-PARTY.properties
+++ b/validation/src/license/THIRD-PARTY.properties
@@ -3,11 +3,19 @@
# Already used licenses in project :
# - Apache 2.0
# - Apache License 2.0
+# - Apache License, version 2.0
# - BSD License
# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Development and Distribution License
+# - Eclipse Distribution License (EDL), Version 1.0
+# - Eclipse Public License (EPL), Version 1.0
# - Eclipse Public License 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License, Version 2 with the Classpath Exception
+# - GNU General Public License, version 2 (GPL2), with the classpath exception
+# - GNU Lesser General Public License, Version 2.1
# - General Public License (GPL)
-# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Indiana University Extreme! Lab Software License, version 1.1.1
# - Lesser General Public License (LGPL)
# - Lesser General Public License (LGPL) v 3.0
# - Lesser General Public License (LPGL)
@@ -16,9 +24,12 @@
# - MPL 1.1
# - New BSD License
# - The Apache Software License, Version 2.0
+# - The MIT License
+# - The PostgreSQL License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Mon Aug 01 17:25:22 CEST 2016
+#Fri May 11 14:23:09 CEST 2018
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b2c87822586a9b71ca9f3081372…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b2c87822586a9b71ca9f3081372…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
e820c75d by Tony CHEMIT at 2018-05-10T10:53:14Z
Fix migration
- - - - -
2 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
@@ -28,8 +28,8 @@ import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
-import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor;
import org.nuiton.topia.service.migration.resources.MigrationVersionResource;
+import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor;
import org.nuiton.version.Versions;
import java.sql.Connection;
@@ -315,75 +315,6 @@ public class DataSourceMigrationForVersion_6_0 extends MigrationVersionResource
executor.writeSql(String.format("UPDATE observe_longline.weightMeasure SET weightMeasureType2 = '%s' WHERE weightMeasureType = '%s';", newId, oldId));
}
}
-
- @Override
- protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
- Boolean withTriggers = topiaSqlSupport.findSingleResult(new TopiaSqlQuery<Boolean>() {
- @Override
- public PreparedStatement prepareQuery(Connection connection) throws SQLException {
- return connection.prepareStatement("select exists(select * from pg_proc where proname = 'sync_activity_the_geom');");
- }
-
- @Override
- public Boolean prepareResult(ResultSet resultSet) throws SQLException {
- return resultSet.getBoolean(1);
- }
- });
-
- if (withTriggers) {
- queries.add("CREATE OR REPLACE function sync_activity_the_geom () returns trigger as '\n" +
- "BEGIN\n" +
- " IF (TG_OP = ''DELETE'') THEN\n" +
- " RETURN OLD;\n" +
- " END IF;\n" +
- " IF (NEW.latitude IS NULL OR NEW.longitude IS NULL) THEN\n" +
- " -- on ne calcule pas le point postgis si au moins une des -- coordonnees n est pas renseignee\n" +
- " RAISE NOTICE ''No latitude or longitude, can not compute postgis field for id % '', NEW.topiaId;\n" +
- " NEW.the_geom := NULL;\n" +
- " return NEW;\n" +
- " END IF;\n" +
- " IF (TG_OP = ''UPDATE'' AND NEW.latitude = OLD.latitude AND NEW.longitude = OLD.longitude)\n" +
- " THEN\n" +
- " -- on ne calcule pas le point postgis si les coordonnées n''ont pas changées\n" +
- " return NEW;\n" +
- " END IF;\n" +
- " RAISE NOTICE ''Will compute the_geom for activite % - latitude % and longitude %'', NEW.topiaId, NEW.latitude, NEW.longitude;\n" +
- " -- affectation du point\n" +
- " NEW.the_geom := ST_SetSRID(ST_MakePoint(NEW.longitude,NEW.latitude), 4326);\n" +
- " RAISE NOTICE ''Computed for activity % latitude % and longitude %, the_geom %'', NEW.topiaId, NEW.latitude, NEW.longitude, NEW.the_geom;\n" +
- "\n" +
- " RETURN NEW;\n" +
- "END\n" +
- "'\n" +
- "LANGUAGE 'plpgsql';\n");
- queries.add("CREATE OR REPLACE function sync_harbour_the_geom () returns trigger as '\n" +
- "BEGIN\n" +
- " IF (TG_OP = ''DELETE'') THEN\n" +
- " RETURN OLD;\n" +
- " END IF;\n" +
- " IF (NEW.latitude IS NULL OR NEW.longitude IS NULL) THEN\n" +
- " -- on ne calcule pas le point postgis si au moins une des -- coordonnees n est pas renseignee\n" +
- " RAISE NOTICE ''No latitude or longitude, can not compute postgis field for id % '', NEW.topiaId;\n" +
- " NEW.the_geom := NULL;\n" +
- " return NEW;\n" +
- " END IF;\n" +
- " IF (TG_OP = ''UPDATE'' AND NEW.latitude = OLD.latitude AND NEW.longitude = OLD.longitude)\n" +
- " THEN\n" +
- " -- on ne calcule pas le point postgis si les coordonnées n''ont pas changées\n" +
- " return NEW;\n" +
- " END IF;\n" +
- " RAISE NOTICE ''Will compute the_geom for harbour % - latitude % and longitude %'', NEW.topiaId, NEW.latitude, NEW.longitude;\n" +
- " -- affectation du point\n" +
- " NEW.the_geom := ST_SetSRID(ST_MakePoint(NEW.longitude,NEW.latitude), 4326);\n" +
- " RAISE NOTICE ''Computed for harbour % latitude % and longitude %, the_geom %'', NEW.topiaId, NEW.latitude, NEW.longitude, NEW.the_geom;\n" +
- " RETURN NEW;\n" +
- "END\n" +
- "'\n" +
- "LANGUAGE 'plpgsql';");
- addScript("00", "fix_trigger", queries);
- }
- super.prepareMigrationScript(topiaSqlSupport, queries, showSql, showProgression);
- }
}
}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java deleted
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package fr.ird.observe.persistence.migration;
-
-/*-
- * #%L
- * ObServe :: Persistence
- * %%
- * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
- * %%
- * 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%
- */
-
-import org.nuiton.topia.persistence.support.TopiaSqlSupport;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-/**
- * Created on 27/10/16.
- *
- * @author Tony Chemit - dev(a)tchemit.fr
- * @since 6.0
- */
-@MigrationVersion(version = "6.1")
-public class DataSourceMigrationForVersion_7_0_RC_4 extends AbstractObserveMigrationCallBack {
-
- DataSourceMigrationForVersion_7_0_RC_4(AbstractDataSourceMigration callBack, String scriptSuffix) {
- super(DataSourceMigrationForVersion_7_0_RC_4.class, callBack, scriptSuffix);
- }
-
- @Override
- protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
-
- addScript("01", "add_object_operation", queries);
- addScript("02", "add_object_material", queries);
- addScript("03", "add_floating_object_part", queries);
- addScript("04", "remove_dcp_fields", queries);
-
- Map<String, String> speciesGroupIdMapping = new TreeMap<>();
- speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1445863056144#0.9820877553253712", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1445863056144#0.9820877553253712', 1, '2015-10-26 16:37:36.144000000', '2016-12-06 15:54:27.727005000', '11', null, false, 1, 'Rays', 'Raies', 'Rayas', null, null, null, null, null);");
- speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.24333033683679461", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.24333033683679461', 14, '2009-04-15 00:00:00.003000000', '2016-12-06 15:54:27.727005000', '4', null, false, 1, 'Turtles', 'Tortues', 'Tortugas', null, null, null, null, null);");
- speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1446014286433#0.6480183366605247", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1446014286433#0.6480183366605247', 1, '2015-10-28 10:38:06.432000000', '2016-12-06 15:54:27.727005000', '12', null, false, 1, 'Whale shark', 'Requin-baleine', 'Tiburón ballena', null, null, null, null, null);");
- speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683689#0.7120116158620075", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683689#0.7120116158620075', 17, '2009-04-15 00:00:00.001000000', '2017-02-28 15:04:55.370000000', '2', null, false, 1, 'Sharks', 'Requins', 'Tiburones', null, null, null, null, null);");
-
- Set<String> existingSpeciesGroupIds = getTopiaIds(topiaSqlSupport, "OBSERVE_COMMON.SPECIESGROUP");
- for (Map.Entry<String, String> entry : speciesGroupIdMapping.entrySet()) {
- if (!existingSpeciesGroupIds.contains(entry.getKey())) {
- queries.add(entry.getValue());
- }
- }
- addScript("05", "add_species_group_release_mode", queries);
- addScript("06", "add_non_target_catch_release", queries);
- addScript("07", "drop_table_sizemeasuretype", queries);
- addScript("08", "add_floating_object_fields", queries);
- addScript("09", "fill_object_material", queries);
-
- }
-
- public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_4 {
-
- public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
- super(callBack, H2DataSourceMigration.TYPE);
- }
-
- }
-
- public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_4 {
-
- public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
- super(callBack, PGDataSourceMigration.TYPE);
- }
-
- }
-
-}
-
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/e820c75d813ec854d539cacff1c…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/e820c75d813ec854d539cacff1c…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT deleted branch release/7.0-RC-13 at ultreiaio / ird-observe
--
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed new tag todo at ultreiaio / ird-observe
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/tree/todo
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed new tag v7.0-RC-13 at ultreiaio / ird-observe
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/tree/v7.0-RC-13
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][release/7.0-RC-13] [jgitflow-maven-plugin]updating poms for branch'release/7.0-RC-13' with…
by Tony CHEMIT 08 May '18
by Tony CHEMIT 08 May '18
08 May '18
Tony CHEMIT pushed to branch release/7.0-RC-13 at ultreiaio / ird-observe
Commits:
7e0ce9c0 by Tony CHEMIT at 2018-05-08T21:41:43Z
[jgitflow-maven-plugin]updating poms for branch'release/7.0-RC-13' with non-snapshot versions[skip ci]
- - - - -
13 changed files:
- client-configuration/pom.xml
- client/pom.xml
- dto/pom.xml
- observe/pom.xml
- persistence/pom.xml
- pom.xml
- server-configuration/pom.xml
- server/pom.xml
- services-client/pom.xml
- services-local/pom.xml
- services/pom.xml
- test/pom.xml
- validation/pom.xml
Changes:
=====================================
client-configuration/pom.xml
=====================================
--- a/client-configuration/pom.xml
+++ b/client-configuration/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>client-configuration</artifactId>
=====================================
client/pom.xml
=====================================
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>client</artifactId>
=====================================
dto/pom.xml
=====================================
--- a/dto/pom.xml
+++ b/dto/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>dto</artifactId>
=====================================
observe/pom.xml
=====================================
--- a/observe/pom.xml
+++ b/observe/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>observe</artifactId>
=====================================
persistence/pom.xml
=====================================
--- a/persistence/pom.xml
+++ b/persistence/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>persistence</artifactId>
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
<packaging>pom</packaging>
<name>ObServe :: Pom</name>
=====================================
server-configuration/pom.xml
=====================================
--- a/server-configuration/pom.xml
+++ b/server-configuration/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>server-configuration</artifactId>
=====================================
server/pom.xml
=====================================
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>server</artifactId>
=====================================
services-client/pom.xml
=====================================
--- a/services-client/pom.xml
+++ b/services-client/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>services-client</artifactId>
=====================================
services-local/pom.xml
=====================================
--- a/services-local/pom.xml
+++ b/services-local/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>services-local</artifactId>
=====================================
services/pom.xml
=====================================
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>services</artifactId>
=====================================
test/pom.xml
=====================================
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>test</artifactId>
=====================================
validation/pom.xml
=====================================
--- a/validation/pom.xml
+++ b/validation/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
- <version>7.0-RC-13-SNAPSHOT</version>
+ <version>7.0-RC-13</version>
</parent>
<artifactId>validation</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7e0ce9c02404c0323fd47beb7ca…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7e0ce9c02404c0323fd47beb7ca…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][master] 10 commits: [jgitflow-maven-plugin]updating poms for 7.0-RC-13-SNAPSHOT development[skip ci]
by Tony CHEMIT 08 May '18
by Tony CHEMIT 08 May '18
08 May '18
Tony CHEMIT pushed to branch master at ultreiaio / ird-observe
Commits:
3dca5446 by Tony CHEMIT at 2018-05-04T09:20:16Z
[jgitflow-maven-plugin]updating poms for 7.0-RC-13-SNAPSHOT development[skip ci]
- - - - -
d46d0433 by Tony CHEMIT at 2018-05-04T09:30:02Z
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci]
- - - - -
44a8d905 by Tony CHEMIT at 2018-05-04T09:30:02Z
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
aff86b4d by Tony CHEMIT at 2018-05-04T09:30:03Z
[jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci]
- - - - -
389010fb by Tony CHEMIT at 2018-05-04T09:40:36Z
update changelog after release 7.0-RC-12 [skip ci]
- - - - -
be4985c5 by Tony CHEMIT at 2018-05-04T16:00:24Z
Fix migration - Closes #945
- - - - -
667850b2 by Tony CHEMIT at 2018-05-06T14:48:26Z
Migration RC12c -> OutOfMemory : Java Heap Space (Closes #947)
- - - - -
d9cd7d7e by Tony CHEMIT at 2018-05-08T21:28:00Z
Improve FOB Form (when creating) - See #948)
- - - - -
7e0ce9c0 by Tony CHEMIT at 2018-05-08T21:41:43Z
[jgitflow-maven-plugin]updating poms for branch'release/7.0-RC-13' with non-snapshot versions[skip ci]
- - - - -
d10e76f5 by Tony CHEMIT at 2018-05-08T22:15:12Z
merge release
- - - - -
30 changed files:
- CHANGELOG.md
- client-configuration/pom.xml
- client-configuration/src/main/resources/log4j.properties
- client-configuration/src/main/resources/observe-log4j.properties
- client/pom.xml
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIModel.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeNode.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/dcp/FloatingObjectPartsTreeTableModel.java
- dto/pom.xml
- observe/pom.xml
- persistence/pom.xml
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaApplicationContext.java
- persistence/src/main/java/fr/ird/observe/persistence/ObserveTopiaConfigurationFactory.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/AbstractDataSourceMigration.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/AbstractObserveMigrationCallBack.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_5_0.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_1.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_6.java → persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_2.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_1.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/H2DataSourceMigration.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/MigrationVersion.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveMigrationCallBackForVersionResolver.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveMigrationConfigurationProvider.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveMigrationEngine.java → persistence/src/main/java/fr/ird/observe/persistence/migration/ObserveTopiaMigrationServiceAskUserToMigrate.java
- − persistence/src/main/java/fr/ird/observe/persistence/migration/PGDataSourceMigration.java
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/414916806da3222e2d102b3ef5…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/414916806da3222e2d102b3ef5…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 6 commits: Fix migration - Closes #945
by Tony CHEMIT 08 May '18
by Tony CHEMIT 08 May '18
08 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
41491680 by Tony CHEMIT at 2018-05-04T16:01:00Z
Fix migration - Closes #945
- - - - -
7e0ce9c0 by Tony CHEMIT at 2018-05-08T21:41:43Z
[jgitflow-maven-plugin]updating poms for branch'release/7.0-RC-13' with non-snapshot versions[skip ci]
- - - - -
d10e76f5 by Tony CHEMIT at 2018-05-08T22:15:12Z
merge release
- - - - -
89ef1058 by Tony CHEMIT at 2018-05-08T22:15:36Z
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci]
- - - - -
b6b9bc62 by Tony CHEMIT at 2018-05-08T22:15:36Z
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
cc085c2d by Tony CHEMIT at 2018-05-08T22:15:37Z
[jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci]
- - - - -
2 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_6_0.java
@@ -316,6 +316,74 @@ public class DataSourceMigrationForVersion_6_0 extends MigrationVersionResource
}
}
+ @Override
+ protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
+ Boolean withTriggers = topiaSqlSupport.findSingleResult(new TopiaSqlQuery<Boolean>() {
+ @Override
+ public PreparedStatement prepareQuery(Connection connection) throws SQLException {
+ return connection.prepareStatement("select exists(select * from pg_proc where proname = 'sync_activity_the_geom');");
+ }
+
+ @Override
+ public Boolean prepareResult(ResultSet resultSet) throws SQLException {
+ return resultSet.getBoolean(1);
+ }
+ });
+
+ if (withTriggers) {
+ queries.add("CREATE OR REPLACE function sync_activity_the_geom () returns trigger as '\n" +
+ "BEGIN\n" +
+ " IF (TG_OP = ''DELETE'') THEN\n" +
+ " RETURN OLD;\n" +
+ " END IF;\n" +
+ " IF (NEW.latitude IS NULL OR NEW.longitude IS NULL) THEN\n" +
+ " -- on ne calcule pas le point postgis si au moins une des -- coordonnees n est pas renseignee\n" +
+ " RAISE NOTICE ''No latitude or longitude, can not compute postgis field for id % '', NEW.topiaId;\n" +
+ " NEW.the_geom := NULL;\n" +
+ " return NEW;\n" +
+ " END IF;\n" +
+ " IF (TG_OP = ''UPDATE'' AND NEW.latitude = OLD.latitude AND NEW.longitude = OLD.longitude)\n" +
+ " THEN\n" +
+ " -- on ne calcule pas le point postgis si les coordonnées n''ont pas changées\n" +
+ " return NEW;\n" +
+ " END IF;\n" +
+ " RAISE NOTICE ''Will compute the_geom for activite % - latitude % and longitude %'', NEW.topiaId, NEW.latitude, NEW.longitude;\n" +
+ " -- affectation du point\n" +
+ " NEW.the_geom := ST_SetSRID(ST_MakePoint(NEW.longitude,NEW.latitude), 4326);\n" +
+ " RAISE NOTICE ''Computed for activity % latitude % and longitude %, the_geom %'', NEW.topiaId, NEW.latitude, NEW.longitude, NEW.the_geom;\n" +
+ "\n" +
+ " RETURN NEW;\n" +
+ "END\n" +
+ "'\n" +
+ "LANGUAGE 'plpgsql';\n");
+ queries.add("CREATE OR REPLACE function sync_harbour_the_geom () returns trigger as '\n" +
+ "BEGIN\n" +
+ " IF (TG_OP = ''DELETE'') THEN\n" +
+ " RETURN OLD;\n" +
+ " END IF;\n" +
+ " IF (NEW.latitude IS NULL OR NEW.longitude IS NULL) THEN\n" +
+ " -- on ne calcule pas le point postgis si au moins une des -- coordonnees n est pas renseignee\n" +
+ " RAISE NOTICE ''No latitude or longitude, can not compute postgis field for id % '', NEW.topiaId;\n" +
+ " NEW.the_geom := NULL;\n" +
+ " return NEW;\n" +
+ " END IF;\n" +
+ " IF (TG_OP = ''UPDATE'' AND NEW.latitude = OLD.latitude AND NEW.longitude = OLD.longitude)\n" +
+ " THEN\n" +
+ " -- on ne calcule pas le point postgis si les coordonnées n''ont pas changées\n" +
+ " return NEW;\n" +
+ " END IF;\n" +
+ " RAISE NOTICE ''Will compute the_geom for harbour % - latitude % and longitude %'', NEW.topiaId, NEW.latitude, NEW.longitude;\n" +
+ " -- affectation du point\n" +
+ " NEW.the_geom := ST_SetSRID(ST_MakePoint(NEW.longitude,NEW.latitude), 4326);\n" +
+ " RAISE NOTICE ''Computed for harbour % latitude % and longitude %, the_geom %'', NEW.topiaId, NEW.latitude, NEW.longitude, NEW.the_geom;\n" +
+ " RETURN NEW;\n" +
+ "END\n" +
+ "'\n" +
+ "LANGUAGE 'plpgsql';");
+ addScript("00", "fix_trigger", queries);
+ }
+ super.prepareMigrationScript(topiaSqlSupport, queries, showSql, showProgression);
+ }
}
}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_0_RC_4.java
@@ -0,0 +1,90 @@
+package fr.ird.observe.persistence.migration;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * 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%
+ */
+
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Created on 27/10/16.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 6.0
+ */
+@MigrationVersion(version = "6.1")
+public class DataSourceMigrationForVersion_7_0_RC_4 extends AbstractObserveMigrationCallBack {
+
+ DataSourceMigrationForVersion_7_0_RC_4(AbstractDataSourceMigration callBack, String scriptSuffix) {
+ super(DataSourceMigrationForVersion_7_0_RC_4.class, callBack, scriptSuffix);
+ }
+
+ @Override
+ protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
+
+ addScript("01", "add_object_operation", queries);
+ addScript("02", "add_object_material", queries);
+ addScript("03", "add_floating_object_part", queries);
+ addScript("04", "remove_dcp_fields", queries);
+
+ Map<String, String> speciesGroupIdMapping = new TreeMap<>();
+ speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1445863056144#0.9820877553253712", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1445863056144#0.9820877553253712', 1, '2015-10-26 16:37:36.144000000', '2016-12-06 15:54:27.727005000', '11', null, false, 1, 'Rays', 'Raies', 'Rayas', null, null, null, null, null);");
+ speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.24333033683679461", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.24333033683679461', 14, '2009-04-15 00:00:00.003000000', '2016-12-06 15:54:27.727005000', '4', null, false, 1, 'Turtles', 'Tortues', 'Tortugas', null, null, null, null, null);");
+ speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1446014286433#0.6480183366605247", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1446014286433#0.6480183366605247', 1, '2015-10-28 10:38:06.432000000', '2016-12-06 15:54:27.727005000', '12', null, false, 1, 'Whale shark', 'Requin-baleine', 'Tiburón ballena', null, null, null, null, null);");
+ speciesGroupIdMapping.put("fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683689#0.7120116158620075", "INSERT INTO OBSERVE_COMMON.SPECIESGROUP (TOPIAID, TOPIAVERSION, TOPIACREATEDATE, LASTUPDATEDATE, CODE, URI, NEEDCOMMENT, STATUS, LABEL1, LABEL2, LABEL3, LABEL4, LABEL5, LABEL6, LABEL7, LABEL8) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683689#0.7120116158620075', 17, '2009-04-15 00:00:00.001000000', '2017-02-28 15:04:55.370000000', '2', null, false, 1, 'Sharks', 'Requins', 'Tiburones', null, null, null, null, null);");
+
+ Set<String> existingSpeciesGroupIds = getTopiaIds(topiaSqlSupport, "OBSERVE_COMMON.SPECIESGROUP");
+ for (Map.Entry<String, String> entry : speciesGroupIdMapping.entrySet()) {
+ if (!existingSpeciesGroupIds.contains(entry.getKey())) {
+ queries.add(entry.getValue());
+ }
+ }
+ addScript("05", "add_species_group_release_mode", queries);
+ addScript("06", "add_non_target_catch_release", queries);
+ addScript("07", "drop_table_sizemeasuretype", queries);
+ addScript("08", "add_floating_object_fields", queries);
+ addScript("09", "fill_object_material", queries);
+
+ }
+
+ public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_4 {
+
+ public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
+ super(callBack, H2DataSourceMigration.TYPE);
+ }
+
+ }
+
+ public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_0_RC_4 {
+
+ public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
+ super(callBack, PGDataSourceMigration.TYPE);
+ }
+
+ }
+
+}
+
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/d12ed2993778345bf960c8145a…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/d12ed2993778345bf960c8145a…
You're receiving this email because of your account on gitlab.com.
1
0