Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3

Commits:

8 changed files:

Changes:

  • t3-domain/src/main/resources/db/migration/V3_0_03_fix-LocalMarketPackagingType-ids.sql
    ... ... @@ -18,14 +18,14 @@
    18 18
     -- along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    19 19
     -- #L%
    
    20 20
     ---
    
    21
    -INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.1', 0, '2016-01-28 00:00:00', 1, 'Vrac pesé ou non (multispécifique) (sondage)', true);
    
    22
    -INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.2', 0, '2016-01-28 00:00:00', 2, 'Pesée (monospécifique) (pas de sondage)', true);
    
    23
    -INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.3', 0, '2016-01-28 00:00:00', 3, 'Espèce unité (monospécifique) (pas de sondage)', true);
    
    24
    -INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.4', 0, '2016-01-28 00:00:00', 4, 'Paquet non pesé (monospécifique) (pas de sondage)', true);
    
    25
    -
    
    21
    +-- Trick (we add 1000 to code, we will subtract them later)
    
    22
    +INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.1', 0, '2016-01-28 00:00:00', 1001, 'Vrac pesé ou non (multispécifique) (sondage)', true);
    
    23
    +INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.2', 0, '2016-01-28 00:00:00', 1002, 'Pesée (monospécifique) (pas de sondage)', true);
    
    24
    +INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.3', 0, '2016-01-28 00:00:00', 1003, 'Espèce unité (monospécifique) (pas de sondage)', true);
    
    25
    +INSERT INTO localmarketpackagingtype (topiaid, topiaversion, topiacreatedate, code, libelle, status) VALUES ('fr.ird.t3.entities.reference.LocalMarketPackagingType#1454009635523#0.4', 0, '2016-01-28 00:00:00', 1004, 'Paquet non pesé (monospécifique) (pas de sondage)', true);
    
    26 26
     UPDATE Localmarketpackaging SET localmarketpackagingtype = replace(localmarketpackagingtype,'LocalMarketPackaging', 'LocalMarketPackagingType');
    
    27
    -
    
    28 27
     DELETE FROM Localmarketpackagingtype WHERE topiaid = 'fr.ird.t3.entities.reference.LocalMarketPackaging#1454009635523#0.1';
    
    29 28
     DELETE FROM Localmarketpackagingtype WHERE topiaid = 'fr.ird.t3.entities.reference.LocalMarketPackaging#1454009635523#0.2';
    
    30 29
     DELETE FROM Localmarketpackagingtype WHERE topiaid = 'fr.ird.t3.entities.reference.LocalMarketPackaging#1454009635523#0.3';
    
    31 30
     DELETE FROM Localmarketpackagingtype WHERE topiaid = 'fr.ird.t3.entities.reference.LocalMarketPackaging#1454009635523#0.4';
    
    31
    +UPDATE LocalmarketpackagingType SET code = code -1000;
    \ No newline at end of file

  • t3-domain/src/main/resources/db/migration/V3_0_06_referential-i18n.sql
    ... ... @@ -51,7 +51,6 @@ ALTER TABLE zoneee RENAME COLUMN libelle TO label1;
    51 51
     ALTER TABLE zoneee RENAME COLUMN versionlibelle TO versionLabel;
    
    52 52
     ALTER TABLE zonefao RENAME COLUMN libelle TO label1;
    
    53 53
     ALTER TABLE zonefao RENAME COLUMN versionlibelle TO versionLabel;
    
    54
    -
    
    55 54
     ALTER TABLE country ADD COLUMN label2 VARCHAR(255);
    
    56 55
     ALTER TABLE schoolType ADD COLUMN label2 VARCHAR(255);
    
    57 56
     ALTER TABLE fishingContext ADD COLUMN label2 VARCHAR(255);
    
    ... ... @@ -78,7 +77,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label2 VARCHAR(255);
    78 77
     ALTER TABLE zoneet ADD COLUMN label2 VARCHAR(255);
    
    79 78
     ALTER TABLE zoneee ADD COLUMN label2 VARCHAR(255);
    
    80 79
     ALTER TABLE zonefao ADD COLUMN label2 VARCHAR(255);
    
    81
    -
    
    82 80
     ALTER TABLE country ADD COLUMN label3 VARCHAR(255);
    
    83 81
     ALTER TABLE schoolType ADD COLUMN label3 VARCHAR(255);
    
    84 82
     ALTER TABLE fishingContext ADD COLUMN label3 VARCHAR(255);
    
    ... ... @@ -105,7 +103,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label3 VARCHAR(255);
    105 103
     ALTER TABLE zoneet ADD COLUMN label3 VARCHAR(255);
    
    106 104
     ALTER TABLE zoneee ADD COLUMN label3 VARCHAR(255);
    
    107 105
     ALTER TABLE zonefao ADD COLUMN label3 VARCHAR(255);
    
    108
    -
    
    109 106
     ALTER TABLE country ADD COLUMN label4 VARCHAR(255);
    
    110 107
     ALTER TABLE schoolType ADD COLUMN label4 VARCHAR(255);
    
    111 108
     ALTER TABLE fishingContext ADD COLUMN label4 VARCHAR(255);
    
    ... ... @@ -132,7 +129,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label4 VARCHAR(255);
    132 129
     ALTER TABLE zoneet ADD COLUMN label4 VARCHAR(255);
    
    133 130
     ALTER TABLE zoneee ADD COLUMN label4 VARCHAR(255);
    
    134 131
     ALTER TABLE zonefao ADD COLUMN label4 VARCHAR(255);
    
    135
    -
    
    136 132
     ALTER TABLE country ADD COLUMN label5 VARCHAR(255);
    
    137 133
     ALTER TABLE schoolType ADD COLUMN label5 VARCHAR(255);
    
    138 134
     ALTER TABLE fishingContext ADD COLUMN label5 VARCHAR(255);
    
    ... ... @@ -159,7 +155,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label5 VARCHAR(255);
    159 155
     ALTER TABLE zoneet ADD COLUMN label5 VARCHAR(255);
    
    160 156
     ALTER TABLE zoneee ADD COLUMN label5 VARCHAR(255);
    
    161 157
     ALTER TABLE zonefao ADD COLUMN label5 VARCHAR(255);
    
    162
    -
    
    163 158
     ALTER TABLE country ADD COLUMN label6 VARCHAR(255);
    
    164 159
     ALTER TABLE schoolType ADD COLUMN label6 VARCHAR(255);
    
    165 160
     ALTER TABLE fishingContext ADD COLUMN label6 VARCHAR(255);
    
    ... ... @@ -186,7 +181,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label6 VARCHAR(255);
    186 181
     ALTER TABLE zoneet ADD COLUMN label6 VARCHAR(255);
    
    187 182
     ALTER TABLE zoneee ADD COLUMN label6 VARCHAR(255);
    
    188 183
     ALTER TABLE zonefao ADD COLUMN label6 VARCHAR(255);
    
    189
    -
    
    190 184
     ALTER TABLE country ADD COLUMN label7 VARCHAR(255);
    
    191 185
     ALTER TABLE schoolType ADD COLUMN label7 VARCHAR(255);
    
    192 186
     ALTER TABLE fishingContext ADD COLUMN label7 VARCHAR(255);
    
    ... ... @@ -213,7 +207,6 @@ ALTER TABLE ElementaryCatchFate ADD COLUMN label7 VARCHAR(255);
    213 207
     ALTER TABLE zoneet ADD COLUMN label7 VARCHAR(255);
    
    214 208
     ALTER TABLE zoneee ADD COLUMN label7 VARCHAR(255);
    
    215 209
     ALTER TABLE zonefao ADD COLUMN label7 VARCHAR(255);
    
    216
    -
    
    217 210
     ALTER TABLE country ADD COLUMN label8 VARCHAR(255);
    
    218 211
     ALTER TABLE schoolType ADD COLUMN label8 VARCHAR(255);
    
    219 212
     ALTER TABLE fishingContext ADD COLUMN label8 VARCHAR(255);
    
    ... ... @@ -239,4 +232,4 @@ ALTER TABLE localMarketPackaging ADD COLUMN label8 VARCHAR(255);
    239 232
     ALTER TABLE ElementaryCatchFate ADD COLUMN label8 VARCHAR(255);
    
    240 233
     ALTER TABLE zoneet ADD COLUMN label8 VARCHAR(255);
    
    241 234
     ALTER TABLE zoneee ADD COLUMN label8 VARCHAR(255);
    
    242
    -ALTER TABLE zonefao ADD COLUMN label8 VARCHAR(255);
    235
    +ALTER TABLE zonefao ADD COLUMN label8 VARCHAR(255);
    \ No newline at end of file

  • t3-domain/src/main/resources/t3-datadb.properties
    ... ... @@ -37,4 +37,5 @@ hibernate.hikari.registerMbeans=true
    37 37
     topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
    
    38 38
     topia.service.migration.callback=fr.ird.t3.services.migration.T3MigrationCallback
    
    39 39
     topia.service.migration.showSql=true
    
    40
    +topia.service.migration.showProgression=true
    
    40 41
     

  • t3-domain/src/main/resources/t3-log4j.conf
    ... ... @@ -20,6 +20,7 @@ log4j.appender.file.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %5p [%t] (
    20 20
     log4j.logger.fr.ird.t3=INFO
    
    21 21
     log4j.logger.fr.ird.t3.services.ioc=WARN
    
    22 22
     log4j.logger.org.nuiton=WARN
    
    23
    +log4j.logger.org.nuiton.topia.migration=INFO
    
    23 24
     log4j.logger.org.hibernate.orm.deprecation=ERROR
    
    24 25
     log4j.logger.com.zaxxer.hikari.HikariDataSource=ERROR
    
    25 26
     

  • t3-domain/src/main/xmi/t3-persistence.properties
    ... ... @@ -22,7 +22,7 @@
    22 22
     model.tagValue.notGenerateToString=true
    
    23 23
     model.tagValue.generateOperatorForDAOHelper=true
    
    24 24
     model.tagValue.constantPrefix=PROPERTY_
    
    25
    -model.tagValue.version=2.0
    
    25
    +model.tagValue.version=3.0
    
    26 26
     model.tagValue.indexForeignKeys=true
    
    27 27
     
    
    28 28
     fr.ird.t3.entities.data.Trip.attribute.activity.stereotype=ordered
    

  • t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
    1
    +package fr.ird.t3.services.migration;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * T3 :: Domain
    
    6
    + * %%
    
    7
    + * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU Affero General Public License as published by
    
    11
    + * the Free Software Foundation, either version 3 of the License, or
    
    12
    + * (at your option) any later version.
    
    13
    + * 
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + * 
    
    19
    + * You should have received a copy of the GNU Affero General Public License
    
    20
    + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    21
    + * #L%
    
    22
    + */
    
    23
    +
    
    24
    +import fr.ird.t3.entities.T3TopiaApplicationContext;
    
    25
    +import fr.ird.t3.entities.user.JdbcConfiguration;
    
    26
    +import fr.ird.t3.entities.user.JdbcConfigurationHelper;
    
    27
    +import org.junit.Assert;
    
    28
    +import org.junit.Ignore;
    
    29
    +import org.junit.Test;
    
    30
    +
    
    31
    +/**
    
    32
    + * Created by tchemit on 20/02/2018.
    
    33
    + *
    
    34
    + * @author Tony Chemit - dev@tchemit.fr
    
    35
    + */
    
    36
    +@Ignore
    
    37
    +public class T3MigrationTest {
    
    38
    +
    
    39
    +    @Test
    
    40
    +    public void migratePostgres() {
    
    41
    +
    
    42
    +        String url = "jdbc:postgresql:t3";
    
    43
    +        String login = "t3-admin";
    
    44
    +        String password = "a";
    
    45
    +
    
    46
    +        JdbcConfiguration jdbcConfiguration = JdbcConfigurationHelper.newJdbcConfiguration();
    
    47
    +        jdbcConfiguration.setUrl(url);
    
    48
    +        jdbcConfiguration.setLogin(login);
    
    49
    +        jdbcConfiguration.setPassword(password);
    
    50
    +        try (T3TopiaApplicationContext rootContext = T3TopiaApplicationContext.newDb(jdbcConfiguration)) {
    
    51
    +            Assert.assertNotNull(rootContext);
    
    52
    +        }
    
    53
    +
    
    54
    +    }
    
    55
    +}

  • t3-domain/src/test/resources/log4j.properties
    ... ... @@ -27,3 +27,4 @@ log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %5p [%t]
    27 27
     
    
    28 28
     # package level
    
    29 29
     log4j.logger.fr.ird.t3=INFO
    
    30
    +log4j.logger.org.nuiton.topia.migration=INFO
    \ No newline at end of file

  • t3-web/src/main/webapp/WEB-INF/jsp/admin/userForm.jsp
    ... ... @@ -130,15 +130,14 @@
    130 130
           <s:hidden key="userEditAction" label=""/>
    
    131 131
           <s:textfield key="user.login" label="%{getText('t3.common.login')}"
    
    132 132
                        size="40" requiredLabel="true"/>
    
    133
    -      <s:textfield key="user.password" label="%{getText('t3.common.password')}"
    
    134
    -                   size="40" requiredLabel="true"/>
    
    133
    +      <s:textfield key="user.password" label="%{getText('t3.common.password')}" size="40" requiredLabel="true"/>
    
    134
    +      <s:textfield name="checkPassword" value="" key="t3.common.checkPassword" size="40" requiredLabel="true"/>
    
    135 135
           <s:checkbox key="user.admin" label="%{getText('t3.common.admin')}"/>
    
    136 136
         </fieldset>
    
    137 137
         <br/>
    
    138 138
         <s:submit action="userForm!doCreate" key="t3.action.create" align="right"/>
    
    139 139
         <s:if test="userIsAdmin">
    
    140
    -      <s:submit action="userList" key="t3.label.admin.backToUserList"
    
    141
    -                align="right"/>
    
    140
    +      <s:submit action="userList" key="t3.label.admin.backToUserList" align="right"/>
    
    142 141
         </s:if>
    
    143 142
       </s:form>
    
    144 143
     </s:if>