Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
-
0b319d95
by Tony CHEMIT at 2018-04-15T15:20:29Z
-
48f2b301
by Tony CHEMIT at 2018-04-16T09:24:23Z
-
eddf203a
by Tony CHEMIT at 2018-04-16T09:24:54Z
-
fec55645
by Tony CHEMIT at 2018-04-16T09:25:16Z
12 changed files:
- pom.xml
- t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelOutputContext.java
- t3-domain/src/main/java/fr/ird/t3/io/input/access/AbstractT3InputMSAccess.java
- t3-domain/src/main/java/fr/ird/t3/io/input/access/T3AccessDataSource.java
- t3-domain/src/main/java/fr/ird/t3/models/SpeciesCountModelHelper.java
- t3-domain/src/main/java/fr/ird/t3/services/T3InputService.java
- t3-domain/src/main/java/fr/ird/t3/services/T3OutputService.java
- t3-domain/src/main/resources/t3-log4j.conf
- t3-web/src/main/java/fr/ird/t3/web/actions/SelectUserInputDatabaseAction.java
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
- t3-web/src/main/webapp/css/screen.css
Changes:
| ... | ... | @@ -102,7 +102,7 @@ |
| 102 | 102 |
<applicationName>t3</applicationName>
|
| 103 | 103 |
<t3-data.version>1.9</t3-data.version>
|
| 104 | 104 |
<lib.version.java4all.i18n>4.0-alpha-11</lib.version.java4all.i18n>
|
| 105 |
- <lib.version.java4all.config>1.0.2-SNAPSHOT</lib.version.java4all.config>
|
|
| 105 |
+ <lib.version.java4all.config>1.0.2</lib.version.java4all.config>
|
|
| 106 | 106 |
|
| 107 | 107 |
<env>dev</env>
|
| 108 | 108 |
<skipITs>true</skipITs>
|
| ... | ... | @@ -110,7 +110,7 @@ public abstract class LevelOutputContext<C extends LevelConfigurationWithStratum |
| 110 | 110 |
}
|
| 111 | 111 |
List<Integer> result = new ArrayList<>(levels);
|
| 112 | 112 |
Collections.reverse(result);
|
| 113 |
- return result.toArray(new Integer[result.size()]);
|
|
| 113 |
+ return result.toArray(new Integer[0]);
|
|
| 114 | 114 |
}
|
| 115 | 115 |
|
| 116 | 116 |
public long getTotalCatchActivitiesWithSample() {
|
| ... | ... | @@ -108,12 +108,12 @@ public abstract class AbstractT3InputMSAccess implements T3Input { |
| 108 | 108 |
|
| 109 | 109 |
@Override
|
| 110 | 110 |
public String[] getAnalyzeErrors() {
|
| 111 |
- return errors.toArray(new String[errors.size()]);
|
|
| 111 |
+ return errors.toArray(new String[0]);
|
|
| 112 | 112 |
}
|
| 113 | 113 |
|
| 114 | 114 |
@Override
|
| 115 | 115 |
public String[] getAnalyzeWarnings() {
|
| 116 |
- return warnings.toArray(new String[warnings.size()]);
|
|
| 116 |
+ return warnings.toArray(new String[0]);
|
|
| 117 | 117 |
}
|
| 118 | 118 |
|
| 119 | 119 |
@Override
|
| ... | ... | @@ -51,7 +51,7 @@ public class T3AccessDataSource extends AbstractAccessDataSource<T3EntityEnum, T |
| 51 | 51 |
|
| 52 | 52 |
@Override
|
| 53 | 53 |
protected T3AccessEntityMeta[] newMetaArray(Collection<T3AccessEntityMeta> table) {
|
| 54 |
- return table.toArray(new T3AccessEntityMeta[table.size()]);
|
|
| 54 |
+ return table.toArray(new T3AccessEntityMeta[0]);
|
|
| 55 | 55 |
}
|
| 56 | 56 |
|
| 57 | 57 |
@Override
|
| ... | ... | @@ -84,7 +84,7 @@ public class T3AccessDataSource extends AbstractAccessDataSource<T3EntityEnum, T |
| 84 | 84 |
Collections.addAll(buffer, meta.getErrors());
|
| 85 | 85 |
}
|
| 86 | 86 |
}
|
| 87 |
- return buffer.toArray(new String[buffer.size()]);
|
|
| 87 |
+ return buffer.toArray(new String[0]);
|
|
| 88 | 88 |
}
|
| 89 | 89 |
|
| 90 | 90 |
public String[] getWarnings() {
|
| ... | ... | @@ -94,7 +94,7 @@ public class T3AccessDataSource extends AbstractAccessDataSource<T3EntityEnum, T |
| 94 | 94 |
Collections.addAll(buffer, meta.getWarnings());
|
| 95 | 95 |
}
|
| 96 | 96 |
}
|
| 97 |
- return buffer.toArray(new String[buffer.size()]);
|
|
| 97 |
+ return buffer.toArray(new String[0]);
|
|
| 98 | 98 |
}
|
| 99 | 99 |
|
| 100 | 100 |
public void analyzeDb(T3AccessHitModel hits) throws Exception {
|
| ... | ... | @@ -115,7 +115,7 @@ public class SpeciesCountModelHelper { |
| 115 | 115 |
header.setHeader(
|
| 116 | 116 |
String.format(
|
| 117 | 117 |
lineFormat.toString(),
|
| 118 |
- (Object[]) headerParams.toArray(new Object[headerParams.size()])));
|
|
| 118 |
+ (Object[]) headerParams.toArray(new Object[0])));
|
|
| 119 | 119 |
|
| 120 | 120 |
header.setCategoryFormat("| %1$-" + (totalLength) + "s |\n");
|
| 121 | 121 |
|
| ... | ... | @@ -158,7 +158,7 @@ public class SpeciesCountModelHelper { |
| 158 | 158 |
inResume.append(
|
| 159 | 159 |
String.format(
|
| 160 | 160 |
lineFormat.toString(),
|
| 161 |
- (Object[]) params.toArray(new Object[params.size()])));
|
|
| 161 |
+ (Object[]) params.toArray(new Object[0])));
|
|
| 162 | 162 |
|
| 163 | 163 |
}
|
| 164 | 164 |
|
| ... | ... | @@ -176,7 +176,7 @@ public class SpeciesCountModelHelper { |
| 176 | 176 |
inResume.append(
|
| 177 | 177 |
String.format(
|
| 178 | 178 |
lineFormat.toString(),
|
| 179 |
- (Object[]) params.toArray(new Object[params.size()])));
|
|
| 179 |
+ (Object[]) params.toArray(new Object[0])));
|
|
| 180 | 180 |
|
| 181 | 181 |
|
| 182 | 182 |
}
|
| ... | ... | @@ -192,7 +192,7 @@ public class SpeciesCountModelHelper { |
| 192 | 192 |
inResume.append(
|
| 193 | 193 |
String.format(
|
| 194 | 194 |
lineFormat.toString(),
|
| 195 |
- (Object[]) params.toArray(new Object[params.size()])));
|
|
| 195 |
+ (Object[]) params.toArray(new Object[0])));
|
|
| 196 | 196 |
|
| 197 | 197 |
inResume.append(header.getBottomSeparatorFormat());
|
| 198 | 198 |
return inResume.toString();
|
| ... | ... | @@ -42,7 +42,7 @@ public class T3InputService extends T3ServiceSupport implements T3ServiceSinglet |
| 42 | 42 |
for (T3InputProvider provider : ServiceLoader.load(T3InputProvider.class)) {
|
| 43 | 43 |
result.add(provider);
|
| 44 | 44 |
}
|
| 45 |
- providers = result.toArray(new T3InputProvider[result.size()]);
|
|
| 45 |
+ providers = result.toArray(new T3InputProvider[0]);
|
|
| 46 | 46 |
}
|
| 47 | 47 |
return providers;
|
| 48 | 48 |
}
|
| ... | ... | @@ -44,7 +44,7 @@ public class T3OutputService extends T3ServiceSupport implements T3ServiceSingle |
| 44 | 44 |
for (T3OutputProvider<?, ?> provider : ServiceLoader.load(T3OutputProvider.class)) {
|
| 45 | 45 |
result.add(provider);
|
| 46 | 46 |
}
|
| 47 |
- providers = result.toArray(new T3OutputProvider[result.size()]);
|
|
| 47 |
+ providers = result.toArray(new T3OutputProvider[0]);
|
|
| 48 | 48 |
}
|
| 49 | 49 |
return providers;
|
| 50 | 50 |
}
|
| ... | ... | @@ -11,7 +11,7 @@ log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%c:%L) %M - %m%n |
| 11 | 11 |
log4j.appender.file=org.apache.log4j.RollingFileAppender
|
| 12 | 12 |
log4j.appender.file.File=${user.log.directory}/t3.log
|
| 13 | 13 |
log4j.appender.file.MaxFileSize=10MB
|
| 14 |
-log4j.appender.file.MaxBackupIndex=4
|
|
| 14 |
+log4j.appender.file.MaxBackupIndex=30
|
|
| 15 | 15 |
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
| 16 | 16 |
log4j.appender.file.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %5p [%t] (%c:%L) %M - %m%n
|
| 17 | 17 |
|
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 |
package fr.ird.t3.web.actions;
|
| 22 | 22 |
|
| 23 | 23 |
import com.opensymphony.xwork2.Preparable;
|
| 24 |
+import fr.ird.t3.entities.T3EntityHelper;
|
|
| 24 | 25 |
import fr.ird.t3.entities.user.JdbcConfiguration;
|
| 25 | 26 |
import fr.ird.t3.entities.user.T3User;
|
| 26 | 27 |
import fr.ird.t3.entities.user.UserDatabase;
|
| ... | ... | @@ -28,6 +29,7 @@ import org.apache.commons.collections.CollectionUtils; |
| 28 | 29 |
import org.apache.commons.logging.Log;
|
| 29 | 30 |
import org.apache.commons.logging.LogFactory;
|
| 30 | 31 |
|
| 32 |
+import java.sql.SQLException;
|
|
| 31 | 33 |
import java.util.Collection;
|
| 32 | 34 |
import java.util.HashMap;
|
| 33 | 35 |
import java.util.Map;
|
| ... | ... | @@ -83,6 +85,12 @@ public class SelectUserInputDatabaseAction extends T3ActionSupport implements Pr |
| 83 | 85 |
@Override
|
| 84 | 86 |
public String execute() {
|
| 85 | 87 |
// set the selected database in session
|
| 88 |
+ try {
|
|
| 89 |
+ T3EntityHelper.checkJDBCConnection(getDatabase());
|
|
| 90 |
+ } catch (SQLException e) {
|
|
| 91 |
+ addActionError(t("t3.message.error.open.database", getDatabase().getUrl(), e.getMessage()));
|
|
| 92 |
+ return ERROR;
|
|
| 93 |
+ }
|
|
| 86 | 94 |
getT3Session().initDatabaseConfiguration(getDatabase());
|
| 87 | 95 |
return SUCCESS;
|
| 88 | 96 |
}
|
| ... | ... | @@ -376,6 +376,7 @@ t3.menu.treatment.level3.launch=Start a level 3 treatment |
| 376 | 376 |
t3.message.discovered.trip.to.insert=La marée %s peut être importée dans T3
|
| 377 | 377 |
t3.message.discovered.trip.to.replace=La marée %s existe déjà dans T3 et peut être importée
|
| 378 | 378 |
t3.message.discovered.unsafe.trip=La marée %s ne peut pas être importée dans T3
|
| 379 |
+t3.message.error.open.database=Could not open selected database [%s]\: %s
|
|
| 379 | 380 |
t3.message.missingActionContext=Action could not be done (no action context found), start it from the beginning
|
| 380 | 381 |
t3.message.missingLevel1Configuration=No configuration registred for level 1 treatment.
|
| 381 | 382 |
t3.message.missingLevel2Configuration=No configuration registred for level 2 treatment.
|
| ... | ... | @@ -376,6 +376,7 @@ t3.menu.treatment.level3.launch=Lancer un traitement de niveau 3 |
| 376 | 376 |
t3.message.discovered.trip.to.insert=La marée %s peut être importée dans T3
|
| 377 | 377 |
t3.message.discovered.trip.to.replace=La marée %s existe déjà dans T3 et peut être importée
|
| 378 | 378 |
t3.message.discovered.unsafe.trip=La marée %s ne peut pas être importée dans T3
|
| 379 |
+t3.message.error.open.database=Impossible d'ouvrir la base sélectionnée [%s] \: %s
|
|
| 379 | 380 |
t3.message.missingActionContext=L'action ne peut pas être réalisée, veuillez la reprendre depuis le début.
|
| 380 | 381 |
t3.message.missingLevel1Configuration=Aucune configuration enregistrée pour les traitements du niveau 1.
|
| 381 | 382 |
t3.message.missingLevel2Configuration=Aucune configuration enregistrée pour les traitements du niveau 2.
|
| ... | ... | @@ -79,7 +79,7 @@ font-size: 11px; |
| 79 | 79 |
.info_error {
|
| 80 | 80 |
background: no-repeat scroll 8px 5px #FFE3E3;
|
| 81 | 81 |
border: 2px solid #DD0000;
|
| 82 |
- width: 800px;
|
|
| 82 |
+ /*width: 1000px;*/
|
|
| 83 | 83 |
margin-bottom: 5px;
|
| 84 | 84 |
}
|
| 85 | 85 |
.info_error ul{
|