Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

14 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java
    ... ... @@ -74,6 +74,7 @@ public abstract class ObserveKeyStrokes {
    74 74
         public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT = KeyStroke.getKeyStroke("ctrl pressed B");
    
    75 75
         public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH = KeyStroke.getKeyStroke("ctrl pressed C");
    
    76 76
     
    
    77
    +    public static final KeyStroke KEY_STROKE_SELECT_TRANSSHIPMENT = KeyStroke.getKeyStroke("ctrl pressed T");
    
    77 78
         public static final KeyStroke KEY_STROKE_SAVE_TABLE_ENTRY = KeyStroke.getKeyStroke("ctrl pressed S");
    
    78 79
         public static final KeyStroke KEY_STROKE_PRESSED_ENTER = KeyStroke.getKeyStroke("pressed ENTER");
    
    79 80
         public static final KeyStroke KEY_STROKE_RESET = KeyStroke.getKeyStroke("ctrl pressed R");
    

  • client/src/main/java/fr/ird/observe/client/ui/actions/content/data/longline/SelectTransshipmentLandingLogbookUIAction.java
    1
    +package fr.ird.observe.client.ui.actions.content.data.longline;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, 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.ui.ObserveKeyStrokes;
    
    26
    +import fr.ird.observe.client.ui.ObserveMainUI;
    
    27
    +import fr.ird.observe.client.ui.actions.content.api.AbstractContentUIAction;
    
    28
    +import fr.ird.observe.client.ui.content.api.ContentUI;
    
    29
    +import fr.ird.observe.client.ui.content.data.longline.logbook.TripLonglineLandingLogbookUI;
    
    30
    +import fr.ird.observe.client.ui.content.data.longline.logbook.TripLonglineLandingLogbookUIModel;
    
    31
    +
    
    32
    +import static org.nuiton.i18n.I18n.n;
    
    33
    +
    
    34
    +/**
    
    35
    + * Created by tchemit on 14/10/2018.
    
    36
    + *
    
    37
    + * @author Tony Chemit - dev@tchemit.fr
    
    38
    + */
    
    39
    +public class SelectTransshipmentLandingLogbookUIAction extends AbstractContentUIAction {
    
    40
    +
    
    41
    +    public static final String ACTION_NAME = SelectTransshipmentLandingLogbookUIAction.class.getName();
    
    42
    +
    
    43
    +    public SelectTransshipmentLandingLogbookUIAction(ObserveMainUI mainUI) {
    
    44
    +        super(mainUI, ACTION_NAME, n("observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment"), n("observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment"), "data-calcule", ObserveKeyStrokes.KEY_STROKE_SELECT_TRANSSHIPMENT);
    
    45
    +    }
    
    46
    +
    
    47
    +    @Override
    
    48
    +    protected void actionPerformed(ContentUI contentUI) {
    
    49
    +
    
    50
    +        TripLonglineLandingLogbookUI ui = (TripLonglineLandingLogbookUI) contentUI;
    
    51
    +        TripLonglineLandingLogbookUIModel model = ui.getModel();
    
    52
    +        model.selectTransshipment();
    
    53
    +    }
    
    54
    +}

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jaxx
    ... ... @@ -39,6 +39,7 @@
    39 39
         fr.ird.observe.client.ui.actions.content.data.longline.delete.DeleteTripLonglineLandingLogbookUIAction
    
    40 40
         fr.ird.observe.client.ui.actions.content.data.longline.move.MoveSingleTripLonglineLandingLogbookUIAction
    
    41 41
         fr.ird.observe.client.ui.actions.content.data.longline.save.SaveTripLonglineLandingLogbookUIAction
    
    42
    +    fr.ird.observe.client.ui.actions.content.data.longline.SelectTransshipmentLandingLogbookUIAction
    
    42 43
     
    
    43 44
         fr.ird.observe.client.ui.util.JComment
    
    44 45
         fr.ird.observe.client.ObserveSwingApplicationContext
    
    ... ... @@ -121,7 +122,10 @@
    121 122
                           <JLabel id='harbourLabel'/>
    
    122 123
                         </cell>
    
    123 124
                         <cell weightx='1' anchor='east'>
    
    124
    -                      <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference'/>
    
    125
    +                      <JPanel layout="{new BorderLayout()}">
    
    126
    +                      <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference' constraints='BorderLayout.CENTER'/>
    
    127
    +                        <JButton id='selectTransshipment' constraints='BorderLayout.EAST'/>
    
    128
    +                      </JPanel>
    
    125 129
                         </cell>
    
    126 130
                       </row>
    
    127 131
     
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jcss
    ... ... @@ -99,3 +99,7 @@
    99 99
     #save {
    
    100 100
       _observeAction:{SaveTripLonglineLandingLogbookUIAction.ACTION_NAME};
    
    101 101
     }
    
    102
    +
    
    103
    +#selectTransshipment {
    
    104
    +  _observeAction:{SelectTransshipmentLandingLogbookUIAction.ACTION_NAME};
    
    105
    +}

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUIModel.java
    ... ... @@ -22,9 +22,12 @@ package fr.ird.observe.client.ui.content.data.longline.logbook;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    +import fr.ird.observe.client.ui.content.api.ContentUI;
    
    25 26
     import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIModel;
    
    26 27
     import fr.ird.observe.dto.data.longline.LandingLogbookDto;
    
    27 28
     import fr.ird.observe.dto.data.longline.LandingLogbookReference;
    
    29
    +import fr.ird.observe.dto.referential.HarbourReference;
    
    30
    +import fr.ird.observe.dto.referential.VesselReference;
    
    28 31
     import org.nuiton.i18n.I18n;
    
    29 32
     
    
    30 33
     /**
    
    ... ... @@ -37,8 +40,27 @@ public class TripLonglineLandingLogbookUIModel extends ContentOpenableUIModel<La
    37 40
     
    
    38 41
         private static final long serialVersionUID = 1L;
    
    39 42
     
    
    43
    +    //FIXME-PROTECTED-ID
    
    44
    +    private static final String LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_VESSEL_ID = "fr.ird.observe.entities.referentiel.Vessel#1308214144311#0.8813727202637713";
    
    45
    +    //FIXME-PROTECTED-ID
    
    46
    +    private static final String LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_HARBOUR_ID = "fr.ird.observe.entities.referentiel.Harbour#11#0.38";
    
    47
    +
    
    48
    +    private HarbourReference transshipmentHarbour;
    
    49
    +    private VesselReference transshipmentVessel;
    
    50
    +
    
    40 51
         public TripLonglineLandingLogbookUIModel() {
    
    41 52
             super(LandingLogbookDto.class, I18n.n("observe.common.TripLonglineLandingLogbookDto.message.not.open"));
    
    42 53
         }
    
    43 54
     
    
    55
    +    @Override
    
    56
    +    public void init(ContentUI ui) {
    
    57
    +        super.init(ui);
    
    58
    +        transshipmentHarbour = ui.getDataSource().getReferentialReferenceSet(HarbourReference.class).tryGetReferenceById(LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_HARBOUR_ID).orElseThrow(IllegalStateException::new);
    
    59
    +        transshipmentVessel = ui.getDataSource().getReferentialReferenceSet(VesselReference.class).tryGetReferenceById(LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_VESSEL_ID).orElseThrow(IllegalStateException::new);
    
    60
    +    }
    
    61
    +
    
    62
    +    public void selectTransshipment() {
    
    63
    +        getBean().setHarbour(transshipmentHarbour);
    
    64
    +        getBean().setVessel(transshipmentVessel);
    
    65
    +    }
    
    44 66
     }

  • client/src/main/resources/i18n/client_en_GB.properties
    ... ... @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Move selected land
    1339 1339
     observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Reopen landing
    
    1340 1340
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Reopen landing
    
    1341 1341
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Reopen landing
    
    1342
    +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transshipment at sea
    
    1342 1343
     observe.common.TripLonglineLandingLogbookDto.comment=Comment
    
    1343 1344
     observe.common.TripLonglineLandingLogbookDto.list=List of landings
    
    1344 1345
     observe.common.TripLonglineLandingLogbookDto.list.message.none=< No landing for current trip >
    

  • client/src/main/resources/i18n/client_es_ES.properties
    ... ... @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Move selected land
    1339 1339
     observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Reopen landing
    
    1340 1340
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Reopen landing
    
    1341 1341
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Reopen landing
    
    1342
    +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transbordo en el mar
    
    1342 1343
     observe.common.TripLonglineLandingLogbookDto.comment=Comment
    
    1343 1344
     observe.common.TripLonglineLandingLogbookDto.list=List of landings
    
    1344 1345
     observe.common.TripLonglineLandingLogbookDto.list.message.none=< No landing for current trip >
    

  • client/src/main/resources/i18n/client_fr_FR.properties
    ... ... @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Déplacer les déb
    1339 1339
     observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Rouvrir le débarquement
    
    1340 1340
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Rouvrir le débarquement
    
    1341 1341
     observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Rouvrir le débarquement sélectionné
    
    1342
    +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transbordement en mer
    
    1342 1343
     observe.common.TripLonglineLandingLogbookDto.comment=Commentaire de le débarquement
    
    1343 1344
     observe.common.TripLonglineLandingLogbookDto.list=Liste des débarquements
    
    1344 1345
     observe.common.TripLonglineLandingLogbookDto.list.message.none=< Aucun débarquement pour la marée courante >
    

  • persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
    ... ... @@ -42,7 +42,6 @@ public class DataSourceMigrationForVersion_7_4 extends MigrationVersionResource
    42 42
         @Override
    
    43 43
         public void generateSqlScript(MigrationVersionResourceExecutor executor) {
    
    44 44
             executor.addScript("01", "update_referential_longline_conservation");
    
    45
    -        executor.addScript("02", "update_referential_common_harbour");
    
    46 45
             executor.addScript("03", "update_referential_longline_line_type");
    
    47 46
             executor.addScript("04", "update_longline_set_logbook_field");
    
    48 47
             executor.addScript("05", "update_longline_activity_logbook_field");
    

  • persistence/src/main/resources/db/migration/7.4/02_update_referential_common_harbour-common.sql deleted
    1
    ----
    
    2
    --- #%L
    
    3
    --- ObServe :: Persistence
    
    4
    --- %%
    
    5
    --- Copyright (C) 2008 - 2018 IRD, Code Lutin, 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
    -INSERT INTO observe_common.Harbour(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, name) values ('fr.ird.observe.entities.referentiel.Harbour#11#0.100' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, '998', 'At sea transshipment');
    
    23
    -UPDATE observe_common.LASTUPDATEDATE SET lastupdatedate = CURRENT_TIMESTAMP WHERE topiaId = 'fr.ird.observe.entities.LastUpdateDate#1236861982132#0.06';

  • test/src/main/resources/db/7.4/dataForTestLongline.sql.gz The diff for this file was not included because it is too large.
  • test/src/main/resources/db/7.4/dataForTestSeine.sql.gz The diff for this file was not included because it is too large.
  • test/src/main/resources/db/7.4/referentiel.sql.gz The diff for this file was not included because it is too large.
  • test/src/main/resources/fixtures/count-referential-common.properties
    ... ... @@ -27,7 +27,7 @@ observe_common.gear=26
    27 27
     observe_common.gear_gearcaracteristic=29
    
    28 28
     observe_common.gearcaracteristic=22
    
    29 29
     observe_common.gearcaracteristictype=6
    
    30
    -observe_common.harbour=75
    
    30
    +observe_common.harbour=74
    
    31 31
     observe_common.lastupdatedate=125
    
    32 32
     observe_common.lengthlengthparameter=0
    
    33 33
     observe_common.lengthmeasuremethod=4