This is an automated email from the git hooks/post-receive script. New commit to branch struts2.5 in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit ad6b043206c3ca865c021d7ebd99cd737dacad4f Author: jcouteau <couteau@codelutin.com> Date: Tue Apr 30 14:56:26 2019 +0200 fixes #8748 - Erreur à l'import des données d'opération (bis) fixes #10287 - Pas de size category dans le fichier d'import des echotypes --- .../WorkingDbMigrationCallBackForVersion3_914.java | 47 +++++++++++++++++++++ .../workingDb/3.914-1-importlog-importtext.sql | 1 + .../workingDb/h2/3.914-1-importlog-importtext.sql | 1 + .../workingDb/pg/3.914-1-importlog-importtext.sql | 1 + echobase-domain/src/main/xmi/echobase.properties | 3 +- echobase-domain/src/main/xmi/echobase.zargo | Bin 100538 -> 100709 bytes .../services/service/UserDbPersistenceService.java | 6 +++ .../importdata/csv/ResultsEchotypeImportRow.java | 9 ++++ ...yageResultsVoyageEchotypeImportExportModel.java | 2 + 9 files changed, 69 insertions(+), 1 deletion(-) diff --git a/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/WorkingDbMigrationCallBackForVersion3_914.java b/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/WorkingDbMigrationCallBackForVersion3_914.java new file mode 100644 index 00000000..18698371 --- /dev/null +++ b/echobase-domain/src/main/java/fr/ifremer/echobase/persistence/migration/workingDb/WorkingDbMigrationCallBackForVersion3_914.java @@ -0,0 +1,47 @@ +package fr.ifremer.echobase.persistence.migration.workingDb; + +/*- + * #%L + * EchoBase :: Domain + * %% + * Copyright (C) 2011 - 2018 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import org.nuiton.topia.persistence.TopiaException; +import org.nuiton.topia.persistence.support.TopiaSqlSupport; +import org.nuiton.version.Version; +import org.nuiton.version.Versions; + +import java.util.List; + +public class WorkingDbMigrationCallBackForVersion3_914 extends WorkingDbMigrationCallBackForVersionSupport { + + @Override + public Version getVersion() { + return Versions.valueOf("3.914"); + } + + @Override + protected void prepareMigrationScript(TopiaSqlSupport sqlSupport, + List<String> queries, + boolean showSql, + boolean showProgression) throws TopiaException { + + addSpecificScript("3.914-1-importlog-importtext.sql", queries); + } + +} diff --git a/echobase-domain/src/main/resources/migration/workingDb/3.914-1-importlog-importtext.sql b/echobase-domain/src/main/resources/migration/workingDb/3.914-1-importlog-importtext.sql new file mode 100644 index 00000000..97f6bf20 --- /dev/null +++ b/echobase-domain/src/main/resources/migration/workingDb/3.914-1-importlog-importtext.sql @@ -0,0 +1 @@ +alter table importlog alter column importtext VARCHAR(2147483647); \ No newline at end of file diff --git a/echobase-domain/src/main/resources/migration/workingDb/h2/3.914-1-importlog-importtext.sql b/echobase-domain/src/main/resources/migration/workingDb/h2/3.914-1-importlog-importtext.sql new file mode 100644 index 00000000..97f6bf20 --- /dev/null +++ b/echobase-domain/src/main/resources/migration/workingDb/h2/3.914-1-importlog-importtext.sql @@ -0,0 +1 @@ +alter table importlog alter column importtext VARCHAR(2147483647); \ No newline at end of file diff --git a/echobase-domain/src/main/resources/migration/workingDb/pg/3.914-1-importlog-importtext.sql b/echobase-domain/src/main/resources/migration/workingDb/pg/3.914-1-importlog-importtext.sql new file mode 100644 index 00000000..97f6bf20 --- /dev/null +++ b/echobase-domain/src/main/resources/migration/workingDb/pg/3.914-1-importlog-importtext.sql @@ -0,0 +1 @@ +alter table importlog alter column importtext VARCHAR(2147483647); \ No newline at end of file diff --git a/echobase-domain/src/main/xmi/echobase.properties b/echobase-domain/src/main/xmi/echobase.properties index 8b737e71..bc827666 100644 --- a/echobase-domain/src/main/xmi/echobase.properties +++ b/echobase-domain/src/main/xmi/echobase.properties @@ -23,7 +23,7 @@ model.tagValue.notGenerateToString=true model.tagValue.generateOperatorForDAOHelper=true -model.tagValue.version=3.913 +model.tagValue.version=3.914 model.tagValue.generatePropertyChangeSupport=false model.tagValue.generateBooleanGetMethods=false model.tagValue.indexForeignKeys=true @@ -54,6 +54,7 @@ fr.ifremer.echobase.entities.data.Voyage.attribute.echotype.stereotype=unique fr.ifremer.echobase.entities.EntityModificationLog.attribute.modificationText.tagValue.hibernateAttributeType=text fr.ifremer.echobase.entities.ImportFile.attribute.importText.tagValue.hibernateAttributeType=text +fr.ifremer.echobase.entities.ImportLog.attribute.importText.tagValue.hibernateAttributeType=text ############################################################################### ### Not null for transverse ################################################### diff --git a/echobase-domain/src/main/xmi/echobase.zargo b/echobase-domain/src/main/xmi/echobase.zargo index c9fa90dd..c41ee24f 100644 Binary files a/echobase-domain/src/main/xmi/echobase.zargo and b/echobase-domain/src/main/xmi/echobase.zargo differ diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java index bb4c11d7..bd52775b 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java @@ -1040,6 +1040,12 @@ public class UserDbPersistenceService extends EchoBaseServiceSupport { ); } + public SizeCategory getSizeCategory(String name) { + return persistenceContext.getSizeCategoryDao().forProperties( + SizeCategory.PROPERTY_NAME, name + ).findAnyOrNull(); + } + //------------------------------------------------------------------------// //--- Transect -----------------------------------------------------------// //------------------------------------------------------------------------// diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/ResultsEchotypeImportRow.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/ResultsEchotypeImportRow.java index ec88750a..80d0e7ae 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/ResultsEchotypeImportRow.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/ResultsEchotypeImportRow.java @@ -38,6 +38,7 @@ public abstract class ResultsEchotypeImportRow<E extends TopiaEntity> implements private static final long serialVersionUID = 1L; public static final String PROPERTY_MEANING = Echotype.PROPERTY_MEANING; + public static final String PROPERTY_ID = Echotype.PROPERTY_ID; public static final String HEADER_ECHOTYPE_NAME = "echotypeName"; protected static final String HEADER_SPECIES = "baracoudaCode"; @@ -87,4 +88,12 @@ public abstract class ResultsEchotypeImportRow<E extends TopiaEntity> implements public void setDepthStratum(DepthStratum depthStratum) { echotype.setDepthStratum(depthStratum); } + + public int getId() { + return echotype.getId(); + } + + public void setId(int id) { + echotype.setId(id); + } } diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/VoyageResultsVoyageEchotypeImportExportModel.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/VoyageResultsVoyageEchotypeImportExportModel.java index dfde0c40..8ec3d242 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/VoyageResultsVoyageEchotypeImportExportModel.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/importdata/csv/VoyageResultsVoyageEchotypeImportExportModel.java @@ -46,6 +46,7 @@ public class VoyageResultsVoyageEchotypeImportExportModel extends EchoBaseImport VoyageResultsVoyageEchotypeImportExportModel model = new VoyageResultsVoyageEchotypeImportExportModel(importDataContext.getCsvSeparator()); model.newMandatoryColumn(HEADER_ECHOTYPE_NAME, Echotype.PROPERTY_NAME); model.newMandatoryColumn(VoyageResultsVoyageEchotypeImportRow.PROPERTY_MEANING, Echotype.PROPERTY_MEANING); + model.newMandatoryColumn(VoyageResultsVoyageEchotypeImportRow.PROPERTY_ID, Echotype.PROPERTY_ID); model.newForeignKeyColumn(VoyageResultsVoyageEchotypeImportRow.PROPERTY_VOYAGE, Voyage.class, Voyage.PROPERTY_NAME, importDataContext.getVoyagesByName()); model.newForeignKeyColumn(EchoBaseCsvUtil.DEPTH_STRATUM_ID, Echotype.PROPERTY_DEPTH_STRATUM, DepthStratum.class, DepthStratum.PROPERTY_ID, importDataContext.getDepthStratumsById()); model.newForeignKeyColumn(HEADER_SPECIES, Echotype.PROPERTY_SPECIES, Species.class, Species.PROPERTY_BARACOUDA_CODE, importDataContext.getSpeciesByBaracoudaCode()); @@ -58,6 +59,7 @@ public class VoyageResultsVoyageEchotypeImportExportModel extends EchoBaseImport VoyageResultsVoyageEchotypeImportExportModel model = new VoyageResultsVoyageEchotypeImportExportModel(importDataContext.getCsvSeparator()); model.newColumnForExport(HEADER_ECHOTYPE_NAME, Echotype.PROPERTY_NAME); model.newColumnForExport(VoyageResultsVoyageEchotypeImportRow.PROPERTY_MEANING, Echotype.PROPERTY_MEANING); + model.newColumnForExport(VoyageResultsVoyageEchotypeImportRow.PROPERTY_ID, Echotype.PROPERTY_ID); model.newColumnForExport(VoyageResultsVoyageEchotypeImportRow.PROPERTY_VOYAGE, EchoBaseCsvUtil.VOYAGE_FORMATTER); model.newColumnForExport(EchoBaseCsvUtil.DEPTH_STRATUM_ID, Echotype.PROPERTY_DEPTH_STRATUM, EchoBaseCsvUtil.DEPTH_STRATUM_FORMATTER); model.newColumnForExport(HEADER_SPECIES, Echotype.PROPERTY_SPECIES, EchoBaseCsvUtil.SPECIES_FORMATTER); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.