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

WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.

Deleted commits:

22 changed files:

Changes:

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ReportModel.java
    ... ... @@ -43,10 +43,10 @@ import java.net.URL;
    43 43
     import java.nio.file.Files;
    
    44 44
     import java.util.Collections;
    
    45 45
     import java.util.Date;
    
    46
    +import java.util.LinkedHashMap;
    
    46 47
     import java.util.List;
    
    47 48
     import java.util.Map;
    
    48 49
     import java.util.Objects;
    
    49
    -import java.util.TreeMap;
    
    50 50
     import java.util.stream.Collectors;
    
    51 51
     
    
    52 52
     /**
    
    ... ... @@ -81,7 +81,7 @@ public class ReportModel extends AdminActionModel {
    81 81
         /**
    
    82 82
          * les variables utilisées pour le report.
    
    83 83
          */
    
    84
    -    protected final Map<String, Object> variables;
    
    84
    +    protected final Map<String, Object> variables = new LinkedHashMap<>();
    
    85 85
         /**
    
    86 86
          * la fichier contenant la définition des reports.
    
    87 87
          */
    
    ... ... @@ -128,7 +128,6 @@ public class ReportModel extends AdminActionModel {
    128 128
     
    
    129 129
         public ReportModel() {
    
    130 130
             super(AdminStep.REPORT);
    
    131
    -        variables = new TreeMap<>();
    
    132 131
             // quand le type de modèle change, on mets à jour les rapports disponibles
    
    133 132
             addPropertyChangeListener(REPORT_FILE_PROPERTY_NAME, evt -> updateReports());
    
    134 133
         }
    

  • client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/report/ResultTableModel.java
    ... ... @@ -149,12 +149,11 @@ public class ResultTableModel extends AbstractTableModel {
    149 149
                 rowNames.addAll(Arrays.asList(report.getRowHeaders()));
    
    150 150
             }
    
    151 151
     
    
    152
    -        withColumnHeader = !columnNames.isEmpty();
    
    153
    -        withRowHeader = !rowNames.isEmpty();
    
    154
    -        table.setTableHeader(!withColumnHeader ? null : tableHeader);
    
    155
    -        table.createDefaultColumnsFromModel();
    
    156 152
             int nbRows = incomingData.getHeight();
    
    157 153
             int nbCols = incomingData.getWidth();
    
    154
    +
    
    155
    +        withColumnHeader = !columnNames.isEmpty();
    
    156
    +        withRowHeader = !rowNames.isEmpty();
    
    158 157
             if (withRowHeader) {
    
    159 158
                 // on ajoute une première colonne aux données
    
    160 159
                 nbCols += 1;
    
    ... ... @@ -162,6 +161,22 @@ public class ResultTableModel extends AbstractTableModel {
    162 161
                 incomingData.setX(1);
    
    163 162
             }
    
    164 163
     
    
    164
    +        if (!withColumnHeader && !withRowHeader) {
    
    165
    +            // let's say we always use columns from incomingData
    
    166
    +            table.setTableHeader(tableHeader);
    
    167
    +            for (int i = 0; i < nbCols; i++) {
    
    168
    +                columnNames.add((String) incomingData.getValue(i, 0));
    
    169
    +            }
    
    170
    +            incomingData.setY(-1);
    
    171
    +            withColumnHeader = true;
    
    172
    +            nbRows--;
    
    173
    +
    
    174
    +        } else {
    
    175
    +            table.setTableHeader(!withColumnHeader ? null : tableHeader);
    
    176
    +        }
    
    177
    +        table.createDefaultColumnsFromModel();
    
    178
    +
    
    179
    +
    
    165 180
             data.setHeight(nbRows);
    
    166 181
             data.setWidth(nbCols);
    
    167 182
     
    
    ... ... @@ -185,7 +200,9 @@ public class ResultTableModel extends AbstractTableModel {
    185 200
             } else if (withColumnHeader) {
    
    186 201
     
    
    187 202
             }
    
    188
    -        data.copyData(incomingData);
    
    203
    +        if (nbCols > 0) {
    
    204
    +            data.copyData(incomingData);
    
    205
    +        }
    
    189 206
             fireTableStructureChanged();
    
    190 207
             table.revalidate();
    
    191 208
             table.repaint();
    
    ... ... @@ -220,7 +237,7 @@ public class ResultTableModel extends AbstractTableModel {
    220 237
         }
    
    221 238
     
    
    222 239
         public String getClipboardContent(boolean copyRowHeaders, boolean copyColumnHeaders) {
    
    223
    -        return getDataContent(copyRowHeaders, copyColumnHeaders, true,'\t');
    
    240
    +        return getDataContent(copyRowHeaders, copyColumnHeaders, true, '\t');
    
    224 241
         }
    
    225 242
     
    
    226 243
         public String getCsvContent() {
    

  • core/api/dto/src/main/resources/observe-reports.properties
    ... ... @@ -157,8 +157,8 @@ report.psObservationFobUsageMinimal.request.3=2,0|row|\
    157 157
       Where \
    
    158 158
           m.id In :tripId \
    
    159 159
           and dcp.computedWhenArrivingSimplifiedObjectType = :typeObjetId \
    
    160
    -	  and a.vesselActivity.id != 'fr.ird.referential.ps.common.VesselActivity#1239832675369#0.12552908048322586'
    
    161
    -and (dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#2' \
    
    160
    +	  and a.vesselActivity.id != 'fr.ird.referential.ps.common.VesselActivity#1239832675369#0.12552908048322586' \
    
    161
    +      and (dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#2' \
    
    162 162
     	  	   or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#8' \
    
    163 163
     	  	   or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#4' \
    
    164 164
     	  	   or dcp.objectOperation.id = 'fr.ird.referential.ps.common.ObjectOperation#0#5' \
    
    ... ... @@ -567,6 +567,140 @@ report.psObservationSetByAssociation.request.8=3,1|column|\
    567 567
           and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    568 568
           and os not in elements(a.observedSystem)
    
    569 569
     ################################################################################
    
    570
    +## Captures thons selon le type d'association
    
    571
    +################################################################################
    
    572
    +report.psObservationTargetCatchByAssociation.modelType=PS
    
    573
    +report.psObservationTargetCatchByAssociation.name=Observations - Captures de thons selon le type d’association (en t)
    
    574
    +report.psObservationTargetCatchByAssociation.description=Afficher la répartitions des captures de thons selon le type d'association
    
    575
    +report.psObservationTargetCatchByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Total
    
    576
    +report.psObservationTargetCatchByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
    
    577
    +report.psObservationTargetCatchByAssociation.operations.1=SumRow
    
    578
    +report.psObservationTargetCatchByAssociation.operations.2=SumColumn
    
    579
    +# ligne 1
    
    580
    +report.psObservationTargetCatchByAssociation.request.1=0,0|row|\
    
    581
    +  Select \
    
    582
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    583
    +                                                 Else 0.0 End), \
    
    584
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    585
    +                                                 Else 0.0 End), \
    
    586
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    587
    +                                                 Else 0.0 End), \
    
    588
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    589
    +                                                 Else 0.0 End), \
    
    590
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    591
    +                                                 Else 0.0 End), \
    
    592
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    593
    +                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    594
    +                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    595
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    596
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    597
    +                                                 Else ct.catchWeight End) \
    
    598
    +  From TripImpl m \
    
    599
    +  Join m.routeObs r \
    
    600
    +  Join r.activity a \
    
    601
    +  Join a.set c \
    
    602
    +      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    603
    +  Join c.catches ct \
    
    604
    +  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    605
    +  ObservedSystemImpl os \
    
    606
    +  Where \
    
    607
    +      m.id In :tripId \
    
    608
    +      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    609
    +      and os not in elements(a.observedSystem)
    
    610
    +# ligne 2
    
    611
    +report.psObservationTargetCatchByAssociation.request.7=0,1|row|\
    
    612
    +  Select \
    
    613
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    614
    +                                                 Else 0.0 End), \
    
    615
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    616
    +                                                 Else 0.0 End), \
    
    617
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    618
    +                                                 Else 0.0 End), \
    
    619
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    620
    +                                                 Else 0.0 End), \
    
    621
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    622
    +                                                 Else 0.0 End), \
    
    623
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    624
    +                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    625
    +                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    626
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    627
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    628
    +                                                 Else ct.catchWeight End) \
    
    629
    +  From TripImpl m \
    
    630
    +  Join m.routeObs r \
    
    631
    +  Join r.activity a \
    
    632
    +  Join a.set c \
    
    633
    +      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    634
    +  Join c.catches ct \
    
    635
    +  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    636
    +  ObservedSystemImpl os \
    
    637
    +  Where \
    
    638
    +      m.id In :tripId \
    
    639
    +      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9395222812356602' \
    
    640
    +      and os in elements(a.observedSystem)
    
    641
    +# ligne 3
    
    642
    +report.psObservationTargetCatchByAssociation.request.13=0,2|row|\
    
    643
    +  Select \
    
    644
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    645
    +                                                 Else 0.0 End), \
    
    646
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    647
    +                                                 Else 0.0 End), \
    
    648
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    649
    +                                                 Else 0.0 End), \
    
    650
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    651
    +                                                 Else 0.0 End), \
    
    652
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    653
    +                                                 Else 0.0 End), \
    
    654
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    655
    +                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    656
    +                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    657
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    658
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    659
    +                                                 Else ct.catchWeight End) \
    
    660
    +  From TripImpl m \
    
    661
    +  Join m.routeObs r \
    
    662
    +  Join r.activity a \
    
    663
    +  Join a.set c \
    
    664
    +      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    665
    +  Join c.catches ct \
    
    666
    +  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    667
    +  ObservedSystemImpl os \
    
    668
    +  Where \
    
    669
    +      m.id In :tripId \
    
    670
    +      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    671
    +      and os in elements(a.observedSystem)
    
    672
    +# ligne 4
    
    673
    +report.psObservationTargetCatchByAssociation.request.19=0,3|row|\
    
    674
    +  Select \
    
    675
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then ct.catchWeight \
    
    676
    +                                                 Else 0.0 End), \
    
    677
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then ct.catchWeight \
    
    678
    +                                                 Else 0.0 End), \
    
    679
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then ct.catchWeight \
    
    680
    +                                                 Else 0.0 End), \
    
    681
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then ct.catchWeight \
    
    682
    +                                                 Else 0.0 End), \
    
    683
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then ct.catchWeight \
    
    684
    +                                                 Else 0.0 End), \
    
    685
    +      Sum(CASE ct.species.topiaId When 'fr.ird.referential.common.Species#1239832685474#0.8943253454598569'  Then 0.0 \
    
    686
    +                                                 When 'fr.ird.referential.common.Species#1239832685474#0.975344121171992'   Then 0.0 \
    
    687
    +                                                 When 'fr.ird.referential.common.Species#1239832685475#0.13349466123905152' Then 0.0 \
    
    688
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.8024257002747615'  Then 0.0 \
    
    689
    +                                                 When 'fr.ird.referential.common.Species#1239832685477#0.3846921632590058'  Then 0.0 \
    
    690
    +                                                 Else ct.catchWeight End) \
    
    691
    +  From TripImpl m \
    
    692
    +  Join m.routeObs r \
    
    693
    +  Join r.activity a \
    
    694
    +  Join a.set c \
    
    695
    +      with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    696
    +  Join c.catches ct \
    
    697
    +  Join ct.speciesFate sf with sf.discard = FALSE, \
    
    698
    +  ObservedSystemImpl os \
    
    699
    +  Where \
    
    700
    +      m.id In :tripId \
    
    701
    +      and os.topiaId = 'fr.ird.referential.ps.common.ObservedSystem#1239832686428#0.9217864901728908' \
    
    702
    +      and os not in elements(a.observedSystem)
    
    703
    +################################################################################
    
    570 704
     ## Rejets thons selon le type d'association
    
    571 705
     ################################################################################
    
    572 706
     report.psObservationTargetDiscardedByAssociation.modelType=PS
    
    ... ... @@ -600,7 +734,8 @@ report.psObservationTargetDiscardedByAssociation.request.1=0,0|row|\
    600 734
       Join r.activity a \
    
    601 735
       Join a.set c \
    
    602 736
           with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    603
    -  Join c.catches ct, \
    
    737
    +  Join c.catches ct \
    
    738
    +  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    604 739
       ObservedSystemImpl os \
    
    605 740
       Where \
    
    606 741
           m.id In :tripId \
    
    ... ... @@ -630,7 +765,8 @@ report.psObservationTargetDiscardedByAssociation.request.7=0,1|row|\
    630 765
       Join r.activity a \
    
    631 766
       Join a.set c \
    
    632 767
           with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#2' \
    
    633
    -  Join c.catches ct, \
    
    768
    +  Join c.catches ct \
    
    769
    +  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    634 770
       ObservedSystemImpl os \
    
    635 771
       Where \
    
    636 772
           m.id In :tripId \
    
    ... ... @@ -660,7 +796,8 @@ report.psObservationTargetDiscardedByAssociation.request.13=0,2|row|\
    660 796
       Join r.activity a \
    
    661 797
       Join a.set c \
    
    662 798
           with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    663
    -  Join c.catches ct, \
    
    799
    +  Join c.catches ct \
    
    800
    +  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    664 801
       ObservedSystemImpl os \
    
    665 802
       Where \
    
    666 803
           m.id In :tripId \
    
    ... ... @@ -690,7 +827,8 @@ report.psObservationTargetDiscardedByAssociation.request.19=0,3|row|\
    690 827
       Join r.activity a \
    
    691 828
       Join a.set c \
    
    692 829
           with c.schoolType.id = 'fr.ird.referential.ps.common.SchoolType#0#1' \
    
    693
    -  Join c.catches ct, \
    
    830
    +  Join c.catches ct \
    
    831
    +  Join ct.speciesFate sf with sf.discard = TRUE, \
    
    694 832
       ObservedSystemImpl os \
    
    695 833
       Where \
    
    696 834
           m.id In :tripId \
    
    ... ... @@ -749,14 +887,14 @@ report.psObservationCatch.request.3=2,0|row|\
    749 887
       Where m.id In :tripId
    
    750 888
     report.psObservationCatch.request.3.repeat=speciesId|column
    
    751 889
     ################################################################################
    
    752
    -## Captures accessoires par speciesGroup d'espèces
    
    890
    +## Captures par groupe d'espèces
    
    753 891
     ################################################################################
    
    754
    -report.psObservationAccessoryCatchByGroup.modelType=PS
    
    755
    -report.psObservationAccessoryCatchByGroup.name=Observations - Dénombrement des captures accessoires et devenir, filtrés par groupe
    
    756
    -report.psObservationAccessoryCatchByGroup.description=Afficher les nombres de captures accessoires par groupe d'espèce selon le type de banc et le devenir
    
    757
    -report.psObservationAccessoryCatchByGroup.columns=Espèce, Total BL, Total BO, Sorti vivant/échappé, Sorti mort, Rejeté vivant, Rejeté mort, Partiellement conservé, Cuve, Cuisine, Autre
    
    758
    -report.psObservationAccessoryCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
    
    759
    -report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\
    
    892
    +report.psObservationCatchByGroup.modelType=PS
    
    893
    +report.psObservationCatchByGroup.name=Observations - Dénombrement des captures par devenir, filtrés par groupe
    
    894
    +report.psObservationCatchByGroup.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
    
    895
    +report.psObservationCatchByGroup.columns=Espèce, Total BL, Total BO, Sorti vivant/échappé, Sorti mort, Rejeté vivant, Rejeté mort, Partiellement conservé, Cuve, Cuisine, Conservé pour le marché local ou poisson séché/salé à bord, Ailerons seulements, Rejeté statut inconnu (seulement pour l'observation électronique), Conservé à des fins scientifiques, Rejeté suffocant, Rejeté blessé, Autre
    
    896
    +report.psObservationCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.common.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
    
    897
    +report.psObservationCatchByGroup.request.1=0,0|row|\
    
    760 898
       Select \
    
    761 899
         concat(\
    
    762 900
           '[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
    
    ... ... @@ -779,6 +917,12 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\
    779 917
                                    else 0.0 end), \
    
    780 918
         Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1239832683621#0.6728026426066158'  then ca.totalCount \
    
    781 919
                                    else 0.0 end), \
    
    920
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1464000000000#15'  then ca.totalCount else 0.0 end), \
    
    921
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1467372855729#0.568287924081734'  then ca.totalCount else 0.0 end), \
    
    922
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1501492537510#0.9210847837998154'  then ca.totalCount else 0.0 end), \
    
    923
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1501492831539#0.9377232562184147'  then ca.totalCount else 0.0 end), \
    
    924
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1544448835551#0.620629930572886'  then ca.totalCount else 0.0 end), \
    
    925
    +    Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1544448977865#0.24265421995390768'  then ca.totalCount else 0.0 end), \
    
    782 926
         Sum(case ca.speciesFate.id when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.9931091059863436'  then 0.0 \
    
    783 927
                                    when 'fr.ird.referential.ps.common.SpeciesFate#1239832683618#0.06155887805368032' then 0.0 \
    
    784 928
                                    when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.11883784875534997' then 0.0 \
    
    ... ... @@ -787,6 +931,12 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\
    787 931
                                    when 'fr.ird.referential.ps.common.SpeciesFate#1239832683620#0.46609703818634485' then 0.0 \
    
    788 932
                                    when 'fr.ird.referential.ps.common.SpeciesFate#1239832683619#0.5722739932065866'  then 0.0 \
    
    789 933
                                    when 'fr.ird.referential.ps.common.SpeciesFate#1239832683621#0.6728026426066158'  then 0.0 \
    
    934
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1464000000000#15'  then 0.0 \
    
    935
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1467372855729#0.568287924081734'  then 0.0 \
    
    936
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1501492537510#0.9210847837998154'  then 0.0 \
    
    937
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1501492831539#0.9377232562184147'  then 0.0 \
    
    938
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1544448835551#0.620629930572886'  then 0.0 \
    
    939
    +                               when 'fr.ird.referential.ps.common.SpeciesFate#1544448977865#0.24265421995390768'  then 0.0 \
    
    790 940
                                    else ca.totalCount end) \
    
    791 941
       From TripImpl m \
    
    792 942
       Join m.routeObs r \
    
    ... ... @@ -799,14 +949,13 @@ report.psObservationAccessoryCatchByGroup.request.1=0,0|row|\
    799 949
       Group by e \
    
    800 950
       Order By e.homeId
    
    801 951
     ###########################################################
    
    802
    -## Distribution des tailles par espèces non ciblées
    
    952
    +## Distribution des tailles par espèces et type de mesure
    
    803 953
     ###########################################################
    
    804
    -report.psObservationNonTargetDistributionLengths.modelType=PS
    
    805
    -report.psObservationNonTargetDistributionLengths.name=Observations - Distribution des tailles par espèces non ciblées
    
    806
    -report.psObservationNonTargetDistributionLengths.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces non ciblées
    
    807
    -report.psObservationNonTargetDistributionLengths.columns=Classe de taille,Effectif
    
    808
    -report.psObservationNonTargetDistributionLengths.operations.1=GroupByLength
    
    809
    -report.psObservationNonTargetDistributionLengths.variable.speciesId=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    954
    +report.psObservationLengthsDistribution.modelType=PS
    
    955
    +report.psObservationLengthsDistribution.name=Observations - Distribution des tailles par espèces et type de mesure
    
    956
    +report.psObservationLengthsDistribution.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces et le type de mesure
    
    957
    +report.psObservationLengthsDistribution.operations.1=ComputePsObservationLengthsDistribution
    
    958
    +report.psObservationLengthsDistribution.variable.1.species=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    810 959
     Select distinct ntl.species \
    
    811 960
     From TripImpl t \
    
    812 961
     Join t.routeObs r \
    
    ... ... @@ -814,133 +963,32 @@ Join r.activity a \
    814 963
     Join a.set.sample nts \
    
    815 964
     Join nts.sampleMeasure ntl \
    
    816 965
     Where t.id In :tripId
    
    817
    -report.psObservationNonTargetDistributionLengths.request.1=0,0|row| \
    
    818
    -Select ntl.length, sum(ntl.count) \
    
    966
    +report.psObservationLengthsDistribution.variable.2.sizeMeasureType=fr.ird.observe.dto.referential.common.SizeMeasureTypeDto|\
    
    967
    +Select distinct ntl.sizeMeasureType \
    
    819 968
     From TripImpl t \
    
    820 969
     Join t.routeObs r \
    
    821 970
     Join r.activity a \
    
    822 971
     Join a.set.sample nts \
    
    823 972
     Join nts.sampleMeasure ntl \
    
    824
    -Where t.id In :tripId \
    
    825
    -And ntl.species.id = :speciesId \
    
    826
    -Group By ntl.length \
    
    827
    -Order By ntl.length
    
    828
    -####################################################################
    
    829
    -## Distribution des tailles des conservés par espèces ciblées (LD1)
    
    830
    -####################################################################
    
    831
    -report.psObservationTargetStoredDistributionLengthsLD1.modelType=PS
    
    832
    -report.psObservationTargetStoredDistributionLengthsLD1.name=Observations - Distribution des tailles des captures par espèces ciblées (mesure LD1)
    
    833
    -report.psObservationTargetStoredDistributionLengthsLD1.description=Afficher le nombre d'individus capturés, mesurés par classe de taille LD1 pour les espèces ciblées
    
    834
    -report.psObservationTargetStoredDistributionLengthsLD1.columns=Classe de taille,Effectif
    
    835
    -report.psObservationTargetStoredDistributionLengthsLD1.operations.1=GroupByLength
    
    836
    -report.psObservationTargetStoredDistributionLengthsLD1.variable.speciesId=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    837
    -Select distinct tl.species \
    
    838
    -From TripImpl t \
    
    839
    -Join t.routeObs r \
    
    840
    -Join r.activity a \
    
    841
    -Join a.set.sample ts \
    
    842
    -Join ts.sampleMeasure tl \
    
    843
    -Where t.id In :tripId \
    
    844
    -And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499466774#0.529249255312607'
    
    845
    -report.psObservationTargetStoredDistributionLengthsLD1.request.1=0,0|row| \
    
    846
    -Select tl.length , Sum(tl.count) \
    
    847
    -From TripImpl t \
    
    848
    -Join t.routeObs r \
    
    849
    -Join r.activity a \
    
    850
    -Join a.set.sample ts \
    
    851
    -Join ts.sampleMeasure tl \
    
    852
    -Where t.id In :tripId \
    
    853
    -  And tl.species.id = :speciesId \
    
    854
    -  And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499466774#0.529249255312607' \
    
    855
    -Group By tl.length \
    
    856
    -Order By tl.length
    
    857
    -################################################################
    
    858
    -## Distribution des tailles des rejets par espèces ciblées (LD1)
    
    859
    -################################################################
    
    860
    -report.psObservationTargetDiscardedDistributionLengthsLD1.modelType=PS
    
    861
    -report.psObservationTargetDiscardedDistributionLengthsLD1.name=Observations - Distribution des tailles des rejets par espèces ciblées (mesure LD1)
    
    862
    -report.psObservationTargetDiscardedDistributionLengthsLD1.description=Afficher la nombre d'individus rejetés, mesurés par classe de taille LD1 pour les espèces ciblées
    
    863
    -report.psObservationTargetDiscardedDistributionLengthsLD1.columns=Classe de taille,Effectif
    
    864
    -report.psObservationTargetDiscardedDistributionLengthsLD1.operations.1=GroupByLength
    
    865
    -report.psObservationTargetDiscardedDistributionLengthsLD1.variable.speciesId=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    866
    -Select distinct tl.species \
    
    867
    -From TripImpl t \
    
    868
    -Join t.routeObs r \
    
    869
    -Join r.activity a \
    
    870
    -Join a.set.sample ts \
    
    871
    -Join ts.sampleMeasure tl \
    
    872
    -Where t.id In :tripId \
    
    873
    -And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499466774#0.529249255312607'
    
    874
    -report.psObservationTargetDiscardedDistributionLengthsLD1.request.1=0,0|row| \
    
    875
    -Select tl.length , Sum(tl.count) \
    
    876
    -From TripImpl t \
    
    877
    -Join t.routeObs r \
    
    878
    -Join r.activity a \
    
    879
    -Join a.set.sample ts \
    
    880
    -Join ts.sampleMeasure tl \
    
    881
    -Where t.id In :tripId \
    
    882
    -  And tl.species.id = :speciesId \
    
    883
    -  And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499466774#0.529249255312607'\
    
    884
    -Group By tl.length \
    
    885
    -Order By tl.length
    
    886
    -###############################################################
    
    887
    -## Distribution des tailles des conservés par espèces ciblées (LF)
    
    888
    -###############################################################
    
    889
    -report.psObservationTargetStoredDistributionLengthsLF.modelType=PS
    
    890
    -report.psObservationTargetStoredDistributionLengthsLF.name=Observations - Distribution des tailles des captures par espèces ciblées (mesure LF)
    
    891
    -report.psObservationTargetStoredDistributionLengthsLF.description=Afficher le nombre d'individus capturés, mesurés par classe de taille LF pour les espèces ciblées
    
    892
    -report.psObservationTargetStoredDistributionLengthsLF.columns=Classe de taille,Effectif
    
    893
    -report.psObservationTargetStoredDistributionLengthsLF.operations.1=GroupByLength
    
    894
    -report.psObservationTargetStoredDistributionLengthsLF.variable.speciesId=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    895
    -Select distinct tl.species \
    
    896
    -From TripImpl t \
    
    897
    -Join t.routeObs r \
    
    898
    -Join r.activity a \
    
    899
    -Join a.set.sample ts \
    
    900
    -Join ts.sampleMeasure tl \
    
    901
    -Where t.id In :tripId \
    
    902
    -And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336'
    
    903
    -report.psObservationTargetStoredDistributionLengthsLF.request.1=0,0|row| \
    
    904
    -Select tl.length , Sum(tl.count) \
    
    905
    -From TripImpl t \
    
    906
    -Join t.routeObs r \
    
    907
    -Join r.activity a \
    
    908
    -Join a.set.sample ts \
    
    909
    -Join ts.sampleMeasure tl \
    
    910
    -Where t.id In :tripId \
    
    911
    -  And tl.species.id = :speciesId \
    
    912
    -  And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    913
    -Group By tl.length \
    
    914
    -Order By tl.length
    
    915
    -###############################################################
    
    916
    -## Distribution des tailles des rejets par espèces ciblées (LF)
    
    917
    -###############################################################
    
    918
    -report.psObservationTargetDiscardedDistributionLengthsLF.modelType=PS
    
    919
    -report.psObservationTargetDiscardedDistributionLengthsLF.name=Observations - Distribution des tailles des rejets par espèces ciblées (mesure LF)
    
    920
    -report.psObservationTargetDiscardedDistributionLengthsLF.description=Afficher le nombre d'individus rejetés, mesurés par classe de taille LF pour les espèces ciblées
    
    921
    -report.psObservationTargetDiscardedDistributionLengthsLF.columns=Classe de taille,Effectif
    
    922
    -report.psObservationTargetDiscardedDistributionLengthsLF.operations.1=GroupByLength
    
    923
    -report.psObservationTargetDiscardedDistributionLengthsLF.variable.speciesId=fr.ird.observe.dto.referential.common.SpeciesDto|\
    
    924
    -Select distinct tl.species \
    
    973
    +Where t.id In :tripId
    
    974
    +report.psObservationLengthsDistribution.repeatVariable.speciesFate=fr.ird.observe.entities.referential.ps.common.SpeciesFate|\
    
    975
    +Select distinct sf \
    
    925 976
     From TripImpl t \
    
    926 977
     Join t.routeObs r \
    
    927 978
     Join r.activity a \
    
    928
    -Join a.set.sample ts \
    
    929
    -Join ts.sampleMeasure tl \
    
    930
    -Where t.id In :tripId \
    
    931
    -And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336'
    
    932
    -report.psObservationTargetDiscardedDistributionLengthsLF.request.1=0,0|row| \
    
    933
    -Select tl.length , Sum(tl.count) \
    
    979
    +Join a.set.sample nts \
    
    980
    +Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \
    
    981
    +Left Join ntl.speciesFate sf \
    
    982
    +Where t.id In :tripId
    
    983
    +report.psObservationLengthsDistribution.repeatVariable.length=java.lang.Float|\
    
    984
    +Select distinct ntl.length \
    
    934 985
     From TripImpl t \
    
    935 986
     Join t.routeObs r \
    
    936 987
     Join r.activity a \
    
    937
    -Join a.set.sample ts \
    
    938
    -Join ts.sampleMeasure tl \
    
    988
    +Join a.set.sample nts \
    
    989
    +Join nts.sampleMeasure ntl with ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \
    
    939 990
     Where t.id In :tripId \
    
    940
    -  And tl.species.id = :speciesId \
    
    941
    -  And tl.sizeMeasureType = 'fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    942
    -Group By tl.length \
    
    943
    -Order By tl.length
    
    991
    +Order By ntl.length
    
    944 992
     ############################################
    
    945 993
     ## Répartition des calées par cuves
    
    946 994
     ############################################
    

  • core/persistence/java/src/main/java/fr/ird/observe/spi/report/ComputePsObservationLengthsDistribution.java
    1
    +package fr.ird.observe.spi.report;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Persistence :: Java
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import com.google.auto.service.AutoService;
    
    26
    +import fr.ird.observe.dto.report.DataMatrix;
    
    27
    +import fr.ird.observe.dto.report.Report;
    
    28
    +import fr.ird.observe.dto.report.ReportOperationConsumer;
    
    29
    +import fr.ird.observe.dto.report.ReportRequestExecutor;
    
    30
    +import fr.ird.observe.dto.report.ReportVariable;
    
    31
    +import fr.ird.observe.entities.referential.ps.common.SpeciesFate;
    
    32
    +
    
    33
    +import java.util.List;
    
    34
    +import java.util.Map;
    
    35
    +import java.util.Set;
    
    36
    +import java.util.TreeMap;
    
    37
    +import java.util.stream.Collectors;
    
    38
    +
    
    39
    +/**
    
    40
    + * Created on 13/11/2022.
    
    41
    + *
    
    42
    + * @author Tony Chemit - dev@tchemit.fr
    
    43
    + * @since 9.0.17
    
    44
    + */
    
    45
    +@AutoService(ReportOperationConsumer.class)
    
    46
    +public class ComputePsObservationLengthsDistribution implements ReportOperationConsumer {
    
    47
    +
    
    48
    +    /**
    
    49
    +     * To get total count per length.
    
    50
    +     */
    
    51
    +    public static final String TOTAL_COUNT_REQUEST = "" +
    
    52
    +            "Select sum(ntl.count) \n" +
    
    53
    +            "From TripImpl t \n" +
    
    54
    +            "Join t.routeObs r \n" +
    
    55
    +            "Join r.activity a \n" +
    
    56
    +            "Join a.set.sample nts \n" +
    
    57
    +            "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType \n" +
    
    58
    +            "Where t.id In :tripId \n" +
    
    59
    +            "Group By ntl.length \n" +
    
    60
    +            "Order By ntl.length";
    
    61
    +
    
    62
    +    /**
    
    63
    +     * To get species fate count per length
    
    64
    +     */
    
    65
    +    public static final String SPECIES_FATE_COUNT_REQUEST = "" +
    
    66
    +            "Select ntl.length, sum(ntl.count) \n" +
    
    67
    +            "From TripImpl t \n" +
    
    68
    +            "Join t.routeObs r \n" +
    
    69
    +            "Join r.activity a \n" +
    
    70
    +            "Join a.set.sample nts \n" +
    
    71
    +            "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType And ntl.speciesFate.id = :speciesFate\n" +
    
    72
    +            "Where t.id In :tripId \n" +
    
    73
    +            "Group By ntl.length \n" +
    
    74
    +            "Order By ntl.length";
    
    75
    +
    
    76
    +    /**
    
    77
    +     * To get null species fate count per length
    
    78
    +     */
    
    79
    +    public static final String NULL_SPECIES_FATE_COUNT_REQUEST = "" +
    
    80
    +            "Select ntl.length, sum(ntl.count) \n" +
    
    81
    +            "From TripImpl t \n" +
    
    82
    +            "Join t.routeObs r \n" +
    
    83
    +            "Join r.activity a \n" +
    
    84
    +            "Join a.set.sample nts \n" +
    
    85
    +            "Join nts.sampleMeasure ntl With ntl.species.id = :species And ntl.sizeMeasureType.id = :sizeMeasureType And ntl.speciesFate Is Null\n" +
    
    86
    +            "Where t.id In :tripId \n" +
    
    87
    +            "Group By ntl.length \n" +
    
    88
    +            "Order By ntl.length";
    
    89
    +
    
    90
    +    @Override
    
    91
    +    public DataMatrix consume(String parameters, ReportRequestExecutor requestExecutor, Report report, Set<String> tripId, DataMatrix incoming) {
    
    92
    +
    
    93
    +        Map<String, Object> queryParameters = new TreeMap<>();
    
    94
    +        queryParameters.put("tripId", tripId);
    
    95
    +        for (ReportVariable<?> variable : report.getVariables()) {
    
    96
    +            queryParameters.put(variable.getName(), variable.getSelectedValue());
    
    97
    +        }
    
    98
    +
    
    99
    +        Set<SpeciesFate> speciesFateList = report.<SpeciesFate>getRepeatVariable("speciesFate").getValues();
    
    100
    +        List<String> lengthList = report.getRepeatVariable("length").getValues().stream().map(Object::toString).collect(Collectors.toList());
    
    101
    +
    
    102
    +        DataMatrix result = createTmpMatrix(0, 0, 2 + speciesFateList.size(), 1 + lengthList.size());
    
    103
    +        boolean useNullSpeciesFate = speciesFateList.remove(null);
    
    104
    +        int columnIndex = 0;
    
    105
    +        fillLengthsColumn(result, columnIndex++, lengthList);
    
    106
    +
    
    107
    +        for (SpeciesFate speciesFate : speciesFateList) {
    
    108
    +            fillSpeciesFateCountColumn(result, columnIndex++, queryParameters, speciesFate, lengthList, requestExecutor);
    
    109
    +        }
    
    110
    +
    
    111
    +        if (useNullSpeciesFate) {
    
    112
    +            fillSpeciesFateCountColumn(result, columnIndex++, queryParameters, null, lengthList, requestExecutor);
    
    113
    +        }
    
    114
    +
    
    115
    +        fillTotalCountColumn(result, columnIndex, queryParameters, requestExecutor);
    
    116
    +
    
    117
    +        return result;
    
    118
    +    }
    
    119
    +
    
    120
    +    private void fillLengthsColumn(DataMatrix result, int columnIndex, List<String> lengthList) {
    
    121
    +        int index = 0;
    
    122
    +        result.setValue(columnIndex, index++, "Classe de taille (cm)");
    
    123
    +        for (String length : lengthList) {
    
    124
    +            result.setValue(columnIndex, index++, length);
    
    125
    +        }
    
    126
    +    }
    
    127
    +
    
    128
    +    private void fillSpeciesFateCountColumn(DataMatrix result, int columnIndex, Map<String, Object> queryParameters, SpeciesFate speciesFate, List<String> lengthList, ReportRequestExecutor requestExecutor) {
    
    129
    +        String header;
    
    130
    +        List<Object[]> rows;
    
    131
    +        if (speciesFate == null) {
    
    132
    +            header = "Aucun";
    
    133
    +            queryParameters.remove("speciesFate");
    
    134
    +            rows = requestExecutor.executeRequest(NULL_SPECIES_FATE_COUNT_REQUEST, queryParameters);
    
    135
    +        } else {
    
    136
    +            header = speciesFate.getLabel2();
    
    137
    +            queryParameters.put("speciesFate", speciesFate.getId());
    
    138
    +            rows = requestExecutor.executeRequest(SPECIES_FATE_COUNT_REQUEST, queryParameters);
    
    139
    +        }
    
    140
    +        result.setValue(columnIndex, 0, String.format("Effectif ( devenir - %s )", header));
    
    141
    +
    
    142
    +        for (Object[] row : rows) {
    
    143
    +            String length = row[0].toString();
    
    144
    +            Number count = (Number) row[1];
    
    145
    +            int index = lengthList.indexOf(length);
    
    146
    +            result.setValue(columnIndex, index + 1, count);
    
    147
    +        }
    
    148
    +    }
    
    149
    +
    
    150
    +    private void fillTotalCountColumn(DataMatrix result, int columnIndex, Map<String, Object> queryParameters, ReportRequestExecutor requestExecutor) {
    
    151
    +        result.setValue(columnIndex, 0, "Effectif total");
    
    152
    +        List<Object> rows = requestExecutor.executeRequest(TOTAL_COUNT_REQUEST, queryParameters);
    
    153
    +        int index = 1;
    
    154
    +        for (Object row : rows) {
    
    155
    +            Number count = (Number) row;
    
    156
    +            result.setValue(columnIndex, index++, count);
    
    157
    +        }
    
    158
    +    }
    
    159
    +
    
    160
    +}
    
    161
    +

  • core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java deleted
    1
    -package fr.ird.observe.services.local.service;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe Core :: Services :: Local
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import fr.ird.observe.services.service.ReportServiceFixtures;
    
    26
    -import org.junit.AfterClass;
    
    27
    -
    
    28
    -public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadTest {
    
    29
    -
    
    30
    -    @AfterClass
    
    31
    -    public static void afterClass() {
    
    32
    -        if (!ReportServiceFixtures.WITH_ASSERT) {
    
    33
    -            System.out.println("New asserts:\n" + String.join("\n", ReportServiceFixtures.getAsserts()));
    
    34
    -            ReportServiceFixtures.getAsserts().clear();
    
    35
    -        }
    
    36
    -    }
    
    37
    -
    
    38
    -}

  • core/services/test/src/main/java/fr/ird/observe/services/service/ReportFixture.java
    ... ... @@ -76,6 +76,7 @@ public abstract class ReportFixture {
    76 76
         }
    
    77 77
     
    
    78 78
         public final DataMatrix execute(ReportService service, Report report) {
    
    79
    +        log.warn("Starting report {}", report.getName());
    
    79 80
             return service.executeReport(report, getTripIds());
    
    80 81
         }
    
    81 82
     
    
    ... ... @@ -127,6 +128,8 @@ public abstract class ReportFixture {
    127 128
                 for (int i = 0; i < rows; i++) {
    
    128 129
                     ReportServiceFixtures.writeArrayAssert(String.format("result.%d", i), actual.getData()[i]);
    
    129 130
                 }
    
    131
    +            System.out.println("New asserts:\n" + String.join("\n", ReportServiceFixtures.getAsserts()));
    
    132
    +            ReportServiceFixtures.getAsserts().clear();
    
    130 133
             }
    
    131 134
         }
    
    132 135
     
    
    ... ... @@ -159,7 +162,11 @@ public abstract class ReportFixture {
    159 162
     
    
    160 163
                 Assert.assertEquals(rows, report.getRows());
    
    161 164
                 Assert.assertEquals(columns, report.getColumns());
    
    162
    -            Assert.assertArrayEquals(columnsHeader, report.getColumnHeaders());
    
    165
    +            if (report.getColumnHeaders() == null) {
    
    166
    +                Assert.assertEquals(0, columnsHeader.length);
    
    167
    +            } else {
    
    168
    +                Assert.assertArrayEquals(columnsHeader, report.getColumnHeaders());
    
    169
    +            }
    
    163 170
                 if (report.getRowHeaders() == null) {
    
    164 171
                     Assert.assertEquals(0, rowsHeader.length);
    
    165 172
                 } else {
    
    ... ... @@ -168,7 +175,11 @@ public abstract class ReportFixture {
    168 175
             } else {
    
    169 176
                 ReportServiceFixtures.addAssert("syntax.rows", report.getRows());
    
    170 177
                 ReportServiceFixtures.addAssert("syntax.columns", report.getColumns());
    
    171
    -            ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader", (Object[]) report.getColumnHeaders());
    
    178
    +            if (report.getRowHeaders() == null) {
    
    179
    +                ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader");
    
    180
    +            } else {
    
    181
    +                ReportServiceFixtures.writeArrayAssert("syntax.columnsHeader", (Object[]) report.getColumnHeaders());
    
    182
    +            }
    
    172 183
                 if (report.getRowHeaders() == null) {
    
    173 184
                     ReportServiceFixtures.writeArrayAssert("syntax.rowsHeader");
    
    174 185
                 } else {
    

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationAccessoryCatchByGroupReportFixture.javacore/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchByGroupReportFixture.java
    ... ... @@ -35,7 +35,7 @@ import java.util.Iterator;
    35 35
      * @since 1.9
    
    36 36
      */
    
    37 37
     @AutoService(ReportFixture.class)
    
    38
    -public class PsObservationAccessoryCatchByGroupReportFixture extends ReportFixture {
    
    38
    +public class PsObservationCatchByGroupReportFixture extends ReportFixture {
    
    39 39
     
    
    40 40
         @Override
    
    41 41
         public void assertSyntax(Report report) {
    

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetStoredDistributionLengthsLFReportFixture.javacore/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationLengthsDistributionReportFixture.java
    ... ... @@ -24,24 +24,21 @@ package fr.ird.observe.services.service.report.ps;
    24 24
     
    
    25 25
     import com.google.auto.service.AutoService;
    
    26 26
     import fr.ird.observe.dto.report.Report;
    
    27
    -import fr.ird.observe.dto.report.ReportRequest;
    
    28 27
     import fr.ird.observe.services.service.ReportFixture;
    
    29 28
     
    
    30
    -import java.util.Iterator;
    
    31
    -
    
    32 29
     /**
    
    33
    - * Created on 17/02/2021.
    
    30
    + * Created on 13/11/2022.
    
    34 31
      *
    
    35 32
      * @author Tony Chemit - dev@tchemit.fr
    
    36
    - * @since 8.0.6
    
    33
    + * @since 9.0.17
    
    37 34
      */
    
    38 35
     @AutoService(ReportFixture.class)
    
    39
    -public class PsObservationTargetStoredDistributionLengthsLFReportFixture extends ReportFixture {
    
    36
    +public class PsObservationLengthsDistributionReportFixture extends ReportFixture {
    
    40 37
     
    
    41 38
         @Override
    
    42
    -    public void assertSyntax(Report report) {
    
    43
    -        super.assertSyntax(report);
    
    44
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    39
    +    protected void setVariables(Report report) {
    
    40
    +        setVariableValue(report, "species", "fr.ird.referential.common.Species#1239832684537#0.2397229787936519");
    
    41
    +        setVariableValue(report, "sizeMeasureType", "fr.ird.referential.common.SizeMeasureType#1433499465700#0.0902433863375336");
    
    46 42
         }
    
    47 43
     }
    
    44
    +

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationNonTargetDistributionLengthsReportFixture.java deleted
    1
    -/*
    
    2
    - * #%L
    
    3
    - * ObServe Core :: Services :: Test
    
    4
    - * %%
    
    5
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    - * %%
    
    7
    - * This program is free software: you can redistribute it and/or modify
    
    8
    - * it under the terms of the GNU General Public License as
    
    9
    - * published by the Free Software Foundation, either version 3 of the
    
    10
    - * License, or (at your option) any later version.
    
    11
    - *
    
    12
    - * This program is distributed in the hope that it will be useful,
    
    13
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    - * GNU General Public License for more details.
    
    16
    - *
    
    17
    - * You should have received a copy of the GNU General Public
    
    18
    - * License along with this program.  If not, see
    
    19
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    - * #L%
    
    21
    - */
    
    22
    -package fr.ird.observe.services.service.report.ps;
    
    23
    -
    
    24
    -
    
    25
    -import com.google.auto.service.AutoService;
    
    26
    -import fr.ird.observe.dto.report.Report;
    
    27
    -import fr.ird.observe.dto.report.ReportRequest;
    
    28
    -import fr.ird.observe.services.service.ReportFixture;
    
    29
    -
    
    30
    -import java.util.Iterator;
    
    31
    -
    
    32
    -/**
    
    33
    - * Test du report {@code accessoryCatch}.
    
    34
    - *
    
    35
    - * @author Tony Chemit - dev@tchemit.fr
    
    36
    - * @since 1.9
    
    37
    - */
    
    38
    -@AutoService(ReportFixture.class)
    
    39
    -public class PsObservationNonTargetDistributionLengthsReportFixture extends ReportFixture {
    
    40
    -
    
    41
    -    @Override
    
    42
    -    public void assertSyntax(Report report) {
    
    43
    -        super.assertSyntax(report);
    
    44
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    46
    -    }
    
    47
    -}

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetDiscardedDistributionLengthsLD1ReportFixture.java deleted
    1
    -package fr.ird.observe.services.service.report.ps;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe Core :: Services :: Test
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import com.google.auto.service.AutoService;
    
    26
    -import fr.ird.observe.dto.report.Report;
    
    27
    -import fr.ird.observe.dto.report.ReportRequest;
    
    28
    -import fr.ird.observe.services.service.ReportFixture;
    
    29
    -
    
    30
    -import java.util.Iterator;
    
    31
    -
    
    32
    -/**
    
    33
    - * Created on 17/02/2021.
    
    34
    - *
    
    35
    - * @author Tony Chemit - dev@tchemit.fr
    
    36
    - * @since 8.0.6
    
    37
    - */
    
    38
    -@AutoService(ReportFixture.class)
    
    39
    -public class PsObservationTargetDiscardedDistributionLengthsLD1ReportFixture extends ReportFixture {
    
    40
    -
    
    41
    -    @Override
    
    42
    -    public void assertSyntax(Report report) {
    
    43
    -        super.assertSyntax(report);
    
    44
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    46
    -    }
    
    47
    -}

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetDiscardedDistributionLengthsLFReportFixture.java deleted
    1
    -package fr.ird.observe.services.service.report.ps;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe Core :: Services :: Test
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import com.google.auto.service.AutoService;
    
    26
    -import fr.ird.observe.dto.report.Report;
    
    27
    -import fr.ird.observe.dto.report.ReportRequest;
    
    28
    -import fr.ird.observe.services.service.ReportFixture;
    
    29
    -
    
    30
    -import java.util.Iterator;
    
    31
    -
    
    32
    -/**
    
    33
    - * Created on 17/02/2021.
    
    34
    - *
    
    35
    - * @author Tony Chemit - dev@tchemit.fr
    
    36
    - * @since 8.0.6
    
    37
    - */
    
    38
    -@AutoService(ReportFixture.class)
    
    39
    -public class PsObservationTargetDiscardedDistributionLengthsLFReportFixture extends ReportFixture {
    
    40
    -
    
    41
    -    @Override
    
    42
    -    public void assertSyntax(Report report) {
    
    43
    -        super.assertSyntax(report);
    
    44
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    46
    -    }
    
    47
    -}

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationTargetStoredDistributionLengthsLD1ReportFixture.java deleted
    1
    -package fr.ird.observe.services.service.report.ps;
    
    2
    -
    
    3
    -/*-
    
    4
    - * #%L
    
    5
    - * ObServe Core :: Services :: Test
    
    6
    - * %%
    
    7
    - * Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    8
    - * %%
    
    9
    - * This program is free software: you can redistribute it and/or modify
    
    10
    - * it under the terms of the GNU General Public License as
    
    11
    - * published by the Free Software Foundation, either version 3 of the
    
    12
    - * License, or (at your option) any later version.
    
    13
    - *
    
    14
    - * This program is distributed in the hope that it will be useful,
    
    15
    - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    - * GNU General Public License for more details.
    
    18
    - *
    
    19
    - * You should have received a copy of the GNU General Public
    
    20
    - * License along with this program.  If not, see
    
    21
    - * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    - * #L%
    
    23
    - */
    
    24
    -
    
    25
    -import com.google.auto.service.AutoService;
    
    26
    -import fr.ird.observe.dto.report.Report;
    
    27
    -import fr.ird.observe.dto.report.ReportRequest;
    
    28
    -import fr.ird.observe.services.service.ReportFixture;
    
    29
    -
    
    30
    -import java.util.Iterator;
    
    31
    -
    
    32
    -/**
    
    33
    - * Created on 17/02/2021.
    
    34
    - *
    
    35
    - * @author Tony Chemit - dev@tchemit.fr
    
    36
    - * @since 8.0.6
    
    37
    - */
    
    38
    -@AutoService(ReportFixture.class)
    
    39
    -public class PsObservationTargetStoredDistributionLengthsLD1ReportFixture extends ReportFixture {
    
    40
    -
    
    41
    -    @Override
    
    42
    -    public void assertSyntax(Report report) {
    
    43
    -        super.assertSyntax(report);
    
    44
    -        Iterator<ReportRequest> requests = getRequestIterator(report);
    
    45
    -        assertReportRequestDimension(requests, ReportRequest.RequestLayout.row, 0, 0);
    
    46
    -    }
    
    47
    -}

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationAccessoryCatchByGroup.propertiescore/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchByGroup.properties
    ... ... @@ -19,13 +19,13 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -result.0=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^3^0^0^0^0^0^0^0.0
    
    23
    -result.columns=11
    
    22
    +result.0=[FAO]ALV [sc]Alopias vulpinus [fr]Renard^0^3^3^0^0^0^0^0^0^0^0^0^0^0^0^0.0
    
    23
    +result.columns=17
    
    24 24
     result.rows=1
    
    25
    -syntax.columns=11
    
    26
    -syntax.columnsHeader=Espèce^Total BL^Total BO^Sorti vivant/échappé^Sorti mort^Rejeté vivant^Rejeté mort^Partiellement conservé^Cuve^Cuisine^Autre
    
    27
    -syntax.description=Afficher les nombres de captures accessoires par groupe d'espèce selon le type de banc et le devenir
    
    28
    -syntax.name=Observations - Dénombrement des captures accessoires et devenir, filtrés par groupe
    
    25
    +syntax.columns=17
    
    26
    +syntax.columnsHeader=Espèce^Total BL^Total BO^Sorti vivant/échappé^Sorti mort^Rejeté vivant^Rejeté mort^Partiellement conservé^Cuve^Cuisine^Conservé pour le marché local ou poisson séché/salé à bord^Ailerons seulements^Rejeté statut inconnu (seulement pour l'observation électronique)^Conservé à des fins scientifiques^Rejeté suffocant^Rejeté blessé^Autre
    
    27
    +syntax.description=Afficher les nombres de captures par groupe d'espèce selon le type de banc et le devenir
    
    28
    +syntax.name=Observations - Dénombrement des captures par devenir, filtrés par groupe
    
    29 29
     syntax.nbRequests=1
    
    30 30
     syntax.rows=-1
    
    31 31
     syntax.rowsHeader=

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationNonTargetDistributionLengths.propertiescore/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationLengthsDistribution.properties
    ... ... @@ -19,11 +19,17 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -syntax.columns=2
    
    23
    -syntax.columnsHeader=Classe de taille^Effectif
    
    24
    -syntax.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces non ciblées
    
    25
    -syntax.name=Observations - Distribution des tailles par espèces non ciblées
    
    26
    -syntax.nbRequests=1
    
    22
    +syntax.name=Observations - Distribution des tailles par espèces et type de mesure
    
    23
    +syntax.description=Afficher la nombre d'individus mesurés par classe de taille pour les espèces et le type de mesure
    
    27 24
     syntax.rows=-1
    
    25
    +syntax.columns=-1
    
    26
    +syntax.columnsHeader=
    
    28 27
     syntax.rowsHeader=
    
    29
    -tripIds=${PS_COMMON_TRIP},${PS_COMMON_TRIP_MOVE}
    28
    +syntax.nbRequests=0
    
    29
    +result.columns=3
    
    30
    +result.rows=5
    
    31
    +result.0=Classe de taille (cm)^Effectif ( devenir - Aucun )^Effectif total
    
    32
    +result.1=50.0^2^2
    
    33
    +result.2=54.0^1^1
    
    34
    +result.3=68.0^1^1
    
    35
    +result.4=70.0^1^1

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetCatchByAssociation.properties
    ... ... @@ -19,3 +19,17 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    +syntax.name=Observations - Captures de thons selon le type d’association (en t)
    
    23
    +syntax.description=Afficher la répartitions des captures de thons selon le type d'association
    
    24
    +syntax.rows=5
    
    25
    +syntax.columns=7
    
    26
    +syntax.columnsHeader=YFT^SKJ^BET^LTA^FRI^Autres^Total
    
    27
    +syntax.rowsHeader=BL sans baleine^BL avec baleine^BO avec requin-baleine^BO sans requin-baleine^Total
    
    28
    +syntax.nbRequests=4
    
    29
    +result.columns=7
    
    30
    +result.rows=5
    
    31
    +result.0=175.0^0.0^7.0^0.0^0.0^0.0^182.0
    
    32
    +result.1=null^null^null^null^null^null^0.0
    
    33
    +result.2=null^null^null^null^null^null^0.0
    
    34
    +result.3=0.0^1.0^0.0^0.0^1.0^12.1406^14.1406
    
    35
    +result.4=175.0^1.0^7.0^0.0^1.0^12.1406^196.1406
    \ No newline at end of file

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetDiscardedByAssociation.properties
    ... ... @@ -19,11 +19,11 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -result.0=175.0^0.0^7.0^0.0^0.0^0.2882^182.2882
    
    22
    +result.0=0.0^0.0^0.0^0.0^0.0^0.2882^0.2882
    
    23 23
     result.1=null^null^null^null^null^null^0.0
    
    24 24
     result.2=null^null^null^null^null^null^0.0
    
    25
    -result.3=0.0^1.0^5.0^0.0^1.0^160.4436^167.4436
    
    26
    -result.4=175.0^1.0^12.0^0.0^1.0^160.7318^349.7318
    
    25
    +result.3=0.0^0.0^5.0^0.0^0.0^148.303^153.303
    
    26
    +result.4=0.0^0.0^5.0^0.0^0.0^148.5912^153.5912
    
    27 27
     result.columns=7
    
    28 28
     result.rows=5
    
    29 29
     syntax.columns=7
    

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetDiscardedDistributionLengthsLD1.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -syntax.columns=2
    
    23
    -syntax.columnsHeader=Classe de taille^Effectif
    
    24
    -syntax.description=Afficher la nombre d'individus rejetés, mesurés par classe de taille LD1 pour les espèces ciblées
    
    25
    -syntax.name=Observations - Distribution des tailles des rejets par espèces ciblées (mesure LD1)
    
    26
    -syntax.nbRequests=1
    
    27
    -syntax.rows=-1
    
    28
    -syntax.rowsHeader=

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetDiscardedDistributionLengthsLF.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -syntax.columns=2
    
    23
    -syntax.columnsHeader=Classe de taille^Effectif
    
    24
    -syntax.description=Afficher le nombre d'individus rejetés, mesurés par classe de taille LF pour les espèces ciblées
    
    25
    -syntax.name=Observations - Distribution des tailles des rejets par espèces ciblées (mesure LF)
    
    26
    -syntax.nbRequests=1
    
    27
    -syntax.rows=-1
    
    28
    -syntax.rowsHeader=

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetStoredDistributionLengthsLD1.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -syntax.columns=2
    
    23
    -syntax.columnsHeader=Classe de taille^Effectif
    
    24
    -syntax.description=Afficher le nombre d'individus capturés, mesurés par classe de taille LD1 pour les espèces ciblées
    
    25
    -syntax.name=Observations - Distribution des tailles des captures par espèces ciblées (mesure LD1)
    
    26
    -syntax.nbRequests=1
    
    27
    -syntax.rows=-1
    
    28
    -syntax.rowsHeader=

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationTargetStoredDistributionLengthsLF.properties deleted
    1
    -###
    
    2
    -# #%L
    
    3
    -# ObServe Core :: Services :: Test
    
    4
    -# %%
    
    5
    -# Copyright (C) 2008 - 2022 IRD, Ultreia.io
    
    6
    -# %%
    
    7
    -# This program is free software: you can redistribute it and/or modify
    
    8
    -# it under the terms of the GNU General Public License as
    
    9
    -# published by the Free Software Foundation, either version 3 of the
    
    10
    -# License, or (at your option) any later version.
    
    11
    -#
    
    12
    -# This program is distributed in the hope that it will be useful,
    
    13
    -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    -# GNU General Public License for more details.
    
    16
    -#
    
    17
    -# You should have received a copy of the GNU General Public
    
    18
    -# License along with this program.  If not, see
    
    19
    -# <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    -# #L%
    
    21
    -###
    
    22
    -syntax.columns=2
    
    23
    -syntax.columnsHeader=Classe de taille^Effectif
    
    24
    -syntax.description=Afficher le nombre d'individus capturés, mesurés par classe de taille LF pour les espèces ciblées
    
    25
    -syntax.name=Observations - Distribution des tailles des captures par espèces ciblées (mesure LF)
    
    26
    -syntax.nbRequests=1
    
    27
    -syntax.rows=-1
    
    28
    -syntax.rowsHeader=

  • toolkit/api/src/main/java/fr/ird/observe/dto/report/DataMatrix.java
    ... ... @@ -159,7 +159,13 @@ public class DataMatrix implements JsonAware {
    159 159
             log.debug(String.format("copying incoming matrix (dim: %s, location: %s)", incoming.getDimension(), incoming.getLocation()));
    
    160 160
     
    
    161 161
             for (int i = 0; i < width; i++) {
    
    162
    +            if (x + i < 0) {
    
    163
    +                continue;
    
    164
    +            }
    
    162 165
                 for (int j = 0; j < height; j++) {
    
    166
    +                if (y + j < 0) {
    
    167
    +                    continue;
    
    168
    +                }
    
    163 169
                     Serializable value = incoming.getValue(i, j);
    
    164 170
                     setValue(x + i, y + j, value);
    
    165 171
                 }
    

  • toolkit/api/src/main/java/fr/ird/observe/dto/report/ReportBuilder.java
    ... ... @@ -319,12 +319,14 @@ public class ReportBuilder {
    319 319
                 Map.Entry<String, String> entry = itr.next();
    
    320 320
                 String key = entry.getKey();
    
    321 321
                 if (!key.startsWith(VARIABLE_PREFIX)) {
    
    322
    -
    
    323 322
                     continue;
    
    324 323
                 }
    
    325 324
                 String operations = entry.getValue();
    
    326 325
                 String id = key.substring(VARIABLE_PREFIX.length());
    
    327
    -
    
    326
    +            int indexOf = id.indexOf(".");
    
    327
    +            if (indexOf > -1) {
    
    328
    +                id = id.substring(indexOf + 1);
    
    329
    +            }
    
    328 330
                 // on interdit la surcharge d'une variable déjà trouvée pour le report
    
    329 331
                 if (ids.contains(id)) {
    
    330 332
                     throw new IllegalArgumentException("La variable " + id + " est déjà définie pour le report " + reportName);
    
    ... ... @@ -359,12 +361,14 @@ public class ReportBuilder {
    359 361
                 Map.Entry<String, String> entry = itr.next();
    
    360 362
                 String key = entry.getKey();
    
    361 363
                 if (!key.startsWith(REPEAT_VARIABLE_PREFIX)) {
    
    362
    -
    
    363 364
                     continue;
    
    364 365
                 }
    
    365 366
                 String operations = entry.getValue();
    
    366 367
                 String id = key.substring(REPEAT_VARIABLE_PREFIX.length());
    
    367
    -
    
    368
    +            int indexOf = id.indexOf(".");
    
    369
    +            if (indexOf > -1) {
    
    370
    +                id = id.substring(indexOf + 1);
    
    371
    +            }
    
    368 372
                 // on interdit la surcharge d'une variable déjà trouvée pour le report
    
    369 373
                 if (ids.contains(id)) {
    
    370 374
                     throw new IllegalArgumentException("La variable de répétition " + id + " est déjà définie pour le report " + reportName);