Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
-
4acaac54
by Tony CHEMIT at 2017-04-03T15:13:44+02:00
26 changed files:
- t3-actions/src/test/java/fr/ird/t3/actions/FakeT3ServiceContext.java
- t3-domain/pom.xml
- + t3-domain/src/main/config/T3.ini
- − t3-domain/src/main/java/fr/ird/t3/T3ApplicationConfigProvider.java
- t3-domain/src/main/java/fr/ird/t3/T3Configuration.java → t3-domain/src/main/java/fr/ird/t3/T3Config.java
- − t3-domain/src/main/java/fr/ird/t3/T3ConfigurationOption.java
- t3-domain/src/main/java/fr/ird/t3/actions/T3ActionContext.java
- t3-domain/src/main/java/fr/ird/t3/entities/T3UserTopiaApplicationContext.java
- t3-domain/src/main/java/fr/ird/t3/services/DefaultT3ServiceContext.java
- t3-domain/src/main/java/fr/ird/t3/services/T3ServiceContext.java
- t3-domain/src/main/java/fr/ird/t3/services/T3ServiceSupport.java
- − t3-domain/src/main/resources/META-INF/services/org.nuiton.util.config.ApplicationConfigProvider
- t3-input-avdthv33/src/test/java/fr/ird/t3/actions/FakeT3ServiceContext.java
- t3-input-avdthv35/src/test/java/fr/ird/t3/actions/FakeT3ServiceContext.java
- t3-input-avdthv36/src/test/java/fr/ird/t3/actions/FakeT3ServiceContext.java
- t3-installer/src/main/java/fr/ird/t3/tools/T3ApplicationInstaller.java
- t3-installer/src/test/java/fr/ird/t3/tools/FakeT3ServiceContext.java
- t3-output-balbayav32/src/test/java/fr/ird/t3/io/output/balbaya/v32/FakeT3ServiceContext.java
- t3-web/src/main/java/fr/ird/t3/web/T3ApplicationContext.java
- t3-web/src/main/java/fr/ird/t3/web/T3ApplicationListener.java
- t3-web/src/main/java/fr/ird/t3/web/T3Session.java
- t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ComputeRF1ConfigureAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level1/ManageLevel1ConfigurationAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step1Action.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java
Changes:
| ... | ... | @@ -20,8 +20,8 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.actions;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 24 |
-import fr.ird.t3.T3ConfigurationOption;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 |
+import fr.ird.t3.T3ConfigOption;
|
|
| 25 | 25 |
import fr.ird.t3.T3IOUtil;
|
| 26 | 26 |
import fr.ird.t3.entities.T3EntityHelper;
|
| 27 | 27 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -59,7 +59,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 59 | 59 |
|
| 60 | 60 |
protected File testDir;
|
| 61 | 61 |
|
| 62 |
- protected T3Configuration applicationConfiguration;
|
|
| 62 |
+ protected T3Config applicationConfiguration;
|
|
| 63 | 63 |
|
| 64 | 64 |
private Locale locale;
|
| 65 | 65 |
|
| ... | ... | @@ -78,8 +78,8 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 78 | 78 |
}
|
| 79 | 79 |
|
| 80 | 80 |
Properties defaultProps = new Properties();
|
| 81 |
- defaultProps.put(T3ConfigurationOption.DATA_DIRECTORY.getKey(), testDir);
|
|
| 82 |
- applicationConfiguration = new T3Configuration(defaultProps);
|
|
| 81 |
+ defaultProps.put(T3ConfigOption.DATA_DIRECTORY.getKey(), testDir);
|
|
| 82 |
+ applicationConfiguration = new T3Config(defaultProps);
|
|
| 83 | 83 |
try {
|
| 84 | 84 |
|
| 85 | 85 |
// where to put h2 database
|
| ... | ... | @@ -133,7 +133,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 133 | 133 |
}
|
| 134 | 134 |
|
| 135 | 135 |
@Override
|
| 136 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 136 |
+ public T3Config getApplicationConfiguration() {
|
|
| 137 | 137 |
return applicationConfiguration;
|
| 138 | 138 |
}
|
| 139 | 139 |
|
| ... | ... | @@ -191,11 +191,38 @@ |
| 191 | 191 |
</includes>
|
| 192 | 192 |
<filtering>true</filtering>
|
| 193 | 193 |
</resource>
|
| 194 |
+ <!-- si on ne met pas ça, les tests ne fonctionnent plus :( -->
|
|
| 195 |
+ <resource>
|
|
| 196 |
+ <directory>target/generated-sources/java</directory>
|
|
| 197 |
+ <includes>
|
|
| 198 |
+ <include>**/*.xml</include>
|
|
| 199 |
+ </includes>
|
|
| 200 |
+ </resource>
|
|
| 194 | 201 |
</resources>
|
| 195 | 202 |
|
| 196 | 203 |
<plugins>
|
| 197 | 204 |
|
| 198 | 205 |
<plugin>
|
| 206 |
+ <groupId>org.nuiton</groupId>
|
|
| 207 |
+ <artifactId>nuiton-config-maven-plugin</artifactId>
|
|
| 208 |
+ <executions>
|
|
| 209 |
+ <execution>
|
|
| 210 |
+ <phase>generate-sources</phase>
|
|
| 211 |
+ <id>generate-config</id>
|
|
| 212 |
+ <configuration>
|
|
| 213 |
+ <modelName>T3</modelName>
|
|
| 214 |
+ <generatePropertyChangeSupport>true</generatePropertyChangeSupport>
|
|
| 215 |
+ <packageName>fr.ird.t3</packageName>
|
|
| 216 |
+ <useNuitonI18n>true</useNuitonI18n>
|
|
| 217 |
+ </configuration>
|
|
| 218 |
+ <goals>
|
|
| 219 |
+ <goal>generate</goal>
|
|
| 220 |
+ </goals>
|
|
| 221 |
+ </execution>
|
|
| 222 |
+ </executions>
|
|
| 223 |
+ </plugin>
|
|
| 224 |
+ |
|
| 225 |
+ <plugin>
|
|
| 199 | 226 |
<groupId>org.nuiton.eugene</groupId>
|
| 200 | 227 |
<artifactId>eugene-maven-plugin</artifactId>
|
| 201 | 228 |
<configuration>
|
| 1 |
+description = t3.application.config
|
|
| 2 |
+ |
|
| 3 |
+[option contextPath]
|
|
| 4 |
+description = t3.config.context.path.description
|
|
| 5 |
+key = context.path
|
|
| 6 |
+type = string
|
|
| 7 |
+defaultValue = t3
|
|
| 8 |
+transient = true
|
|
| 9 |
+final = true
|
|
| 10 |
+ |
|
| 11 |
+[option dataDirectory]
|
|
| 12 |
+description = t3.config.data.directory.description
|
|
| 13 |
+key = data.directory
|
|
| 14 |
+type = file
|
|
| 15 |
+defaultValue = /var/local/t3/${context.path}
|
|
| 16 |
+transient = true
|
|
| 17 |
+final = true
|
|
| 18 |
+ |
|
| 19 |
+[option internalDbDirectory]
|
|
| 20 |
+description = t3.config.internal.db.directory.description
|
|
| 21 |
+key = internal.db.directory
|
|
| 22 |
+type = file
|
|
| 23 |
+defaultValue = ${data.directory}/db
|
|
| 24 |
+transient = true
|
|
| 25 |
+final = true
|
|
| 26 |
+ |
|
| 27 |
+[option parameterProfileDirectory]
|
|
| 28 |
+description = t3.config.parameterProfiles.storage.directory.description
|
|
| 29 |
+key = parameterProfiles.storage.directory
|
|
| 30 |
+type = file
|
|
| 31 |
+defaultValue = ${data.directory}/parameter-profiles
|
|
| 32 |
+transient = true
|
|
| 33 |
+final = true
|
|
| 34 |
+ |
|
| 35 |
+[option logFile]
|
|
| 36 |
+description = t3.user.log.file.description
|
|
| 37 |
+key = user.log.file
|
|
| 38 |
+type = file
|
|
| 39 |
+defaultValue = ${data.directory}/t3-log.properties
|
|
| 40 |
+transient = true
|
|
| 41 |
+final = true
|
|
| 42 |
+ |
|
| 43 |
+[option userLogDirectory]
|
|
| 44 |
+description = t3.user.log.directory.description
|
|
| 45 |
+key = user.log.directory
|
|
| 46 |
+type = file
|
|
| 47 |
+defaultValue = ${data.directory}/logs
|
|
| 48 |
+transient = true
|
|
| 49 |
+final = true
|
|
| 50 |
+ |
|
| 51 |
+[option treatmentWorkingDirectory]
|
|
| 52 |
+description = t3.config.treatment.working.directory.description
|
|
| 53 |
+key = treatment.working.directory
|
|
| 54 |
+type = file
|
|
| 55 |
+defaultValue = ${data.directory}/treatments
|
|
| 56 |
+transient = true
|
|
| 57 |
+final = true
|
|
| 58 |
+ |
|
| 59 |
+[option stratumWeightRatio]
|
|
| 60 |
+description = t3.config.stratum.weightRatio.description
|
|
| 61 |
+key = stratum.weightRatio
|
|
| 62 |
+type = Float
|
|
| 63 |
+defaultValue = 250
|
|
| 64 |
+transient = true
|
|
| 65 |
+final = true
|
|
| 66 |
+ |
|
| 67 |
+[option rf1MinimumRate]
|
|
| 68 |
+description = t3.config.rf1.minimumrate.description
|
|
| 69 |
+key = rf1.minimumrate
|
|
| 70 |
+type = Float
|
|
| 71 |
+defaultValue = 0.8
|
|
| 72 |
+transient = true
|
|
| 73 |
+final = true
|
|
| 74 |
+ |
|
| 75 |
+[option rf1MaximumRate]
|
|
| 76 |
+description = t3.config.rf1.maximumrate.description
|
|
| 77 |
+key = rf1.maximumrate
|
|
| 78 |
+type = Float
|
|
| 79 |
+defaultValue = 1.2
|
|
| 80 |
+transient = true
|
|
| 81 |
+final = true
|
|
| 82 |
+ |
|
| 83 |
+[option rfTotMax]
|
|
| 84 |
+description = t3.config.rfTot.maximum.description
|
|
| 85 |
+key = rfTot.maximum
|
|
| 86 |
+type = Float
|
|
| 87 |
+defaultValue = 250
|
|
| 88 |
+transient = true
|
|
| 89 |
+final = true
|
|
| 90 |
+ |
|
| 91 |
+[option rfMinus10Max]
|
|
| 92 |
+description = t3.config.rfMinus10.maximum.description
|
|
| 93 |
+key = rfMinus10.maximum
|
|
| 94 |
+type = Float
|
|
| 95 |
+defaultValue = 500
|
|
| 96 |
+transient = true
|
|
| 97 |
+final = true
|
|
| 98 |
+ |
|
| 99 |
+[option rfPlus10Max]
|
|
| 100 |
+description = t3.config.rfPlus10.maximum.description
|
|
| 101 |
+key = rfPlus10.maximum
|
|
| 102 |
+type = Float
|
|
| 103 |
+defaultValue = 500
|
|
| 104 |
+transient = true
|
|
| 105 |
+final = true
|
|
| 106 |
+ |
|
| 107 |
+[option rfMinus10MinNumber]
|
|
| 108 |
+description = t3.config.rfMinus10.minNumber.description
|
|
| 109 |
+key = rfMinus10.minNumber
|
|
| 110 |
+type = Integer
|
|
| 111 |
+defaultValue = 75
|
|
| 112 |
+transient = true
|
|
| 113 |
+final = true
|
|
| 114 |
+ |
|
| 115 |
+[option rfPlus10MinNumber]
|
|
| 116 |
+description = t3.config.rfPlus10.minNumber.description
|
|
| 117 |
+key = rfPlus10.minNumber
|
|
| 118 |
+type = Integer
|
|
| 119 |
+defaultValue = 75
|
|
| 120 |
+transient = true
|
|
| 121 |
+final = true
|
|
| 122 |
+ |
|
| 123 |
+[option weightedSetWeight]
|
|
| 124 |
+description = t3.config.level0.weightedSetWeight.description
|
|
| 125 |
+key = level0.weightedSetWeight
|
|
| 126 |
+type = Float
|
|
| 127 |
+defaultValue = 40
|
|
| 128 |
+transient = true
|
|
| 129 |
+final = true
|
|
| 130 |
+ |
|
| 131 |
+[option level2DefaultSpecies]
|
|
| 132 |
+description = t3.config.level2.defaultSpecies.description
|
|
| 133 |
+key = level2.defaultSpecies
|
|
| 134 |
+type = Integer[]
|
|
| 135 |
+defaultValue = 1,2,3
|
|
| 136 |
+transient = true
|
|
| 137 |
+final = true
|
|
| 138 |
+ |
|
| 139 |
+[option level3DefaultSpecies]
|
|
| 140 |
+description = t3.config.level3.defaultSpecies.description
|
|
| 141 |
+key = level3.defaultSpecies
|
|
| 142 |
+type = Integer[]
|
|
| 143 |
+defaultValue = 1,2,3,4,5,6
|
|
| 144 |
+transient = true
|
|
| 145 |
+final = true
|
|
| 146 |
+ |
|
| 147 |
+[option t3DataVersion]
|
|
| 148 |
+description = t3.config.data.version.description
|
|
| 149 |
+key = data.version
|
|
| 150 |
+type = version
|
|
| 151 |
+defaultValue =
|
|
| 152 |
+transient = true
|
|
| 153 |
+final = true
|
|
| 154 |
+ |
| 1 |
-/*
|
|
| 2 |
- * #%L
|
|
| 3 |
- * T3 :: Domain
|
|
| 4 |
- * %%
|
|
| 5 |
- * Copyright (C) 2010 - 2017 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 |
-package fr.ird.t3;
|
|
| 22 |
- |
|
| 23 |
-import java.util.Locale;
|
|
| 24 |
-import org.nuiton.config.ApplicationConfigProvider;
|
|
| 25 |
-import org.nuiton.config.ConfigActionDef;
|
|
| 26 |
-import org.nuiton.config.ConfigOptionDef;
|
|
| 27 |
- |
|
| 28 |
- |
|
| 29 |
-import static org.nuiton.i18n.I18n.l;
|
|
| 30 |
- |
|
| 31 |
-/**
|
|
| 32 |
- * Application config provider (for site generation).
|
|
| 33 |
- *
|
|
| 34 |
- * @author Tony Chemit - dev@tchemit.fr
|
|
| 35 |
- * @since 1.3.1
|
|
| 36 |
- */
|
|
| 37 |
-public class T3ApplicationConfigProvider implements ApplicationConfigProvider {
|
|
| 38 |
- |
|
| 39 |
- @Override
|
|
| 40 |
- public String getName() {
|
|
| 41 |
- return "t3";
|
|
| 42 |
- }
|
|
| 43 |
- |
|
| 44 |
- @Override
|
|
| 45 |
- public String getDescription(Locale locale) {
|
|
| 46 |
- return l(locale, "t3.application.config");
|
|
| 47 |
- }
|
|
| 48 |
- |
|
| 49 |
- @Override
|
|
| 50 |
- public ConfigOptionDef[] getOptions() {
|
|
| 51 |
- return T3ConfigurationOption.values();
|
|
| 52 |
- }
|
|
| 53 |
- |
|
| 54 |
- @Override
|
|
| 55 |
- public ConfigActionDef[] getActions() {
|
|
| 56 |
- return new ConfigActionDef[0];
|
|
| 57 |
- }
|
|
| 58 |
-}
|
| ... | ... | @@ -27,8 +27,8 @@ import com.google.common.io.Resources; |
| 27 | 27 |
import java.io.BufferedReader;
|
| 28 | 28 |
import java.io.File;
|
| 29 | 29 |
import java.io.IOException;
|
| 30 |
-import java.net.URL;
|
|
| 31 | 30 |
import java.nio.file.Files;
|
| 31 |
+import java.util.Arrays;
|
|
| 32 | 32 |
import java.util.List;
|
| 33 | 33 |
import java.util.Map;
|
| 34 | 34 |
import java.util.Properties;
|
| ... | ... | @@ -39,7 +39,6 @@ import org.apache.log4j.PropertyConfigurator; |
| 39 | 39 |
import org.nuiton.config.ApplicationConfig;
|
| 40 | 40 |
import org.nuiton.config.ArgumentsParserException;
|
| 41 | 41 |
import org.nuiton.util.FileUtil;
|
| 42 |
-import org.nuiton.version.Version;
|
|
| 43 | 42 |
|
| 44 | 43 |
/**
|
| 45 | 44 |
* T3 configuration
|
| ... | ... | @@ -47,35 +46,31 @@ import org.nuiton.version.Version; |
| 47 | 46 |
* @author Tony Chemit - dev@tchemit.fr
|
| 48 | 47 |
* @since 1.0
|
| 49 | 48 |
*/
|
| 50 |
-public class T3Configuration {
|
|
| 49 |
+public class T3Config extends GeneratedT3Config {
|
|
| 51 | 50 |
|
| 52 | 51 |
/** Logger. */
|
| 53 |
- protected static Log log = LogFactory.getLog(T3Configuration.class);
|
|
| 52 |
+ protected static Log log = LogFactory.getLog(T3Config.class);
|
|
| 54 | 53 |
|
| 55 |
- private final MyApplicationConfig config;
|
|
| 54 |
+ public T3Config(Properties defaultProps) {
|
|
| 56 | 55 |
|
| 57 |
- public T3Configuration(Properties defaultProps) {
|
|
| 58 |
- |
|
| 59 |
- config = new MyApplicationConfig();
|
|
| 60 |
- config.setConfigFileName("t3.conf");
|
|
| 56 |
+ ApplicationConfig applicationConfig = get();
|
|
| 57 |
+ applicationConfig.loadDefaultOptions(T3ConfigOption.values());
|
|
| 58 |
+ applicationConfig.setConfigFileName("t3.conf");
|
|
| 61 | 59 |
|
| 62 | 60 |
if (log.isInfoEnabled()) {
|
| 63 | 61 |
log.info(this + " is initializing...");
|
| 64 | 62 |
}
|
| 65 | 63 |
|
| 66 |
- config.loadDefaultOptions(T3ConfigurationOption.values());
|
|
| 67 | 64 |
if (defaultProps != null) {
|
| 68 | 65 |
for (Map.Entry<Object, Object> entry : defaultProps.entrySet()) {
|
| 69 | 66 |
|
| 70 |
- config.setDefaultOption(
|
|
| 71 |
- String.valueOf(entry.getKey()),
|
|
| 72 |
- String.valueOf(entry.getValue())
|
|
| 67 |
+ applicationConfig.setDefaultOption(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())
|
|
| 73 | 68 |
);
|
| 74 | 69 |
}
|
| 75 | 70 |
}
|
| 76 | 71 |
}
|
| 77 | 72 |
|
| 78 |
- public T3Configuration() {
|
|
| 73 |
+ public T3Config() {
|
|
| 79 | 74 |
|
| 80 | 75 |
this(null);
|
| 81 | 76 |
}
|
| ... | ... | @@ -90,13 +85,13 @@ public class T3Configuration { |
| 90 | 85 |
// parse configuration (with no parameters)
|
| 91 | 86 |
parse();
|
| 92 | 87 |
|
| 93 |
- createDirectory(T3ConfigurationOption.DATA_DIRECTORY,
|
|
| 88 |
+ createDirectory(T3ConfigOption.DATA_DIRECTORY,
|
|
| 94 | 89 |
"data directory");
|
| 95 | 90 |
|
| 96 |
- createDirectory(T3ConfigurationOption.USER_LOG_DIRECTORY,
|
|
| 91 |
+ createDirectory(T3ConfigOption.USER_LOG_DIRECTORY,
|
|
| 97 | 92 |
"user logs directory");
|
| 98 | 93 |
|
| 99 |
- createDirectory(T3ConfigurationOption.TREATMENT_WORKING_DIRECTORY,
|
|
| 94 |
+ createDirectory(T3ConfigOption.TREATMENT_WORKING_DIRECTORY,
|
|
| 100 | 95 |
"treatment workdir directory");
|
| 101 | 96 |
|
| 102 | 97 |
File log4jConfigurationFile = getLog4jConfigurationFile();
|
| ... | ... | @@ -117,20 +112,18 @@ public class T3Configuration { |
| 117 | 112 |
|
| 118 | 113 |
}
|
| 119 | 114 |
|
| 120 |
- public File getLog4jConfigurationFile() {
|
|
| 121 |
- return config.getOptionAsFile(T3ConfigurationOption.LOG_FILE.key);
|
|
| 122 |
- }
|
|
| 123 |
- |
|
| 124 |
- protected void parse() {
|
|
| 115 |
+ public void parse() {
|
|
| 125 | 116 |
try {
|
| 126 |
- config.parse();
|
|
| 117 |
+ get().parse();
|
|
| 127 | 118 |
} catch (ArgumentsParserException e) {
|
| 128 |
- if (log.isErrorEnabled()) {
|
|
| 129 |
- log.error("Could not parse configuration", e);
|
|
| 130 |
- }
|
|
| 119 |
+ throw new IllegalStateException("Could not parse configuration",e);
|
|
| 131 | 120 |
}
|
| 132 | 121 |
}
|
| 133 | 122 |
|
| 123 |
+ public File getLog4jConfigurationFile() {
|
|
| 124 |
+ return get().getOptionAsFile(T3ConfigOption.LOG_FILE.getKey());
|
|
| 125 |
+ }
|
|
| 126 |
+ |
|
| 134 | 127 |
public File getTreatmentWorkingDirectory(String name,
|
| 135 | 128 |
boolean create) {
|
| 136 | 129 |
File file = getTreatmentWorkingDirectory();
|
| ... | ... | @@ -148,86 +141,19 @@ public class T3Configuration { |
| 148 | 141 |
}
|
| 149 | 142 |
|
| 150 | 143 |
public String getApplicationVersion() {
|
| 151 |
- return config.getOption("application.version");
|
|
| 152 |
- }
|
|
| 153 |
- |
|
| 154 |
- public Version getT3DataVersion() {
|
|
| 155 |
- return config.getOptionAsVersion(T3ConfigurationOption.T3_DATA_VERSION.key);
|
|
| 156 |
- }
|
|
| 157 |
- |
|
| 158 |
- public URL getApplicationSite() {
|
|
| 159 |
- return config.getOptionAsURL("application.site.url");
|
|
| 160 |
- }
|
|
| 161 |
- |
|
| 162 |
- public File getDataDirectory() {
|
|
| 163 |
- return config.getOptionAsFile(T3ConfigurationOption.DATA_DIRECTORY.key);
|
|
| 164 |
- }
|
|
| 165 |
- |
|
| 166 |
- public File getInternalDbDirectory() {
|
|
| 167 |
- return config.getOptionAsFile(T3ConfigurationOption.INTERNAL_DB_DIRECTORY.key);
|
|
| 168 |
- }
|
|
| 169 |
- |
|
| 170 |
- public File getParameterProfilePath() {
|
|
| 171 |
- return config.getOptionAsFile(T3ConfigurationOption.PARAMETER_PROFILE_DIRECTORY.key);
|
|
| 172 |
- }
|
|
| 173 |
- |
|
| 174 |
- public File getTreatmentWorkingDirectory() {
|
|
| 175 |
- return config.getOptionAsFile(T3ConfigurationOption.TREATMENT_WORKING_DIRECTORY.key);
|
|
| 176 |
- }
|
|
| 177 |
- |
|
| 178 |
- public File getUserLogDirectory() {
|
|
| 179 |
- return config.getOptionAsFile(T3ConfigurationOption.USER_LOG_DIRECTORY.key);
|
|
| 144 |
+ return get().getOption("application.version");
|
|
| 180 | 145 |
}
|
| 181 | 146 |
|
| 182 |
- public Float getWeightedSetWeight() {
|
|
| 183 |
- return config.getOptionAsFloat(T3ConfigurationOption.WEIGHTED_SET_WEIGHT.key);
|
|
| 147 |
+ public List<Integer> getLevel2DefaultSpeciesAsList() {
|
|
| 148 |
+ return Arrays.asList(getLevel2DefaultSpecies());
|
|
| 184 | 149 |
}
|
| 185 | 150 |
|
| 186 |
- public Float getStratumWeightRatio() {
|
|
| 187 |
- return config.getOptionAsFloat(T3ConfigurationOption.STRATUM_WEIGHT_RATIO.key);
|
|
| 188 |
- }
|
|
| 189 |
- |
|
| 190 |
- public float getRF1MinimumRate() {
|
|
| 191 |
- return config.getOptionAsFloat(T3ConfigurationOption.RF1_MINIMUM_RATE.key);
|
|
| 192 |
- }
|
|
| 193 |
- |
|
| 194 |
- public float getRF1MaximumRate() {
|
|
| 195 |
- return config.getOptionAsFloat(T3ConfigurationOption.RF1_MAXIMUM_RATE.key);
|
|
| 196 |
- }
|
|
| 197 |
- |
|
| 198 |
- public int getRFTotMax() {
|
|
| 199 |
- return config.getOptionAsInt(T3ConfigurationOption.RF_TOT_MAX.key);
|
|
| 200 |
- }
|
|
| 201 |
- |
|
| 202 |
- public int getRFMinus10Max() {
|
|
| 203 |
- return config.getOptionAsInt(T3ConfigurationOption.RF_MINUS10_MAX.key);
|
|
| 204 |
- }
|
|
| 205 |
- |
|
| 206 |
- public int getRFPlus10Max() {
|
|
| 207 |
- return config.getOptionAsInt(T3ConfigurationOption.RF_PLUS10_MAX.key);
|
|
| 208 |
- }
|
|
| 209 |
- |
|
| 210 |
- public int getRFMinus10MinNumber() {
|
|
| 211 |
- return config.getOptionAsInt(T3ConfigurationOption.RF_MINUS10_MIN_NUMBER.key);
|
|
| 212 |
- }
|
|
| 213 |
- |
|
| 214 |
- public int getRFPlus10MinNumber() {
|
|
| 215 |
- return config.getOptionAsInt(T3ConfigurationOption.RF_PLUS10_MIN_NUMBER.key);
|
|
| 216 |
- }
|
|
| 217 |
- |
|
| 218 |
- public List<Integer> getLevel2DefaultSpecies() {
|
|
| 219 |
- ApplicationConfig.OptionList optionAsList = config.getOptionAsList(T3ConfigurationOption.LEVEL2_DEFAULT_SPECIES.key);
|
|
| 220 |
- return optionAsList.getOptionAsInt();
|
|
| 221 |
- }
|
|
| 222 |
- |
|
| 223 |
- public List<Integer> getLevel3DefaultSpecies() {
|
|
| 224 |
- ApplicationConfig.OptionList optionAsList = config.getOptionAsList(T3ConfigurationOption.LEVEL3_DEFAULT_SPECIES.key);
|
|
| 225 |
- return optionAsList.getOptionAsInt();
|
|
| 151 |
+ public List<Integer> getLevel3DefaultSpeciesAsList() {
|
|
| 152 |
+ return Arrays.asList(getLevel3DefaultSpecies());
|
|
| 226 | 153 |
}
|
| 227 | 154 |
|
| 228 | 155 |
public boolean isUpdateSchema() {
|
| 229 |
- Boolean result = config.getOptionAsBoolean("updateSchema");
|
|
| 230 |
- return result != null && result;
|
|
| 156 |
+ return get().getOptionAsBoolean("updateSchema");
|
|
| 231 | 157 |
}
|
| 232 | 158 |
|
| 233 | 159 |
/**
|
| ... | ... | @@ -237,9 +163,9 @@ public class T3Configuration { |
| 237 | 163 |
* the directory to create
|
| 238 | 164 |
* @param name a name used for logs
|
| 239 | 165 |
*/
|
| 240 |
- protected void createDirectory(T3ConfigurationOption key, String name) {
|
|
| 166 |
+ private void createDirectory(T3ConfigOption key, String name) {
|
|
| 241 | 167 |
|
| 242 |
- File directory = config.getOptionAsFile(key.getKey());
|
|
| 168 |
+ File directory = get().getOptionAsFile(key.getKey());
|
|
| 243 | 169 |
|
| 244 | 170 |
Preconditions.checkNotNull(
|
| 245 | 171 |
directory,
|
| ... | ... | @@ -278,7 +204,7 @@ public class T3Configuration { |
| 278 | 204 |
LogManager.resetConfiguration();
|
| 279 | 205 |
PropertyConfigurator.configure(finalLogConfigurationProperties);
|
| 280 | 206 |
|
| 281 |
- log = LogFactory.getLog(T3Configuration.class);
|
|
| 207 |
+ log = LogFactory.getLog(T3Config.class);
|
|
| 282 | 208 |
if (log.isInfoEnabled()) {
|
| 283 | 209 |
log.info("Configuration des logs chargée depuis le fichier " + logFile);
|
| 284 | 210 |
}
|
| ... | ... | @@ -291,17 +217,10 @@ public class T3Configuration { |
| 291 | 217 |
for (Map.Entry<Object, Object> entry : sourceProperties.entrySet()) {
|
| 292 | 218 |
String key = (String) entry.getKey();
|
| 293 | 219 |
String value = (String) entry.getValue();
|
| 294 |
- String newValue = config.replaceRecursiveOptions(value);
|
|
| 220 |
+ String newValue = get().replaceRecursiveOptions(value);
|
|
| 295 | 221 |
targetProperties.setProperty(key, newValue);
|
| 296 | 222 |
}
|
| 297 | 223 |
return targetProperties;
|
| 298 | 224 |
}
|
| 299 | 225 |
|
| 300 |
- private static class MyApplicationConfig extends ApplicationConfig {
|
|
| 301 |
- |
|
| 302 |
- @Override
|
|
| 303 |
- public String replaceRecursiveOptions(String option) {
|
|
| 304 |
- return super.replaceRecursiveOptions(option);
|
|
| 305 |
- }
|
|
| 306 |
- }
|
|
| 307 | 226 |
}
|
| 1 |
-/*
|
|
| 2 |
- * #%L
|
|
| 3 |
- * T3 :: Domain
|
|
| 4 |
- * %%
|
|
| 5 |
- * Copyright (C) 2010 - 2017 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 |
-package fr.ird.t3;
|
|
| 22 |
- |
|
| 23 |
-import java.io.File;
|
|
| 24 |
-import org.nuiton.config.ConfigOptionDef;
|
|
| 25 |
-import org.nuiton.version.Version;
|
|
| 26 |
- |
|
| 27 |
- |
|
| 28 |
-import static org.nuiton.i18n.I18n.n;
|
|
| 29 |
- |
|
| 30 |
-/**
|
|
| 31 |
- * All T3 configuration options.
|
|
| 32 |
- *
|
|
| 33 |
- * @since 1.0
|
|
| 34 |
- */
|
|
| 35 |
-public enum T3ConfigurationOption implements ConfigOptionDef {
|
|
| 36 |
- |
|
| 37 |
- CONTEXT_PATH(
|
|
| 38 |
- "context.path",
|
|
| 39 |
- n("t3.config.context.path.description"),
|
|
| 40 |
- "t3",
|
|
| 41 |
- String.class),
|
|
| 42 |
- |
|
| 43 |
- /** Main directory where to put t3 data (logs, and others...). */
|
|
| 44 |
- DATA_DIRECTORY(
|
|
| 45 |
- "data.directory",
|
|
| 46 |
- n("t3.config.data.directory.description"),
|
|
| 47 |
- "/var/local/t3/${context.path}",
|
|
| 48 |
- File.class),
|
|
| 49 |
- INTERNAL_DB_DIRECTORY(
|
|
| 50 |
- "internal.db.directory",
|
|
| 51 |
- n("t3.config.internal.db.directory.description"),
|
|
| 52 |
- "${data.directory}/db",
|
|
| 53 |
- File.class),
|
|
| 54 |
- |
|
| 55 |
- PARAMETER_PROFILE_DIRECTORY(
|
|
| 56 |
- "parameterProfiles.storage.directory",
|
|
| 57 |
- n("t3.config.parameterProfiles.storage.directory.description"),
|
|
| 58 |
- "${data.directory}/parameter-profiles",
|
|
| 59 |
- File.class),
|
|
| 60 |
- |
|
| 61 |
- LOG_FILE(
|
|
| 62 |
- "user.log.file",
|
|
| 63 |
- n("t3.user.log.file.description"),
|
|
| 64 |
- "${data.directory}/t3-log.properties",
|
|
| 65 |
- File.class),
|
|
| 66 |
- |
|
| 67 |
- USER_LOG_DIRECTORY(
|
|
| 68 |
- "user.log.directory",
|
|
| 69 |
- n("t3.user.log.directory.description"),
|
|
| 70 |
- "${data.directory}/logs",
|
|
| 71 |
- File.class),
|
|
| 72 |
- |
|
| 73 |
- TREATMENT_WORKING_DIRECTORY(
|
|
| 74 |
- "treatment.working.directory",
|
|
| 75 |
- n("t3.config.treatment.working.directory.description"),
|
|
| 76 |
- "${data.directory}/treatments",
|
|
| 77 |
- File.class),
|
|
| 78 |
- STRATUM_WEIGHT_RATIO(
|
|
| 79 |
- "stratum.weightRatio",
|
|
| 80 |
- n("t3.config.stratum.weightRatio.description"),
|
|
| 81 |
- "250",
|
|
| 82 |
- Float.class),
|
|
| 83 |
- RF1_MINIMUM_RATE(
|
|
| 84 |
- "rf1.minimumrate",
|
|
| 85 |
- n("t3.config.rf1.minimumrate.description"),
|
|
| 86 |
- "0.8",
|
|
| 87 |
- Float.class),
|
|
| 88 |
- RF1_MAXIMUM_RATE(
|
|
| 89 |
- "rf1.maximumrate",
|
|
| 90 |
- n("t3.config.rf1.maximumrate.description"),
|
|
| 91 |
- "1.2",
|
|
| 92 |
- Float.class),
|
|
| 93 |
- RF_TOT_MAX(
|
|
| 94 |
- "rfTot.maximum",
|
|
| 95 |
- n("t3.config.rfTot.maximum.description"),
|
|
| 96 |
- "250",
|
|
| 97 |
- Float.class),
|
|
| 98 |
- RF_MINUS10_MAX(
|
|
| 99 |
- "rfMinus10.maximum",
|
|
| 100 |
- n("t3.config.rfMinus10.maximum.description"),
|
|
| 101 |
- "500",
|
|
| 102 |
- Float.class),
|
|
| 103 |
- RF_PLUS10_MAX(
|
|
| 104 |
- "rfPlus10.maximum",
|
|
| 105 |
- n("t3.config.rfPlus10.maximum.description"),
|
|
| 106 |
- "500",
|
|
| 107 |
- Float.class),
|
|
| 108 |
- RF_MINUS10_MIN_NUMBER(
|
|
| 109 |
- "rfMinus10.minNumber",
|
|
| 110 |
- n("t3.config.rfMinus10.minNumber.description"),
|
|
| 111 |
- "75",
|
|
| 112 |
- Integer.class),
|
|
| 113 |
- RF_PLUS10_MIN_NUMBER(
|
|
| 114 |
- "rfPlus10.minNumber",
|
|
| 115 |
- n("t3.config.rfPlus10.minNumber.description"),
|
|
| 116 |
- "75",
|
|
| 117 |
- Integer.class),
|
|
| 118 |
- WEIGHTED_SET_WEIGHT(
|
|
| 119 |
- "level0.weightedSetWeight",
|
|
| 120 |
- n("t3.config.level0.weightedSetWeight.description"),
|
|
| 121 |
- "40",
|
|
| 122 |
- Float.class),
|
|
| 123 |
- LEVEL2_DEFAULT_SPECIES(
|
|
| 124 |
- "level2.defaultSpecies",
|
|
| 125 |
- n("t3.config.level2.defaultSpecies.description"),
|
|
| 126 |
- "1,2,3", // YFT, SKJ, BET
|
|
| 127 |
- int[].class),
|
|
| 128 |
- LEVEL3_DEFAULT_SPECIES(
|
|
| 129 |
- "level3.defaultSpecies",
|
|
| 130 |
- n("t3.config.level3.defaultSpecies.description"),
|
|
| 131 |
- "1,2,3,4,5,6", // YFT, SKJ, BET, ALB, LTA, FRI
|
|
| 132 |
- int[].class),
|
|
| 133 |
- T3_DATA_VERSION(
|
|
| 134 |
- "data.version",
|
|
| 135 |
- n("t3.config.data.version.description"),
|
|
| 136 |
- "",
|
|
| 137 |
- Version.class),;
|
|
| 138 |
- |
|
| 139 |
- /** Configuration key. */
|
|
| 140 |
- protected final String key;
|
|
| 141 |
- |
|
| 142 |
- /** I18n key of option description */
|
|
| 143 |
- protected final String description;
|
|
| 144 |
- |
|
| 145 |
- /** Type of option */
|
|
| 146 |
- protected final Class<?> type;
|
|
| 147 |
- |
|
| 148 |
- /** Default value of option. */
|
|
| 149 |
- protected String defaultValue;
|
|
| 150 |
- |
|
| 151 |
- T3ConfigurationOption(String key,
|
|
| 152 |
- String description,
|
|
| 153 |
- String defaultValue,
|
|
| 154 |
- Class<?> type) {
|
|
| 155 |
- this.key = key;
|
|
| 156 |
- this.description = description;
|
|
| 157 |
- this.defaultValue = defaultValue;
|
|
| 158 |
- this.type = type;
|
|
| 159 |
- }
|
|
| 160 |
- |
|
| 161 |
- @Override
|
|
| 162 |
- public String getKey() {
|
|
| 163 |
- return key;
|
|
| 164 |
- }
|
|
| 165 |
- |
|
| 166 |
- @Override
|
|
| 167 |
- public Class<?> getType() {
|
|
| 168 |
- return type;
|
|
| 169 |
- }
|
|
| 170 |
- |
|
| 171 |
- @Override
|
|
| 172 |
- public String getDescription() {
|
|
| 173 |
- return description;
|
|
| 174 |
- }
|
|
| 175 |
- |
|
| 176 |
- @Override
|
|
| 177 |
- public String getDefaultValue() {
|
|
| 178 |
- return defaultValue;
|
|
| 179 |
- }
|
|
| 180 |
- |
|
| 181 |
- @Override
|
|
| 182 |
- public boolean isTransient() {
|
|
| 183 |
- return true;
|
|
| 184 |
- }
|
|
| 185 |
- |
|
| 186 |
- @Override
|
|
| 187 |
- public boolean isFinal() {
|
|
| 188 |
- return true;
|
|
| 189 |
- }
|
|
| 190 |
- |
|
| 191 |
- @Override
|
|
| 192 |
- public void setDefaultValue(String defaultValue) {
|
|
| 193 |
- this.defaultValue = defaultValue;
|
|
| 194 |
- }
|
|
| 195 |
- |
|
| 196 |
- @Override
|
|
| 197 |
- public void setTransient(boolean newValue) {
|
|
| 198 |
- // not used
|
|
| 199 |
- }
|
|
| 200 |
- |
|
| 201 |
- @Override
|
|
| 202 |
- public void setFinal(boolean newValue) {
|
|
| 203 |
- // not used
|
|
| 204 |
- }
|
|
| 205 |
-}
|
| ... | ... | @@ -24,7 +24,7 @@ import com.google.common.collect.ArrayListMultimap; |
| 24 | 24 |
import com.google.common.collect.Maps;
|
| 25 | 25 |
import com.google.common.collect.Multimap;
|
| 26 | 26 |
import com.opensymphony.xwork2.LocaleProvider;
|
| 27 |
-import fr.ird.t3.T3Configuration;
|
|
| 27 |
+import fr.ird.t3.T3Config;
|
|
| 28 | 28 |
import fr.ird.t3.entities.T3Messager;
|
| 29 | 29 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| 30 | 30 |
import fr.ird.t3.entities.T3TopiaPersistenceContext;
|
| ... | ... | @@ -112,7 +112,7 @@ public class T3ActionContext<C extends T3ActionConfiguration> implements T3Messa |
| 112 | 112 |
}
|
| 113 | 113 |
|
| 114 | 114 |
@Override
|
| 115 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 115 |
+ public T3Config getApplicationConfiguration() {
|
|
| 116 | 116 |
return serviceContext.getApplicationConfiguration();
|
| 117 | 117 |
}
|
| 118 | 118 |
|
| ... | ... | @@ -22,8 +22,8 @@ package fr.ird.t3.entities; |
| 22 | 22 |
*/
|
| 23 | 23 |
|
| 24 | 24 |
import com.google.common.base.Charsets;
|
| 25 |
-import fr.ird.t3.T3Configuration;
|
|
| 26 |
-import fr.ird.t3.T3ConfigurationOption;
|
|
| 25 |
+import fr.ird.t3.T3Config;
|
|
| 26 |
+import fr.ird.t3.T3ConfigOption;
|
|
| 27 | 27 |
import fr.ird.t3.T3IOUtil;
|
| 28 | 28 |
import fr.ird.t3.entities.user.T3UserImpl;
|
| 29 | 29 |
import java.io.File;
|
| ... | ... | @@ -49,7 +49,7 @@ public class T3UserTopiaApplicationContext extends AbstractT3UserTopiaApplicatio |
| 49 | 49 |
* @param configuration application configuration where to find db directory
|
| 50 | 50 |
* @return the new fresh root context of the internal db
|
| 51 | 51 |
*/
|
| 52 |
- public static T3UserTopiaApplicationContext newInternalDb(T3Configuration configuration) {
|
|
| 52 |
+ public static T3UserTopiaApplicationContext newInternalDb(T3Config configuration) {
|
|
| 53 | 53 |
|
| 54 | 54 |
URL dbConfigFile = T3UserTopiaApplicationContext.class.getResource(T3_INTERNAL_DB_PROPERTIES);
|
| 55 | 55 |
|
| ... | ... | @@ -60,7 +60,7 @@ public class T3UserTopiaApplicationContext extends AbstractT3UserTopiaApplicatio |
| 60 | 60 |
try (InputStreamReader reader = new InputStreamReader(dbConfigFile.openStream(), Charsets.UTF_8)) {
|
| 61 | 61 |
result = new RecursiveProperties();
|
| 62 | 62 |
|
| 63 |
- String key = T3ConfigurationOption.INTERNAL_DB_DIRECTORY.getKey();
|
|
| 63 |
+ String key = T3ConfigOption.INTERNAL_DB_DIRECTORY.getKey();
|
|
| 64 | 64 |
|
| 65 | 65 |
result.setProperty(key, internalDbDirectory.getAbsolutePath());
|
| 66 | 66 |
result.load(reader);
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.services;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| 25 | 25 |
import fr.ird.t3.entities.T3TopiaPersistenceContext;
|
| 26 | 26 |
import fr.ird.t3.entities.T3UserTopiaApplicationContext;
|
| ... | ... | @@ -43,7 +43,7 @@ public class DefaultT3ServiceContext implements T3ServiceContext { |
| 43 | 43 |
|
| 44 | 44 |
private Locale locale;
|
| 45 | 45 |
|
| 46 |
- private final T3Configuration applicationConfiguration;
|
|
| 46 |
+ private final T3Config applicationConfiguration;
|
|
| 47 | 47 |
|
| 48 | 48 |
private final T3ServiceFactory serviceFactory;
|
| 49 | 49 |
|
| ... | ... | @@ -69,7 +69,7 @@ public class DefaultT3ServiceContext implements T3ServiceContext { |
| 69 | 69 |
T3TopiaApplicationContext transactionContext,
|
| 70 | 70 |
T3UserTopiaPersistenceContext internalTransaction,
|
| 71 | 71 |
T3TopiaPersistenceContext transaction,
|
| 72 |
- T3Configuration applicationConfiguration,
|
|
| 72 |
+ T3Config applicationConfiguration,
|
|
| 73 | 73 |
T3ServiceFactory serviceFactory) {
|
| 74 | 74 |
return new DefaultT3ServiceContext(locale,
|
| 75 | 75 |
internalTransactionContext,
|
| ... | ... | @@ -85,7 +85,7 @@ public class DefaultT3ServiceContext implements T3ServiceContext { |
| 85 | 85 |
T3TopiaApplicationContext applicationContext,
|
| 86 | 86 |
T3UserTopiaPersistenceContext internalTransaction,
|
| 87 | 87 |
T3TopiaPersistenceContext transaction,
|
| 88 |
- T3Configuration applicationConfiguration,
|
|
| 88 |
+ T3Config applicationConfiguration,
|
|
| 89 | 89 |
T3ServiceFactory serviceFactory) {
|
| 90 | 90 |
this.locale = locale;
|
| 91 | 91 |
this.internalApplicationContext = internalApplicationContext;
|
| ... | ... | @@ -123,7 +123,7 @@ public class DefaultT3ServiceContext implements T3ServiceContext { |
| 123 | 123 |
}
|
| 124 | 124 |
|
| 125 | 125 |
@Override
|
| 126 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 126 |
+ public T3Config getApplicationConfiguration() {
|
|
| 127 | 127 |
return applicationConfiguration;
|
| 128 | 128 |
}
|
| 129 | 129 |
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.services;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| 25 | 25 |
import fr.ird.t3.entities.T3TopiaPersistenceContext;
|
| 26 | 26 |
import fr.ird.t3.entities.T3UserTopiaApplicationContext;
|
| ... | ... | @@ -48,7 +48,7 @@ public interface T3ServiceContext { |
| 48 | 48 |
|
| 49 | 49 |
Locale getLocale();
|
| 50 | 50 |
|
| 51 |
- T3Configuration getApplicationConfiguration();
|
|
| 51 |
+ T3Config getApplicationConfiguration();
|
|
| 52 | 52 |
|
| 53 | 53 |
T3ServiceFactory getServiceFactory();
|
| 54 | 54 |
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.services;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.entities.T3TopiaPersistenceContext;
|
| 25 | 25 |
import fr.ird.t3.entities.T3UserTopiaPersistenceContext;
|
| 26 | 26 |
import java.util.Locale;
|
| ... | ... | @@ -56,7 +56,7 @@ public class T3ServiceSupport implements T3Service { |
| 56 | 56 |
return serviceContext.getLocale();
|
| 57 | 57 |
}
|
| 58 | 58 |
|
| 59 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 59 |
+ public T3Config getApplicationConfiguration() {
|
|
| 60 | 60 |
return serviceContext.getApplicationConfiguration();
|
| 61 | 61 |
}
|
| 62 | 62 |
|
| 1 |
-fr.ird.t3.T3ApplicationConfigProvider
|
|
| \ No newline at end of file |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.actions;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.T3IOUtil;
|
| 25 | 25 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 26 | 26 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -66,7 +66,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 66 | 66 |
|
| 67 | 67 |
protected File testDir;
|
| 68 | 68 |
|
| 69 |
- protected T3Configuration applicationConfiguration;
|
|
| 69 |
+ protected T3Config applicationConfiguration;
|
|
| 70 | 70 |
|
| 71 | 71 |
private Locale locale;
|
| 72 | 72 |
|
| ... | ... | @@ -88,7 +88,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 88 | 88 |
File treatmentDirectory = new File(testDir, "treatment");
|
| 89 | 89 |
FileUtil.createDirectoryIfNecessary(treatmentDirectory);
|
| 90 | 90 |
|
| 91 |
- T3Configuration realConfiguration = new T3Configuration() {
|
|
| 91 |
+ T3Config realConfiguration = new T3Config() {
|
|
| 92 | 92 |
@Override
|
| 93 | 93 |
public void init() {
|
| 94 | 94 |
parse();
|
| ... | ... | @@ -96,7 +96,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 96 | 96 |
};
|
| 97 | 97 |
realConfiguration.init();
|
| 98 | 98 |
Version t3DataVersion = realConfiguration.getT3DataVersion();
|
| 99 |
- applicationConfiguration = Mockito.mock(T3Configuration.class);
|
|
| 99 |
+ applicationConfiguration = Mockito.mock(T3Config.class);
|
|
| 100 | 100 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory()).thenReturn(treatmentDirectory);
|
| 101 | 101 |
Mockito.when(applicationConfiguration.getT3DataVersion()).thenReturn(t3DataVersion);
|
| 102 | 102 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory(Mockito.anyString(), Mockito.anyBoolean())).thenCallRealMethod();
|
| ... | ... | @@ -151,7 +151,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 151 | 151 |
}
|
| 152 | 152 |
|
| 153 | 153 |
@Override
|
| 154 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 154 |
+ public T3Config getApplicationConfiguration() {
|
|
| 155 | 155 |
return applicationConfiguration;
|
| 156 | 156 |
}
|
| 157 | 157 |
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.actions;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.T3IOUtil;
|
| 25 | 25 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 26 | 26 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -61,7 +61,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 61 | 61 |
|
| 62 | 62 |
protected File testDir;
|
| 63 | 63 |
|
| 64 |
- protected T3Configuration applicationConfiguration;
|
|
| 64 |
+ protected T3Config applicationConfiguration;
|
|
| 65 | 65 |
|
| 66 | 66 |
private Locale locale;
|
| 67 | 67 |
|
| ... | ... | @@ -83,7 +83,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 83 | 83 |
File treatmentDirectory = new File(testDir, "treatment");
|
| 84 | 84 |
FileUtil.createDirectoryIfNecessary(treatmentDirectory);
|
| 85 | 85 |
|
| 86 |
- T3Configuration realConfiguration = new T3Configuration() {
|
|
| 86 |
+ T3Config realConfiguration = new T3Config() {
|
|
| 87 | 87 |
@Override
|
| 88 | 88 |
public void init() {
|
| 89 | 89 |
parse();
|
| ... | ... | @@ -92,7 +92,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 92 | 92 |
realConfiguration.init();
|
| 93 | 93 |
Version t3DataVersion = realConfiguration.getT3DataVersion();
|
| 94 | 94 |
|
| 95 |
- applicationConfiguration = Mockito.mock(T3Configuration.class);
|
|
| 95 |
+ applicationConfiguration = Mockito.mock(T3Config.class);
|
|
| 96 | 96 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory()).thenReturn(treatmentDirectory);
|
| 97 | 97 |
Mockito.when(applicationConfiguration.getT3DataVersion()).thenReturn(t3DataVersion);
|
| 98 | 98 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory(Mockito.anyString(), Mockito.anyBoolean())).thenCallRealMethod();
|
| ... | ... | @@ -146,7 +146,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 146 | 146 |
}
|
| 147 | 147 |
|
| 148 | 148 |
@Override
|
| 149 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 149 |
+ public T3Config getApplicationConfiguration() {
|
|
| 150 | 150 |
return applicationConfiguration;
|
| 151 | 151 |
}
|
| 152 | 152 |
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.actions;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.T3IOUtil;
|
| 25 | 25 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 26 | 26 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -61,7 +61,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 61 | 61 |
|
| 62 | 62 |
protected File testDir;
|
| 63 | 63 |
|
| 64 |
- protected T3Configuration applicationConfiguration;
|
|
| 64 |
+ protected T3Config applicationConfiguration;
|
|
| 65 | 65 |
|
| 66 | 66 |
private Locale locale;
|
| 67 | 67 |
|
| ... | ... | @@ -83,7 +83,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 83 | 83 |
File treatmentDirectory = new File(testDir, "treatment");
|
| 84 | 84 |
FileUtil.createDirectoryIfNecessary(treatmentDirectory);
|
| 85 | 85 |
|
| 86 |
- T3Configuration realConfiguration = new T3Configuration() {
|
|
| 86 |
+ T3Config realConfiguration = new T3Config() {
|
|
| 87 | 87 |
@Override
|
| 88 | 88 |
public void init() {
|
| 89 | 89 |
parse();
|
| ... | ... | @@ -92,7 +92,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 92 | 92 |
realConfiguration.init();
|
| 93 | 93 |
Version t3DataVersion = realConfiguration.getT3DataVersion();
|
| 94 | 94 |
|
| 95 |
- applicationConfiguration = Mockito.mock(T3Configuration.class);
|
|
| 95 |
+ applicationConfiguration = Mockito.mock(T3Config.class);
|
|
| 96 | 96 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory()).thenReturn(treatmentDirectory);
|
| 97 | 97 |
Mockito.when(applicationConfiguration.getT3DataVersion()).thenReturn(t3DataVersion);
|
| 98 | 98 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory(Mockito.anyString(), Mockito.anyBoolean())).thenCallRealMethod();
|
| ... | ... | @@ -146,7 +146,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 146 | 146 |
}
|
| 147 | 147 |
|
| 148 | 148 |
@Override
|
| 149 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 149 |
+ public T3Config getApplicationConfiguration() {
|
|
| 150 | 150 |
return applicationConfiguration;
|
| 151 | 151 |
}
|
| 152 | 152 |
|
| ... | ... | @@ -25,7 +25,7 @@ package fr.ird.t3.tools; |
| 25 | 25 |
|
| 26 | 26 |
import com.google.common.base.Preconditions;
|
| 27 | 27 |
import com.google.common.base.Predicates;
|
| 28 |
-import fr.ird.t3.T3Configuration;
|
|
| 28 |
+import fr.ird.t3.T3Config;
|
|
| 29 | 29 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 30 | 30 |
import fr.ird.t3.entities.T3EntityHelper;
|
| 31 | 31 |
import fr.ird.t3.entities.T3ScriptHelper;
|
| ... | ... | @@ -192,7 +192,7 @@ public class T3ApplicationInstaller { |
| 192 | 192 |
|
| 193 | 193 |
|
| 194 | 194 |
// initialize configuration
|
| 195 |
- T3Configuration configuration = new T3Configuration();
|
|
| 195 |
+ T3Config configuration = new T3Config();
|
|
| 196 | 196 |
configuration.init();
|
| 197 | 197 |
|
| 198 | 198 |
|
| ... | ... | @@ -23,8 +23,8 @@ |
| 23 | 23 |
*/
|
| 24 | 24 |
package fr.ird.t3.tools;
|
| 25 | 25 |
|
| 26 |
-import fr.ird.t3.T3Configuration;
|
|
| 27 |
-import fr.ird.t3.T3ConfigurationOption;
|
|
| 26 |
+import fr.ird.t3.T3Config;
|
|
| 27 |
+import fr.ird.t3.T3ConfigOption;
|
|
| 28 | 28 |
import fr.ird.t3.T3IOUtil;
|
| 29 | 29 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 30 | 30 |
import fr.ird.t3.entities.T3EntityHelper;
|
| ... | ... | @@ -68,7 +68,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 68 | 68 |
|
| 69 | 69 |
protected File testDir;
|
| 70 | 70 |
|
| 71 |
- protected T3Configuration applicationConfiguration;
|
|
| 71 |
+ protected T3Config applicationConfiguration;
|
|
| 72 | 72 |
|
| 73 | 73 |
private Locale locale;
|
| 74 | 74 |
private boolean initOk;
|
| ... | ... | @@ -86,8 +86,8 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 86 | 86 |
}
|
| 87 | 87 |
|
| 88 | 88 |
Properties defaultProps = new Properties();
|
| 89 |
- defaultProps.put(T3ConfigurationOption.DATA_DIRECTORY.getKey(), testDir);
|
|
| 90 |
- applicationConfiguration = new T3Configuration(defaultProps) {
|
|
| 89 |
+ defaultProps.put(T3ConfigOption.DATA_DIRECTORY.getKey(), testDir);
|
|
| 90 |
+ applicationConfiguration = new T3Config(defaultProps) {
|
|
| 91 | 91 |
@Override
|
| 92 | 92 |
public void init() {
|
| 93 | 93 |
parse();
|
| ... | ... | @@ -141,7 +141,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 141 | 141 |
}
|
| 142 | 142 |
|
| 143 | 143 |
@Override
|
| 144 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 144 |
+ public T3Config getApplicationConfiguration() {
|
|
| 145 | 145 |
return applicationConfiguration;
|
| 146 | 146 |
}
|
| 147 | 147 |
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 |
*/
|
| 21 | 21 |
package fr.ird.t3.io.output.balbaya.v32;
|
| 22 | 22 |
|
| 23 |
-import fr.ird.t3.T3Configuration;
|
|
| 23 |
+import fr.ird.t3.T3Config;
|
|
| 24 | 24 |
import fr.ird.t3.T3IOUtil;
|
| 25 | 25 |
import fr.ird.t3.T3SqlScriptsImporter;
|
| 26 | 26 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -67,7 +67,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 67 | 67 |
|
| 68 | 68 |
protected File testDir;
|
| 69 | 69 |
|
| 70 |
- protected T3Configuration applicationConfiguration;
|
|
| 70 |
+ protected T3Config applicationConfiguration;
|
|
| 71 | 71 |
|
| 72 | 72 |
private Locale locale;
|
| 73 | 73 |
|
| ... | ... | @@ -89,7 +89,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 89 | 89 |
File treatmentDirectory = new File(testDir, "treatment");
|
| 90 | 90 |
FileUtil.createDirectoryIfNecessary(treatmentDirectory);
|
| 91 | 91 |
|
| 92 |
- T3Configuration realConfiguration = new T3Configuration() {
|
|
| 92 |
+ T3Config realConfiguration = new T3Config() {
|
|
| 93 | 93 |
@Override
|
| 94 | 94 |
public void init() {
|
| 95 | 95 |
parse();
|
| ... | ... | @@ -98,7 +98,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 98 | 98 |
realConfiguration.init();
|
| 99 | 99 |
Version t3DataVersion = realConfiguration.getT3DataVersion();
|
| 100 | 100 |
|
| 101 |
- applicationConfiguration = Mockito.mock(T3Configuration.class);
|
|
| 101 |
+ applicationConfiguration = Mockito.mock(T3Config.class);
|
|
| 102 | 102 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory()).thenReturn(treatmentDirectory);
|
| 103 | 103 |
Mockito.when(applicationConfiguration.getT3DataVersion()).thenReturn(t3DataVersion);
|
| 104 | 104 |
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory(Mockito.anyString(), Mockito.anyBoolean())).thenCallRealMethod();
|
| ... | ... | @@ -156,7 +156,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex |
| 156 | 156 |
}
|
| 157 | 157 |
|
| 158 | 158 |
@Override
|
| 159 |
- public T3Configuration getApplicationConfiguration() {
|
|
| 159 |
+ public T3Config getApplicationConfiguration() {
|
|
| 160 | 160 |
return applicationConfiguration;
|
| 161 | 161 |
}
|
| 162 | 162 |
|
| ... | ... | @@ -23,7 +23,7 @@ package fr.ird.t3.web; |
| 23 | 23 |
import com.google.common.base.Preconditions;
|
| 24 | 24 |
import com.google.common.collect.Sets;
|
| 25 | 25 |
import com.opensymphony.xwork2.ActionContext;
|
| 26 |
-import fr.ird.t3.T3Configuration;
|
|
| 26 |
+import fr.ird.t3.T3Config;
|
|
| 27 | 27 |
import fr.ird.t3.entities.T3UserTopiaApplicationContext;
|
| 28 | 28 |
import java.util.Map;
|
| 29 | 29 |
import java.util.Set;
|
| ... | ... | @@ -47,7 +47,7 @@ public class T3ApplicationContext { |
| 47 | 47 |
private static final String APPLICATION_CONTEXT_PARAMETER = "t3ApplicationContext";
|
| 48 | 48 |
|
| 49 | 49 |
/** Application configuration. */
|
| 50 |
- protected T3Configuration configuration;
|
|
| 50 |
+ protected T3Config configuration;
|
|
| 51 | 51 |
|
| 52 | 52 |
/** Root context for the internal database. */
|
| 53 | 53 |
protected T3UserTopiaApplicationContext internalRootContext;
|
| ... | ... | @@ -111,11 +111,11 @@ public class T3ApplicationContext { |
| 111 | 111 |
session.close();
|
| 112 | 112 |
}
|
| 113 | 113 |
|
| 114 |
- public T3Configuration getConfiguration() {
|
|
| 114 |
+ public T3Config getConfiguration() {
|
|
| 115 | 115 |
return configuration;
|
| 116 | 116 |
}
|
| 117 | 117 |
|
| 118 |
- public void setConfiguration(T3Configuration configuration) {
|
|
| 118 |
+ public void setConfiguration(T3Config configuration) {
|
|
| 119 | 119 |
this.configuration = configuration;
|
| 120 | 120 |
}
|
| 121 | 121 |
|
| ... | ... | @@ -21,8 +21,8 @@ |
| 21 | 21 |
package fr.ird.t3.web;
|
| 22 | 22 |
|
| 23 | 23 |
import fr.ird.converter.FloatConverter;
|
| 24 |
-import fr.ird.t3.T3Configuration;
|
|
| 25 |
-import fr.ird.t3.T3ConfigurationOption;
|
|
| 24 |
+import fr.ird.t3.T3Config;
|
|
| 25 |
+import fr.ird.t3.T3ConfigOption;
|
|
| 26 | 26 |
import fr.ird.t3.entities.T3EntityHelper;
|
| 27 | 27 |
import fr.ird.t3.entities.T3UserTopiaApplicationContext;
|
| 28 | 28 |
import fr.ird.t3.entities.T3UserTopiaPersistenceContext;
|
| ... | ... | @@ -52,7 +52,6 @@ import org.apache.commons.logging.LogFactory; |
| 52 | 52 |
import org.nuiton.i18n.I18n;
|
| 53 | 53 |
import org.nuiton.i18n.init.DefaultI18nInitializer;
|
| 54 | 54 |
import org.nuiton.topia.persistence.TopiaException;
|
| 55 |
-import org.nuiton.topia.persistence.util.TopiaUtil;
|
|
| 56 | 55 |
import org.nuiton.util.converter.ConverterUtil;
|
| 57 | 56 |
|
| 58 | 57 |
/**
|
| ... | ... | @@ -100,8 +99,8 @@ public class T3ApplicationListener implements ServletContextListener { |
| 100 | 99 |
|
| 101 | 100 |
// initialize configuration
|
| 102 | 101 |
Properties defaultProps = new Properties();
|
| 103 |
- defaultProps.put(T3ConfigurationOption.CONTEXT_PATH.getKey(), contextPath);
|
|
| 104 |
- T3Configuration configuration = new T3Configuration(defaultProps);
|
|
| 102 |
+ defaultProps.put(T3ConfigOption.CONTEXT_PATH.getKey(), contextPath);
|
|
| 103 |
+ T3Config configuration = new T3Config(defaultProps);
|
|
| 105 | 104 |
configuration.init();
|
| 106 | 105 |
|
| 107 | 106 |
log = LogFactory.getLog(T3ApplicationListener.class);
|
| ... | ... | @@ -211,7 +210,7 @@ public class T3ApplicationListener implements ServletContextListener { |
| 211 | 210 |
T3ServiceContext serviceContext) {
|
| 212 | 211 |
|
| 213 | 212 |
try {
|
| 214 |
- T3Configuration configuration = serviceContext.getApplicationConfiguration();
|
|
| 213 |
+ T3Config configuration = serviceContext.getApplicationConfiguration();
|
|
| 215 | 214 |
|
| 216 | 215 |
T3UserTopiaApplicationContext internalRootContext = T3UserTopiaApplicationContext.newInternalDb(configuration);
|
| 217 | 216 |
applicationContext.setInternalRootContext(internalRootContext);
|
| ... | ... | @@ -24,7 +24,7 @@ import com.google.common.base.Preconditions; |
| 24 | 24 |
import com.google.common.collect.Maps;
|
| 25 | 25 |
import com.google.common.collect.Sets;
|
| 26 | 26 |
import com.opensymphony.xwork2.ActionContext;
|
| 27 |
-import fr.ird.t3.T3Configuration;
|
|
| 27 |
+import fr.ird.t3.T3Config;
|
|
| 28 | 28 |
import fr.ird.t3.actions.T3ActionContext;
|
| 29 | 29 |
import fr.ird.t3.entities.T3EntityHelper;
|
| 30 | 30 |
import fr.ird.t3.entities.T3TopiaApplicationContext;
|
| ... | ... | @@ -295,7 +295,7 @@ public class T3Session implements Closeable, Serializable { |
| 295 | 295 |
|
| 296 | 296 |
if (result == null) {
|
| 297 | 297 |
|
| 298 |
- T3Configuration configuration = T3ActionSupport.getApplicationConfig();
|
|
| 298 |
+ T3Config configuration = T3ActionSupport.getApplicationConfig();
|
|
| 299 | 299 |
File userLogDirectory = configuration.getUserLogDirectory();
|
| 300 | 300 |
|
| 301 | 301 |
String filename = String.format(FILE_LOG_PATTERN,
|
| ... | ... | @@ -25,7 +25,7 @@ import com.google.common.collect.Lists; |
| 25 | 25 |
import com.google.common.collect.Maps;
|
| 26 | 26 |
import com.google.common.collect.Multimap;
|
| 27 | 27 |
import com.opensymphony.xwork2.ActionContext;
|
| 28 |
-import fr.ird.t3.T3Configuration;
|
|
| 28 |
+import fr.ird.t3.T3Config;
|
|
| 29 | 29 |
import fr.ird.t3.entities.T3TopiaPersistenceContext;
|
| 30 | 30 |
import fr.ird.t3.entities.T3UserTopiaPersistenceContext;
|
| 31 | 31 |
import fr.ird.t3.entities.data.TripTopiaDao;
|
| ... | ... | @@ -154,7 +154,7 @@ public class T3ActionSupport extends BaseAction implements TopiaTransactionAware |
| 154 | 154 |
return getApplicationConfig().getApplicationVersion();
|
| 155 | 155 |
}
|
| 156 | 156 |
|
| 157 |
- public static T3Configuration getApplicationConfig() {
|
|
| 157 |
+ public static T3Config getApplicationConfig() {
|
|
| 158 | 158 |
return getT3ApplicationContext().getConfiguration();
|
| 159 | 159 |
}
|
| 160 | 160 |
|
| ... | ... | @@ -43,7 +43,7 @@ public class ComputeRF1ConfigureAction extends AbstractLevel0ConfigureAction<Com |
| 43 | 43 |
protected void loadDefaultConfiguration(ComputeRF1Configuration config) throws TopiaException {
|
| 44 | 44 |
|
| 45 | 45 |
super.loadDefaultConfiguration(config);
|
| 46 |
- config.setMinimumRate(getApplicationConfig().getRF1MinimumRate());
|
|
| 47 |
- config.setMaximumRate(getApplicationConfig().getRF1MaximumRate());
|
|
| 46 |
+ config.setMinimumRate(getApplicationConfig().getRf1MinimumRate());
|
|
| 47 |
+ config.setMaximumRate(getApplicationConfig().getRf1MaximumRate());
|
|
| 48 | 48 |
}
|
| 49 | 49 |
}
|
| ... | ... | @@ -146,19 +146,19 @@ public class ManageLevel1ConfigurationAction extends AbstractConfigureAction<Lev |
| 146 | 146 |
conf.setFleetIds(ids);
|
| 147 | 147 |
|
| 148 | 148 |
// default rftotMax
|
| 149 |
- conf.setRfTotMax(getApplicationConfig().getRFTotMax());
|
|
| 149 |
+ conf.setRfTotMax(getApplicationConfig().getRfTotMax().intValue());
|
|
| 150 | 150 |
|
| 151 | 151 |
// default rfMinus10Max
|
| 152 |
- conf.setRfMinus10Max(getApplicationConfig().getRFMinus10Max());
|
|
| 152 |
+ conf.setRfMinus10Max(getApplicationConfig().getRfMinus10Max().intValue());
|
|
| 153 | 153 |
|
| 154 | 154 |
// default rfPlus10Max
|
| 155 |
- conf.setRfPlus10Max(getApplicationConfig().getRFPlus10Max());
|
|
| 155 |
+ conf.setRfPlus10Max(getApplicationConfig().getRfPlus10Max().intValue());
|
|
| 156 | 156 |
|
| 157 | 157 |
// default rfMinus10MinNumber
|
| 158 |
- conf.setRfMinus10MinNumber(getApplicationConfig().getRFMinus10MinNumber());
|
|
| 158 |
+ conf.setRfMinus10MinNumber(getApplicationConfig().getRfMinus10MinNumber());
|
|
| 159 | 159 |
|
| 160 | 160 |
// default rfPlus10MinNumber
|
| 161 |
- conf.setRfPlus10MinNumber(getApplicationConfig().getRFPlus10MinNumber());
|
|
| 161 |
+ conf.setRfPlus10MinNumber(getApplicationConfig().getRfPlus10MinNumber());
|
|
| 162 | 162 |
|
| 163 | 163 |
}
|
| 164 | 164 |
|
| ... | ... | @@ -185,7 +185,7 @@ public class ConfigureLevel2Step1Action extends AbstractConfigureAction<Level2Co |
| 185 | 185 |
if (!isValidating() && !configurationInSession) {
|
| 186 | 186 |
|
| 187 | 187 |
List<Integer> level2DefaultSpecies =
|
| 188 |
- getApplicationConfig().getLevel2DefaultSpecies();
|
|
| 188 |
+ getApplicationConfig().getLevel2DefaultSpeciesAsList();
|
|
| 189 | 189 |
|
| 190 | 190 |
// use default species
|
| 191 | 191 |
for (Species aSpecies : conf.getSpecies()) {
|
| ... | ... | @@ -182,7 +182,7 @@ public class ConfigureLevel3Step1Action extends AbstractConfigureAction<Level3Co |
| 182 | 182 |
if (!isValidating() && !configurationInSession) {
|
| 183 | 183 |
|
| 184 | 184 |
List<Integer> level3DefaultSpecies =
|
| 185 |
- getApplicationConfig().getLevel3DefaultSpecies();
|
|
| 185 |
+ getApplicationConfig().getLevel3DefaultSpeciesAsList();
|
|
| 186 | 186 |
|
| 187 | 187 |
// keep default species of level 3
|
| 188 | 188 |
for (Species aSpecies : conf.getSpecies()) {
|