Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: f7b27df4 by Tony CHEMIT at 2018-04-05T15:39:09Z [N3] Option à supprimer sur le N3 (closes #307) - - - - - 14 changed files: - t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java - t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Configuration.java - 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-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step2Action.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.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/level3/level3ConfigurationResume.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep2.jsp Changes: ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java @@ -334,7 +334,6 @@ public class Level3Action extends T3Action<Level3Configuration> { String key = aCatch.getWeightCategoryTreatment().getTopiaId() + aCatch.getSpecies().getTopiaId(); linearCorrectedCatches.put(key, aCatch); } - boolean useWeightCategories = getConfiguration().isUseWeightCategories(); // Generate for each species to fix for (Species aSpecies : catchSpecies) { // get all compositions for this species @@ -350,34 +349,19 @@ public class Level3Action extends T3Action<Level3Configuration> { continue; } LengthWeightConversion conversions = catchStratum.getConfiguration().getConversionHelper().getConversions(aSpecies); - if (useWeightCategories) { - for (WeightCategoryTreatment weightCategory : weightCategories) { - // get total catch weight for this species and weight category - String key = weightCategory.getTopiaId() + aSpecies.getTopiaId(); - CorrectedElementaryCatch aCatch = linearCorrectedCatches.get(key); - if (aCatch != null) { - // get weight to use in this stratum (in kg) - float totalWeight = 1000 * aCatch.getCorrectedCatchWeight() / nbZones; - // get composition for this weight category - LengthCompositionModel model = compositionModel.getModel(weightCategory); - generateFrequencies(activity, aSpecies, previousValues, model, totalWeight, speciesCountModel, conversions); - } - } - } else { - float totalWeight = 0f; - for (WeightCategoryTreatment weightCategory : weightCategories) { - // get total catch weight for this species and weight category - String key = weightCategory.getTopiaId() + aSpecies.getTopiaId(); - CorrectedElementaryCatch aCatch = linearCorrectedCatches.get(key); - if (aCatch != null) { - totalWeight += aCatch.getCorrectedCatchWeight(); - } + float totalWeight = 0f; + for (WeightCategoryTreatment weightCategory : weightCategories) { + // get total catch weight for this species and weight category + String key = weightCategory.getTopiaId() + aSpecies.getTopiaId(); + CorrectedElementaryCatch aCatch = linearCorrectedCatches.get(key); + if (aCatch != null) { + totalWeight += aCatch.getCorrectedCatchWeight(); } - totalWeight = 1000 * totalWeight / nbZones; - // get composition for all weight categories - LengthCompositionModel model = compositionModel.getTotalModel(); - generateFrequencies(activity, aSpecies, previousValues, model, totalWeight, speciesCountModel, conversions); } + totalWeight = 1000 * totalWeight / nbZones; + // get composition for all weight categories + LengthCompositionModel model = compositionModel.getTotalModel(); + generateFrequencies(activity, aSpecies, previousValues, model, totalWeight, speciesCountModel, conversions); } } } ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Configuration.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Configuration.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Configuration.java @@ -8,12 +8,12 @@ * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% @@ -48,13 +48,6 @@ public class Level3Configuration extends LevelConfigurationWithStratum { */ private boolean useAllSamplesOfStratum; - /** - * Use weight categories when generating frequencies, or not. - * - * @since 2.0 - */ - private boolean useWeightCategories; - public Map<String, StratumMinimumSampleCount> getStratumMinimumSampleCount() { return stratumMinimumSampleCount; } @@ -71,14 +64,6 @@ public class Level3Configuration extends LevelConfigurationWithStratum { this.useAllSamplesOfStratum = useAllSamplesOfStratum; } - public boolean isUseWeightCategories() { - return useWeightCategories; - } - - public void setUseWeightCategories(boolean useWeightCategories) { - this.useWeightCategories = useWeightCategories; - } - @Override public String getName(Locale locale) { return l(locale, "t3.level3.action"); ===================================== 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 @@ -42,12 +42,6 @@ Utilisation des catégories de poids +10/-10 dans la stratification. 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> -Générer les structures de tailles toutes catégories de poids confondues -</#if> - <#list oceans?values as ocean> Océan sélectionné : ${ocean} </#list> ===================================== 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 @@ -42,12 +42,6 @@ Use weight categories +10/-10 in stratification. Do not use weight categories +10/-10 in stratification. </#if> -<#if configuration.useWeightCategories> -Generate length structures by weight category -<#else> -Generate length structures for all weight categories -</#if> - <#list oceans?values as ocean> Selected ocean: ${ocean} </#list> ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java @@ -316,12 +316,6 @@ public class T3ActionSupport extends ActionSupport implements T3TopiaPersistence "true", t("t3.label.data.level3.configuration.useAllSamples")); } - protected ImmutableMap<String, String> createLevel3UseWeightCategoriesOrNotMap() { - return ImmutableMap.of( - "true", t("t3.label.data.level3.configuration.useWeightCategories"), - "false", t("t3.label.data.level3.configuration.ignoreWeightCategories")); - } - protected ImmutableMap<String, String> createUseRfMinus10AndRfPlus10OrNot() { return ImmutableMap.of( "true", t("t3.label.data.level1.configuration.useRfMinus10AndRfPlus10"), ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java @@ -109,7 +109,6 @@ public class ConfigureLevel3Step1Action extends AbstractConfigureAction<Level3Co conf.setOceans(sortToList(oceanDAO.findAllUsedInActivity())); conf.setSpecies(sortToList(specieDAO.findAllSpeciesUsedInCatch())); conf.setZoneTypes(sortToList(getZoneStratumService().getZoneStratumAwareMetas())); - conf.setUseWeightCategories(true); } if (StringUtils.isNotEmpty(conf.getZoneTypeId())) { // let's fill the zone versions for the selected zone type ===================================== 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 @@ -25,7 +25,6 @@ import fr.ird.t3.actions.stratum.SchoolTypeIndeterminate; import fr.ird.t3.actions.stratum.StratumMinimumSampleCount; import fr.ird.t3.entities.reference.Country; import fr.ird.t3.entities.reference.CountryTopiaDao; -import fr.ird.t3.entities.reference.SchoolTypeTopiaDao; import fr.ird.t3.entities.reference.Species; import fr.ird.t3.services.ioc.InjectDAO; import fr.ird.t3.services.ioc.InjectDecoratedBeans; @@ -66,7 +65,6 @@ public class ConfigureLevel3Step2Action extends AbstractConfigureAction<Level3Co private Map<String, String> species; private Map<String, String> schoolTypeIndeterminate; private Map<String, String> useSamplesOrNot; - private Map<String, String> useWeightCategoriesOrNot; private Map<String, String> useWeightCategoriesInStratumOrNot; /** * Flag to know if some data are missing. @@ -82,7 +80,6 @@ public class ConfigureLevel3Step2Action extends AbstractConfigureAction<Level3Co @Override public void prepare() throws Exception { useSamplesOrNot = createLevel3UseSamplesOrNotMap(); - useWeightCategoriesOrNot = createLevel3UseWeightCategoriesOrNotMap(); useWeightCategoriesInStratumOrNot = createUseWeightCategoriesInStratumOrNot(); schoolTypeIndeterminate = sortAndDecorateIdAbles(Arrays.asList(SchoolTypeIndeterminate.values())); // on level 3, can't treat Indeterminate school type @@ -279,11 +276,6 @@ public class ConfigureLevel3Step2Action extends AbstractConfigureAction<Level3Co } @SuppressWarnings("unused") - public Map<String, String> getUseWeightCategoriesOrNot() { - return useWeightCategoriesOrNot; - } - - @SuppressWarnings("unused") public Map<String, String> getUseWeightCategoriesInStratumOrNot() { return useWeightCategoriesInStratumOrNot; } ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java @@ -74,7 +74,6 @@ public class Level3ConfigureAction extends AbstractConfigureAction<Level3Configu private Map<String, String> sampleFlags; private Map<String, String> schoolTypeIndeterminate; private Map<String, String> useSamplesOrNot; - private Map<String, String> useWeightCategoriesOrNot; private Map<String, String> useWeightCategoriesInStratumOrNot; public Level3ConfigureAction() { @@ -85,7 +84,6 @@ public class Level3ConfigureAction extends AbstractConfigureAction<Level3Configu public void prepare() throws Exception { log.info(String.format("Prepare with configuration %s", getConfiguration())); useSamplesOrNot = createLevel3UseSamplesOrNotMap(); - useWeightCategoriesOrNot = createLevel3UseWeightCategoriesOrNotMap(); useWeightCategoriesInStratumOrNot = createUseWeightCategoriesInStratumOrNot(); schoolTypeIndeterminate = sortAndDecorateIdAbles(Arrays.asList(SchoolTypeIndeterminate.values())); // on level 3, can't treat Indeterminate school type @@ -165,11 +163,6 @@ public class Level3ConfigureAction extends AbstractConfigureAction<Level3Configu } @SuppressWarnings("unused") - public Map<String, String> getUseWeightCategoriesOrNot() { - return useWeightCategoriesOrNot; - } - - @SuppressWarnings("unused") public Map<String, String> getUseWeightCategoriesInStratumOrNot() { return useWeightCategoriesInStratumOrNot; } ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java @@ -72,7 +72,6 @@ public class Level3RunAction extends AbstractRunAction<Level3Configuration, Leve private Map<String, String> sampleFlags; private Map<String, String> schoolTypeIndeterminate; private Map<String, String> useSamplesOrNot; - private Map<String, String> useWeightCategoriesOrNot; private Map<String, String> useWeightCategoriesInStratumOrNot; public Level3RunAction() { @@ -145,11 +144,6 @@ public class Level3RunAction extends AbstractRunAction<Level3Configuration, Leve } @SuppressWarnings("unused") - public Map<String, String> getUseWeightCategoriesOrNot() { - return useWeightCategoriesOrNot; - } - - @SuppressWarnings("unused") public Map<String, String> getUseWeightCategoriesInStratumOrNot() { return useWeightCategoriesInStratumOrNot; } @@ -157,7 +151,6 @@ public class Level3RunAction extends AbstractRunAction<Level3Configuration, Leve @Override public void prepare() throws Exception { useSamplesOrNot = createLevel3UseSamplesOrNotMap(); - useWeightCategoriesOrNot = createLevel3UseWeightCategoriesOrNotMap(); useWeightCategoriesInStratumOrNot = createUseWeightCategoriesInStratumOrNot(); schoolTypeIndeterminate = sortAndDecorateIdAbles(Arrays.asList(SchoolTypeIndeterminate.values())); super.prepare(); ===================================== 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 @@ -263,15 +263,12 @@ t3.label.data.level2.configuration.step1=Level 2 configuration step 1 t3.label.data.level2.configuration.step2=Level 2 configuration step 2 t3.label.data.level2.configuration.useAllSamples=Use their own sample t3.label.data.level2.configuration.useCatchSamples=Use their stratum sample -t3.label.data.level3.configuration.ignoreWeightCategories=Do not use weight categories t3.label.data.level3.configuration.resume=Level 3 configuration resume t3.label.data.level3.configuration.samplesToUse=Treatment to apply to catches with samples t3.label.data.level3.configuration.step1=Level 3 configuration step 1 t3.label.data.level3.configuration.step2=Level 3 configuration step 2 t3.label.data.level3.configuration.useAllSamples=Keep their own sample (do nothing) t3.label.data.level3.configuration.useCatchSamples=Apply length structures from the sample stratum -t3.label.data.level3.configuration.useWeightCategories=Use weight categories -t3.label.data.level3.configuration.useWeightCategoriesOrNot=Extrapolation method t3.label.data.treatment.level0=Level 0 treatment t3.label.data.treatment.level1=Level 0 treatment t3.label.data.treatment.level2=Level 2 treatment\: Species composition correction ===================================== 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 @@ -263,15 +263,12 @@ t3.label.data.level2.configuration.step1=Configuration du niveau 2 (étape 1) t3.label.data.level2.configuration.step2=Configuration du niveau 2 (étape 2) t3.label.data.level2.configuration.useAllSamples=Les échantillons de leur strate échantillon t3.label.data.level2.configuration.useCatchSamples=Leur propre échantillon -t3.label.data.level3.configuration.ignoreWeightCategories=Extrapoler les échantillons uniformément t3.label.data.level3.configuration.resume=Résumé de la configuration t3.label.data.level3.configuration.samplesToUse=Traitement à appliquer aux calées avec échantillon t3.label.data.level3.configuration.step1=Configuration du niveau 3 (étape 1) t3.label.data.level3.configuration.step2=Configuration du niveau 3 (étape 2) t3.label.data.level3.configuration.useAllSamples=Appliquer les structures de tailles de la strate échantillons t3.label.data.level3.configuration.useCatchSamples=Conserver leurs échantillons en l'état -t3.label.data.level3.configuration.useWeightCategories=Extrapoler les échantillons proportionnellement aux captures des catégories de poids -t3.label.data.level3.configuration.useWeightCategoriesOrNot=Méthode d'extrapolation t3.label.data.treatment.level0=Traitement du niveau 0 t3.label.data.treatment.level1=Traitement du niveau 1 t3.label.data.treatment.level2=Traitement du niveau 2 \: Correction de la composition spécifique ===================================== 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 @@ -68,10 +68,6 @@ <s:radio key="configuration.useAllSamplesOfStratum" disabled="true" list="useSamplesOrNot" label='%{getText("t3.label.data.level3.configuration.samplesToUse")}'/> - <%-- use weight categories --%> - <s:radio key="configuration.useWeightCategories" disabled="true" list="useWeightCategoriesOrNot" - label='%{getText("t3.label.data.level3.configuration.useWeightCategoriesOrNot")}'/> - <%--use weight categories in stratum--%> <s:radio key="configuration.useWeightCategoriesInStratum" disabled="true" list="useWeightCategoriesInStratumOrNot" label='%{getText("t3.label.data.useWeightCategoriesInStratum")}'/> ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp @@ -99,10 +99,6 @@ label='%{getText("t3.common.endDate")}' appendText=" (mm-yyyy)"/> <%-- selected species --%> - <%--<s:iterator value="configuration.speciesIds" var="id">--%> - <%--<s:hidden name="configuration.speciesIds" value='%{#id}'/>--%> - <%--</s:iterator>--%> - <s:checkboxlist key="configuration.speciesIds" requiredLabel="true" list="species" label='%{getText("t3.common.species")}' template="mycheckboxlist"/> ===================================== 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 @@ -57,10 +57,6 @@ <s:radio key="configuration.useAllSamplesOfStratum" requiredLabel="true" list="useSamplesOrNot" label='%{getText("t3.label.data.level3.configuration.samplesToUse")}'/> - <%-- 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:radio key="configuration.useWeightCategoriesInStratum" requiredLabel="true" list="useWeightCategoriesInStratumOrNot" label='%{getText("t3.label.data.useWeightCategoriesInStratum")}'/> View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/f7b27df40d4086b84428812cf752bc05d... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/f7b27df40d4086b84428812cf752bc05d... You're receiving this email because of your account on gitlab.com.