Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: c4ca8b96 by tchemit at 2018-11-16T16:08:04Z Traductions espagnoles - Closes #1165 - - - - - d8f0108a by tchemit at 2018-11-18T20:11:22Z update some libs - - - - - a93063f5 by tchemit at 2018-11-18T20:11:49Z use las toolkit - - - - - d1de3405 by tchemit at 2018-11-19T09:25:44Z [LL] Echantillons : Petits ajustements - Closes #1132 - - - - - 10 changed files: - client-core/pom.xml - client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/config/TranslateAction.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SamplePartLogbookUIHandler.java - client-core/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SamplePartLogbookUIModel.java - client-core/src/main/java/fr/ird/observe/client/ui/util/ObserveValidationMessageTableRenderer.java - client-core/src/main/java/fr/ird/observe/client/ui/util/ObserveValidatorMessageTableRenderer.java - dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nDecoratorHelper.java - dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java - persistence/src/main/resources/db/migration/6.1/09_fill_object_material-common.sql - pom.xml Changes: ===================================== client-core/pom.xml ===================================== @@ -336,10 +336,10 @@ </dependency> <!-- Pour avoir les traductions de la configuration dans un seul bundle ... !--> <!--<dependency>--> - <!--<groupId>${project.groupId}</groupId>--> - <!--<artifactId>server-configuration</artifactId>--> - <!--<version>${project.version}</version>--> - <!--<scope>runtime</scope>--> + <!--<groupId>${project.groupId}</groupId>--> + <!--<artifactId>server-configuration</artifactId>--> + <!--<version>${project.version}</version>--> + <!--<scope>runtime</scope>--> <!--</dependency>--> <dependency> <groupId>${project.groupId}</groupId> @@ -365,8 +365,8 @@ <artifactId>persistence</artifactId> </dependency> <!--<dependency>--> - <!--<groupId>io.ultreia.java4all.topia</groupId>--> - <!--<artifactId>service-migration</artifactId>--> + <!--<groupId>io.ultreia.java4all.topia</groupId>--> + <!--<artifactId>service-migration</artifactId>--> <!--</dependency>--> <dependency> @@ -759,7 +759,6 @@ <artifactId>common-dto</artifactId> <version>${observeToolkitVersion}</version> </dependency> - </dependencies> </plugin> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/actions/main/menu/config/TranslateAction.java ===================================== @@ -72,7 +72,7 @@ public class TranslateAction extends MenuActionSupport { projectUI.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { - if (model.getLastExport() != null) { + if (model.getLastExportDate() != null) { log.info("Found existing i18n export, will reload i18n"); UIHelper.displayInfo(t("observe.title.reload.i18n"), t("observe.message.reload.i18n")); ObserveUICallback.application.run(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SamplePartLogbookUIHandler.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.longline.logbook; * it under the terms of the GNU 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 General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -61,9 +61,13 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl private static final Logger log = LogManager.getLogger(SamplePartLogbookUIHandler.class); private final PropertyChangeListener speciesChanged; + private final PropertyChangeListener lengthChanged; + private final PropertyChangeListener weightChanged; SamplePartLogbookUIHandler() { speciesChanged = evt -> onSpeciesChanged((SpeciesReference) evt.getNewValue()); + lengthChanged = evt -> onLengthChanged((Float) evt.getNewValue()); + weightChanged = evt -> onWeightChanged((Float) evt.getNewValue()); } @Override @@ -156,6 +160,8 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl SamplePartLogbookDto tableEditBean = getModel().getTableEditBean(); tableEditBean.removePropertyChangeListener(SamplePartLogbookDto.PROPERTY_SPECIES, speciesChanged); + tableEditBean.removePropertyChangeListener(SamplePartLogbookDto.PROPERTY_LENGTH, lengthChanged); + tableEditBean.removePropertyChangeListener(SamplePartLogbookDto.PROPERTY_WEIGHT, weightChanged); SpeciesReference species = bean.getSpecies(); log.debug(prefix + "selected species " + species); @@ -197,26 +203,23 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl UIHelper.askFocus(requestFocus); tableEditBean.addPropertyChangeListener(SamplePartLogbookDto.PROPERTY_SPECIES, speciesChanged); + tableEditBean.addPropertyChangeListener(SamplePartLogbookDto.PROPERTY_LENGTH, lengthChanged); + tableEditBean.addPropertyChangeListener(SamplePartLogbookDto.PROPERTY_WEIGHT, weightChanged); + onLengthChanged(tableEditBean.getLength()); + onWeightChanged(tableEditBean.getWeight()); } - private Optional<SizeMeasureTypeReference> getSpeciesDefaultSizeMeasureType(SpeciesReference species) { - Optional<SizeMeasureTypeReference> result = Optional.empty(); - if (species != null) { + @Override + public SamplePartLogbookUIModel getModel() { + return ui.getModel(); + } - String sizeMeasureId = species.getSizeMeasureTypeId(); - result = ui.getSizeMeasureType().getData().stream() - .filter(s -> s.getId().equals(sizeMeasureId)).findFirst(); - } - return result; + public void resetDefaultSizeMeasureType() { + ui.getSizeMeasureType().setSelectedItem(null); + ui.getSizeMeasureType().setSelectedItem(ui.getModel().getDefaultSizeMeasureType()); } - /** - * Le mode de saisie a été mis à jour. - * - * @param newMode le nouveau de mode de saisie à utiliser - * @since 3.0 - */ void updateAcquisitionMode(AcquisitionMode newMode) { log.debug(prefix + String.format("Change acquisition mode to %s", newMode)); if (newMode == null) { @@ -244,7 +247,7 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl // on supprime le weight (si il a été saisie) editBean.setWeight(null); editBean.setWeightMeasureType(null); - // on supprime aussi l'count (pour forcer la saisie) + // on supprime aussi le count (pour forcer la saisie) editBean.setCount(null); } break; @@ -260,7 +263,7 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl if (createMode) { - // on positionne l'count à 1 (seule valeur possible) + // on positionne le count à 1 (seule valeur possible) editBean.setCount(1); } break; @@ -273,14 +276,44 @@ public class SamplePartLogbookUIHandler extends NotStandaloneContentTableUIHandl } } + private Optional<SizeMeasureTypeReference> getSpeciesDefaultSizeMeasureType(SpeciesReference species) { + Optional<SizeMeasureTypeReference> result = Optional.empty(); + if (species != null) { + + String sizeMeasureId = species.getSizeMeasureTypeId(); + result = ui.getSizeMeasureType().getData().stream() + .filter(s -> s.getId().equals(sizeMeasureId)).findFirst(); + } + return result; + } + private void onSpeciesChanged(SpeciesReference species) { Optional<SizeMeasureTypeReference> sizeMeasureType = getSpeciesDefaultSizeMeasureType(species); ui.getModel().setDefaultSizeMeasureType(sizeMeasureType.orElse(null)); resetDefaultSizeMeasureType(); } - public void resetDefaultSizeMeasureType() { - ui.getSizeMeasureType().setSelectedItem(null); - ui.getSizeMeasureType().setSelectedItem(ui.getModel().getDefaultSizeMeasureType()); + private void onLengthChanged(Float newValue) { + SamplePartLogbookUIModel model = getModel(); + SamplePartLogbookDto tableEditBean = model.getTableEditBean(); + if (newValue == null) { + tableEditBean.setLengthMeasureMethod(null); + } else { + if (tableEditBean.getLengthMeasureMethod() == null) { + tableEditBean.setLengthMeasureMethod(model.getDefaultLengthMeasureMethod()); + } + } + } + + private void onWeightChanged(Float newValue) { + SamplePartLogbookUIModel model = getModel(); + SamplePartLogbookDto tableEditBean = model.getTableEditBean(); + if (newValue == null) { + tableEditBean.setWeightMeasureMethod(null); + } else { + if (tableEditBean.getWeightMeasureMethod() == null) { + tableEditBean.setWeightMeasureMethod(model.getDefaultWeightMeasureMethod()); + } + } } } ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SamplePartLogbookUIModel.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.longline.logbook; * it under the terms of the GNU 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 General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. @@ -30,7 +30,10 @@ import fr.ird.observe.client.validation.ClientValidationContext; import fr.ird.observe.dto.data.longline.SampleLogbookDto; import fr.ird.observe.dto.data.longline.SamplePartLogbookDto; import fr.ird.observe.dto.data.longline.SamplePartLogbookHelper; +import fr.ird.observe.dto.referential.LengthMeasureMethodReference; +import fr.ird.observe.dto.referential.SexReference; import fr.ird.observe.dto.referential.SizeMeasureTypeReference; +import fr.ird.observe.dto.referential.WeightMeasureMethodReference; import fr.ird.observe.navigation.model.select.ObserveSelectNode; import java.util.Arrays; @@ -46,9 +49,19 @@ import java.util.List; */ public class SamplePartLogbookUIModel extends ContentTableUIModel<SampleLogbookDto, SamplePartLogbookDto> { - public static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE = "defaultSizeMeasureType"; + private static final String PROPERTY_DEFAULT_SIZE_MEASURE_TYPE = "defaultSizeMeasureType"; + //FIXME-PROTECTED-ID + private static final String SAMPLE_PART_LOGBOOK_DEFAULT_LENGTH_MEASURE_METHOD_ID = "fr.ird.observe.entities.referentiel.LengthMeasureMethod#666#01"; + //FIXME-PROTECTED-ID + private static final String SAMPLE_PART_LOGBOOK_DEFAULT_WEIGHT_MEASURE_METHOD_ID = "fr.ird.observe.entities.referentiel.WeightMeasureMethod#666#02"; + //FIXME-PROTECTED-ID + private static final String SAMPLE_PART_LOGBOOK_DEFAULT_SEX_ID = "fr.ird.observe.entities.referentiel.Sex#1239832686122#0.5"; private static final long serialVersionUID = 1L; + private SizeMeasureTypeReference defaultSizeMeasureType; + private SexReference defaultSex; + private LengthMeasureMethodReference defaultLengthMeasureMethod; + private WeightMeasureMethodReference defaultWeightMeasureMethod; public SamplePartLogbookUIModel(SamplePartLogbookUI ui, ObserveSelectNode<?> selectNode) { super(SampleLogbookDto.class, @@ -83,6 +96,33 @@ public class SamplePartLogbookUIModel extends ContentTableUIModel<SampleLogbookD setAddMessageOnOpen(false); } + @Override + public void initModel(ContentTableUI<SampleLogbookDto, SamplePartLogbookDto, ?> ui, List<ContentTableMeta<SamplePartLogbookDto>> contentTableMetas) { + super.initModel(ui, contentTableMetas); + defaultSex = ui.getDataSource().getReferentialReferenceSet(SexReference.class).tryGetReferenceById(SAMPLE_PART_LOGBOOK_DEFAULT_SEX_ID).orElseThrow(IllegalStateException::new); + defaultLengthMeasureMethod = ui.getDataSource().getReferentialReferenceSet(LengthMeasureMethodReference.class).tryGetReferenceById(SAMPLE_PART_LOGBOOK_DEFAULT_LENGTH_MEASURE_METHOD_ID).orElseThrow(IllegalStateException::new); + defaultWeightMeasureMethod = ui.getDataSource().getReferentialReferenceSet(WeightMeasureMethodReference.class).tryGetReferenceById(SAMPLE_PART_LOGBOOK_DEFAULT_WEIGHT_MEASURE_METHOD_ID).orElseThrow(IllegalStateException::new); + } + + @Override + public SamplePartLogbookDto newTableEditBean() { + SamplePartLogbookDto result = super.newTableEditBean(); + result.setSex(getDefaultSex()); + return result; + } + + public LengthMeasureMethodReference getDefaultLengthMeasureMethod() { + return defaultLengthMeasureMethod; + } + + public WeightMeasureMethodReference getDefaultWeightMeasureMethod() { + return defaultWeightMeasureMethod; + } + + public SexReference getDefaultSex() { + return defaultSex; + } + @Override protected ObserveSelectNode<?> computeSelectNode() { return super.computeSelectNode(); ===================================== client-core/src/main/java/fr/ird/observe/client/ui/util/ObserveValidationMessageTableRenderer.java ===================================== @@ -25,7 +25,7 @@ package fr.ird.observe.client.ui.util; import fr.ird.observe.client.ui.admin.validate.ValidationMessageTableModel; import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper; import fr.ird.observe.services.service.actions.validate.ValidationResultDtoMessage; -import org.nuiton.i18n.util.BeanPropertyI18nKeyProducer; +import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducer; import org.nuiton.jaxx.validator.swing.SwingValidatorUtil; import org.nuiton.validator.NuitonValidatorScope; ===================================== client-core/src/main/java/fr/ird/observe/client/ui/util/ObserveValidatorMessageTableRenderer.java ===================================== @@ -23,10 +23,10 @@ package fr.ird.observe.client.ui.util; */ import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper; +import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducer; import org.apache.commons.lang3.BooleanUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.nuiton.i18n.util.BeanPropertyI18nKeyProducer; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel; import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableRenderer; ===================================== dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nDecoratorHelper.java ===================================== @@ -23,8 +23,8 @@ package fr.ird.observe.dto.decoration; */ import com.google.auto.service.AutoService; -import org.nuiton.i18n.util.BeanPropertyI18nKeyProducer; -import org.nuiton.i18n.util.BeanPropertyI18nKeyProducerProvider; +import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducer; +import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducerProvider; /** * Created on 03/09/16. ===================================== dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java ===================================== @@ -28,7 +28,7 @@ import fr.ird.observe.dto.IdHelper; import fr.ird.observe.dto.data.DataDto; import fr.ird.observe.dto.referential.I18nReferentialDto; import fr.ird.observe.dto.referential.ReferentialDto; -import org.nuiton.i18n.util.BeanPropertyI18nKeyProducerSupport; +import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducerSupport; import java.util.Map; ===================================== persistence/src/main/resources/db/migration/6.1/09_fill_object_material-common.sql ===================================== @@ -19,27 +19,7 @@ -- <http://www.gnu.org/licenses/gpl-3.0.html>. -- #L% --- ---- --- #%L --- ObServe :: Persistence --- %% --- Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io --- %% --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU 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 General Public --- License along with this program. If not, see --- <http://www.gnu.org/licenses/gpl-3.0.html>. --- #L% ---- + INSERT INTO observe_seine.objectmaterial (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, legacycode, standardcode, parent, status, needcomment, uri, objectmaterialtype, biodegradable, nonentangling, label1, label2, label3, label4, label5, label6, label7, label8, childrenmultiselectable, childselectionmandatory, validation) VALUES ('fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#1.3',0,'2018-11-12','2018-11-12 17:27:06.06232','',null,'FOB',null,1,false,null,null,false,false,'FOB','FOB','FOB',null,null,null,null,null,true,true,null); INSERT INTO observe_seine.objectmaterial (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, legacycode, standardcode, parent, status, needcomment, uri, objectmaterialtype, biodegradable, nonentangling, label1, label2, label3, label4, label5, label6, label7, label8, childrenmultiselectable, childselectionmandatory, validation) VALUES ('fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.1',0,'2018-11-12','2018-11-12 17:27:06.06232','1',null,'FAD','fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#1.3',1,false,null,null,false,false,'FAD','FAD','FAD',null,null,null,null,null,false,false,null); INSERT INTO observe_seine.objectmaterial (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, legacycode, standardcode, parent, status, needcomment, uri, objectmaterialtype, biodegradable, nonentangling, label1, label2, label3, label4, label5, label6, label7, label8, childrenmultiselectable, childselectionmandatory, validation) VALUES ('fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.2',1,'2018-11-12','2018-11-12 17:27:06.06232','1-1',null,'DFAD','fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.1',1,false,null,'fr.ird.observe.entities.referentiel.seine.ObjectMaterialType#0#0',false,false,'DFAD (drifting FAD)','DFAD (FAD dérivant)','DFAD (FAD a la deriva)',null,null,null,null,null,true,false,null); ===================================== pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>io.ultreia.maven</groupId> <artifactId>pom</artifactId> - <version>2018.8.3</version> + <version>2018.8.8</version> </parent> <groupId>fr.ird.observe</groupId> @@ -150,13 +150,13 @@ <devMode>true</devMode> <!--persistence model version--> - <observe.model.version>7.4</observe.model.version> + <observe.model.version>7.0</observe.model.version> <!-- build timestamp configuration --> <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <observeToolkitVersion>4.8-SNAPSHOT</observeToolkitVersion> + <observeToolkitVersion>4.9-SNAPSHOT</observeToolkitVersion> <!--<lib.version.java4all.topia>1.1.1</lib.version.java4all.topia>--> <!--<lib.version.java4all.eugene>3.0-alpha-22</lib.version.java4all.eugene>--> <!--<lib.version.java4all.jaxx>3.0-alpha-45-SNAPSHOT</lib.version.java4all.jaxx>--> @@ -373,19 +373,20 @@ <reporting> <plugins> - <!--<plugin>--> - <!--<groupId>io.ultreia.java4all.config</groupId>--> - <!--<artifactId>config-maven-plugin</artifactId>--> - <!--<version>${lib.version.java4all.config}</version>--> - <!--<inherited>false</inherited>--> - <!--<reportSets>--> - <!--<reportSet>--> - <!--<reports>--> - <!--<report>aggregate-report</report>--> - <!--</reports>--> - <!--</reportSet>--> - <!--</reportSets>--> - <!--</plugin>--> + <plugin> + <groupId>io.ultreia.java4all.config</groupId> + <artifactId>config-maven-plugin</artifactId> + <version>${lib.version.java4all.config}</version> + <inherited>false</inherited> + <reportSets> + <reportSet> + <reports> + <report>aggregate-report</report> + </reports> + </reportSet> + </reportSets> + + </plugin> <plugin> <artifactId>maven-project-info-reports-plugin</artifactId> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/51843ff1314431ccd2aa109e3b9... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/51843ff1314431ccd2aa109e3b9... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT