Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: b8253407 by tchemit at 2020-03-29T11:19:01+02:00 [V7-V8] Ajustement du modèle - Part 3 - Closes #1438 - - - - - 753ea025 by tchemit at 2020-03-29T11:19:08+02:00 add fixme - - - - - f499486e by tchemit at 2020-03-29T11:19:34+02:00 More detail when can't get last update date - - - - - 70408597 by tchemit at 2020-03-29T11:19:53+02:00 bind species on TargetCatch - - - - - eb101b74 by tchemit at 2020-03-29T11:30:31+02:00 [SFA] LL / Logbooks / Samples : modification d'espèce (application sur les autres formulaires) - Closes #1453 - - - - - 46fb786f by tchemit at 2020-03-29T12:43:01+02:00 Improve some i18n keys - - - - - 33db59d9 by tchemit at 2020-03-29T13:26:42+02:00 Ajouter l'icone de l'application lors du lancement de l'application en mode autre - Closes #1459 - - - - - 29 changed files: - client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jcss - client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java - client-core/src/main/java/fr/ird/observe/client/util/UIHelper.java - client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIHandler.java - client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/RemoteUILauncher.java - client-datasource-editor-ps/src/main/i18n/getters/java.getter - client-datasource-editor-ps/src/main/i18n/getters/jaxx.getter - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/NonTargetCatchUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/NonTargetSampleUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectObservedSpeciesUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectSchoolEstimateUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUI.jcss - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetCatchUI.jcss - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetCatchUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetDiscardCatchUI.jcss - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetDiscardCatchUIHandler.java - client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetSampleUIHandler.java - observe-i18n/src/main/i18n/translations/observe_en_GB.properties - observe-i18n/src/main/i18n/translations/observe_es_ES.properties - observe-i18n/src/main/i18n/translations/observe_fr_FR.properties - persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/TargetCatchImpl.java - persistence/src/main/resources/db/migration/7.4/03_rename_referential-H2.sql - persistence/src/main/resources/db/migration/7.4/03_rename_referential-PG.sql - services-local/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialServiceLocal.java - test/src/main/resources/db/8.0-RC-2/dataForTestLongline.sql.gz - test/src/main/resources/db/8.0-RC-2/dataForTestSeine.sql.gz - test/src/main/resources/db/8.0-RC-2/referentiel.sql.gz - test/src/main/resources/fixtures/validate-service-seine-trips.properties Changes: ===================================== client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jcss ===================================== @@ -22,7 +22,6 @@ #mainFrame { defaultCloseOperation: "do_nothing_on_close"; - iconImage: {SwingUtil.createImageIcon("logo.png").getImage()}; } #menu { ===================================== client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java ===================================== @@ -74,6 +74,7 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI>, WithClien @Override public void afterInit(ObserveMainUI ui) { + UIHelper.addApplicationIcon(ui); getClientUIContext().setMainUI(ui); ui.getMainUIBodyContentManager().install(); KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(keyEventDispatcher = new MainUIKeyEventDispatcher(ui.getModel())); ===================================== client-core/src/main/java/fr/ird/observe/client/util/UIHelper.java ===================================== @@ -61,7 +61,9 @@ import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.Color; import java.awt.Component; +import java.awt.Container; import java.awt.Toolkit; +import java.awt.Window; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.KeyEvent; @@ -86,6 +88,10 @@ public class UIHelper extends SwingUtil { public static final PropertyChangeListener LOG_PROPERTY_CHANGE_LISTENER = new LogPropertyChanged(); public static final String NO_PACK = "NoPack"; + public static void addApplicationIcon(Window window) { + window.setIconImage(createImageIcon("logo.png").getImage()); + } + public static void handlingError(String message, Exception e) { if (log.isErrorEnabled()) { ===================================== client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIHandler.java ===================================== @@ -218,6 +218,7 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe break; case 1: // wil reset ui + //FIXME If checking from closing, we should do nothing ? ui.resetEdit(); break; } @@ -241,6 +242,7 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe break; case 0: // wil reset ui + //FIXME If checking from closing, we should do nothing ? ui.resetEdit(); break; } ===================================== client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/RemoteUILauncher.java ===================================== @@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.wizard; import fr.ird.observe.client.constants.DbMode; import fr.ird.observe.client.datasource.editor.wizard.tabs.SecurityModel; +import fr.ird.observe.client.util.UIHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.JAXXContext; @@ -87,6 +88,7 @@ public abstract class RemoteUILauncher extends StorageUILauncher { model.setSteps(steps.toArray(new StorageStep[0])); ui.setSize(800, 600); + UIHelper.addApplicationIcon(ui); } @Override ===================================== client-datasource-editor-ps/src/main/i18n/getters/java.getter ===================================== @@ -67,10 +67,10 @@ observe.data.ps.observation.NonTargetCatch.table.meanWeight observe.data.ps.observation.NonTargetCatch.table.meanWeight.tip observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard.tip +observe.data.ps.observation.NonTargetCatch.table.species +observe.data.ps.observation.NonTargetCatch.table.species.tip observe.data.ps.observation.NonTargetCatch.table.speciesFate observe.data.ps.observation.NonTargetCatch.table.speciesFate.tip -observe.data.ps.observation.NonTargetCatch.table.speciesFaune -observe.data.ps.observation.NonTargetCatch.table.speciesFaune.tip observe.data.ps.observation.NonTargetCatch.table.totalCount observe.data.ps.observation.NonTargetCatch.table.totalCount.tip observe.data.ps.observation.NonTargetCatch.table.well @@ -100,16 +100,16 @@ observe.data.ps.observation.NonTargetLength.table.length observe.data.ps.observation.NonTargetLength.table.length.tip observe.data.ps.observation.NonTargetLength.table.meanWeight observe.data.ps.observation.NonTargetLength.table.meanWeight.tip -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies.tip observe.data.ps.observation.NonTargetLength.table.picturesReferences observe.data.ps.observation.NonTargetLength.table.picturesReferences.tip observe.data.ps.observation.NonTargetLength.table.sizeMeasureType observe.data.ps.observation.NonTargetLength.table.sizeMeasureType.tip +observe.data.ps.observation.NonTargetLength.table.species +observe.data.ps.observation.NonTargetLength.table.species.tip observe.data.ps.observation.ObjectObservedSpecies.table.count observe.data.ps.observation.ObjectObservedSpecies.table.count.tip -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune.tip +observe.data.ps.observation.ObjectObservedSpecies.table.species +observe.data.ps.observation.ObjectObservedSpecies.table.species.tip observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus.tip observe.data.ps.observation.Route.action.moves @@ -124,8 +124,8 @@ observe.data.ps.observation.Sample.weight.computed.tip observe.data.ps.observation.Sample.weight.observed.tip observe.data.ps.observation.SchoolEstimate.table.meanWeight observe.data.ps.observation.SchoolEstimate.table.meanWeight.tip -observe.data.ps.observation.SchoolEstimate.table.speciesThon -observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip +observe.data.ps.observation.SchoolEstimate.table.species +observe.data.ps.observation.SchoolEstimate.table.species.tip observe.data.ps.observation.SchoolEstimate.table.weight observe.data.ps.observation.SchoolEstimate.table.weight.tip observe.data.ps.observation.Set.message.no.nonTargetCatchRelease @@ -136,8 +136,8 @@ observe.data.ps.observation.Set.schoolType.not.fill observe.data.ps.observation.TargetCatch.message.table.will.delete.targetLength observe.data.ps.observation.TargetCatch.table.comment observe.data.ps.observation.TargetCatch.table.comment.tip -observe.data.ps.observation.TargetCatch.table.speciesThon -observe.data.ps.observation.TargetCatch.table.speciesThon.tip +observe.data.ps.observation.TargetCatch.table.species +observe.data.ps.observation.TargetCatch.table.species.tip observe.data.ps.observation.TargetCatch.table.weight observe.data.ps.observation.TargetCatch.table.weight.tip observe.data.ps.observation.TargetCatch.table.weightCategory @@ -151,8 +151,8 @@ observe.data.ps.observation.TargetDiscard.table.comment observe.data.ps.observation.TargetDiscard.table.comment.tip observe.data.ps.observation.TargetDiscard.table.reasonForDiscard observe.data.ps.observation.TargetDiscard.table.reasonForDiscard.tip +observe.data.ps.observation.TargetDiscard.table.species observe.data.ps.observation.TargetDiscard.table.species.tip -observe.data.ps.observation.TargetDiscard.table.speciesThon observe.data.ps.observation.TargetDiscard.table.weight observe.data.ps.observation.TargetDiscard.table.weight.tip observe.data.ps.observation.TargetDiscard.table.weightCategory @@ -167,8 +167,8 @@ observe.data.ps.observation.TargetLength.table.sex observe.data.ps.observation.TargetLength.table.sex.tip observe.data.ps.observation.TargetLength.table.sizeMeasureType observe.data.ps.observation.TargetLength.table.sizeMeasureType.tip -observe.data.ps.observation.TargetLength.table.speciesThon -observe.data.ps.observation.TargetLength.table.speciesThon.tip +observe.data.ps.observation.TargetLength.table.species +observe.data.ps.observation.TargetLength.table.species.tip observe.data.ps.observation.TargetLength.table.totalWeight observe.data.ps.observation.TargetLength.table.totalWeight.tip observe.menu.navigation.action.move.activity ===================================== client-datasource-editor-ps/src/main/i18n/getters/jaxx.getter ===================================== @@ -158,7 +158,7 @@ observe.data.ps.observation.Sample.weight observe.data.ps.observation.SchoolEstimate.action.create observe.data.ps.observation.SchoolEstimate.action.create.tip observe.data.ps.observation.SchoolEstimate.meanWeight -observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip +observe.data.ps.observation.SchoolEstimate.table.species.tip observe.data.ps.observation.SchoolEstimate.title observe.data.ps.observation.SchoolEstimate.totalWeight observe.data.ps.observation.Set.currentDirection @@ -186,7 +186,7 @@ observe.data.ps.observation.TargetCatch.broughtOnDeckInformation observe.data.ps.observation.TargetCatch.catchWeight observe.data.ps.observation.TargetCatch.reasonForDiscard observe.data.ps.observation.TargetCatch.table.deleteExtraMessage -observe.data.ps.observation.TargetCatch.table.speciesThon.tip +observe.data.ps.observation.TargetCatch.table.species.tip observe.data.ps.observation.TargetCatch.table.weightCategory.tip observe.data.ps.observation.TargetCatch.table.well.tip observe.data.ps.observation.TargetCatch.targetCatchCompositionEstimatedByObserver ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/NonTargetCatchUIHandler.java ===================================== @@ -141,8 +141,8 @@ public class NonTargetCatchUIHandler extends ContentTableUIHandler<SetNonTargetC UIHelper.fixTableColumnWidth(table, 7, 50); UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.NonTargetCatch.table.speciesFaune"), - n("observe.data.ps.observation.NonTargetCatch.table.speciesFaune.tip"), + n("observe.data.ps.observation.NonTargetCatch.table.species"), + n("observe.data.ps.observation.NonTargetCatch.table.species.tip"), n("observe.data.ps.observation.NonTargetCatch.table.speciesFate"), n("observe.data.ps.observation.NonTargetCatch.table.speciesFate.tip"), n("observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard"), ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/NonTargetSampleUIHandler.java ===================================== @@ -160,8 +160,8 @@ public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetS UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies"), - n("observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies.tip"), + n("observe.data.ps.observation.NonTargetLength.table.species"), + n("observe.data.ps.observation.NonTargetLength.table.species.tip"), n("observe.data.ps.observation.NonTargetLength.table.sizeMeasureType"), n("observe.data.ps.observation.NonTargetLength.table.sizeMeasureType.tip"), n("observe.data.ps.observation.NonTargetLength.table.length"), ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectObservedSpeciesUIHandler.java ===================================== @@ -69,8 +69,8 @@ public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<Floati JTable table = getUi().getTable(); UIHelper.setI18nTableHeaderRenderer(table, - n("observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune"), - n("observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune.tip"), + n("observe.data.ps.observation.ObjectObservedSpecies.table.species"), + n("observe.data.ps.observation.ObjectObservedSpecies.table.species.tip"), n("observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus"), n("observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus.tip"), n("observe.data.ps.observation.ObjectObservedSpecies.table.count"), ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectSchoolEstimateUIHandler.java ===================================== @@ -67,8 +67,8 @@ public class ObjectSchoolEstimateUIHandler extends ContentTableUIHandler<Floatin JTable table = getUi().getTable(); UIHelper.setI18nTableHeaderRenderer(table, - n("observe.data.ps.observation.SchoolEstimate.table.speciesThon"), - n("observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip"), + n("observe.data.ps.observation.SchoolEstimate.table.species"), + n("observe.data.ps.observation.SchoolEstimate.table.species.tip"), n("observe.data.ps.observation.SchoolEstimate.table.weight"), n("observe.data.ps.observation.SchoolEstimate.table.weight.tip")); ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUI.jcss ===================================== @@ -21,9 +21,5 @@ */ #speciesLabel { - toolTipText:"observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip"; -} - -#species { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; + toolTipText:"observe.data.ps.observation.SchoolEstimate.table.species.tip"; } ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUIHandler.java ===================================== @@ -40,7 +40,6 @@ import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; import java.awt.Component; import java.awt.Container; -import java.util.Collections; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -64,31 +63,24 @@ public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSchoolEsti ContentTableModel<SetSchoolEstimateDto, SchoolEstimateDto> model = getTableModel(); if (!model.isEditable()) { - // rien a faire return; } - SchoolEstimateUI ui = getUi(); - List<SpeciesReference> availableEspeces; JComponent requestFocus; - + List<SpeciesReference> listSpeciesUsed = model.getColumnValues(0); + Set<String> listSpeciesIdUsed = listSpeciesUsed.stream().map(ReferentialDtoReference::getId).collect(Collectors.toSet()); + List<SpeciesReference> references = getModel().getReferenceCache().getReferentialReferences(SchoolEstimateDto.PROPERTY_SPECIES); + List<SpeciesReference> availableSpecies = DtoReferenceCollection.filterNotContains(references, listSpeciesIdUsed); if (create) { - List<SpeciesReference> references = getModel().getReferenceCache().getReferentialReferences(SchoolEstimateDto.PROPERTY_SPECIES); - - List<SpeciesReference> listSpeciesUsed = model.getColumnValues(0); - - Set<String> listSpeciesIdUsed = listSpeciesUsed.stream().map(ReferentialDtoReference::getId).collect(Collectors.toSet()); - - availableEspeces = DtoReferenceCollection.filterNotContains(references, listSpeciesIdUsed); - requestFocus = ui.getSpecies(); } else { - SpeciesReference species = bean.getSpecies(); - availableEspeces = Collections.singletonList(species); + if (bean.getSpecies() != null) { + availableSpecies.add(bean.getSpecies()); + } requestFocus = ui.getTotalWeight(); } - ui.getSpecies().setData(availableEspeces); + ui.getSpecies().setData(availableSpecies); setFormFocusOwner(requestFocus); } @@ -98,8 +90,8 @@ public class SchoolEstimateUIHandler extends ContentTableUIHandler<SetSchoolEsti UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.SchoolEstimate.table.speciesThon"), - n("observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip"), + n("observe.data.ps.observation.SchoolEstimate.table.species"), + n("observe.data.ps.observation.SchoolEstimate.table.species.tip"), n("observe.data.ps.observation.SchoolEstimate.table.weight"), n("observe.data.ps.observation.SchoolEstimate.table.weight.tip"), n("observe.data.ps.observation.SchoolEstimate.table.meanWeight"), ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetCatchUI.jcss ===================================== @@ -25,25 +25,14 @@ } #speciesLabel { - toolTipText:"observe.data.ps.observation.TargetCatch.table.speciesThon.tip"; -} - -#species { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; + toolTipText:"observe.data.ps.observation.TargetCatch.table.species.tip"; } #weightCategoryLabel { toolTipText:"observe.data.ps.observation.TargetCatch.table.weightCategory.tip"; } -#weightCategory { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; -} - #wellLabel { toolTipText:"observe.data.ps.observation.TargetCatch.table.well.tip"; } -#well { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; -} ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetCatchUIHandler.java ===================================== @@ -135,11 +135,9 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetTargetCatchDt log.debug("response : " + reponse); } boolean canContinue = false; - switch (reponse) { - case 0: + if (reponse == 0) { // wil reset ui - canContinue = true; - break; + canContinue = true; } if (!canContinue) { return false; @@ -182,13 +180,15 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetTargetCatchDt // au singleton de sa valeur correspondante dans le bean // puisque dans ce mode, pas possibilite de modifier de cette // valeur (clef metier) + ui.getSpecies().setSelectedItem(null); ui.getSpecies().setSelectedItem(species); - ui.getWeightCategory().setData(Collections.singletonList(weightCategory)); +// ui.getWeightCategory().setData(Collections.singletonList(weightCategory)); ui.getWeightCategory().setSelectedItem(weightCategory); requestFocus = ui.getCatchWeight(); } + if (log.isDebugEnabled()) { log.debug("selected weightCategory " + weightCategory); log.debug("selected species " + species); @@ -207,8 +207,8 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetTargetCatchDt UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.TargetCatch.table.speciesThon"), - n("observe.data.ps.observation.TargetCatch.table.speciesThon.tip"), + n("observe.data.ps.observation.TargetCatch.table.species"), + n("observe.data.ps.observation.TargetCatch.table.species.tip"), n("observe.data.ps.observation.TargetCatch.table.weightCategory"), n("observe.data.ps.observation.TargetCatch.table.weightCategory.tip"), n("observe.data.ps.observation.TargetCatch.table.well"), @@ -265,9 +265,6 @@ public class TargetCatchUIHandler extends ContentTableUIHandler<SetTargetCatchDt protected void loadEditBean(String beanId) { Form<SetTargetCatchDto> form = getPsObservationTargetCatchService().loadForm(beanId, false); getModel().openForm(form); -// loadReferentialReferenceSetsInModel(form); -// getModel().setForm(form); -// SetTargetCatchHelper.copySetTargetCatchDto(form.getObject(), getBean()); } @Override ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetDiscardCatchUI.jcss ===================================== @@ -28,18 +28,10 @@ toolTipText:"observe.data.ps.observation.TargetDiscard.table.species.tip"; } -#species { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; -} - #weightCategoryLabel { toolTipText:"observe.data.ps.observation.TargetDiscard.table.weightCategory.tip"; } -#weightCategory { - enabled:{!tableModel.isEditable() || !model.isRowSaved()}; -} - #reasonForDiscardLabel { toolTipText:"observe.data.ps.observation.TargetDiscard.table.reasonForDiscard.tip"; } ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetDiscardCatchUIHandler.java ===================================== @@ -218,10 +218,16 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetTarget // au singleton de sa valeur correspondante dans le bean // puisque dans ce mode, pas possibilite de modifier de cette // valeur (clef metier) + + // on recalcule la liste des speciess disponibles + List<SpeciesReference> availableSpecies = buildSpeciesList(weightCategory); + ui.getSpecies().setData(availableSpecies); + + ui.getSpecies().setSelectedItem(null); ui.getSpecies().setSelectedItem(species); - ui.getWeightCategory().setData(Collections.singletonList(weightCategory)); +// ui.getWeightCategory().setData(Collections.singletonList(weightCategory)); ui.getWeightCategory().setSelectedItem(weightCategory); - ui.getReasonForDiscard().setData(Collections.singletonList(reasonForDiscard)); +// ui.getReasonForDiscard().setData(Collections.singletonList(reasonForDiscard)); ui.getReasonForDiscard().setSelectedItem(reasonForDiscard); requestFocus = ui.getCatchWeight(); @@ -239,7 +245,7 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetTarget UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.TargetDiscard.table.speciesThon"), + n("observe.data.ps.observation.TargetDiscard.table.species"), n("observe.data.ps.observation.TargetDiscard.table.species.tip"), n("observe.data.ps.observation.TargetDiscard.table.weightCategory"), n("observe.data.ps.observation.TargetDiscard.table.weightCategory.tip"), @@ -362,7 +368,6 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetTarget } - @SuppressWarnings("unchecked") private List<ReasonForDiscardReference> buildReasonFordiscardList() { return getModel().getReferenceCache().getReferentialReferences(TargetCatchDto.PROPERTY_REASON_FOR_DISCARD); } @@ -382,9 +387,6 @@ public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetTarget protected void loadEditBean(String beanId) { Form<SetTargetCatchDto> form = getPsObservationTargetCatchService().loadForm(beanId, true); getModel().openForm(form); -// loadReferentialReferenceSetsInModel(form); -// getModel().setForm(form); -// SetTargetCatchHelper.copySetTargetCatchDto(form.getObject(), getBean()); } @Override ===================================== client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/TargetSampleUIHandler.java ===================================== @@ -157,8 +157,8 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar UIHelper.setI18nTableHeaderRenderer( table, - n("observe.data.ps.observation.TargetLength.table.speciesThon"), - n("observe.data.ps.observation.TargetLength.table.speciesThon.tip"), + n("observe.data.ps.observation.TargetLength.table.species"), + n("observe.data.ps.observation.TargetLength.table.species.tip"), n("observe.data.ps.observation.TargetLength.table.sex"), n("observe.data.ps.observation.TargetLength.table.sex.tip"), n("observe.data.ps.observation.TargetLength.table.sizeMeasureType"), ===================================== observe-i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -2005,10 +2005,10 @@ observe.data.ps.observation.NonTargetCatch.table.meanWeight=Mean weight observe.data.ps.observation.NonTargetCatch.table.meanWeight.tip=Mean weight (in Kg) observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard=Reason for discard observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard.tip=Reason for discard +observe.data.ps.observation.NonTargetCatch.table.species=Species +observe.data.ps.observation.NonTargetCatch.table.species.tip=non target species observe.data.ps.observation.NonTargetCatch.table.speciesFate=Species fate observe.data.ps.observation.NonTargetCatch.table.speciesFate.tip=Species fate -observe.data.ps.observation.NonTargetCatch.table.speciesFaune=Species -observe.data.ps.observation.NonTargetCatch.table.speciesFaune.tip=non target species observe.data.ps.observation.NonTargetCatch.table.totalCount=Count observe.data.ps.observation.NonTargetCatch.table.totalCount.tip=Estimated count observe.data.ps.observation.NonTargetCatch.table.well=Well @@ -2064,12 +2064,12 @@ observe.data.ps.observation.NonTargetLength.table.length=Length observe.data.ps.observation.NonTargetLength.table.length.tip=Length observe.data.ps.observation.NonTargetLength.table.meanWeight=Indiv. Weight observe.data.ps.observation.NonTargetLength.table.meanWeight.tip=Individual weight (en Kg) -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies=Species -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies.tip=Non target species observe.data.ps.observation.NonTargetLength.table.picturesReferences=Pictures references observe.data.ps.observation.NonTargetLength.table.picturesReferences.tip=Pictures references observe.data.ps.observation.NonTargetLength.table.sizeMeasureType=Measure type observe.data.ps.observation.NonTargetLength.table.sizeMeasureType.tip=Size measure type +observe.data.ps.observation.NonTargetLength.table.species=Species +observe.data.ps.observation.NonTargetLength.table.species.tip=Non target species observe.data.ps.observation.NonTargetLength.tagNumber=Sample number observe.data.ps.observation.NonTargetLength.title=Non target lengths observe.data.ps.observation.NonTargetLength.type=Non target length @@ -2092,8 +2092,8 @@ observe.data.ps.observation.ObjectObservedSpecies.species=Species observe.data.ps.observation.ObjectObservedSpecies.speciesStatus=Species status observe.data.ps.observation.ObjectObservedSpecies.table.count=Count observe.data.ps.observation.ObjectObservedSpecies.table.count.tip=Count -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune=Species -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune.tip=Object observed species +observe.data.ps.observation.ObjectObservedSpecies.table.species=Species +observe.data.ps.observation.ObjectObservedSpecies.table.species.tip=Object observed species observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus=Status observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus.tip=Species status observe.data.ps.observation.ObjectObservedSpecies.title=Object observed species @@ -2155,8 +2155,8 @@ observe.data.ps.observation.SchoolEstimate.meanWeight=Mean weight observe.data.ps.observation.SchoolEstimate.species=Species observe.data.ps.observation.SchoolEstimate.table.meanWeight=Mean weight (in Kg) observe.data.ps.observation.SchoolEstimate.table.meanWeight.tip=Mean weight (in Kg) -observe.data.ps.observation.SchoolEstimate.table.speciesThon=Species -observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip=Target species +observe.data.ps.observation.SchoolEstimate.table.species=Species +observe.data.ps.observation.SchoolEstimate.table.species.tip=Target species observe.data.ps.observation.SchoolEstimate.table.weight=Weight (in t) observe.data.ps.observation.SchoolEstimate.table.weight.tip=Weight (in t) observe.data.ps.observation.SchoolEstimate.title=School estimate @@ -2213,8 +2213,8 @@ observe.data.ps.observation.TargetCatch.species=Species observe.data.ps.observation.TargetCatch.table.comment=Com observe.data.ps.observation.TargetCatch.table.comment.tip=comment observe.data.ps.observation.TargetCatch.table.deleteExtraMessage=\nDeleting a target catch will delete all the sample for this species. -observe.data.ps.observation.TargetCatch.table.speciesThon=Species -observe.data.ps.observation.TargetCatch.table.speciesThon.tip=Targt species +observe.data.ps.observation.TargetCatch.table.species=Species +observe.data.ps.observation.TargetCatch.table.species.tip=Targt species observe.data.ps.observation.TargetCatch.table.weight=Weight (in t) observe.data.ps.observation.TargetCatch.table.weight.tip=Weight (in t) observe.data.ps.observation.TargetCatch.table.weightCategory=Weight category @@ -2237,8 +2237,8 @@ observe.data.ps.observation.TargetDiscard.table.comment.tip=Comment observe.data.ps.observation.TargetDiscard.table.deleteExtraMessage=\nDeleting a discarded target catch will delete all the sample for this species. observe.data.ps.observation.TargetDiscard.table.reasonForDiscard=Reason for discard observe.data.ps.observation.TargetDiscard.table.reasonForDiscard.tip=Reason for discard +observe.data.ps.observation.TargetDiscard.table.species=Species observe.data.ps.observation.TargetDiscard.table.species.tip=Target discarded species -observe.data.ps.observation.TargetDiscard.table.speciesThon=Species observe.data.ps.observation.TargetDiscard.table.weight=Weight (in t) observe.data.ps.observation.TargetDiscard.table.weight.tip=Weight (in t) observe.data.ps.observation.TargetDiscard.table.weightCategory=Weight category @@ -2262,8 +2262,8 @@ observe.data.ps.observation.TargetLength.table.sex=Sex observe.data.ps.observation.TargetLength.table.sex.tip=Sex observe.data.ps.observation.TargetLength.table.sizeMeasureType=Measure type observe.data.ps.observation.TargetLength.table.sizeMeasureType.tip=Measure type (LF or LD1) -observe.data.ps.observation.TargetLength.table.speciesThon=Species -observe.data.ps.observation.TargetLength.table.speciesThon.tip=Target sample species +observe.data.ps.observation.TargetLength.table.species=Species +observe.data.ps.observation.TargetLength.table.species.tip=Target sample species observe.data.ps.observation.TargetLength.table.totalWeight=Total weight (in t) observe.data.ps.observation.TargetLength.table.totalWeight.tip=Total weight (in t) observe.data.ps.observation.TargetLength.tagNumber=Tag number ===================================== observe-i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -2005,10 +2005,10 @@ observe.data.ps.observation.NonTargetCatch.table.meanWeight=Peso medio observe.data.ps.observation.NonTargetCatch.table.meanWeight.tip=Peso medio (en Kg) observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard=Razón del descarte observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard.tip=Razón del descarte +observe.data.ps.observation.NonTargetCatch.table.species=Especie +observe.data.ps.observation.NonTargetCatch.table.species.tip=Especie observe.data.ps.observation.NonTargetCatch.table.speciesFate=Devenir observe.data.ps.observation.NonTargetCatch.table.speciesFate.tip=Devenir de la fauna -observe.data.ps.observation.NonTargetCatch.table.speciesFaune=Especie -observe.data.ps.observation.NonTargetCatch.table.speciesFaune.tip=Especie observe.data.ps.observation.NonTargetCatch.table.totalCount=Número observe.data.ps.observation.NonTargetCatch.table.totalCount.tip=Número estimado observe.data.ps.observation.NonTargetCatch.table.well=Cuba @@ -2064,12 +2064,12 @@ observe.data.ps.observation.NonTargetLength.table.length=Talla observe.data.ps.observation.NonTargetLength.table.length.tip=Talla observe.data.ps.observation.NonTargetLength.table.meanWeight=Peso observe.data.ps.observation.NonTargetLength.table.meanWeight.tip=Peso del individuo -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies=Especie -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies.tip=Especie observe.data.ps.observation.NonTargetLength.table.picturesReferences=Ref. foto observe.data.ps.observation.NonTargetLength.table.picturesReferences.tip=Referencia foto observe.data.ps.observation.NonTargetLength.table.sizeMeasureType=Typo de medida observe.data.ps.observation.NonTargetLength.table.sizeMeasureType.tip=Typo de medida +observe.data.ps.observation.NonTargetLength.table.species=Especie +observe.data.ps.observation.NonTargetLength.table.species.tip=Especie observe.data.ps.observation.NonTargetLength.tagNumber=Numéro d'échantillon \#TODO observe.data.ps.observation.NonTargetLength.title=Longitudes (cm inf.) observe.data.ps.observation.NonTargetLength.type=Longitud (cm inf.) @@ -2092,8 +2092,8 @@ observe.data.ps.observation.ObjectObservedSpecies.species=Especie observe.data.ps.observation.ObjectObservedSpecies.speciesStatus=Estado de especie observe.data.ps.observation.ObjectObservedSpecies.table.count=Número observe.data.ps.observation.ObjectObservedSpecies.table.count.tip=Número -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune=Especie -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune.tip=Especie +observe.data.ps.observation.ObjectObservedSpecies.table.species=Especie +observe.data.ps.observation.ObjectObservedSpecies.table.species.tip=Especie observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus=Estado observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus.tip=Estado observe.data.ps.observation.ObjectObservedSpecies.title=Fauna observada @@ -2155,8 +2155,8 @@ observe.data.ps.observation.SchoolEstimate.meanWeight=Peso medio (en Kg) observe.data.ps.observation.SchoolEstimate.species=Especie observe.data.ps.observation.SchoolEstimate.table.meanWeight=Peso medio (en Kg) observe.data.ps.observation.SchoolEstimate.table.meanWeight.tip=Peso medio (en Kg) -observe.data.ps.observation.SchoolEstimate.table.speciesThon=Especie -observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip=Especie de atún (no se puede modificar una vez se haya creado la estimación) +observe.data.ps.observation.SchoolEstimate.table.species=Especie +observe.data.ps.observation.SchoolEstimate.table.species.tip=Especie de atún (no se puede modificar una vez se haya creado la estimación) observe.data.ps.observation.SchoolEstimate.table.weight=Peso (en t) observe.data.ps.observation.SchoolEstimate.table.weight.tip=Peso (en t) observe.data.ps.observation.SchoolEstimate.title=Estimación del banco @@ -2213,8 +2213,8 @@ observe.data.ps.observation.TargetCatch.species=Especie observe.data.ps.observation.TargetCatch.table.comment=Comentario observe.data.ps.observation.TargetCatch.table.comment.tip=Comentario observe.data.ps.observation.TargetCatch.table.deleteExtraMessage=\nLa eliminación de una captura de atún puede provocar la eliminación de muestreo(s) sobre la especie. -observe.data.ps.observation.TargetCatch.table.speciesThon=Atún puesto en tanque -observe.data.ps.observation.TargetCatch.table.speciesThon.tip=Atún puesto en tanque +observe.data.ps.observation.TargetCatch.table.species=Atún puesto en tanque +observe.data.ps.observation.TargetCatch.table.species.tip=Atún puesto en tanque observe.data.ps.observation.TargetCatch.table.weight=Peso (en t) observe.data.ps.observation.TargetCatch.table.weight.tip=Peso (en t) observe.data.ps.observation.TargetCatch.table.weightCategory=Categoría de peso @@ -2237,8 +2237,8 @@ observe.data.ps.observation.TargetDiscard.table.comment.tip=Comentario observe.data.ps.observation.TargetDiscard.table.deleteExtraMessage=\nLa eliminación de un rechazo de atún puede provocar la eliminación de muestreo(s) sobre la especie. observe.data.ps.observation.TargetDiscard.table.reasonForDiscard=Razon de descarte observe.data.ps.observation.TargetDiscard.table.reasonForDiscard.tip=Razon de descarte +observe.data.ps.observation.TargetDiscard.table.species=Especie de atún observe.data.ps.observation.TargetDiscard.table.species.tip=Especie de atún -observe.data.ps.observation.TargetDiscard.table.speciesThon=Especie de atún observe.data.ps.observation.TargetDiscard.table.weight=Peso observe.data.ps.observation.TargetDiscard.table.weight.tip=Peso (en t) observe.data.ps.observation.TargetDiscard.table.weightCategory=Categoría de peso @@ -2262,8 +2262,8 @@ observe.data.ps.observation.TargetLength.table.sex=Sexo observe.data.ps.observation.TargetLength.table.sex.tip=Sexo observe.data.ps.observation.TargetLength.table.sizeMeasureType=Tipo de medición observe.data.ps.observation.TargetLength.table.sizeMeasureType.tip=El tipo de medición utilizado (LF ou LD1) -observe.data.ps.observation.TargetLength.table.speciesThon=Especie de atún -observe.data.ps.observation.TargetLength.table.speciesThon.tip=Especie de atún +observe.data.ps.observation.TargetLength.table.species=Especie de atún +observe.data.ps.observation.TargetLength.table.species.tip=Especie de atún observe.data.ps.observation.TargetLength.table.totalWeight=Peso tot. observe.data.ps.observation.TargetLength.table.totalWeight.tip=Peso total (en t) observe.data.ps.observation.TargetLength.tagNumber=Numéro échantillon \#TODO ===================================== observe-i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -2005,10 +2005,10 @@ observe.data.ps.observation.NonTargetCatch.table.meanWeight=Poids moy observe.data.ps.observation.NonTargetCatch.table.meanWeight.tip=Poids moyen (en Kg) observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard=Raison rejet observe.data.ps.observation.NonTargetCatch.table.reasonForDiscard.tip=Raison rejet +observe.data.ps.observation.NonTargetCatch.table.species=Espèce de faune +observe.data.ps.observation.NonTargetCatch.table.species.tip=Espèce de faune observe.data.ps.observation.NonTargetCatch.table.speciesFate=Devenir observe.data.ps.observation.NonTargetCatch.table.speciesFate.tip=Devenir faune -observe.data.ps.observation.NonTargetCatch.table.speciesFaune=Espèce de faune -observe.data.ps.observation.NonTargetCatch.table.speciesFaune.tip=Espèce de faune observe.data.ps.observation.NonTargetCatch.table.totalCount=Nombre observe.data.ps.observation.NonTargetCatch.table.totalCount.tip=Nombre estimé observe.data.ps.observation.NonTargetCatch.table.well=Cuve @@ -2064,12 +2064,12 @@ observe.data.ps.observation.NonTargetLength.table.length=Longueur observe.data.ps.observation.NonTargetLength.table.length.tip=Longueur observe.data.ps.observation.NonTargetLength.table.meanWeight=Poids ind.. observe.data.ps.observation.NonTargetLength.table.meanWeight.tip=Poids individuel (en Kg) -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies=Espèce faune -observe.data.ps.observation.NonTargetLength.table.nonTargetSpecies.tip=Espèce faune observe.data.ps.observation.NonTargetLength.table.picturesReferences=Ref photo observe.data.ps.observation.NonTargetLength.table.picturesReferences.tip=référence photo observe.data.ps.observation.NonTargetLength.table.sizeMeasureType=Type de mensuration observe.data.ps.observation.NonTargetLength.table.sizeMeasureType.tip=Le type de mensuration utilisé (LF ou LD1) +observe.data.ps.observation.NonTargetLength.table.species=Espèce faune +observe.data.ps.observation.NonTargetLength.table.species.tip=Espèce faune observe.data.ps.observation.NonTargetLength.tagNumber=Id marque observe.data.ps.observation.NonTargetLength.title=Longueurs (cm inf.) observe.data.ps.observation.NonTargetLength.type=Longueur (cm inf.) @@ -2092,8 +2092,8 @@ observe.data.ps.observation.ObjectObservedSpecies.species=Espèce observe.data.ps.observation.ObjectObservedSpecies.speciesStatus=Statut faune observée observe.data.ps.observation.ObjectObservedSpecies.table.count=Nombre observe.data.ps.observation.ObjectObservedSpecies.table.count.tip=Nombre -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune=Espèce de faune -observe.data.ps.observation.ObjectObservedSpecies.table.speciesFaune.tip=Espèce de faune +observe.data.ps.observation.ObjectObservedSpecies.table.species=Espèce de faune +observe.data.ps.observation.ObjectObservedSpecies.table.species.tip=Espèce de faune observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus=Statut Espèce observe.data.ps.observation.ObjectObservedSpecies.table.speciesStatus.tip=Statut Espèce observe.data.ps.observation.ObjectObservedSpecies.title=Faune observée @@ -2155,8 +2155,8 @@ observe.data.ps.observation.SchoolEstimate.meanWeight=Poids moyen (en Kg) observe.data.ps.observation.SchoolEstimate.species=Espèce observe.data.ps.observation.SchoolEstimate.table.meanWeight=Poids moyen (en Kg) observe.data.ps.observation.SchoolEstimate.table.meanWeight.tip=Poids moyen (en Kg) -observe.data.ps.observation.SchoolEstimate.table.speciesThon=Espèce de thon -observe.data.ps.observation.SchoolEstimate.table.speciesThon.tip=Espèce de thon (ne peut pas être modifié une fois l'estimation crée) +observe.data.ps.observation.SchoolEstimate.table.species=Espèce de thon +observe.data.ps.observation.SchoolEstimate.table.species.tip=Espèce de thon (ne peut pas être modifié une fois l'estimation crée) observe.data.ps.observation.SchoolEstimate.table.weight=Poids (en t) observe.data.ps.observation.SchoolEstimate.table.weight.tip=Poids (en t) observe.data.ps.observation.SchoolEstimate.title=Estimation banc @@ -2213,8 +2213,8 @@ observe.data.ps.observation.TargetCatch.species=Espèce observe.data.ps.observation.TargetCatch.table.comment=Com observe.data.ps.observation.TargetCatch.table.comment.tip=Commentaire observe.data.ps.observation.TargetCatch.table.deleteExtraMessage=\nLe fait de supprimer une capture thon peut entrainer la suppression d'échantillonnage(s) sur l'espèce. -observe.data.ps.observation.TargetCatch.table.speciesThon=Thon mis en cuve -observe.data.ps.observation.TargetCatch.table.speciesThon.tip=Thon mis en cuve +observe.data.ps.observation.TargetCatch.table.species=Thon mis en cuve +observe.data.ps.observation.TargetCatch.table.species.tip=Thon mis en cuve observe.data.ps.observation.TargetCatch.table.weight=Poids (en t) observe.data.ps.observation.TargetCatch.table.weight.tip=Poids (en t) observe.data.ps.observation.TargetCatch.table.weightCategory=Catégorie de poids @@ -2237,8 +2237,8 @@ observe.data.ps.observation.TargetDiscard.table.comment.tip=Commentaire observe.data.ps.observation.TargetDiscard.table.deleteExtraMessage=\nLe fait de supprimer un rejet de thon peut entrainer la suppression d'échantillonnage(s) sur l'espèce. observe.data.ps.observation.TargetDiscard.table.reasonForDiscard=Raison rejet observe.data.ps.observation.TargetDiscard.table.reasonForDiscard.tip=Raison rejet +observe.data.ps.observation.TargetDiscard.table.species=Espèce de thon observe.data.ps.observation.TargetDiscard.table.species.tip=Espèce de thon -observe.data.ps.observation.TargetDiscard.table.speciesThon=Espèce de thon observe.data.ps.observation.TargetDiscard.table.weight=Poids observe.data.ps.observation.TargetDiscard.table.weight.tip=Poids (en t) observe.data.ps.observation.TargetDiscard.table.weightCategory=Catégorie de poids @@ -2262,8 +2262,8 @@ observe.data.ps.observation.TargetLength.table.sex=Sexe observe.data.ps.observation.TargetLength.table.sex.tip=Sexe observe.data.ps.observation.TargetLength.table.sizeMeasureType=Type de mensuration observe.data.ps.observation.TargetLength.table.sizeMeasureType.tip=Le type de mensuration utilisé (LF ou LD1) -observe.data.ps.observation.TargetLength.table.speciesThon=Espèce de thon -observe.data.ps.observation.TargetLength.table.speciesThon.tip=Espèce de thon +observe.data.ps.observation.TargetLength.table.species=Espèce de thon +observe.data.ps.observation.TargetLength.table.species.tip=Espèce de thon observe.data.ps.observation.TargetLength.table.totalWeight=Poids tot. observe.data.ps.observation.TargetLength.table.totalWeight.tip=Poids total (en t) observe.data.ps.observation.TargetLength.tagNumber=Numéro échantillon ===================================== persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/TargetCatchImpl.java ===================================== @@ -21,6 +21,8 @@ */ package fr.ird.observe.entities.data.ps.observation; +import fr.ird.observe.dto.data.DataDto; +import fr.ird.observe.dto.referential.ReferentialLocale; import fr.ird.observe.entities.referential.common.Species; import org.nuiton.util.NumberUtil; @@ -51,4 +53,13 @@ public class TargetCatchImpl extends TargetCatchAbstract { super.setCatchWeight(catchWeight); } + @Override + public <D extends DataDto> void toDto(ReferentialLocale referentialLocale, D dto) { + super.toDto(referentialLocale, dto); + + if (dto instanceof fr.ird.observe.dto.data.ps.observation.TargetCatchDto) { + fr.ird.observe.dto.data.ps.observation.TargetCatchDto dto1 = (fr.ird.observe.dto.data.ps.observation.TargetCatchDto) dto; + dto1.setSpecies(java.util.Optional.ofNullable(getSpecies()).map(e-> e.toReference(referentialLocale)).orElse(null)); + } + } } ===================================== persistence/src/main/resources/db/migration/7.4/03_rename_referential-H2.sql ===================================== @@ -43,5 +43,5 @@ CREATE INDEX idx_observe_longline_catch_stomachFullness ON observe_longline.catc DROP TABLE observe_longline.Healthness; DROP TABLE observe_longline.StomacFullness; -UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.Healthness', 'referential.longline.HealthStatus'); -UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.StomacFullness', 'referential.longline.StomachFullness'); \ No newline at end of file +UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.Healthness', 'referentiel.longline.HealthStatus'); +UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.StomacFullness', 'referentiel.longline.StomachFullness'); \ No newline at end of file ===================================== persistence/src/main/resources/db/migration/7.4/03_rename_referential-PG.sql ===================================== @@ -43,4 +43,4 @@ DROP TABLE observe_longline.Healthness CASCADE; DROP TABLE observe_longline.StomacFullness CASCADE; UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.Healthness', 'referentiel.longline.HealthStatus'); -UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.StomachFullness', 'referentiel.longline.StomachFullness'); \ No newline at end of file +UPDATE observe_common.LASTUPDATEDATE SET TYPE = REPLACE(TYPE, 'referentiel.longline.StomacFullness', 'referentiel.longline.StomachFullness'); \ No newline at end of file ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialServiceLocal.java ===================================== @@ -57,6 +57,7 @@ import fr.ird.observe.spi.map.ImmutableTypedMap; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.nuiton.topia.persistence.TopiaDao; +import org.nuiton.topia.persistence.TopiaException; import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity; import org.nuiton.topia.persistence.metadata.TopiaMetadataModel; import org.nuiton.topia.persistence.script.SqlScriptConsumer; @@ -314,8 +315,12 @@ public class ReferentialServiceLocal extends ObserveServiceLocal implements Refe ReferentialDtoEntityContext<D, ?, E, ?> dtoEntityContext = DbModelHelper.fromReferentialDtoWeak(dtoType); Class<E> entityType = dtoEntityContext.toEntityType(); ObserveTopiaPersistenceContext persistenceContext = serviceContext.getTopiaPersistenceContext(); - Date lastUpdateDate = persistenceContext.getLastUpdateDate(entityType); - return Optional.ofNullable(lastUpdateDate); + try { + Date lastUpdateDate = persistenceContext.getLastUpdateDate(entityType); + return Optional.ofNullable(lastUpdateDate); + } catch (Exception e) { + throw new TopiaException(String.format("Can't find last update date for type: %s", entityType.getName())); + } } private <D extends ReferentialDto, E extends ReferentialEntity<D, ?>> Form<D> referentialEntityToForm(ReferentialDtoEntityContext<D, ?, E, ?> spi, E entity) { ===================================== test/src/main/resources/db/8.0-RC-2/dataForTestLongline.sql.gz ===================================== Binary files a/test/src/main/resources/db/8.0-RC-2/dataForTestLongline.sql.gz and b/test/src/main/resources/db/8.0-RC-2/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/8.0-RC-2/dataForTestSeine.sql.gz ===================================== Binary files a/test/src/main/resources/db/8.0-RC-2/dataForTestSeine.sql.gz and b/test/src/main/resources/db/8.0-RC-2/dataForTestSeine.sql.gz differ ===================================== test/src/main/resources/db/8.0-RC-2/referentiel.sql.gz ===================================== Binary files a/test/src/main/resources/db/8.0-RC-2/referentiel.sql.gz and b/test/src/main/resources/db/8.0-RC-2/referentiel.sql.gz differ ===================================== test/src/main/resources/fixtures/validate-service-seine-trips.properties ===================================== @@ -28,5 +28,4 @@ NonTargetCatchDto=3 NonTargetLengthDto=3 TargetLengthDto=1 FloatingObjectDto=1 -FloatingObjectPartDto=1 -TargetCatchDto=1 +FloatingObjectPartDto=1 \ No newline at end of file View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/16203a30a6d40f66bbf2be9d1... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/16203a30a6d40f66bbf2be9d1... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT