Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: 0ea4c85e by Tony CHEMIT at 2018-02-21T17:02:36+01:00 fix level 2 and 3 config code - - - - - 5b34b3ef by Tony CHEMIT at 2018-02-21T17:05:13+01:00 [N2][N3] Gestion des catégories de poids -10/+10kg dans la stratification N2 et N3 (Mise en place de la configuration) (See #263) - - - - - 13 changed files: - t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action.ftl - t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action_en.ftl - t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action.ftl - t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action_en.ftl - t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step2Action.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step2Action.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/WEB-INF/jsp/data/level2/level2ConfigurationResume.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep2.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationResume.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep2.jsp Changes: ===================================== t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action.ftl ===================================== --- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action.ftl +++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action.ftl @@ -35,6 +35,12 @@ Corriger avec les échantillons de leur strate échantillon Corriger avec leur propre échantillon </#if> +<#if configuration.useWeightCategoriesInStratum> +Utilisation des catégories de poids +10/-10 dans la stratification. +<#else> +Catégories de poids +10/-10 non utilisés dans la stratification. +</#if> + <#list oceans?values as ocean> Océan sélectionné : ${ocean} </#list> @@ -63,6 +69,7 @@ Flotte d'échantillon sélectionnée : ${sampleFleet} Pavillon d'échantillon sélectionnée : ${sampleFlag} </#list> + Qualité des strates échantillons : - Nombre minimum d'effectif dans les échantillons : ===================================== t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action_en.ftl ===================================== --- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action_en.ftl +++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level2/Level2Action_en.ftl @@ -35,6 +35,12 @@ Fix with the stratum sample Fix with their own sample </#if> +<#if configuration.useWeightCategoriesInStratum> +Use weight categories +10/-10 in stratification. +<#else> +Do not use weight categories +10/-10 in stratification. +</#if> + <#list oceans?values as ocean> Selected ocean: ${ocean} </#list> ===================================== t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action.ftl ===================================== --- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action.ftl +++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action.ftl @@ -35,6 +35,12 @@ Appliquer les structures de tailles de la strate échantillons Conserver leurs échantillons en l'état </#if> +<#if configuration.useWeightCategoriesInStratum> +Utilisation des catégories de poids +10/-10 dans la stratification. +<#else> +Catégories de poids +10/-10 non utilisés dans la stratification. +</#if> + <#if configuration.useWeightCategories> Générer les structures de tailles par catégories de poids <#else> ===================================== t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action_en.ftl ===================================== --- a/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action_en.ftl +++ b/t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level3/Level3Action_en.ftl @@ -35,6 +35,12 @@ Apply length structures from the sample statrum Keep their own samples (do nothing) </#if> +<#if configuration.useWeightCategoriesInStratum> +Use weight categories +10/-10 in stratification. +<#else> +Do not use weight categories +10/-10 in stratification. +</#if> + <#if configuration.useWeightCategories> Generate length structures by weight category <#else> ===================================== t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java +++ b/t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java @@ -111,6 +111,10 @@ public abstract class LevelConfigurationWithStratum implements T3ActionConfigura * The first step is the general configuration. */ private boolean validStep1; + /** + * Flag to add weight categories as a component of the stratum hierarchy. + */ + private boolean useWeightCategoriesInStratum; /** * Flag to validate the step two of configuration. @@ -307,4 +311,12 @@ public abstract class LevelConfigurationWithStratum implements T3ActionConfigura public void setLocale(Locale locale) { this.locale = locale; } + + public boolean isUseWeightCategoriesInStratum() { + return useWeightCategoriesInStratum; + } + + public void setUseWeightCategoriesInStratum(boolean useWeightCategoriesInStratum) { + this.useWeightCategoriesInStratum= useWeightCategoriesInStratum; + } } ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step2Action.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step2Action.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step2Action.java @@ -33,8 +33,9 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.util.LinkedHashSet; import java.util.Map; -import java.util.TreeSet; +import java.util.Set; /** * To manager the step 2 of a level 2 treatment configuration. @@ -83,8 +84,8 @@ public class ConfigureLevel2Step2Action extends AbstractConfigureAction<Level2Co missingDatas = false; - TreeSet<Country> sampleFlags = new TreeSet<>(); - TreeSet<Country> sampleFleets = new TreeSet<>(); + Set<Country> sampleFlags = new LinkedHashSet<>(); + Set<Country> sampleFleets = new LinkedHashSet<>(); for (String oceanId : configuration.getOceanIds()) { sampleFlags.addAll(countryDAO.findAllFlagUsedInSample(oceanId)); sampleFleets.addAll(countryDAO.findAllFleetUsedInSample(oceanId)); ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step2Action.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step2Action.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step2Action.java @@ -34,8 +34,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.interceptor.ParameterAware; +import java.util.LinkedHashSet; import java.util.Map; -import java.util.TreeSet; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -51,24 +52,24 @@ public class ConfigureLevel3Step2Action extends AbstractConfigureAction<Level3Co public static final Pattern BL_STRATUM_MINIMUM_COUNT_PATTERN = Pattern.compile("BL:(.*)?"); private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(ConfigureLevel3Step2Action.class); - protected final Map<String, String> timeSteps = createTimeSteps(); + private final Map<String, String> timeSteps = createTimeSteps(); @InjectDAO(entityType = Country.class) - protected transient CountryTopiaDao countryDAO; + private transient CountryTopiaDao countryDAO; @InjectDecoratedBeans(beanType = Country.class) - protected Map<String, String> sampleFleets; + private Map<String, String> sampleFleets; @InjectDecoratedBeans(beanType = Country.class) - protected Map<String, String> sampleFlags; + private Map<String, String> sampleFlags; @InjectDecoratedBeans(beanType = Species.class, filterById = true, pathIds = "speciesIds") - protected Map<String, String> species; - protected Map<String, String> useSamplesOrNot; - protected Map<String, String> useWeightCategoriesOrNot; + private Map<String, String> species; + private Map<String, String> useSamplesOrNot; + private Map<String, String> useWeightCategoriesOrNot; /** * Flag to know if some data are missings. * <p/> * This flag is setted in the {@link #prepare()} method while * loading possibles data. */ - protected boolean missingDatas; + private boolean missingDatas; public ConfigureLevel3Step2Action() { super(Level3Configuration.class); @@ -88,8 +89,8 @@ public class ConfigureLevel3Step2Action extends AbstractConfigureAction<Level3Co missingDatas = false; - TreeSet<Country> sampleFlags = new TreeSet<>(); - TreeSet<Country> sampleFleets = new TreeSet<>(); + Set<Country> sampleFlags = new LinkedHashSet<>(); + Set<Country> sampleFleets = new LinkedHashSet<>(); for (String oceanId : configuration.getOceanIds()) { sampleFlags.addAll(countryDAO.findAllFlagUsedInSample(oceanId)); sampleFleets.addAll(countryDAO.findAllFleetUsedInSample(oceanId)); ===================================== t3-web/src/main/resources/i18n/t3-web_en_GB.properties ===================================== --- a/t3-web/src/main/resources/i18n/t3-web_en_GB.properties +++ b/t3-web/src/main/resources/i18n/t3-web_en_GB.properties @@ -118,6 +118,7 @@ t3.common.uploaded.source=Input file uploaded t3.common.usable.trips=Marées utilisables t3.common.useReplacementVessel=Use a replacement vessel t3.common.useSamplesOnly=Database 'Samples only' +t3.common.useWeightCategoriesInStratum=Use Weight categories -10/+10 in stratum t3.common.useWells=Use wells t3.common.user.outputDatabases=List of configured target databases t3.common.user.t3Databases=List of configured working databases ===================================== t3-web/src/main/resources/i18n/t3-web_fr_FR.properties ===================================== --- a/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties +++ b/t3-web/src/main/resources/i18n/t3-web_fr_FR.properties @@ -118,6 +118,7 @@ t3.common.uploaded.source=Source téléchargé t3.common.usable.trips=Marées utilisables t3.common.useReplacementVessel=Utiliser un navire de remplacement t3.common.useSamplesOnly=Base échantillon seulement +t3.common.useWeightCategoriesInStratum=Utiliser les catégories de poids -10/+10Kg dans la stratification t3.common.useWells=Utilisation des plans de cuve t3.common.user.outputDatabases=Liste des configurations de bases de sortie t3.common.user.t3Databases=Liste des configurations de bases de travail ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationResume.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationResume.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationResume.jsp @@ -41,7 +41,7 @@ list="zoneVersions" label='%{getText("t3.common.zoneVersion")}'/> <%-- selected catch fleet --%> - <s:select key="configuration.catchFleetId" list="catchFleets" disabled="true" + <s:select key="configuration.catchFleetIds" list="catchFleets" disabled="true" label='%{getText("t3.common.catchFleet")}'/> <%-- selected time step --%> @@ -90,6 +90,11 @@ label="%{getText('t3.common.stratumMinimumSampleCountFreeSchoolType')}"/> <div class="formSeparator"></div> + + <%--use weight categories in stratum--%> + <s:checkbox key="configuration.useWeightCategoriesInStratum" disabled="true" + label='%{getText("t3.common.useWeightCategoriesInStratum")}'/> + <%-- use all samples --%> <s:radio key="configuration.useAllSamplesOfStratum" list="useSamplesOrNot" disabled="true" label='%{getText("t3.label.data.level2.configuration.samplesToUse")}'/> ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep2.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep2.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep2.jsp @@ -68,6 +68,10 @@ <s:radio key="configuration.useAllSamplesOfStratum" requiredLabel="true" list="useSamplesOrNot" label='%{getText("t3.label.data.level2.configuration.samplesToUse")}'/> + <%--use weight categories in stratum--%> + <s:checkbox key="configuration.useWeightCategoriesInStratum" label='%{getText("t3.common.useWeightCategoriesInStratum")}'/> + + </fieldset> <br/> ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationResume.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationResume.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationResume.jsp @@ -38,7 +38,7 @@ label='%{getText("t3.common.zoneType")}'/> <%-- selected catch fleet --%> - <s:select key="configuration.catchFleetId" disabled="true" + <s:select key="configuration.catchFleetIds" disabled="true" list="catchFleets" label='%{getText("t3.common.catchFleet")}'/> <%-- selected time step --%> @@ -74,6 +74,10 @@ <s:radio key="configuration.useAllSamplesOfStratum" list="useSamplesOrNot" disabled="true" label='%{getText("t3.label.data.level3.configuration.samplesToUse")}'/> + <%--use weight categories in stratum--%> + <s:checkbox key="configuration.useWeightCategoriesInStratum" disabled="true" + label='%{getText("t3.common.useWeightCategoriesInStratum")}'/> + <%-- use weight categories --%> <s:radio key="configuration.useWeightCategories" list="useWeightCategoriesOrNot" disabled="true" label='%{getText("t3.label.data.level3.configuration.useWeightCategoriesOrNot")}'/> ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep2.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep2.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep2.jsp @@ -63,6 +63,10 @@ <%-- use weight categories --%> <s:radio key="configuration.useWeightCategories" requiredLabel="true" list="useWeightCategoriesOrNot" label='%{getText("t3.label.data.level3.configuration.useWeightCategoriesOrNot")}'/> + + <%--use weight categories in stratum--%> + <s:checkbox key="configuration.useWeightCategoriesInStratum" label='%{getText("t3.common.useWeightCategoriesInStratum")}'/> + <br/> <table class="cleanBoth"> <tr> View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/19e6e2e502638a48564ef16caeac7941... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/19e6e2e502638a48564ef16caeac7941... You're receiving this email because of your account on gitlab.com.