branch develop-4.x updated (e851d74 -> 714fbd6)
This is an automated email from the git hooks/post-receive script. New change to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git discards e851d74 Des clics multiples sur "Charger la source de données/Utiliser" provoquent une exception (termine #7673) Merge branch 'feature/7673' into develop-4.x discards 2d37aac Cacher la barre d'actions une fois l'action d'ouverture de base lancée (See #7673) discards 10da863 Ajout de la migration pour supprimer le champs datearriveeport (termine #7542) discards 2f2a795 Ajout d'un log pour voir le nombre de données trouvées pour chaque variable d'un rapport (See #7671) discards e7a4526 Plantage des calculs taille/poids lorsque des paramètres de conversion existent pour plusieurs sexes (termine #7628) Merge branch 'feature/7628' into develop-4.x discards de79835 Ajout d'un test pour vérifier la bonne récupération des RTP (See #7673) new 80523ed Ajout d'un test pour vérifier la bonne récupération des RTP (See #7628) new 51908ea Ajout d'un log pour voir le nombre de données trouvées pour chaque variable d'un rapport (See #7671) new 99af45f Ajout de la migration pour supprimer le champs datearriveeport (termine #7542) new 714fbd6 Cacher la barre d'actions une fois l'action d'ouverture de base lancée (See #7673) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (e851d74) \ N -- N -- N refs/heads/develop-4.x (714fbd6) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 714fbd60cee7b14616c1d1fbe5ba8d369668aecd Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 17:52:24 2015 +0100 Cacher la barre d'actions une fois l'action d'ouverture de base lancée (See #7673) commit 99af45ff9ad29b3535615447f43b6dac5d6acfc5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 17:25:20 2015 +0100 Ajout de la migration pour supprimer le champs datearriveeport (termine #7542) commit 51908eab6fb1b9dd856569dc136dd3738c2eb52d Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 15:39:15 2015 +0100 Ajout d'un log pour voir le nombre de données trouvées pour chaque variable d'un rapport (See #7671) commit 80523ed4d0e10724ee918130c18d405308e742b7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 14:38:20 2015 +0100 Ajout d'un test pour vérifier la bonne récupération des RTP (See #7628) Summary of changes: -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 80523ed4d0e10724ee918130c18d405308e742b7 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 14:38:20 2015 +0100 Ajout d'un test pour vérifier la bonne récupération des RTP (See #7628) --- .../LengthWeightParemeterHelperTest.java | 294 +++++++++++++++++++++ 1 file changed, 294 insertions(+) diff --git a/observe-business/src/test/java/fr/ird/observe/entities/referentiel/LengthWeightParemeterHelperTest.java b/observe-business/src/test/java/fr/ird/observe/entities/referentiel/LengthWeightParemeterHelperTest.java new file mode 100644 index 0000000..4cba24f --- /dev/null +++ b/observe-business/src/test/java/fr/ird/observe/entities/referentiel/LengthWeightParemeterHelperTest.java @@ -0,0 +1,294 @@ +/* + * #%L + * ObServe :: Entities + * %% + * Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package fr.ird.observe.entities.referentiel; + +import fr.ird.observe.DataService; +import fr.ird.observe.IObserveConfig; +import fr.ird.observe.ObserveServiceHelper; +import fr.ird.observe.db.DBTestHelper; +import fr.ird.observe.db.DataSource; +import fr.ird.observe.db.DataSourceException; +import fr.ird.observe.entities.constants.ReferenceStatus; +import fr.ird.observe.test.TestHelper; +import fr.ird.observe.util.Scripts; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.nuiton.topia.TopiaContext; +import org.nuiton.util.DateUtil; + +import java.io.File; +import java.net.URL; +import java.util.Date; + +/** + * Test de la classe {@link LengthWeightParemeterHelper}. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 1.8 + */ +public class LengthWeightParemeterHelperTest { + + /** Logger */ + private static final Log log = LogFactory.getLog(LengthWeightParemeterHelperTest.class); + + + /** La base de test chargée à partir du la sauvegarde. */ + private static DataSource dataSource; + + private DataService dataService; + + @BeforeClass + public static void init() throws Exception { + + TestHelper.initTest(LengthWeightParemeterHelperTest.class); + + TestHelper.createApplicationContext(); + + TestHelper.setConfig(IObserveConfig.DB_VERSION, Scripts.V_LAST.toString()); + + File localDB = TestHelper.newLocalDB(TestHelper.class.getSimpleName()); + + String dbPath = Scripts.getBackupScript(Scripts.V_LAST, "referentiel"); + + URL dbUrl = LengthWeightParemeterHelperTest.class.getResource(dbPath); + + Assert.assertNotNull("could not find resource : " + dbPath, dbUrl); + + dataSource = DBTestHelper.createAndOpenFromDump( + localDB, + dbUrl, + false, + false, + true, + true, + true); + + DataService dataService = ObserveServiceHelper.get().getDataService(); + dataService.registerDataSource(dataSource); + + TopiaContext tx = dataService.beginTransaction(dataSource, "testGetCorrectLengthWeightParameter"); + + try { + + SpeciesDAO speciesDAO = (SpeciesDAO) dataSource.getDAO(tx, Species.class); + OceanDAO oceanDAO = (OceanDAO) dataSource.getDAO(tx, Ocean.class); + SexDAO sexDao = (SexDAO) dataSource.getDAO(tx, Sex.class); + + Species species = speciesDAO.findByFaoCode("DOL"); + Assert.assertNotNull("Could not find species with faoCode: DOL", species); + + Sex undeterminedSex = sexDao.findByCode("0"); + Assert.assertNotNull("Could not find sex with code 0 (Undetermined)", undeterminedSex); + + Sex maleSex = sexDao.findByCode("1"); + Assert.assertNotNull("Could not find sex with code 1 (male)", maleSex); + + Sex femaleSex = sexDao.findByCode("2"); + Assert.assertNotNull("Could not find sex with code 2 (female)", femaleSex); + + Date firstStartDate = DateUtil.createDate(1, 1, 2010); + Date firstEndDate = DateUtil.createDate(31, 12, 2010); + Date secondStartDate = DateUtil.createDate(1, 1, 2011); + + Ocean atlanticOcean = oceanDAO.findByCode("1"); + Assert.assertNotNull("Could not find ocean with code 1 (Atlantic)", atlanticOcean); + + Ocean indianOcean = oceanDAO.findByCode("2"); + Assert.assertNotNull("Could not find ocean with code 2 (Indian)", indianOcean); + + LengthWeightParameterDAO lengthWeightParameterDao = (LengthWeightParameterDAO) dataSource.getDAO(tx, LengthWeightParameter.class); + + // Ajout parametrage Male / Atlantique (2010) + createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, firstStartDate, firstEndDate); + // Ajout parametrage Male / Atlantique (après 2010) + createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, secondStartDate, null); + // Ajout parametrage Male / Indien (2010) + createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, firstStartDate, firstEndDate); + // Ajout parametrage Male / Indien (Après 2010) + createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, secondStartDate, null); + + tx.commitTransaction(); + + + } finally { + + tx.closeContext(); + + } + + } + + protected static void createLengthWeightParameter(LengthWeightParameterDAO lengthWeightParameterDao, + Species species, + Ocean ocean, + Sex sex, + Date startDate, + Date endDate) { + + LengthWeightParameter entity = lengthWeightParameterDao.newInstance(); + + entity.setSpecies(species); + entity.setSex(sex); + entity.setOcean(ocean); + entity.setStartDate(startDate); + entity.setEndDate(endDate); + entity.setStatus(ReferenceStatus.enabled); + entity.setCoefficients("a=3.8E-5:b=2.78"); + entity.setLengthWeightFormula("a * Math.pow(L, b)"); + entity.setWeightLengthFormula("Math.pow(P/a, 1/b)"); + lengthWeightParameterDao.create(entity); + + + } + + @Before + public void setUp() throws Exception { + + dataService = ObserveServiceHelper.get().getDataService(); + + } + + @After + public final void tearDown() throws Exception { + + try { + dataSource.doClose(false); + } finally { + + ObserveServiceHelper.get().close(); + ObserveServiceHelper.close(); + + } + + } + + /** + * Pour tester que l'on récupère la bonne relation. + * See http://forge.codelutin.com/issues/7628 + */ + @Test + public void testGetCorrectLengthWeightParameter() throws DataSourceException { + + + TopiaContext tx = dataService.beginTransaction(dataSource, "testGetCorrectLengthWeightParameter"); + + try { + + SpeciesDAO speciesDAO = (SpeciesDAO) dataSource.getDAO(tx, Species.class); + OceanDAO oceanDAO = (OceanDAO) dataSource.getDAO(tx, Ocean.class); + SexDAO sexDao = (SexDAO) dataSource.getDAO(tx, Sex.class); + + Species species = speciesDAO.findByFaoCode("DOL"); + Assert.assertNotNull("Could not find species with faoCode: DOL", species); + + Sex undeterminedSex = sexDao.findByCode("0"); + Assert.assertNotNull("Could not find sex with code 0 (Undetermined)", undeterminedSex); + + Sex maleSex = sexDao.findByCode("1"); + Assert.assertNotNull("Could not find sex with code 1 (male)", maleSex); + + Sex femaleSex = sexDao.findByCode("2"); + Assert.assertNotNull("Could not find sex with code 2 (female)", femaleSex); + + Date date1970 = DateUtil.createDate(1, 1, 1970); + Date date2009 = DateUtil.createDate(1, 1, 2009); + Date date2010 = DateUtil.createDate(1, 1, 2010); + Date date2011 = DateUtil.createDate(1, 1, 2011); + + Ocean atlanticOcean = oceanDAO.findByCode("1"); + Assert.assertNotNull("Could not find ocean with code 1 (Atlantic)", atlanticOcean); + + Ocean indianOcean = oceanDAO.findByCode("2"); + Assert.assertNotNull("Could not find ocean with code 2 (Indian)", indianOcean); + + Ocean pacificOcean = oceanDAO.findByCode("3"); + Assert.assertNotNull("Could not find ocean with code 3 (Pacific)", pacificOcean); + + assertFoundLengthWeightParameter(tx, species, atlanticOcean, null, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, undeterminedSex, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, maleSex, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, femaleSex, undeterminedSex, date2009, date1970); + + assertFoundLengthWeightParameter(tx, species, atlanticOcean, null, undeterminedSex, date2010, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, undeterminedSex, undeterminedSex, date2010, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, maleSex, maleSex, date2010, date2010); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, femaleSex, undeterminedSex, date2010, date1970); + + assertFoundLengthWeightParameter(tx, species, atlanticOcean, null, undeterminedSex, date2011, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, undeterminedSex, undeterminedSex, date2011, date1970); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, maleSex, maleSex, date2011, date2011); + assertFoundLengthWeightParameter(tx, species, atlanticOcean, femaleSex, undeterminedSex, date2011, date1970); + + assertFoundLengthWeightParameter(tx, species, indianOcean, null, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, indianOcean, undeterminedSex, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, indianOcean, maleSex, undeterminedSex, date2009, date1970); + assertFoundLengthWeightParameter(tx, species, indianOcean, femaleSex, undeterminedSex, date2009, date1970); + + assertFoundLengthWeightParameter(tx, species, indianOcean, undeterminedSex, undeterminedSex, date2010, date1970); + assertFoundLengthWeightParameter(tx, species, indianOcean, maleSex, maleSex, date2010, date2010); + assertFoundLengthWeightParameter(tx, species, indianOcean, femaleSex, undeterminedSex, date2010, date1970); + + assertFoundLengthWeightParameter(tx, species, indianOcean, undeterminedSex, undeterminedSex, date2011, date1970); + assertFoundLengthWeightParameter(tx, species, indianOcean, maleSex, maleSex, date2011, date2011); + assertFoundLengthWeightParameter(tx, species, indianOcean, femaleSex, undeterminedSex, date2011, date1970); + + assertNotFoundLengthWeightParameter(tx, species, pacificOcean, undeterminedSex, date2010); + assertNotFoundLengthWeightParameter(tx, species, pacificOcean, maleSex, date2010); + assertNotFoundLengthWeightParameter(tx, species, pacificOcean, femaleSex, date2010); + + } finally { + + tx.closeContext(); + + } + + } + + protected void assertFoundLengthWeightParameter(TopiaContext tx, Species species, Ocean ocean, Sex sex, Sex expectedSex, Date date, Date expectedStartDate) throws DataSourceException { + + if (log.isInfoEnabled()) { + log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date); + } + LengthWeightParameter lengthWeightParameter = dataService.findLengthWeightParameter(tx, species, ocean, sex, date); + + Assert.assertNotNull("length weith parameter not found for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date, lengthWeightParameter); + Assert.assertEquals("Expected sex is " + expectedSex.getLabel1() + " but the one found was " + lengthWeightParameter.getSex().getLabel1(), expectedSex, lengthWeightParameter.getSex()); + Date startDate = new Date(lengthWeightParameter.getStartDate().getTime()); + Assert.assertEquals("Expected startDate is " + expectedStartDate + " but the one found was " + startDate, expectedStartDate, startDate); + } + + protected void assertNotFoundLengthWeightParameter(TopiaContext tx, Species species, Ocean ocean, Sex sex, Date date) throws DataSourceException { + + if (log.isInfoEnabled()) { + log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date); + } + LengthWeightParameter lengthWeightParameter = dataService.findLengthWeightParameter(tx, species, ocean, sex, date); + + Assert.assertNull("length weith parameter should not ne found for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date, lengthWeightParameter); + } + +} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 51908eab6fb1b9dd856569dc136dd3738c2eb52d Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 15:39:15 2015 +0100 Ajout d'un log pour voir le nombre de données trouvées pour chaque variable d'un rapport (See #7671) --- .../src/main/java/fr/ird/observe/report/model/ReportExecute.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/observe-business/src/main/java/fr/ird/observe/report/model/ReportExecute.java b/observe-business/src/main/java/fr/ird/observe/report/model/ReportExecute.java index 94500ef..fc81476 100644 --- a/observe-business/src/main/java/fr/ird/observe/report/model/ReportExecute.java +++ b/observe-business/src/main/java/fr/ird/observe/report/model/ReportExecute.java @@ -244,6 +244,9 @@ public class ReportExecute { String hql = variable.getRequest(); Object[] objects = ReportRequest.getParams(hql, vars); List<?> universe = tx.findAll(hql, objects); + if (log.isInfoEnabled()) { + log.info(String.format("Found for variable %s : %d", variable.getName(), universe.size())); + } variablesUniverse.put(variable.getName(), universe); } } finally { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 99af45ff9ad29b3535615447f43b6dac5d6acfc5 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 17:25:20 2015 +0100 Ajout de la migration pour supprimer le champs datearriveeport (termine #7542) --- .../src/test/resources/db/4.0.4/referentiel.sql.gz | Bin 0 -> 138244 bytes .../migration/AbstractDataSourceMigration.java | 4 +- .../DataSourceMigrationForVersion_4_0_4.java | 48 +++++++++++++++++++++ .../4.0.4/remove-trip-datearriveeport-field-H2.sql | 23 ++++++++++ .../4.0.4/remove-trip-datearriveeport-field-PG.sql | 23 ++++++++++ .../src/main/xmi/observe-common.properties | 2 +- .../src/main/xmi/observe-longline.properties | 2 +- .../src/main/xmi/observe-seine.properties | 2 +- observe-entities/src/main/xmi/observe-seine.zargo | Bin 85905 -> 85857 bytes 9 files changed, 100 insertions(+), 4 deletions(-) diff --git a/observe-business/src/test/resources/db/4.0.4/referentiel.sql.gz b/observe-business/src/test/resources/db/4.0.4/referentiel.sql.gz new file mode 100644 index 0000000..7cd9cbe Binary files /dev/null and b/observe-business/src/test/resources/db/4.0.4/referentiel.sql.gz differ diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java b/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java index 2ea4149..4333afa 100644 --- a/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java +++ b/observe-entities/src/main/java/fr/ird/observe/entities/migration/AbstractDataSourceMigration.java @@ -91,10 +91,12 @@ public abstract class AbstractDataSourceMigration extends TopiaMigrationCallback public static final Version V_4_0_2 = Versions.valueOf("4.0.2"); + public static final Version V_4_0_4 = Versions.valueOf("4.0.4"); + /** Les versions de mise à jour disponibles. */ public static final Version[] availableVersions = new Version[]{ V_3_1, V_3_5, V_3_7, V_3_8, V_3_9, V_3_10, V_3_11, V_3_12, V_3_14, V_3_15, V_3_16, V_4_0_RC2, - V_4_0_RC3, V_4_0_RC4, V_4_0_RC6, V_4_0_RC7, V_4_0, V_4_0_1, V_4_0_2 + V_4_0_RC3, V_4_0_RC4, V_4_0_RC6, V_4_0_RC7, V_4_0, V_4_0_1, V_4_0_2, V_4_0_4 }; private static Supplier<ApplicationConfig> applicationConfigSupplier; diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java new file mode 100644 index 0000000..46daf0a --- /dev/null +++ b/observe-entities/src/main/java/fr/ird/observe/entities/migration/versions/DataSourceMigrationForVersion_4_0_4.java @@ -0,0 +1,48 @@ +package fr.ird.observe.entities.migration.versions; + +import fr.ird.observe.entities.migration.AbstractDataSourceMigration; +import fr.ird.observe.entities.migration.AbstractObserveMigrationCallBack; +import fr.ird.observe.entities.migration.H2DataSourceMigration; +import fr.ird.observe.entities.migration.PGDataSourceMigration; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; + +import java.util.List; + +/** + * Created on 03/11/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 4.0.4 + */ +public class DataSourceMigrationForVersion_4_0_4 extends AbstractObserveMigrationCallBack { + + public DataSourceMigrationForVersion_4_0_4(AbstractDataSourceMigration callBack, String scriptSuffix) { + super(AbstractDataSourceMigration.V_4_0_4, callBack, scriptSuffix); + } + + @Override + protected void prepareMigrationScript(TopiaContextImplementor tx, List<String> queries, boolean showSql, boolean showProgression) throws TopiaException { + + // supprimer un champs résiduel (Voir http://forge.codelutin.com/issues/7542) + addScript("remove-trip-datearriveeport-field", queries); + + } + + public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_4 { + + public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, H2DataSourceMigration.TYPE); + } + + } + + public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_4_0_4 { + + public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, PGDataSourceMigration.TYPE); + } + + } + +} diff --git a/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-H2.sql b/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-H2.sql new file mode 100644 index 0000000..e029d1f --- /dev/null +++ b/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-H2.sql @@ -0,0 +1,23 @@ +--- +-- #%L +-- ObServe :: Entities +-- %% +-- Copyright (C) 2008 - 2015 IRD, Codelutin, Tony Chemit +-- %% +-- 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% +--- + +ALTER TABLE observe_seine.trip DROP COLUMN datearriveeport; \ No newline at end of file diff --git a/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-PG.sql b/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-PG.sql new file mode 100644 index 0000000..e029d1f --- /dev/null +++ b/observe-entities/src/main/resources/db/4.0.4/remove-trip-datearriveeport-field-PG.sql @@ -0,0 +1,23 @@ +--- +-- #%L +-- ObServe :: Entities +-- %% +-- Copyright (C) 2008 - 2015 IRD, Codelutin, Tony Chemit +-- %% +-- 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% +--- + +ALTER TABLE observe_seine.trip DROP COLUMN datearriveeport; \ No newline at end of file diff --git a/observe-entities/src/main/xmi/observe-common.properties b/observe-entities/src/main/xmi/observe-common.properties index 9b32ae1..9227f7e 100644 --- a/observe-entities/src/main/xmi/observe-common.properties +++ b/observe-entities/src/main/xmi/observe-common.properties @@ -19,7 +19,7 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -model.tagvalue.version=4.0.2 +model.tagvalue.version=4.0.4 model.tagvalue.notGenerateToString=true model.tagvalue.generateOperatorForDAOHelper=true model.tagvalue.generateStandaloneEnumForDAOHelper=true diff --git a/observe-entities/src/main/xmi/observe-longline.properties b/observe-entities/src/main/xmi/observe-longline.properties index 7a5450e..6187717 100644 --- a/observe-entities/src/main/xmi/observe-longline.properties +++ b/observe-entities/src/main/xmi/observe-longline.properties @@ -19,7 +19,7 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -model.tagvalue.version=4.0.2 +model.tagvalue.version=4.0.4 model.tagvalue.notGenerateToString=true model.tagvalue.generateOperatorForDAOHelper=true model.tagvalue.generateStandaloneEnumForDAOHelper=true diff --git a/observe-entities/src/main/xmi/observe-seine.properties b/observe-entities/src/main/xmi/observe-seine.properties index 21d5297..650acc8 100644 --- a/observe-entities/src/main/xmi/observe-seine.properties +++ b/observe-entities/src/main/xmi/observe-seine.properties @@ -19,7 +19,7 @@ # <http://www.gnu.org/licenses/gpl-3.0.html>. # #L% ### -model.tagvalue.version=4.0.2 +model.tagvalue.version=4.0.4 model.tagvalue.notGenerateToString=true model.tagvalue.generateOperatorForDAOHelper=true model.tagvalue.generateStandaloneEnumForDAOHelper=true diff --git a/observe-entities/src/main/xmi/observe-seine.zargo b/observe-entities/src/main/xmi/observe-seine.zargo index 9116a17..d64b15c 100644 Binary files a/observe-entities/src/main/xmi/observe-seine.zargo and b/observe-entities/src/main/xmi/observe-seine.zargo differ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-4.x in repository observe. See http://git.codelutin.com/observe.git commit 714fbd60cee7b14616c1d1fbe5ba8d369668aecd Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Nov 3 17:52:24 2015 +0100 Cacher la barre d'actions une fois l'action d'ouverture de base lancée (See #7673) --- .../java/fr/ird/observe/ui/storage/StorageUI.css | 4 ++++ .../java/fr/ird/observe/ui/storage/StorageUI.jaxx | 2 +- .../ird/observe/ui/storage/StorageUIHandler.java | 2 ++ .../fr/ird/observe/ui/storage/StorageUIModel.java | 24 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css index 1fb9545..173ea78 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.css @@ -69,3 +69,7 @@ enabled:{getModel().isValidStep()}; visible:{getModel().getNextStep() == null}; } + +#actions { + visible:{!getModel().isAlreadyApplied()}; +} \ No newline at end of file diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx index b46f1d1..404516d 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUI.jaxx @@ -161,7 +161,7 @@ void $afterCompleteSetup() { onStateChanged='if (getSelectedStep() != null) { getModel().gotoStep(getSelectedStep()); }'/> <!-- les actions --> - <Table weightx='1' fill='both' constraints='BorderLayout.SOUTH'> + <Table id='actions' weightx='1' fill='both' constraints='BorderLayout.SOUTH'> <row> <cell weightx='0.5' fill="both"> <!-- pour annuler --> diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java index 360f72f..e74d350 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java @@ -317,6 +317,8 @@ public class StorageUIHandler { public void launchApply(final StorageUI ui) { + ui.getModel().setAlreadyApplied(true); + Runnable action = WizardUILancher.APPLY_DEF.getContextValue(ui); if (action == null) { diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index 5b1a8af..74635ff 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -113,6 +113,8 @@ public class StorageUIModel extends WizardModel<StorageStep> { public static final String VALID_PROPERTY_NAME = "valid"; + public static final String ALREADY_APPLIED_PROPERTY_NAME = "alreadyApplied"; + private static final char[] EMPTY_PASSWORD = new char[0]; private static final String LOGIN_REFERENTIEL = "referentiel"; @@ -133,6 +135,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { protected boolean doBackup; /** + * Un drapeau pour savoir si on a déjà lancé l'action Appliquer (pour éviter le code ré-entrant). + * @since 4.0.4 + */ + protected boolean alreadyApplied; + + /** * le fichier ou effectuer la sauvegarde de la base locale si le drapeau * doBackup est active. */ @@ -207,6 +215,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { securityModel = new SecurityModel(); } + @Override + public void setStep(StorageStep step) { + setAlreadyApplied(false); + super.setStep(step); + } + /** * La méthode pour initialiser le modèle à partir du context applicatif et * d'un service existant. @@ -946,6 +960,16 @@ public class StorageUIModel extends WizardModel<StorageStep> { firePropertyChange(VALID_PROPERTY_NAME, isValid()); } + public boolean isAlreadyApplied() { + return alreadyApplied; + } + + public void setAlreadyApplied(boolean alreadyApplied) { + boolean oldValue = isAlreadyApplied(); + this.alreadyApplied = alreadyApplied; + firePropertyChange(ALREADY_APPLIED_PROPERTY_NAME, oldValue, alreadyApplied); + } + public boolean isValid() { boolean result = false; if (dbMode != null) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm