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

Commits:

7 changed files:

Changes:

  • t3-domain/src/main/java/fr/ird/t3/io/input/access/T3ReferentielEntityVisitor.java
    ... ... @@ -39,128 +39,75 @@ import org.nuiton.topia.persistence.TopiaEntity;
    39 39
      */
    
    40 40
     public class T3ReferentielEntityVisitor extends AbstractT3EntityVisitor {
    
    41 41
     
    
    42
    -    /** Logger. */
    
    43
    -    private static final Log log =
    
    44
    -            LogFactory.getLog(T3ReferentielEntityVisitor.class);
    
    42
    +    private static final Log log = LogFactory.getLog(T3ReferentielEntityVisitor.class);
    
    45 43
     
    
    46
    -    public T3ReferentielEntityVisitor(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
    
    44
    +    T3ReferentielEntityVisitor(T3AccessDataSource dataSource, ReferenceEntityMap referentiel) {
    
    47 45
             super(dataSource, referentiel);
    
    48 46
         }
    
    49 47
     
    
    50 48
         @Override
    
    51
    -    public void onVisitSimpleProperty(String propertyName,
    
    52
    -                                      Class<?> type,
    
    53
    -                                      T3AccessEntity entity, T3AccessEntityMeta meta) {
    
    49
    +    public void onVisitSimpleProperty(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
    
    54 50
             // just set the property into the entity
    
    55
    -
    
    56 51
             if (!deepVisit) {
    
    57 52
                 if (!propertyName.equals(meta.getTopiaNaturalId())) {
    
    58
    -
    
    59 53
                     // not a deep visit and not a pKey property name, skip visit
    
    60 54
                     return;
    
    61 55
                 }
    
    62 56
             }
    
    63
    -
    
    64 57
             Serializable newValue = getProperty(propertyName, meta, row);
    
    65
    -
    
    66 58
             if (newValue != null) {
    
    67 59
                 if (log.isDebugEnabled()) {
    
    68 60
                     String colName = meta.getPropertyColumnName(propertyName);
    
    69
    -                log.debug("get property [" + propertyName + "] (type:" +
    
    70
    -                                  type.getName() + ") (dbcol:" + colName + ") = " +
    
    71
    -                                  newValue);
    
    61
    +                log.debug(String.format("get property [%s] (type:%s) (dbcol:%s) = %s", propertyName, type.getName(), colName, newValue));
    
    72 62
                 }
    
    73 63
                 entity.setProperty(propertyName, newValue);
    
    74 64
             }
    
    75 65
         }
    
    76 66
     
    
    77 67
         @Override
    
    78
    -    public void onVisitComposition(String propertyName,
    
    79
    -                                   Class<?> type,
    
    80
    -                                   T3AccessEntity entity,
    
    81
    -                                   T3AccessEntityMeta meta) {
    
    82
    -
    
    68
    +    public void onVisitComposition(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
    
    83 69
             if (!deepVisit) {
    
    84 70
                 return;
    
    85 71
             }
    
    86
    -
    
    87 72
             // find the reference entity to add as composition
    
    88 73
             Serializable newValue = getProperty(propertyName, meta, row);
    
    89 74
             if (newValue == null) {
    
    90
    -
    
    91 75
                 // rien a faire si la composition est nulle
    
    92 76
                 return;
    
    93 77
             }
    
    94
    -
    
    95
    -        AbstractAccessEntityMeta.PropertyMapping mapping =
    
    96
    -                meta.getPropertyMapping(propertyName);
    
    78
    +        AbstractAccessEntityMeta.PropertyMapping mapping = meta.getPropertyMapping(propertyName);
    
    97 79
             Class<?> compositionType = mapping.getType();
    
    98
    -
    
    99
    -        T3AccessEntityMeta compoMeta;
    
    100
    -
    
    101
    -        T3AccessEntityMeta[] compoMetas =
    
    102
    -                dataSource.getMetaForType(compositionType);
    
    103
    -
    
    80
    +        T3AccessEntityMeta[] compoMetas = dataSource.getMetaForType(compositionType);
    
    104 81
             if (compoMetas.length == 0) {
    
    105
    -            if (log.isWarnEnabled()) {
    
    106
    -                log.warn("Skip composition [" + meta.getType() + " - " +
    
    107
    -                                 propertyName + "], meta of type [" + compositionType +
    
    108
    -                                 "] not found...");
    
    109
    -            }
    
    82
    +            log.warn(String.format("Skip composition [%s - %s], meta of type [%s] not found...", meta.getType(), propertyName, compositionType));
    
    110 83
                 return;
    
    111 84
             }
    
    112
    -
    
    113 85
             if (compoMetas.length > 1) {
    
    114
    -
    
    115
    -            // on n'autorise pas d'avoir plusieurs méta à traiter
    
    116
    -            // il s'agit d'une reférence sur un référentiel
    
    86
    +            // on n'autorise pas d'avoir plusieurs méta à traiter - il s'agit d'une reférence sur un référentiel
    
    117 87
                 throw new IllegalStateException(
    
    118
    -                    "Found more than one meta for referentiel type [" +
    
    119
    -                            compositionType + "] : " + Arrays.toString(compoMetas));
    
    88
    +                    String.format("Found more than one meta for referentiel type [%s] : %s", compositionType, Arrays.toString(compoMetas)));
    
    120 89
             }
    
    121
    -
    
    122
    -        compoMeta = compoMetas[0];
    
    123
    -
    
    90
    +        T3AccessEntityMeta compoMeta = compoMetas[0];
    
    124 91
             TopiaEntity compoEntity = getReferenceEntity(compoMeta, newValue);
    
    125
    -
    
    126 92
             if (compoEntity == null) {
    
    127
    -
    
    128 93
                 // could not find the correct composition entity
    
    129 94
                 throw new IllegalStateException(
    
    130
    -                    "Could not find reference entity of type [" +
    
    131
    -                            compoMeta.getType() + "] with pKey [" + newValue + "]");
    
    95
    +                    String.format("Could not find reference entity of type [%s] with pKey [%s]", compoMeta.getType(), newValue));
    
    132 96
             }
    
    133
    -
    
    134
    -//        // find the correct entity
    
    135
    -//        T3AccessEntity toSave = (T3AccessEntity) compoEntity;
    
    136
    -//
    
    137
    -//        if (log.isDebugEnabled()) {
    
    138
    -//            log.debug("Will add composition [" + propertyName +
    
    139
    -//                      ":" + toSave + "] to " + entity);
    
    140
    -//        }
    
    141 97
             // then affect it to this entity for the given property
    
    142 98
             entity.setProperty(propertyName, compoEntity);
    
    143 99
         }
    
    144 100
     
    
    145 101
         @Override
    
    146
    -    public void onVisitAssociation(String propertyName,
    
    147
    -                                   Class<?> type,
    
    148
    -                                   T3AccessEntity entity,
    
    149
    -                                   T3AccessEntityMeta meta) {
    
    102
    +    public void onVisitAssociation(String propertyName, Class<?> type, T3AccessEntity entity, T3AccessEntityMeta meta) {
    
    150 103
             // no used for reference entity
    
    151
    -        throw new IllegalStateException(
    
    152
    -                "Can not visit an association for a reference entity " +
    
    153
    -                        entity);
    
    104
    +        throw new IllegalStateException(String.format("Can not visit an association for a reference entity %s", entity));
    
    154 105
         }
    
    155 106
     
    
    156 107
         @Override
    
    157
    -    public void onVisitReverseAssociation(String propertyName,
    
    158
    -                                          T3AccessEntity entity,
    
    159
    -                                          T3AccessEntityMeta meta) {
    
    108
    +    public void onVisitReverseAssociation(String propertyName, T3AccessEntity entity, T3AccessEntityMeta meta) {
    
    160 109
             // no used for reference entity
    
    161
    -        throw new IllegalStateException(
    
    162
    -                "Can not visit a reverse association for a reference entity " +
    
    163
    -                        entity);
    
    110
    +        throw new IllegalStateException(String.format("Can not visit a reverse association for a reference entity %s", entity));
    
    164 111
         }
    
    165 112
     
    
    166 113
     }

  • t3-installer/.mvn/add-build-number

  • t3-installer/.mvn/application-assembly

  • t3-installer/pom.xml
    ... ... @@ -140,48 +140,10 @@
    140 140
     
    
    141 141
       <build>
    
    142 142
     
    
    143
    -    <plugins>
    
    144
    -
    
    145
    -      <plugin>
    
    146
    -        <artifactId>maven-dependency-plugin</artifactId>
    
    147
    -        <executions>
    
    148
    -          <execution>
    
    149
    -            <id>copy-dependencies</id>
    
    150
    -            <goals>
    
    151
    -              <goal>copy-dependencies</goal>
    
    152
    -            </goals>
    
    153
    -            <phase>process-classes</phase>
    
    154
    -            <configuration>
    
    155
    -              <overWriteReleases>false</overWriteReleases>
    
    156
    -              <overWriteSnapshots>true</overWriteSnapshots>
    
    157
    -              <overWriteIfNewer>true</overWriteIfNewer>
    
    158
    -              <outputDirectory>${project.build.directory}/lib</outputDirectory>
    
    159
    -              <silent>true</silent>
    
    160
    -            </configuration>
    
    161
    -          </execution>
    
    162
    -        </executions>
    
    163
    -      </plugin>
    
    164
    -
    
    165
    -    </plugins>
    
    166
    -
    
    167 143
         <pluginManagement>
    
    168 144
           <plugins>
    
    169 145
     
    
    170 146
             <plugin>
    
    171
    -          <artifactId>maven-jar-plugin</artifactId>
    
    172
    -          <configuration>
    
    173
    -            <archive>
    
    174
    -              <manifest>
    
    175
    -                <useUniqueVersions>true</useUniqueVersions>
    
    176
    -                <addClasspath>true</addClasspath>
    
    177
    -                <classpathPrefix>./lib/</classpathPrefix>
    
    178
    -                <mainClass>${maven.jar.main.class}</mainClass>
    
    179
    -              </manifest>
    
    180
    -            </archive>
    
    181
    -          </configuration>
    
    182
    -        </plugin>
    
    183
    -
    
    184
    -        <plugin>
    
    185 147
               <artifactId>maven-surefire-plugin</artifactId>
    
    186 148
               <configuration>
    
    187 149
                 <argLine>-Xms512m -Xmx1512m</argLine>
    
    ... ... @@ -291,39 +253,6 @@
    291 253
         </profile>
    
    292 254
     
    
    293 255
         <profile>
    
    294
    -      <id>assembly-profile</id>
    
    295
    -      <activation>
    
    296
    -        <property>
    
    297
    -          <name>performRelease</name>
    
    298
    -          <value>true</value>
    
    299
    -        </property>
    
    300
    -      </activation>
    
    301
    -      <build>
    
    302
    -        <defaultGoal>package</defaultGoal>
    
    303
    -        <plugins>
    
    304
    -          <plugin>
    
    305
    -            <artifactId>maven-assembly-plugin</artifactId>
    
    306
    -            <configuration>
    
    307
    -              <descriptors>
    
    308
    -                <descriptor>src/main/assembly/bin.xml</descriptor>
    
    309
    -              </descriptors>
    
    310
    -              <attach>true</attach>
    
    311
    -            </configuration>
    
    312
    -            <executions>
    
    313
    -              <execution>
    
    314
    -                <id>create-assemblies</id>
    
    315
    -                <phase>package</phase>
    
    316
    -                <goals>
    
    317
    -                  <goal>single</goal>
    
    318
    -                </goals>
    
    319
    -              </execution>
    
    320
    -            </executions>
    
    321
    -          </plugin>
    
    322
    -        </plugins>
    
    323
    -      </build>
    
    324
    -    </profile>
    
    325
    -
    
    326
    -    <profile>
    
    327 256
           <id>run-reference-tools-its</id>
    
    328 257
           <activation>
    
    329 258
             <property>
    

  • t3-installer/src/main/assembly/bin.xml
    ... ... @@ -28,20 +28,12 @@
    28 28
       <fileSets>
    
    29 29
     
    
    30 30
         <fileSet>
    
    31
    -      <directory>${project.build.directory}/lib</directory>
    
    32
    -      <outputDirectory>lib</outputDirectory>
    
    33
    -      <fileMode>0755</fileMode>
    
    34
    -      <includes>
    
    35
    -        <include>*.jar</include>
    
    36
    -      </includes>
    
    37
    -    </fileSet>
    
    38
    -
    
    39
    -    <fileSet>
    
    40 31
           <directory>${project.build.directory}</directory>
    
    41 32
           <outputDirectory/>
    
    42 33
           <fileMode>0755</fileMode>
    
    43 34
           <includes>
    
    44 35
             <include>${project.build.finalName}.jar</include>
    
    36
    +        <include>${project.build.finalName}.exe</include>
    
    45 37
           </includes>
    
    46 38
         </fileSet>
    
    47 39
     
    
    ... ... @@ -55,7 +47,7 @@
    55 47
         </fileSet>
    
    56 48
     
    
    57 49
         <fileSet>
    
    58
    -      <directory>${installer.cache}/t3-data-ddl-${t3-data.version}</directory>
    
    50
    +      <directory>${installer.cache.dir}/t3-data-ddl-${t3-data.version}</directory>
    
    59 51
           <outputDirectory>scripts/ddl</outputDirectory>
    
    60 52
           <includes>
    
    61 53
             <include>**/*</include>
    
    ... ... @@ -63,7 +55,7 @@
    63 55
         </fileSet>
    
    64 56
     
    
    65 57
         <fileSet>
    
    66
    -      <directory>${installer.cache}/t3-data-referential-${t3-data.version}</directory>
    
    58
    +      <directory>${installer.cache.dir}/t3-data-referential-${t3-data.version}</directory>
    
    67 59
           <outputDirectory>scripts/referential</outputDirectory>
    
    68 60
           <includes>
    
    69 61
             <include>**/*</include>
    
    ... ... @@ -71,7 +63,7 @@
    71 63
         </fileSet>
    
    72 64
     
    
    73 65
         <fileSet>
    
    74
    -      <directory>${installer.cache}/t3-data-zones-${t3-data.version}</directory>
    
    66
    +      <directory>${installer.cache.dir}/t3-data-zones-${t3-data.version}</directory>
    
    75 67
           <outputDirectory>scripts/zones</outputDirectory>
    
    76 68
           <includes>
    
    77 69
             <include>**/*</include>
    
    ... ... @@ -79,7 +71,7 @@
    79 71
         </fileSet>
    
    80 72
     
    
    81 73
         <fileSet>
    
    82
    -      <directory>${installer.cache}/t3-data-h2-${t3-data.version}</directory>
    
    74
    +      <directory>${installer.cache.dir}/t3-data-h2-${t3-data.version}</directory>
    
    83 75
           <outputDirectory>scripts/h2</outputDirectory>
    
    84 76
           <includes>
    
    85 77
             <include>**/*</include>
    
    ... ... @@ -106,6 +98,7 @@
    106 98
           <includes>
    
    107 99
             <include>**/*.sh</include>
    
    108 100
             <include>**/*.bat</include>
    
    101
    +        <include>**/*.exe</include>
    
    109 102
           </includes>
    
    110 103
         </fileSet>
    
    111 104
       </fileSets>
    

  • t3-installer/src/main/assembly/i18n.xml
    1
    +<!--
    
    2
    +  #%L
    
    3
    +  T3 :: Installer
    
    4
    +  %%
    
    5
    +  Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
    
    6
    +  %%
    
    7
    +  This program is free software: you can redistribute it and/or modify
    
    8
    +  it under the terms of the GNU Affero General Public License as published by
    
    9
    +  the Free Software Foundation, either version 3 of the License, or
    
    10
    +  (at your option) any later version.
    
    11
    +
    
    12
    +  This program is distributed in the hope that it will be useful,
    
    13
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    +  GNU General Public License for more details.
    
    16
    +
    
    17
    +  You should have received a copy of the GNU Affero General Public License
    
    18
    +  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    19
    +  #L%
    
    20
    +  -->
    
    21
    +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    22
    +          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
    
    23
    +  <id>i18n</id>
    
    24
    +  <formats>
    
    25
    +    <format>zip</format>
    
    26
    +  </formats>
    
    27
    +  <fileSets>
    
    28
    +    <fileSet>
    
    29
    +      <directory>target/classes/META-INF</directory>
    
    30
    +      <outputDirectory/>
    
    31
    +      <includes>
    
    32
    +        <include>t3-i18n*</include>
    
    33
    +      </includes>
    
    34
    +    </fileSet>
    
    35
    +  </fileSets>
    
    36
    +</assembly>

  • t3/pom.xml
    ... ... @@ -76,7 +76,6 @@
    76 76
                       <artifactId>t3-installer</artifactId>
    
    77 77
                       <version>${project.version}</version>
    
    78 78
                       <type>zip</type>
    
    79
    -                  <classifier>bin</classifier>
    
    80 79
                     </artifactItem>
    
    81 80
                   </artifactItems>
    
    82 81
                 </configuration>