Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
b5cd2d6d
by Tony Chemit at 2023-02-24T01:30:04+01:00
15 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/actions/src/main/i18n/getters/jaxx.getter
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateConfigUI.jaxx
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateConfigUI.jcss
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateUIHandler.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/ConsolidateConfigUIActionSupport.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/SelectConsolidationConfigFlag.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/Start.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
- core/persistence/java/src/main/java/fr/ird/observe/entities/referential/common/LengthWeightParameters.java
Changes:
| ... | ... | @@ -462,6 +462,18 @@ key = instance.validation.useDisabledReferential |
| 462 | 462 | type = Boolean
|
| 463 | 463 | defaultValue = false
|
| 464 | 464 | |
| 465 | +[option consolidationFailIfLengthWeightParameterNotFound]
|
|
| 466 | +description = observe.config.consolidation.failIfLengthWeightParameterNotFound
|
|
| 467 | +key = instance.consolidation.failIfLengthWeightParameterNotFound
|
|
| 468 | +type = Boolean
|
|
| 469 | +defaultValue = false
|
|
| 470 | + |
|
| 471 | +[option consolidationFailIfLengthLengthParameterNotFound]
|
|
| 472 | +description = observe.config.consolidation.failIfLengthLengthParameterNotFound
|
|
| 473 | +key = instance.consolidation.failIfLengthLengthParameterNotFound
|
|
| 474 | +type = Boolean
|
|
| 475 | +defaultValue = false
|
|
| 476 | + |
|
| 465 | 477 | [option sizeMeasureTypeSeineObservationTargetSampleId]
|
| 466 | 478 | description = observe.config.sizeMeasureType.seine.observation.targetSample
|
| 467 | 479 | key = referential.sizeMeasureType.seine.observation.targetSample
|
| ... | ... | @@ -19,6 +19,8 @@ observe.config.client.backupFiles.timeout.description |
| 19 | 19 | observe.config.client.feedbackFiles.timeout.description
|
| 20 | 20 | observe.config.client.logFiles.timeout.description
|
| 21 | 21 | observe.config.client.temporaryFiles.timeout.description
|
| 22 | +observe.config.consolidation.failIfLengthLengthParameterNotFound
|
|
| 23 | +observe.config.consolidation.failIfLengthWeightParameterNotFound
|
|
| 22 | 24 | observe.config.coordinate.format
|
| 23 | 25 | observe.config.db.locale
|
| 24 | 26 | observe.config.dcpPresetsDirectory.description
|
| ... | ... | @@ -271,6 +271,8 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext |
| 271 | 271 | helper.addOption(ClientConfigOption.VALIDATION_SPEED_MAX_VALUE);
|
| 272 | 272 | helper.addOption(ClientConfigOption.VALIDATION_LENGTH_WEIGHT_ENABLE);
|
| 273 | 273 | helper.addOption(ClientConfigOption.VALIDATION_USE_DISABLED_REFERENTIAL);
|
| 274 | + helper.addOption(ClientConfigOption.CONSOLIDATION_FAIL_IF_LENGTH_WEIGHT_PARAMETER_NOT_FOUND);
|
|
| 275 | + helper.addOption(ClientConfigOption.CONSOLIDATION_FAIL_IF_LENGTH_LENGTH_PARAMETER_NOT_FOUND);
|
|
| 274 | 276 | |
| 275 | 277 | }
|
| 276 | 278 |
| ... | ... | @@ -2,6 +2,8 @@ observe.Common.directory |
| 2 | 2 | observe.Common.file
|
| 3 | 3 | observe.Common.global.progression.description
|
| 4 | 4 | observe.Common.step.description
|
| 5 | +observe.config.consolidation.failIfLengthLengthParameterNotFound
|
|
| 6 | +observe.config.consolidation.failIfLengthWeightParameterNotFound
|
|
| 5 | 7 | observe.config.ui.seineBycatchObservedSystem.description
|
| 6 | 8 | observe.config.validation.lengthWeightEnable
|
| 7 | 9 | observe.config.validation.speedEnable
|
| ... | ... | @@ -12,6 +14,7 @@ observe.info.validation.credentials |
| 12 | 14 | observe.ui.action.show.properties
|
| 13 | 15 | observe.ui.action.show.properties.tip
|
| 14 | 16 | observe.ui.choice.cancel.tip
|
| 17 | +observe.ui.datasource.editor.actions.consolidate.config
|
|
| 15 | 18 | observe.ui.datasource.editor.actions.operation.configuration
|
| 16 | 19 | observe.ui.datasource.editor.actions.operations
|
| 17 | 20 | observe.ui.datasource.editor.actions.report.auto.copy.to.clipboard
|
| 1 | +<!--
|
|
| 2 | + #%L
|
|
| 3 | + ObServe Client :: DataSource :: Actions
|
|
| 4 | + %%
|
|
| 5 | + Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 6 | + %%
|
|
| 7 | + This program is free software: you can redistribute it and/or modify
|
|
| 8 | + it under the terms of the GNU General Public License as
|
|
| 9 | + published by the Free Software Foundation, either version 3 of the
|
|
| 10 | + License, or (at your option) any later version.
|
|
| 11 | + This program is distributed in the hope that it will be useful,
|
|
| 12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 14 | + GNU General Public License for more details.
|
|
| 15 | + You should have received a copy of the GNU General Public
|
|
| 16 | + License along with this program. If not, see
|
|
| 17 | + <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 18 | + #L%
|
|
| 19 | + -->
|
|
| 20 | +<JPanel id="consolidateConfig" layout="{new BorderLayout()}">
|
|
| 21 | + |
|
| 22 | + <import>
|
|
| 23 | + fr.ird.observe.client.datasource.actions.AdminUIModel
|
|
| 24 | + fr.ird.observe.client.datasource.actions.consolidate.actions.SelectConsolidationConfigFlag
|
|
| 25 | + |
|
| 26 | + org.nuiton.jaxx.widgets.number.NumberEditor
|
|
| 27 | + |
|
| 28 | + java.io.File
|
|
| 29 | + |
|
| 30 | + javax.swing.JComboBox
|
|
| 31 | + |
|
| 32 | + static io.ultreia.java4all.i18n.I18n.t
|
|
| 33 | + static fr.ird.observe.client.util.UIHelper.getStringValue
|
|
| 34 | + </import>
|
|
| 35 | + |
|
| 36 | + <ConsolidateUIHandler id='handler' initializer='getContextValue(ConsolidateUIHandler.class)'/>
|
|
| 37 | + <AdminUIModel id='model' initializer='getContextValue(AdminUIModel.class)'/>
|
|
| 38 | + <ConsolidateModel id='consolidateModel' initializer='model.getConsolidateModel()'/>
|
|
| 39 | + |
|
| 40 | + <script><![CDATA[
|
|
| 41 | +public void destroy() {
|
|
| 42 | + model = null;
|
|
| 43 | + consolidateModel = null;
|
|
| 44 | +}
|
|
| 45 | +]]>
|
|
| 46 | + </script>
|
|
| 47 | + |
|
| 48 | + <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
|
|
| 49 | + <Table id="consolidateDataConfig" constraints='BorderLayout.NORTH'>
|
|
| 50 | + |
|
| 51 | + <row>
|
|
| 52 | + <cell anchor="west">
|
|
| 53 | + <JLabel id='consolidationFailIfLengthWeightParameterNotFoundLabel' styleClass="skipI18n"/>
|
|
| 54 | + </cell>
|
|
| 55 | + <cell weightx='1' fill="horizontal">
|
|
| 56 | + <JCheckBox id='consolidationFailIfLengthWeightParameterNotFound' styleClass="skipI18n"/>
|
|
| 57 | + </cell>
|
|
| 58 | + </row>
|
|
| 59 | + <row>
|
|
| 60 | + <cell anchor="west">
|
|
| 61 | + <JLabel id='consolidationFailIfLengthLengthParameterNotFoundLabel' styleClass="skipI18n"/>
|
|
| 62 | + </cell>
|
|
| 63 | + <cell weightx='1' fill="horizontal">
|
|
| 64 | + <JCheckBox id='consolidationFailIfLengthLengthParameterNotFound' styleClass="skipI18n"/>
|
|
| 65 | + </cell>
|
|
| 66 | + </row>
|
|
| 67 | + </Table>
|
|
| 68 | + <!--Table id='consolidationReportConfig' fill='both' constraints='BorderLayout.CENTER'>
|
|
| 69 | + <row>
|
|
| 70 | + <cell>
|
|
| 71 | + <JLabel id="consolidationReportDirectoryLabel"/>
|
|
| 72 | + </cell>
|
|
| 73 | + <cell weightx='1' fill="horizontal">
|
|
| 74 | + <JTextField id='consolidationReportDirectoryText'
|
|
| 75 | + onKeyReleased='getHandler().changeConsolidationReportDirectory(this, new File(((JTextField)event.getSource()).getText()))'/>
|
|
| 76 | + </cell>
|
|
| 77 | + <cell anchor="east">
|
|
| 78 | + <JButton id="chooseConsolidationReportFileAction"/>
|
|
| 79 | + </cell>
|
|
| 80 | + </row>
|
|
| 81 | + <row>
|
|
| 82 | + <cell>
|
|
| 83 | + <JLabel id="consolidationReportFileLabel"/>
|
|
| 84 | + </cell>
|
|
| 85 | + <cell weightx='1' fill="horizontal" columns="2">
|
|
| 86 | + <JTextField
|
|
| 87 | + id='consolidationReportFilenameText'
|
|
| 88 | + onKeyReleased='getHandler().changeConsolidationReportFilename(this, ((JTextField)event.getSource()).getText())'/>
|
|
| 89 | + </cell>
|
|
| 90 | + </row>
|
|
| 91 | + </Table-->
|
|
| 92 | + |
|
| 93 | + </JPanel>
|
|
| 94 | +<!-- <Table constraints='BorderLayout.SOUTH' weightx='1' weighty='1'>-->
|
|
| 95 | +<!-- <row>-->
|
|
| 96 | +<!-- <cell>-->
|
|
| 97 | +<!-- <JLabel/>-->
|
|
| 98 | +<!-- </cell>-->
|
|
| 99 | +<!-- </row>-->
|
|
| 100 | +<!-- </Table>-->
|
|
| 101 | + |
|
| 102 | +</JPanel> |
| 1 | +/*
|
|
| 2 | + * #%L
|
|
| 3 | + * ObServe Client :: DataSource :: Actions
|
|
| 4 | + * %%
|
|
| 5 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 6 | + * %%
|
|
| 7 | + * This program is free software: you can redistribute it and/or modify
|
|
| 8 | + * it under the terms of the GNU General Public License as
|
|
| 9 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 10 | + * License, or (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 General Public
|
|
| 18 | + * License along with this program. If not, see
|
|
| 19 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 | + * #L%
|
|
| 21 | + */
|
|
| 22 | + |
|
| 23 | +#consolidateDataConfig {
|
|
| 24 | + border:{new TitledBorder(t("observe.ui.datasource.editor.actions.consolidate.config") + " ")};
|
|
| 25 | +}
|
|
| 26 | + |
|
| 27 | +#consolidationFailIfLengthWeightParameterNotFoundLabel {
|
|
| 28 | + text:"observe.config.consolidation.failIfLengthWeightParameterNotFound";
|
|
| 29 | +}
|
|
| 30 | + |
|
| 31 | +#consolidationFailIfLengthWeightParameterNotFound {
|
|
| 32 | + selected:{consolidateModel.isConsolidationFailIfLengthWeightParameterNotFound()};
|
|
| 33 | +}
|
|
| 34 | + |
|
| 35 | +#consolidationFailIfLengthLengthParameterNotFoundLabel {
|
|
| 36 | + text:"observe.config.consolidation.failIfLengthLengthParameterNotFound";
|
|
| 37 | +}
|
|
| 38 | + |
|
| 39 | +#consolidationFailIfLengthLengthParameterNotFound {
|
|
| 40 | + selected:{consolidateModel.isConsolidationFailIfLengthLengthParameterNotFound()};
|
|
| 41 | +}
|
|
| 42 | + |
|
| 43 | + |
|
| 44 | +#consolidationReportConfig {
|
|
| 45 | + border:{new TitledBorder(t("observe.ui.datasource.editor.actions.consolidate.config.report") + " ")};
|
|
| 46 | +}
|
|
| 47 | + |
|
| 48 | +#consolidationReportDirectoryLabel {
|
|
| 49 | + text:"observe.Common.directory";
|
|
| 50 | +}
|
|
| 51 | + |
|
| 52 | +#consolidationReportDirectoryText {
|
|
| 53 | + text:{consolidateModel.getReportFile().getParent()};
|
|
| 54 | +}
|
|
| 55 | + |
|
| 56 | +#consolidationReportFileLabel {
|
|
| 57 | + text:"observe.Common.file";
|
|
| 58 | +}
|
|
| 59 | + |
|
| 60 | +#consolidationReportFilenameText {
|
|
| 61 | + text:{consolidateModel.getReportFile().getName()};
|
|
| 62 | +} |
| ... | ... | @@ -51,6 +51,9 @@ public class ConsolidateModel extends AdminActionModel { |
| 51 | 51 | */
|
| 52 | 52 | private final Set<String> alreadyDoneTripIds;
|
| 53 | 53 | |
| 54 | + private boolean consolidationFailIfLengthWeightParameterNotFound;
|
|
| 55 | + private boolean consolidationFailIfLengthLengthParameterNotFound;
|
|
| 56 | + |
|
| 54 | 57 | public ConsolidateModel() {
|
| 55 | 58 | super(AdminStep.CONSOLIDATE);
|
| 56 | 59 | this.alreadyDoneTripIds = new TreeSet<>();
|
| ... | ... | @@ -81,6 +84,9 @@ public class ConsolidateModel extends AdminActionModel { |
| 81 | 84 | sourceModel.setRequiredReadOnReferential(true);
|
| 82 | 85 | sourceModel.setRequiredReadOnData(true);
|
| 83 | 86 | sourceModel.setRequiredWriteOnData(true);
|
| 87 | + |
|
| 88 | + setConsolidationFailIfLengthWeightParameterNotFound(getClientConfig().isConsolidationFailIfLengthWeightParameterNotFound());
|
|
| 89 | + setConsolidationFailIfLengthLengthParameterNotFound(getClientConfig().isConsolidationFailIfLengthLengthParameterNotFound());
|
|
| 84 | 90 | }
|
| 85 | 91 | |
| 86 | 92 | @Override
|
| ... | ... | @@ -95,4 +101,24 @@ public class ConsolidateModel extends AdminActionModel { |
| 95 | 101 | public void setTripProcessed(String tripId) {
|
| 96 | 102 | alreadyDoneTripIds.add(tripId);
|
| 97 | 103 | }
|
| 104 | + |
|
| 105 | + public boolean isConsolidationFailIfLengthWeightParameterNotFound() {
|
|
| 106 | + return consolidationFailIfLengthWeightParameterNotFound;
|
|
| 107 | + }
|
|
| 108 | + |
|
| 109 | + public void setConsolidationFailIfLengthWeightParameterNotFound(boolean consolidationFailIfLengthWeightParameterNotFound) {
|
|
| 110 | + boolean oldValue = this.consolidationFailIfLengthWeightParameterNotFound;
|
|
| 111 | + this.consolidationFailIfLengthWeightParameterNotFound = consolidationFailIfLengthWeightParameterNotFound;
|
|
| 112 | + firePropertyChange("consolidationFailIfLengthWeightParameterNotFound", oldValue, consolidationFailIfLengthWeightParameterNotFound);
|
|
| 113 | + }
|
|
| 114 | + |
|
| 115 | + public boolean isConsolidationFailIfLengthLengthParameterNotFound() {
|
|
| 116 | + return consolidationFailIfLengthLengthParameterNotFound;
|
|
| 117 | + }
|
|
| 118 | + |
|
| 119 | + public void setConsolidationFailIfLengthLengthParameterNotFound(boolean consolidationFailIfLengthLengthParameterNotFound) {
|
|
| 120 | + boolean oldValue = this.consolidationFailIfLengthLengthParameterNotFound;
|
|
| 121 | + this.consolidationFailIfLengthLengthParameterNotFound = consolidationFailIfLengthLengthParameterNotFound;
|
|
| 122 | + firePropertyChange("consolidationFailIfLengthLengthParameterNotFound", oldValue, consolidationFailIfLengthLengthParameterNotFound);
|
|
| 123 | + }
|
|
| 98 | 124 | } |
| ... | ... | @@ -23,6 +23,8 @@ package fr.ird.observe.client.datasource.actions.consolidate; |
| 23 | 23 | |
| 24 | 24 | import fr.ird.observe.client.datasource.actions.AdminTabUIHandler;
|
| 25 | 25 | import fr.ird.observe.client.datasource.actions.config.ConfigUI;
|
| 26 | +import fr.ird.observe.client.datasource.actions.consolidate.actions.SelectConsolidationConfigFlag;
|
|
| 27 | +import fr.ird.observe.client.util.UIHelper;
|
|
| 26 | 28 | import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 27 | 29 | |
| 28 | 30 | import static io.ultreia.java4all.i18n.I18n.t;
|
| ... | ... | @@ -43,6 +45,9 @@ public class ConsolidateUIHandler extends AdminTabUIHandler<ConsolidateUI> imple |
| 43 | 45 | protected void initConfig(ConfigUI configUI) {
|
| 44 | 46 | super.initConfig(configUI);
|
| 45 | 47 | configUI.getLeftSourceConfig().getSourceInfoLabel().setText(t("observe.ui.action.config.left.datasource.required.write.data"));
|
| 48 | + ConsolidateConfigUI extraConfig = new ConsolidateConfigUI(UIHelper.initialContext(configUI, this));
|
|
| 49 | + SelectConsolidationConfigFlag.init(extraConfig, extraConfig.getConsolidationFailIfLengthWeightParameterNotFound(), new SelectConsolidationConfigFlag("consolidationFailIfLengthWeightParameterNotFound", ConsolidateModel::isConsolidationFailIfLengthWeightParameterNotFound, ConsolidateModel::setConsolidationFailIfLengthWeightParameterNotFound, 5));
|
|
| 50 | + SelectConsolidationConfigFlag.init(extraConfig, extraConfig.getConsolidationFailIfLengthLengthParameterNotFound(), new SelectConsolidationConfigFlag("consolidationFailIfLengthLengthParameterNotFound", ConsolidateModel::isConsolidationFailIfLengthLengthParameterNotFound, ConsolidateModel::setConsolidationFailIfLengthLengthParameterNotFound, 6));
|
|
| 51 | + configUI.getExtraConfig().add(extraConfig);
|
|
| 46 | 52 | }
|
| 47 | - |
|
| 48 | 53 | } |
| 1 | +package fr.ird.observe.client.datasource.actions.consolidate.actions;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Client :: DataSource :: Actions
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateConfigUI;
|
|
| 26 | +import org.nuiton.jaxx.runtime.swing.action.JComponentActionSupport;
|
|
| 27 | + |
|
| 28 | +import javax.swing.KeyStroke;
|
|
| 29 | + |
|
| 30 | +/**
|
|
| 31 | + * Created on 24/02/2023.
|
|
| 32 | + *
|
|
| 33 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 34 | + * @since 9.0.26
|
|
| 35 | + */
|
|
| 36 | +public abstract class ConsolidateConfigUIActionSupport extends JComponentActionSupport<ConsolidateConfigUI> {
|
|
| 37 | + |
|
| 38 | + public ConsolidateConfigUIActionSupport(String label, String shortDescription, String actionIcon, KeyStroke acceleratorKey) {
|
|
| 39 | + super(label, shortDescription, actionIcon, acceleratorKey);
|
|
| 40 | + }
|
|
| 41 | + |
|
| 42 | + public ConsolidateConfigUIActionSupport(String actionCommandKey, String label, String shortDescription, String actionIcon, KeyStroke acceleratorKey) {
|
|
| 43 | + super(actionCommandKey, label, shortDescription, actionIcon, acceleratorKey);
|
|
| 44 | + }
|
|
| 45 | +} |
| 1 | +package fr.ird.observe.client.datasource.actions.consolidate.actions;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Client :: DataSource :: Actions
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | + |
|
| 26 | +import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateModel;
|
|
| 27 | +import fr.ird.observe.client.datasource.actions.consolidate.ConsolidateConfigUI;
|
|
| 28 | +import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
|
|
| 29 | + |
|
| 30 | +import java.awt.event.ActionEvent;
|
|
| 31 | +import java.util.function.BiConsumer;
|
|
| 32 | +import java.util.function.Function;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * Created on 24/02/2023.
|
|
| 36 | + *
|
|
| 37 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 38 | + * @since 9.0.26
|
|
| 39 | + */
|
|
| 40 | +public class SelectConsolidationConfigFlag extends ConsolidateConfigUIActionSupport {
|
|
| 41 | + |
|
| 42 | + private final Function<ConsolidateModel, Boolean> getter;
|
|
| 43 | + private final BiConsumer<ConsolidateModel, Boolean> setter;
|
|
| 44 | + |
|
| 45 | + public SelectConsolidationConfigFlag(String propertyName, Function<ConsolidateModel, Boolean> getter, BiConsumer<ConsolidateModel, Boolean> setter, int strokeIndex) {
|
|
| 46 | + super(SelectConsolidationConfigFlag.class.getName() + propertyName, "", null, null, ObserveKeyStrokesSupport.getFunctionKeyStroke(strokeIndex));
|
|
| 47 | + this.getter = getter;
|
|
| 48 | + this.setter = setter;
|
|
| 49 | + }
|
|
| 50 | + |
|
| 51 | + @Override
|
|
| 52 | + protected void doActionPerformed(ActionEvent e, ConsolidateConfigUI ui) {
|
|
| 53 | + ConsolidateModel validateModel = ui.getModel().getConsolidateModel();
|
|
| 54 | + boolean oldValue = getter.apply(validateModel);
|
|
| 55 | + setter.accept(validateModel, !oldValue);
|
|
| 56 | + }
|
|
| 57 | + |
|
| 58 | +} |
| ... | ... | @@ -124,10 +124,8 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 124 | 124 | }
|
| 125 | 125 | TripConsolidateRequest request = new TripConsolidateRequest();
|
| 126 | 126 | request.setTripId(tripId);
|
| 127 | - //FIXME Add option in configuration
|
|
| 128 | - request.setFailIfLengthWeightParameterNotFound(false);
|
|
| 129 | - //FIXME Add option in configuration
|
|
| 130 | - request.setFailIfLengthLengthParameterNotFound(false);
|
|
| 127 | + request.setFailIfLengthWeightParameterNotFound(stepModel.isConsolidationFailIfLengthWeightParameterNotFound());
|
|
| 128 | + request.setFailIfLengthLengthParameterNotFound(stepModel.isConsolidationFailIfLengthLengthParameterNotFound());
|
|
| 131 | 129 | |
| 132 | 130 | TripConsolidateResult result = consolidateDataService.consolidateTrip(simplifiedObjectTypeSpecializedRules, request);
|
| 133 | 131 | if (result != null) {
|
| ... | ... | @@ -36,6 +36,8 @@ observe.config.client.backupFiles.timeout.description=Backup files delete (in ho |
| 36 | 36 | observe.config.client.feedbackFiles.timeout.description=Feedback files delete (in hours)
|
| 37 | 37 | observe.config.client.logFiles.timeout.description=Log files delete (in hours)
|
| 38 | 38 | observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours)
|
| 39 | +observe.config.consolidation.failIfLengthLengthParameterNotFound=In consolidate action, raise an error if a lengthLengthParameter is not found, otherwise add an warning in action
|
|
| 40 | +observe.config.consolidation.failIfLengthWeightParameterNotFound=In consolidate action, raise an error if a lengthWeightParameter is not found, otherwise add an warning in action
|
|
| 39 | 41 | observe.config.coordinate.format=Position format (DMD, DD, DMS)
|
| 40 | 42 | observe.config.db.locale=Language of data source (fr_FR, en_GB or es_ES)
|
| 41 | 43 | observe.config.dcpPresetsDirectory.description=Dcp presets directory
|
| ... | ... | @@ -486,6 +488,7 @@ observe.ui.datasource.backup.done=[%s] Auto backup done (in %s) |
| 486 | 488 | observe.ui.datasource.backup.start=[%s] Start auto backup
|
| 487 | 489 | observe.ui.datasource.editor.actions.activity.pairing=Activities pairing
|
| 488 | 490 | observe.ui.datasource.editor.actions.consolidate=Consolidate data
|
| 491 | +observe.ui.datasource.editor.actions.consolidate.config=Consolidate data configuration
|
|
| 489 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Consolidate observed data
|
| 490 | 493 | observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Computed data for activity [%s] %s
|
| 491 | 494 | observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Some warnings were found for activity [%s] %s
|
| ... | ... | @@ -36,6 +36,8 @@ observe.config.client.backupFiles.timeout.description=Backup files delete (in ho |
| 36 | 36 | observe.config.client.feedbackFiles.timeout.description=Feedback files delete (in hours) \#TODO
|
| 37 | 37 | observe.config.client.logFiles.timeout.description=Log files delete (in hours) \#TODO
|
| 38 | 38 | observe.config.client.temporaryFiles.timeout.description=Temporary files delete (in hours) \#TODO
|
| 39 | +observe.config.consolidation.failIfLengthLengthParameterNotFound=In consolidate action, raise an error if a lengthLengthParameter is not found, otherwise add an warning in action \#TODO
|
|
| 40 | +observe.config.consolidation.failIfLengthWeightParameterNotFound=In consolidate action, raise an error if a lengthWeightParameter is not found, otherwise add an warning in action \#TODO
|
|
| 39 | 41 | observe.config.coordinate.format=Formato de posición (DMD, DD, DMS)
|
| 40 | 42 | observe.config.db.locale=Idioma del referencial (fr_FR, en_GB o es_ES)
|
| 41 | 43 | observe.config.dcpPresetsDirectory.description=Dcp presets directory \#TODO
|
| ... | ... | @@ -486,6 +488,7 @@ observe.ui.datasource.backup.done=[%s] Copia de seguridad automática realizada |
| 486 | 488 | observe.ui.datasource.backup.start=[%s] Inicio de copia de seguridad automática
|
| 487 | 489 | observe.ui.datasource.editor.actions.activity.pairing=Activities pairing \#TODO
|
| 488 | 490 | observe.ui.datasource.editor.actions.consolidate=Calcular los datos
|
| 491 | +observe.ui.datasource.editor.actions.consolidate.config=Consolidate data configuration
|
|
| 489 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Calcular los datos que no fueron observados
|
| 490 | 493 | observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Datos calculados para la actividad [%s] %s
|
| 491 | 494 | observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Some warnings were found for activity [%s] %s
|
| ... | ... | @@ -36,6 +36,8 @@ observe.config.client.backupFiles.timeout.description=Nettoyage des fichiers de |
| 36 | 36 | observe.config.client.feedbackFiles.timeout.description=Nettoyage des fichiers de retour d'expérience (en heures)
|
| 37 | 37 | observe.config.client.logFiles.timeout.description=Nettoyage des fichiers de log (en heures)
|
| 38 | 38 | observe.config.client.temporaryFiles.timeout.description=Nettoyage des fichiers temporaires (en heures)
|
| 39 | +observe.config.consolidation.failIfLengthLengthParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-taille n'est pas trouvée, sinon consigner cela en avertissement de l'action
|
|
| 40 | +observe.config.consolidation.failIfLengthWeightParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-poids n'est pas trouvée, sinon consigner cela en avertissement de l'action
|
|
| 39 | 41 | observe.config.coordinate.format=Format des positions (DMD, DD, DMS)
|
| 40 | 42 | observe.config.db.locale=La langue du référentiel (fr_FR, en_GB ou es_ES)
|
| 41 | 43 | observe.config.dcpPresetsDirectory.description=Répertoire des pré-configurations de DCP
|
| ... | ... | @@ -486,6 +488,7 @@ observe.ui.datasource.backup.done=[%s] Fin de la sauvegarde automatique (en %s) |
| 486 | 488 | observe.ui.datasource.backup.start=[%s] Début de la sauvegarde automatique
|
| 487 | 489 | observe.ui.datasource.editor.actions.activity.pairing=Appairement des activités
|
| 488 | 490 | observe.ui.datasource.editor.actions.consolidate=Calculer les données
|
| 491 | +observe.ui.datasource.editor.actions.consolidate.config=Configuration de la consolidation
|
|
| 489 | 492 | observe.ui.datasource.editor.actions.consolidate.description=Calculer les données non observées
|
| 490 | 493 | observe.ui.datasource.editor.actions.consolidate.message.activity.modification=Données calculées pour l'activité [%s] %s
|
| 491 | 494 | observe.ui.datasource.editor.actions.consolidate.message.activity.warning=Des avertissements ont été détectés pour l'activité [%s] %s
|
| ... | ... | @@ -81,6 +81,11 @@ public class LengthWeightParameters { |
| 81 | 81 | // }
|
| 82 | 82 | |
| 83 | 83 | if (list == null || list.isEmpty()) {
|
| 84 | + decoratorService.installDecorator(Species.class, species);
|
|
| 85 | + decoratorService.installDecorator(Ocean.class, ocean);
|
|
| 86 | + if (sex!=null) {
|
|
| 87 | + decoratorService.installDecorator(Sex.class, sex);
|
|
| 88 | + }
|
|
| 84 | 89 | throw new LengthWeightParameterNotFoundException(species, ocean, sex, date);
|
| 85 | 90 | }
|
| 86 | 91 | |
| ... | ... | @@ -102,7 +107,9 @@ public class LengthWeightParameters { |
| 102 | 107 | if (list.size() > 1) {
|
| 103 | 108 | decoratorService.installDecorator(Species.class, species);
|
| 104 | 109 | decoratorService.installDecorator(Ocean.class, ocean);
|
| 105 | - decoratorService.installDecorator(Sex.class, sex);
|
|
| 110 | + if (sex!=null) {
|
|
| 111 | + decoratorService.installDecorator(Sex.class, sex);
|
|
| 112 | + }
|
|
| 106 | 113 | decoratorService.installDecorator(LengthWeightParameter.class, list.stream());
|
| 107 | 114 | throw new DuplicateLengthWeightParameterException(species, ocean, sex, date, list);
|
| 108 | 115 | }
|