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

Commits:

24 changed files:

Changes:

  • .gitlab/issue_templates/Contrat-SFA-2017-Anomalie.md
    ... ... @@ -10,5 +10,5 @@
    10 10
     
    
    11 11
     /label ~"Anomalie"
    
    12 12
     /label ~"IRD-2018-01-V8"
    
    13
    -/milestone %"8.0-RC-1"
    
    13
    +/milestone %"8.0-RC-2"
    
    14 14
     /assign @tchemit
    \ No newline at end of file

  • .gitlab/issue_templates/Contrat-SFA-2017-Evolution.md
    1 1
     
    
    2 2
     /label ~"Evolution"
    
    3 3
     /label ~"IRD-2018-01-V8"
    
    4
    -/milestone %"8.0-RC-1"
    
    4
    +/milestone %"8.0-RC-2"
    
    5 5
     /assign @tchemit
    \ No newline at end of file

  • client-core/.mvn/i18n/parse-validation-messages

  • client-core/pom.xml
    ... ... @@ -770,6 +770,53 @@
    770 770
             </dependencies>
    
    771 771
           </plugin>
    
    772 772
     
    
    773
    +      <plugin>
    
    774
    +        <groupId>fr.ird.observe.toolkit</groupId>
    
    775
    +        <artifactId>toolbox-maven-plugin</artifactId>
    
    776
    +        <version>${observeToolkitVersion}</version>
    
    777
    +        <executions>
    
    778
    +          <execution>
    
    779
    +            <id>generate-i18n-validator-fields</id>
    
    780
    +            <goals>
    
    781
    +              <goal>generate-i18n-validator-fields</goal>
    
    782
    +            </goals>
    
    783
    +          </execution>
    
    784
    +          <execution>
    
    785
    +            <id>generate-validators-descriptor</id>
    
    786
    +            <goals>
    
    787
    +              <goal>generate-validators-descriptor</goal>
    
    788
    +            </goals>
    
    789
    +          </execution>
    
    790
    +        </executions>
    
    791
    +        <dependencies>
    
    792
    +          <dependency>
    
    793
    +            <groupId>${project.groupId}</groupId>
    
    794
    +            <artifactId>client-core</artifactId>
    
    795
    +            <version>${project.version}</version>
    
    796
    +          </dependency>
    
    797
    +          <dependency>
    
    798
    +            <groupId>fr.ird.observe.toolkit</groupId>
    
    799
    +            <artifactId>common-validation</artifactId>
    
    800
    +            <version>${observeToolkitVersion}</version>
    
    801
    +          </dependency>
    
    802
    +          <dependency>
    
    803
    +            <groupId>io.ultreia.java4all.jaxx</groupId>
    
    804
    +            <artifactId>jaxx-widgets-gis</artifactId>
    
    805
    +            <version>${lib.version.java4all.jaxx}</version>
    
    806
    +          </dependency>
    
    807
    +          <dependency>
    
    808
    +            <groupId>io.ultreia.java4all.jaxx</groupId>
    
    809
    +            <artifactId>jaxx-widgets-temperature</artifactId>
    
    810
    +            <version>${lib.version.java4all.jaxx}</version>
    
    811
    +          </dependency>
    
    812
    +          <dependency>
    
    813
    +            <groupId>org.javassist</groupId>
    
    814
    +            <artifactId>javassist</artifactId>
    
    815
    +            <version>${lib.version.javassist}</version>
    
    816
    +          </dependency>
    
    817
    +        </dependencies>
    
    818
    +      </plugin>
    
    819
    +
    
    773 820
         </plugins>
    
    774 821
       </build>
    
    775 822
     
    

  • client-core/src/main/i18n/getters/java.getter
    ... ... @@ -1040,6 +1040,9 @@ observe.ui.tree.referential.ll.landing
    1040 1040
     observe.ui.tree.referential.ll.obs
    
    1041 1041
     observe.ui.tree.referential.ps.common
    
    1042 1042
     observe.ui.tree.referential.ps.obs
    
    1043
    +observe.validation.setLonglineObsDetailComposition.invalid.pattern
    
    1044
    +observe.validation.setLonglineObsDetailComposition.required.id
    
    1045
    +observe.validation.setLonglineObsDetailComposition.required.pattern
    
    1043 1046
     observe.validator.field.tip
    
    1044 1047
     observe.validator.message.tip
    
    1045 1048
     observe.validator.scope.tip
    

  • client-core/src/main/i18n/getters/validation-fields.getter
    1
    +observe.common.LonglineDetailCompositionObsUIModelDto.generateTabValid

  • client-core/src/main/i18n/getters/validation-messages.getter
    1
    +observe.validation.setLonglineObsDetailComposition.invalid.templates

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/ContentUIHandler.java
    ... ... @@ -516,7 +516,7 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe
    516 516
             return icon;
    
    517 517
         }
    
    518 518
     
    
    519
    -    protected final void prepareValidators(IdDto editBean) {
    
    519
    +    protected void installValidators(IdDto editBean) {
    
    520 520
             // reset all validators
    
    521 521
             SwingValidatorUtil.setValidatorBean(ui, null);
    
    522 522
             // mark ui as editing
    
    ... ... @@ -552,9 +552,12 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe
    552 552
     //        ui.removeContextValue(model.getBeanType(), "edit");
    
    553 553
     
    
    554 554
             // dettach all validators
    
    555
    -        SwingValidatorUtil.setValidatorBean(ui, null);
    
    555
    +        uninstallValidators();
    
    556 556
         }
    
    557 557
     
    
    558
    +    protected void uninstallValidators() {
    
    559
    +        SwingValidatorUtil.setValidatorBean(ui, null);
    
    560
    +    }
    
    558 561
         protected boolean resetEdit;
    
    559 562
     
    
    560 563
         public boolean isResetEdit() {
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/data/edit/ContentEditUIHandler.java
    ... ... @@ -53,7 +53,7 @@ public abstract class ContentEditUIHandler<D extends DataDto, R extends DataDtoR
    53 53
         public void startEditUI() {
    
    54 54
             ContentEditUIModel<D, R> model = getModel();
    
    55 55
             prepareValidationContext();
    
    56
    -        prepareValidators(model.getBean());
    
    56
    +        installValidators(model.getBean());
    
    57 57
     //        addInfoMessageStartEdit();
    
    58 58
             model.setModified(model.isCreatingMode());
    
    59 59
         }
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/data/open/ContentOpenableUIHandler.java
    ... ... @@ -76,7 +76,7 @@ public abstract class ContentOpenableUIHandler<D extends DataDto, R extends Data
    76 76
         public void startEditUI() {
    
    77 77
             ContentOpenableUIModel<D, R> model = getModel();
    
    78 78
             prepareValidationContext();
    
    79
    -        prepareValidators(model.getBean());
    
    79
    +        installValidators(model.getBean());
    
    80 80
     //        addInfoMessageStartEdit();
    
    81 81
             boolean create = model.isCreatingMode();
    
    82 82
             model.setModified(create);
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/data/simple/ContentSimpleUIHandler.java
    ... ... @@ -57,7 +57,7 @@ public abstract class ContentSimpleUIHandler<D extends DataDto, U extends Conten
    57 57
         public void startEditUI() {
    
    58 58
             prepareValidationContext();
    
    59 59
             ContentSimpleUIModel<D> model = getModel();
    
    60
    -        prepareValidators(model.getBean());
    
    60
    +        installValidators(model.getBean());
    
    61 61
             model.setModified(false);
    
    62 62
             if (model.isCreatingMode()) {
    
    63 63
                 grabFocusOnForm();
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/data/table/ContentTableUIHandler.java
    ... ... @@ -188,7 +188,7 @@ public abstract class ContentTableUIHandler<D extends DataDto, C extends DataDto
    188 188
         @Override
    
    189 189
         public void startEditUI() {
    
    190 190
             prepareValidationContext();
    
    191
    -        prepareValidators(getModel().getBean());
    
    191
    +        installValidators(getModel().getBean());
    
    192 192
             reselectRow();
    
    193 193
             getModel().setModified(false);
    
    194 194
     //        addUpdatingMessage();
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/api/ref/ContentReferenceUIHandler.java
    ... ... @@ -216,7 +216,7 @@ public class ContentReferenceUIHandler<D extends ReferentialDto, R extends Refer
    216 216
                 removeAllMessages(ui);
    
    217 217
                 model.setEditing(true);
    
    218 218
                 prepareValidationContext();
    
    219
    -            prepareValidators(model.getBean());
    
    219
    +            installValidators(model.getBean());
    
    220 220
     
    
    221 221
                 if (model.isCreatingMode()) {
    
    222 222
     //                addInfoMessage(t("observe.message.creating.referentiel"));
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/BranchlineObsUI.jaxx
    ... ... @@ -116,10 +116,7 @@ public void edit(BranchlineObsDto branchline) { getHandler().edit(branchline); }
    116 116
                         <cell anchor='east'>
    
    117 117
                           <BeanCheckBox id='timer'/>
    
    118 118
                         </cell>
    
    119
    -                    <cell>
    
    120
    -                      <JLabel id='timeSinceContactLabel'/>
    
    121
    -                    </cell>
    
    122
    -                    <cell>
    
    119
    +                    <cell columns="2">
    
    123 120
                           <TimeEditor id='timeSinceContact' constructorParams='this' beanScope="model"/>
    
    124 121
                         </cell>
    
    125 122
                       </row>
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/BranchlineObsUI.jcss
    ... ... @@ -43,6 +43,14 @@
    43 43
       showTimeEditorSlider:false;
    
    44 44
     }
    
    45 45
     
    
    46
    +#snapWeight {
    
    47
    +  enabled:{BooleanUtils.isTrue(bean.getWeightedSnap())};
    
    48
    +}
    
    49
    +
    
    50
    +#swivelWeight {
    
    51
    +  enabled:{BooleanUtils.isTrue(bean.getWeightedSwivel())};
    
    52
    +}
    
    53
    +
    
    46 54
     /* ***************************************************************************** */
    
    47 55
     /*  HOOK AND BAIT TAB ********************************************************** */
    
    48 56
     /* ***************************************************************************** */

  • client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/BranchlineObsUIModel.java
    ... ... @@ -39,7 +39,7 @@ import java.util.Date;
    39 39
     @GenerateJavaBeanDefinition
    
    40 40
     public class BranchlineObsUIModel extends ContentSimpleUIModel<BranchlineObsDto> implements JavaBean {
    
    41 41
     
    
    42
    -    public static final String PROPERTY_SAVED = "saved";
    
    42
    +    static final String PROPERTY_SAVED = "saved";
    
    43 43
         private static final long serialVersionUID = 1L;
    
    44 44
         private BranchlineObsDto branchlineDto;
    
    45 45
     
    
    ... ... @@ -82,6 +82,6 @@ public class BranchlineObsUIModel extends ContentSimpleUIModel<BranchlineObsDto>
    82 82
     
    
    83 83
         @Override
    
    84 84
         public JavaBeanDefinition javaBeanDefinition() {
    
    85
    -        return null;
    
    85
    +        return javaBeanDefinition;
    
    86 86
         }
    
    87 87
     }

  • client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/LonglineDetailCompositionObsUI.jaxx
    ... ... @@ -54,6 +54,12 @@
    54 54
                      errorTableModel='{getErrorTableModel()}' context='update-longlineDetailComposition'>
    
    55 55
       </BeanValidator>
    
    56 56
     
    
    57
    +  <BeanValidator id='generateValidator' autoField='true'
    
    58
    +                 beanClass='fr.ird.observe.client.ui.content.data.ll.observation.LonglineDetailCompositionObsUIModel'
    
    59
    +                 errorTableModel='{getErrorTableModel()}' context='update'>
    
    60
    +    <field name="generateTabValid" component="sectionTemplatesPane"/>
    
    61
    +  </BeanValidator>
    
    62
    +
    
    57 63
       <BeanValidator id='sectionValidator' beanClass='fr.ird.observe.dto.data.ll.observation.SectionObsDto'
    
    58 64
                      errorTableModel='{getErrorTableModel()}' context='update-table'>
    
    59 65
         <field name='basket' component='sectionsPane'/>
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/LonglineDetailCompositionObsUIHandler.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.ll.observation;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -28,6 +28,7 @@ import fr.ird.observe.client.ui.actions.content.api.tab.GoToTabUIActionSupport;
    28 28
     import fr.ird.observe.client.ui.content.api.data.simple.ContentSimpleUIHandler;
    
    29 29
     import fr.ird.observe.client.ui.content.api.ui.ObserveLayoutFocusTraversalPolicy;
    
    30 30
     import fr.ird.observe.client.ui.util.UIHelper;
    
    31
    +import fr.ird.observe.dto.IdDto;
    
    31 32
     import fr.ird.observe.dto.data.ll.observation.BasketObsDto;
    
    32 33
     import fr.ird.observe.dto.data.ll.observation.BranchlineObsDto;
    
    33 34
     import fr.ird.observe.dto.data.ll.observation.SectionObsDto;
    
    ... ... @@ -40,8 +41,13 @@ import fr.ird.observe.dto.form.FormDefinition;
    40 41
     import fr.ird.observe.services.service.data.ll.observation.SetLonglineObsDetailCompositionService;
    
    41 42
     import fr.ird.observe.spi.DtoModelHelper;
    
    42 43
     import org.apache.commons.lang3.BooleanUtils;
    
    44
    +import org.apache.commons.lang3.StringUtils;
    
    43 45
     import org.apache.logging.log4j.LogManager;
    
    44 46
     import org.apache.logging.log4j.Logger;
    
    47
    +import org.jdesktop.swingx.JXTable;
    
    48
    +import org.jdesktop.swingx.decorator.ColorHighlighter;
    
    49
    +import org.jdesktop.swingx.decorator.ToolTipHighlighter;
    
    50
    +import org.jdesktop.swingx.renderer.StringValue;
    
    45 51
     import org.nuiton.decorator.Decorator;
    
    46 52
     import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    47 53
     import org.nuiton.jaxx.runtime.swing.JVetoableTabbedPane;
    
    ... ... @@ -50,6 +56,7 @@ import javax.swing.JComboBox;
    50 56
     import javax.swing.JOptionPane;
    
    51 57
     import javax.swing.event.ChangeListener;
    
    52 58
     import javax.swing.event.TableModelListener;
    
    59
    +import java.awt.Color;
    
    53 60
     import java.awt.Component;
    
    54 61
     import java.awt.Container;
    
    55 62
     import java.beans.PropertyChangeListener;
    
    ... ... @@ -273,6 +280,7 @@ public class LonglineDetailCompositionObsUIHandler extends ContentSimpleUIHandle
    273 280
         @Override
    
    274 281
         public void afterInit(LonglineDetailCompositionObsUI ui) {
    
    275 282
             super.afterInit(ui);
    
    283
    +        ui.getSectionTemplatesTable().setCellSelectionEnabled(false);
    
    276 284
             ui.get$objectMap().put(GoToTabUIActionSupport.SUB_TABBED_PANE, ui.getBranchlineDetailUI().getSubTabbedPane());
    
    277 285
             this.validationHelper = new LonglineDetailCompositionObsUIValidationHelper(ui, getDecoratorService());
    
    278 286
             getBranchlineDetailUIModel().addPropertyChangeListener(BranchlineObsUIModel.PROPERTY_SAVED, branchlineDetailChanged);
    
    ... ... @@ -335,7 +343,7 @@ public class LonglineDetailCompositionObsUIHandler extends ContentSimpleUIHandle
    335 343
     
    
    336 344
             BranchlineObsUIModel branchlineUIModel = branchlineObsUI.getModel();
    
    337 345
             Optional<FormDefinition<BranchlineObsDto>> optionalFormDefinition = DtoModelHelper.getOptionalFormDefinition(BranchlineObsDto.class);
    
    338
    -        optionalFormDefinition.ifPresent(t->branchlineObsUI.getModel().getReferenceCache().loadReferentialReferenceSetsInModel(t, true));
    
    346
    +        optionalFormDefinition.ifPresent(t -> branchlineObsUI.getModel().getReferenceCache().loadReferentialReferenceSetsInModel(t, true));
    
    339 347
             branchlineUIModel.setForm(branchlineDtoForm);
    
    340 348
     
    
    341 349
             //FIXME Validate this default date
    
    ... ... @@ -374,6 +382,82 @@ public class LonglineDetailCompositionObsUIHandler extends ContentSimpleUIHandle
    374 382
             }
    
    375 383
         }
    
    376 384
     
    
    385
    +    @Override
    
    386
    +    protected void installValidators(IdDto editBean) {
    
    387
    +        super.installValidators(editBean);
    
    388
    +        ui.getGenerateValidator().setBean(getModel());
    
    389
    +    }
    
    390
    +
    
    391
    +    @Override
    
    392
    +    protected void uninstallValidators() {
    
    393
    +        super.uninstallValidators();
    
    394
    +        ui.getGenerateValidator().setBean(null);
    
    395
    +    }
    
    396
    +
    
    397
    +    @Override
    
    398
    +    public void startEditUI() {
    
    399
    +        super.startEditUI();
    
    400
    +        ui.getSectionTemplatesTable().addHighlighter(new ColorHighlighter((renderer, adapter) -> {
    
    401
    +            JXTable component = (JXTable) adapter.getComponent();
    
    402
    +            SectionObsTemplateTableModel model = (SectionObsTemplateTableModel) component.getModel();
    
    403
    +            int row = adapter.convertRowIndexToModel(adapter.row);
    
    404
    +            SectionTemplate node = model.getData(row);
    
    405
    +            if (node.isEmpty()) {
    
    406
    +                return false;
    
    407
    +            }
    
    408
    +            switch (adapter.convertColumnIndexToModel(adapter.column)) {
    
    409
    +                case 0:
    
    410
    +                    return !node.isIdValid();
    
    411
    +                case 1:
    
    412
    +                    return !node.isFloatlineLengthsValid();
    
    413
    +            }
    
    414
    +            return true;
    
    415
    +        }, ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialErrorColor(), Color.WHITE,ObserveSwingApplicationContext.get().getConfig().getFloatingObjectMaterialErrorColor(), Color.WHITE));
    
    416
    +        ui.getSectionTemplatesTable().addHighlighter(new ToolTipHighlighter((renderer, adapter) -> {
    
    417
    +            JXTable component = (JXTable) adapter.getComponent();
    
    418
    +            SectionObsTemplateTableModel model = (SectionObsTemplateTableModel) component.getModel();
    
    419
    +            int row = adapter.convertRowIndexToModel(adapter.row);
    
    420
    +            SectionTemplate node = model.getData(row);
    
    421
    +            if (node.isEmpty()) {
    
    422
    +                return false;
    
    423
    +            }
    
    424
    +            switch (adapter.convertColumnIndexToModel(adapter.column)) {
    
    425
    +                case 0:
    
    426
    +                    return !node.isIdValid();
    
    427
    +                case 1:
    
    428
    +                    return !node.isFloatlineLengthsValid();
    
    429
    +            }
    
    430
    +            return true;
    
    431
    +        }, (StringValue) value -> {
    
    432
    +            int selectedColumn = ui.getSectionTemplatesTable().getSelectedColumn();
    
    433
    +            String str = (String) value;
    
    434
    +            boolean empty = StringUtils.isEmpty(str);
    
    435
    +            switch (selectedColumn) {
    
    436
    +                case 0:
    
    437
    +                    return t("observe.validation.setLonglineObsDetailComposition.required.id");
    
    438
    +                case 1:
    
    439
    +                    return empty?t("observe.validation.setLonglineObsDetailComposition.required.pattern"):t("observe.validation.setLonglineObsDetailComposition.invalid.pattern");
    
    440
    +            }
    
    441
    +            return null;
    
    442
    +        }));
    
    443
    +//        ui.getSectionTemplatesTable().addHighlighter(new IconHighlighter((renderer, adapter) -> {
    
    444
    +//            JXTable component = (JXTable) adapter.getComponent();
    
    445
    +//            SectionObsTemplateTableModel model = (SectionObsTemplateTableModel) component.getModel();
    
    446
    +//            int row = adapter.convertRowIndexToModel(adapter.row);
    
    447
    +//            SectionTemplate node = model.getData(row);
    
    448
    +//            if (node.isEmpty()) {
    
    449
    +//                return false;
    
    450
    +//            }
    
    451
    +//            switch (adapter.convertColumnIndexToModel(adapter.column)) {
    
    452
    +//                case 0:
    
    453
    +//                    return !node.isIdValid();
    
    454
    +//                case 1:
    
    455
    +//                    return !node.isFloatlineLengthsValid();
    
    456
    +//            }
    
    457
    +//            return true;
    
    458
    +//        }, JTabbedPaneValidator.ERROR_ICON));
    
    459
    +    }
    
    460
    +
    
    377 461
         public void insertBeforeSelectedSectionTemplate() {
    
    378 462
             getSectionTemplatesTableModel().insertBeforeSelectedRow();
    
    379 463
         }
    

  • client-core/src/main/resources/fr/ird/observe/client/ui/content/data/ll/observation/LonglineDetailCompositionObsUIModel-update-error-validation.xml
    1
    +<?xml version="1.0" encoding="UTF-8"?>
    
    2
    +<!--
    
    3
    +  #%L
    
    4
    +  ObServe :: Client core
    
    5
    +  %%
    
    6
    +  Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
    
    7
    +  %%
    
    8
    +  This program is free software: you can redistribute it and/or modify
    
    9
    +  it under the terms of the GNU General Public License as
    
    10
    +  published by the Free Software Foundation, either version 3 of the
    
    11
    +  License, or (at your option) any later version.
    
    12
    +  
    
    13
    +  This program is distributed in the hope that it will be useful,
    
    14
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    15
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    16
    +  GNU General Public License for more details.
    
    17
    +  
    
    18
    +  You should have received a copy of the GNU General Public
    
    19
    +  License along with this program.  If not, see
    
    20
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    21
    +  #L%
    
    22
    +  -->
    
    23
    +
    
    24
    +
    
    25
    +<!DOCTYPE validators PUBLIC
    
    26
    +    "-//Apache Struts//XWork Validator 1.0.3//EN"
    
    27
    +    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
    
    28
    +<validators>
    
    29
    +  <field name="generateTabValid">
    
    30
    +    <field-validator type="fieldexpression" short-circuit="true">
    
    31
    +      <param name="expression">
    
    32
    +        <![CDATA[ generateTabValid ]]>
    
    33
    +      </param>
    
    34
    +      <message>observe.validation.setLonglineObsDetailComposition.invalid.templates</message>
    
    35
    +    </field-validator>
    
    36
    +  </field>
    
    37
    +</validators>

  • dto/src/main/java/fr/ird/observe/dto/data/ll/observation/SectionTemplate.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.dto.data.ll.observation;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -23,6 +23,7 @@ package fr.ird.observe.dto.data.ll.observation;
    23 23
      */
    
    24 24
     
    
    25 25
     import com.google.common.base.Preconditions;
    
    26
    +import org.apache.commons.lang3.StringUtils;
    
    26 27
     import org.apache.commons.lang3.builder.ToStringBuilder;
    
    27 28
     import org.apache.commons.lang3.builder.ToStringStyle;
    
    28 29
     import org.jdesktop.beans.AbstractSerializableBean;
    
    ... ... @@ -84,7 +85,9 @@ public class SectionTemplate extends AbstractSerializableBean {
    84 85
         }
    
    85 86
     
    
    86 87
         public boolean isFloatlineLengthsValid() {
    
    87
    -
    
    88
    +        if (floatlineLengths == null) {
    
    89
    +            return false;
    
    90
    +        }
    
    88 91
             Matcher matcher = FLOATLINE_LENGTHS_PATTERN.matcher(floatlineLengths);
    
    89 92
             return matcher.matches();
    
    90 93
     
    
    ... ... @@ -92,7 +95,7 @@ public class SectionTemplate extends AbstractSerializableBean {
    92 95
     
    
    93 96
         public List<Float> getFloatlineLengthsAsList() {
    
    94 97
     
    
    95
    -        String[] parts = floatlineLengths.split("\\/");
    
    98
    +        String[] parts = floatlineLengths.split("/");
    
    96 99
             List<Float> newLengths = new ArrayList<>(parts.length);
    
    97 100
             for (String part : parts) {
    
    98 101
                 Float aFloat = Float.valueOf(part);
    
    ... ... @@ -179,4 +182,12 @@ public class SectionTemplate extends AbstractSerializableBean {
    179 182
             result = 31 * result + (floatlineLengths == null ? 0 : floatlineLengths.hashCode());
    
    180 183
             return result;
    
    181 184
         }
    
    185
    +
    
    186
    +    public boolean isIdValid() {
    
    187
    +        return StringUtils.isNotEmpty(id);
    
    188
    +    }
    
    189
    +
    
    190
    +    public boolean isEmpty() {
    
    191
    +        return StringUtils.isEmpty(id) && StringUtils.isEmpty(floatlineLengths);
    
    192
    +    }
    
    182 193
     }

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -1446,6 +1446,7 @@ observe.common.LonglineDetailCompositionObsDto.sectionsTable.template=Template
    1446 1446
     observe.common.LonglineDetailCompositionObsDto.sectionsTable.template.tip=Template used to generate baskets floatline lengths
    
    1447 1447
     observe.common.LonglineDetailCompositionObsDto.title=Detailed composition
    
    1448 1448
     observe.common.LonglineDetailCompositionObsDto.title.section.cant.use.firstTemplate=Can't use the first template while generating
    
    1449
    +observe.common.LonglineDetailCompositionObsUIModelDto.generateTabValid=Templates
    
    1449 1450
     observe.common.LonglineGlobalCompositionDto.message.updating=Updating global composition
    
    1450 1451
     observe.common.LonglineGlobalCompositionLogbookDto.message.updating=Updating global composition
    
    1451 1452
     observe.common.LonglineGlobalCompositionObsDto.message.updating=Updating global composition
    
    ... ... @@ -3611,6 +3612,10 @@ observe.validation.setLongline.required.settingStartTimeStamp=Timestamp must be
    3611 3612
     observe.validation.setLongline.required.totalSectionsCount=Total sections count must be filled.
    
    3612 3613
     observe.validation.setLongline.settingEndTimeStamp.before.haulingStartTimeStamp=Setting end time must be before hauling start time.
    
    3613 3614
     observe.validation.setLongline.settingStartTimeStamp.before.settingEndTimeStamp=Setting start time must be before setting end time.
    
    3615
    +observe.validation.setLonglineObsDetailComposition.invalid.pattern=Pattern format is 'x/y/z/...'
    
    3616
    +observe.validation.setLonglineObsDetailComposition.invalid.templates=Templates are not valid, see tooltip on error cells
    
    3617
    +observe.validation.setLonglineObsDetailComposition.required.id=Id must be filled.
    
    3618
    +observe.validation.setLonglineObsDetailComposition.required.pattern=Pattern must be filled.
    
    3614 3619
     observe.validation.shipOwner.desactivated.country=Selected ship owner is disabled.
    
    3615 3620
     observe.validation.shipOwner.required.code=Code is mandatory.
    
    3616 3621
     observe.validation.shipOwner.required.label=Label is mandatory.
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -1446,6 +1446,7 @@ observe.common.LonglineDetailCompositionObsDto.sectionsTable.template=Template
    1446 1446
     observe.common.LonglineDetailCompositionObsDto.sectionsTable.template.tip=Template
    
    1447 1447
     observe.common.LonglineDetailCompositionObsDto.title=Esquema del palangre
    
    1448 1448
     observe.common.LonglineDetailCompositionObsDto.title.section.cant.use.firstTemplate=Impossible de utilizar el primer modelo durante la generación
    
    1449
    +observe.common.LonglineDetailCompositionObsUIModelDto.generateTabValid=Templates \#TODO
    
    1449 1450
     observe.common.LonglineGlobalCompositionDto.message.updating=Composición global del palangre en proceso de modificación
    
    1450 1451
     observe.common.LonglineGlobalCompositionLogbookDto.message.updating=Composición global del palangre en proceso de modificación
    
    1451 1452
     observe.common.LonglineGlobalCompositionObsDto.message.updating=Composición global del palangre en proceso de modificación
    
    ... ... @@ -3611,6 +3612,10 @@ observe.validation.setLongline.required.settingStartTimeStamp=Timestamp de inici
    3611 3612
     observe.validation.setLongline.required.totalSectionsCount=Número de secciones vacío.
    
    3612 3613
     observe.validation.setLongline.settingEndTimeStamp.before.haulingStartTimeStamp=La hora de inicio de arrastre debe ser superior o igual a la hora de fin de calada.
    
    3613 3614
     observe.validation.setLongline.settingStartTimeStamp.before.settingEndTimeStamp=L'heure de fin de calada debe ser superior o igual a la hora de inicio de calada.
    
    3615
    +observe.validation.setLonglineObsDetailComposition.invalid.pattern=Le format du patron doit être de la forme x/y/z/... \#TODO
    
    3616
    +observe.validation.setLonglineObsDetailComposition.invalid.templates=Templates are not valid, see tooltip on error cells. \#TODO
    
    3617
    +observe.validation.setLonglineObsDetailComposition.required.id=Identifiant non renseigné \#TODO
    
    3618
    +observe.validation.setLonglineObsDetailComposition.required.pattern=Patron non renseigné \#TODO
    
    3614 3619
     observe.validation.shipOwner.desactivated.country=L'armateur sélectionné est désactivé. \#TODO
    
    3615 3620
     observe.validation.shipOwner.required.code=Le code est obligatoire. \#TODO
    
    3616 3621
     observe.validation.shipOwner.required.label=Le code est obligatoire. \#TODO
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -1446,6 +1446,7 @@ observe.common.LonglineDetailCompositionObsDto.sectionsTable.template=Patron
    1446 1446
     observe.common.LonglineDetailCompositionObsDto.sectionsTable.template.tip=Patron
    
    1447 1447
     observe.common.LonglineDetailCompositionObsDto.title=Schéma de palangre
    
    1448 1448
     observe.common.LonglineDetailCompositionObsDto.title.section.cant.use.firstTemplate=Impossible d'utiliser le premier modèle lors de la génération
    
    1449
    +observe.common.LonglineDetailCompositionObsUIModelDto.generateTabValid=Templates
    
    1449 1450
     observe.common.LonglineGlobalCompositionDto.message.updating=Composition globale de la palangre en cours de modification
    
    1450 1451
     observe.common.LonglineGlobalCompositionLogbookDto.message.updating=Composition globale de la palangre en cours de modification
    
    1451 1452
     observe.common.LonglineGlobalCompositionObsDto.message.updating=Composition globale de la palangre en cours de modification
    
    ... ... @@ -3611,6 +3612,10 @@ observe.validation.setLongline.required.settingStartTimeStamp=Horodatage de déb
    3611 3612
     observe.validation.setLongline.required.totalSectionsCount=Nombre de sections non renseigné.
    
    3612 3613
     observe.validation.setLongline.settingEndTimeStamp.before.haulingStartTimeStamp=L'heure de début de virage doit être supérieure ou égal à l'heure de fin de filage.
    
    3613 3614
     observe.validation.setLongline.settingStartTimeStamp.before.settingEndTimeStamp=L'heure de fin de filage doit être supérieure ou égal à l'heure de début de filage.
    
    3615
    +observe.validation.setLonglineObsDetailComposition.invalid.pattern=Le format du patron doit être de la forme x/y/z/...
    
    3616
    +observe.validation.setLonglineObsDetailComposition.invalid.templates=Les templates ne sont pas valides, passer en revue les cellules en erreur
    
    3617
    +observe.validation.setLonglineObsDetailComposition.required.id=Identifiant non renseigné
    
    3618
    +observe.validation.setLonglineObsDetailComposition.required.pattern=Patron non renseigné
    
    3614 3619
     observe.validation.shipOwner.desactivated.country=L'armateur sélectionné est désactivé.
    
    3615 3620
     observe.validation.shipOwner.required.code=Le code est obligatoire.
    
    3616 3621
     observe.validation.shipOwner.required.label=Le libellé est obligatoire.
    

  • pom.xml
    ... ... @@ -156,7 +156,7 @@
    156 156
         <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
    
    157 157
         <buildDate>${maven.build.timestamp}</buildDate>
    
    158 158
     
    
    159
    -    <observeToolkitVersion>4.11</observeToolkitVersion>
    
    159
    +    <observeToolkitVersion>4.12</observeToolkitVersion>
    
    160 160
         <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
    
    161 161
         <!--can't use 1.4.197 (date has changed + blob also)-->
    
    162 162
         <lib.version.h2>1.4.196</lib.version.h2>