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

Commits:

9 changed files:

Changes:

  • core/persistence/report/src/main/resources/META-INF/report/default/ps/psLogbookCatchWeightByFPAZonePerSpeciesFate.report
    1
    +###
    
    2
    +# #%L
    
    3
    +# ObServe Core :: Persistence :: Report
    
    4
    +# %%
    
    5
    +# Copyright (C) 2008 - 2023 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
    +modelType=PS
    
    23
    +name=Livre de bord - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t)
    
    24
    +name.en=Logbook - Catch fates by species group and FPA zone, filtered per group (in t)
    
    25
    +name.es=
    
    26
    +description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir
    
    27
    +description.en=Once a species group is selected, this report returns catch weights (in tons) by FPA zone and fate
    
    28
    +description.es=
    
    29
    +variable.1.name=speciesGroup
    
    30
    +variable.1.type=fr.ird.observe.dto.referential.common.SpeciesGroupReference
    
    31
    +variable.1.request=Select distinct sg \
    
    32
    +From TripImpl t \
    
    33
    +Join t.routeLogbook r \
    
    34
    +Join r.activity a \
    
    35
    +Join a.catches ca with ca.weight Is Not Null \
    
    36
    +Join ca.species e \
    
    37
    +Join e.speciesGroup sg \
    
    38
    +Where t.id In :tripId \
    
    39
    +Order By sg.code
    
    40
    +repeatVariable.1.name=fpaZone
    
    41
    +repeatVariable.1.type=fr.ird.observe.entities.referential.common.FpaZone
    
    42
    +repeatVariable.1.request=Select distinct z \
    
    43
    +From TripImpl t \
    
    44
    +Join t.routeLogbook r \
    
    45
    +Join r.activity a \
    
    46
    +Join a.currentFpaZone z \
    
    47
    +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    48
    +Where t.id In :tripId \
    
    49
    +Order By z.code, z.@i18nColumnName@
    
    50
    +repeatVariable.2.name=speciesFate
    
    51
    +repeatVariable.2.type=fr.ird.observe.entities.referential.ps.common.SpeciesFate
    
    52
    +repeatVariable.2.request=Select distinct sf \
    
    53
    +From TripImpl t \
    
    54
    +Join t.routeLogbook r \
    
    55
    +Join r.activity a \
    
    56
    +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    57
    +Join ca.speciesFate sf  \
    
    58
    +Where t.id In :tripId \
    
    59
    +Order by sf.discard, sf.code
    
    60
    +request.1.location=0,0
    
    61
    +request.1.layout=row
    
    62
    +request.1.request=Select \
    
    63
    +concat( z.code, ' - ', z.@i18nColumnName@) \
    
    64
    +From FpaZoneImpl z \
    
    65
    +Where z In :fpaZone \
    
    66
    +Group by z.code, z.@i18nColumnName@
    
    67
    +request.1.repeat.name=fpaZone
    
    68
    +request.1.repeat.layout=column
    
    69
    +operations.1.type=ExecuteRequestAndReorganizeDataByRepeatVariable
    
    70
    +operations.1.parameters=fpaZone|speciesFate|Select \
    
    71
    +z.id, sf.id, Sum(ca.weight) \
    
    72
    +From TripImpl m \
    
    73
    +Join m.routeLogbook r \
    
    74
    +Join r.activity a \
    
    75
    +Join a.currentFpaZone z With z.id In :fpaZone \
    
    76
    +Join a.catches ca with ca.weight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    77
    +Join ca.speciesFate sf with sf.id In :speciesFate \
    
    78
    +Where m.id In :tripId \
    
    79
    +Group by z, sf \
    
    80
    +Order By z.code
    
    81
    +operations.2.type=ComputeDynamicHeader
    
    82
    +operations.2.parameters=@fpaZone@|speciesFate
    
    83
    +operations.3.type=SumRow
    
    84
    +operations.3.parameters=0|1
    
    85
    +operations.4.type=SumColumn
    
    86
    +operations.4.parameters=1|1
    
    87
    +i18n.fpaZone=Zone FPA
    
    88
    +i18n.fpaZone.en=FPA Zone
    
    89
    +i18n.fpaZone.es=
    \ No newline at end of file

  • core/persistence/report/src/main/resources/META-INF/report/default/ps/psObservationCatchWeightByFPAZonePerSpeciesFate.report
    1
    +###
    
    2
    +# #%L
    
    3
    +# ObServe Core :: Persistence :: Report
    
    4
    +# %%
    
    5
    +# Copyright (C) 2008 - 2023 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
    +modelType=PS
    
    23
    +name=Observations - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t)
    
    24
    +name.en=Observation - Catch fates by species group and FPA zone, filtered per group (in t)
    
    25
    +name.es=
    
    26
    +description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir
    
    27
    +description.en=Once a species group is selected, this report returns catch weights (in tons) by FPA zone and fate
    
    28
    +description.es=
    
    29
    +variable.1.name=speciesGroup
    
    30
    +variable.1.type=fr.ird.observe.dto.referential.common.SpeciesGroupReference
    
    31
    +variable.1.request=Select distinct sg \
    
    32
    +From TripImpl t \
    
    33
    +Join t.routeObs r \
    
    34
    +Join r.activity a \
    
    35
    +Join a.set c \
    
    36
    +Join c.catches ca with ca.catchWeight Is Not Null \
    
    37
    +Join ca.species e \
    
    38
    +Join e.speciesGroup sg \
    
    39
    +Where t.id In :tripId \
    
    40
    +Order By sg.code
    
    41
    +repeatVariable.1.name=fpaZone
    
    42
    +repeatVariable.1.type=fr.ird.observe.entities.referential.common.FpaZone
    
    43
    +repeatVariable.1.request=Select distinct z \
    
    44
    +From TripImpl t \
    
    45
    +Join t.routeObs r \
    
    46
    +Join r.activity a \
    
    47
    +Join a.currentFpaZone z \
    
    48
    +Join a.set c \
    
    49
    +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    50
    +Where t.id In :tripId \
    
    51
    +Order By z.code, z.@i18nColumnName@
    
    52
    +repeatVariable.2.name=speciesFate
    
    53
    +repeatVariable.2.type=fr.ird.observe.entities.referential.ps.common.SpeciesFate
    
    54
    +repeatVariable.2.request=Select distinct sf \
    
    55
    +From TripImpl t \
    
    56
    +Join t.routeObs r \
    
    57
    +Join r.activity a \
    
    58
    +Join a.set c \
    
    59
    +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    60
    +Join ca.speciesFate sf  \
    
    61
    +Where t.id In :tripId \
    
    62
    +Order by sf.discard, sf.code
    
    63
    +request.1.location=0,0
    
    64
    +request.1.layout=row
    
    65
    +request.1.request=Select \
    
    66
    +concat( z.code, ' - ', z.@i18nColumnName@) \
    
    67
    +From FpaZoneImpl z \
    
    68
    +Where z In :fpaZone \
    
    69
    +Group by z.code, z.@i18nColumnName@
    
    70
    +request.1.repeat.name=fpaZone
    
    71
    +request.1.repeat.layout=column
    
    72
    +operations.1.type=ExecuteRequestAndReorganizeDataByRepeatVariable
    
    73
    +operations.1.parameters=fpaZone|speciesFate|Select \
    
    74
    +z.id, sf.id, Sum(ca.catchWeight) \
    
    75
    +From TripImpl m \
    
    76
    +Join m.routeObs r \
    
    77
    +Join r.activity a \
    
    78
    +Join a.currentFpaZone z With z.id In :fpaZone \
    
    79
    +Join a.set c \
    
    80
    +Join c.catches ca with ca.catchWeight Is Not Null And ca.species.speciesGroup.id = :speciesGroup \
    
    81
    +Join ca.speciesFate sf with sf.id In :speciesFate \
    
    82
    +Where m.id In :tripId \
    
    83
    +Group by z, sf \
    
    84
    +Order By z.code
    
    85
    +operations.2.type=ComputeDynamicHeader
    
    86
    +operations.2.parameters=@fpaZone@|speciesFate
    
    87
    +operations.3.type=SumRow
    
    88
    +operations.3.parameters=0|1
    
    89
    +operations.4.type=SumColumn
    
    90
    +operations.4.parameters=1|1
    
    91
    +i18n.fpaZone=Zone FPA
    
    92
    +i18n.fpaZone.en=FPA Zone
    
    93
    +i18n.fpaZone.es=
    \ No newline at end of file

  • core/persistence/report/src/main/resources/META-INF/report/embedded.list
    ... ... @@ -10,6 +10,7 @@ default/ps/psLocalmarketBatch.report
    10 10
     default/ps/psLocalmarketSample.report
    
    11 11
     default/ps/psLocalmarketSurvey.report
    
    12 12
     default/ps/psLogbookActivity.report
    
    13
    +default/ps/psLogbookCatchWeightByFPAZonePerSpeciesFate.report
    
    13 14
     default/ps/psLogbookFobUsageExtended.report
    
    14 15
     default/ps/psLogbookFobUsageMinimal.report
    
    15 16
     default/ps/psLogbookSampleMeasures.report
    
    ... ... @@ -26,6 +27,7 @@ default/ps/psObservationCatch.report
    26 27
     default/ps/psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation.report
    
    27 28
     default/ps/psObservationCatchTotalCountByGroupPerReasonForDiscard.report
    
    28 29
     default/ps/psObservationCatchTotalCountByGroupPerSpeciesFate.report
    
    30
    +default/ps/psObservationCatchWeightByFPAZonePerSpeciesFate.report
    
    29 31
     default/ps/psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation.report
    
    30 32
     default/ps/psObservationCatchWeightByGroupPerReasonForDiscard.report
    
    31 33
     default/ps/psObservationCatchWeightByGroupPerSpeciesFate.report
    

  • core/persistence/report/src/test/java/fr/ird/observe/report/ToolsTest.java
    ... ... @@ -47,7 +47,7 @@ import java.util.Objects;
    47 47
     
    
    48 48
     public class ToolsTest {
    
    49 49
     
    
    50
    -    public static final int REPORTS_COUNT_COUNT = 37;
    
    50
    +    public static final int REPORTS_COUNT_COUNT = 39;
    
    51 51
     
    
    52 52
         private static Path reportsPath(Path basedir) {
    
    53 53
             return basedir.resolve("src").resolve("main").resolve("resources").resolve("META-INF").resolve("report");
    

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsLogbookCatchWeightByFPAZonePerSpeciesFateReportFixture.java
    1
    +package fr.ird.observe.services.service.report.ps;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Services :: Test
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2024 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.report.Report;
    
    27
    +import fr.ird.observe.report.definition.ReportRequestDefinition;
    
    28
    +import fr.ird.observe.report.definition.RequestLayout;
    
    29
    +import fr.ird.observe.services.service.ReportFixture;
    
    30
    +
    
    31
    +import java.util.Iterator;
    
    32
    +
    
    33
    +/**
    
    34
    + * Created at 19/03/2024.
    
    35
    + *
    
    36
    + * @author Tony Chemit - dev@tchemit.fr
    
    37
    + * @since 9.3.0
    
    38
    + */
    
    39
    +@AutoService(ReportFixture.class)
    
    40
    +public class PsLogbookCatchWeightByFPAZonePerSpeciesFateReportFixture extends ReportFixture {
    
    41
    +
    
    42
    +    @Override
    
    43
    +    public void assertSyntax(Report report) {
    
    44
    +        super.assertSyntax(report);
    
    45
    +        Iterator<ReportRequestDefinition> requests = getRequestIterator(report);
    
    46
    +        assertReportRequestDimension(requests, RequestLayout.row, 0, 0);
    
    47
    +    }
    
    48
    +
    
    49
    +    @Override
    
    50
    +    protected void setVariables(Report report) {
    
    51
    +        setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.7120116158620075");
    
    52
    +    }
    
    53
    +}

  • core/services/test/src/main/java/fr/ird/observe/services/service/report/ps/PsObservationCatchWeightByFPAZonePerSpeciesFateReportFixture.java
    1
    +package fr.ird.observe.services.service.report.ps;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Services :: Test
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2024 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.report.Report;
    
    27
    +import fr.ird.observe.report.definition.ReportRequestDefinition;
    
    28
    +import fr.ird.observe.report.definition.RequestLayout;
    
    29
    +import fr.ird.observe.services.service.ReportFixture;
    
    30
    +
    
    31
    +import java.util.Iterator;
    
    32
    +
    
    33
    +/**
    
    34
    + * Created at 19/03/2024.
    
    35
    + *
    
    36
    + * @author Tony Chemit - dev@tchemit.fr
    
    37
    + * @since 9.3.0
    
    38
    + */
    
    39
    +@AutoService(ReportFixture.class)
    
    40
    +public class PsObservationCatchWeightByFPAZonePerSpeciesFateReportFixture  extends ReportFixture {
    
    41
    +
    
    42
    +    @Override
    
    43
    +    public void assertSyntax(Report report) {
    
    44
    +        super.assertSyntax(report);
    
    45
    +        Iterator<ReportRequestDefinition> requests = getRequestIterator(report);
    
    46
    +        assertReportRequestDimension(requests, RequestLayout.row, 0, 0);
    
    47
    +    }
    
    48
    +
    
    49
    +    @Override
    
    50
    +    protected void setVariables(Report report) {
    
    51
    +        setVariableValue(report, "speciesGroup", "fr.ird.referential.common.SpeciesGroup#1239832683689#0.7120116158620075");
    
    52
    +    }
    
    53
    +}

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookCatchWeightByFPAZonePerSpeciesFate.properties
    1
    +###
    
    2
    +# #%L
    
    3
    +# ObServe Core :: Services :: Test
    
    4
    +# %%
    
    5
    +# Copyright (C) 2008 - 2024 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.name=Livre de bord - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t)
    
    23
    +syntax.description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir
    
    24
    +syntax.rows=-1
    
    25
    +syntax.columns=-1
    
    26
    +syntax.columnsHeader=
    
    27
    +syntax.rowsHeader=
    
    28
    +syntax.nbRequests=1

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psObservationCatchWeightByFPAZonePerSpeciesFate.properties
    1
    +###
    
    2
    +# #%L
    
    3
    +# ObServe Core :: Services :: Test
    
    4
    +# %%
    
    5
    +# Copyright (C) 2008 - 2024 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.name=Observations - Devenir des captures par groupe d'espèces et par zone FPA filtré par groupe d'espèce (en t)
    
    23
    +syntax.description=Après sélection d'un groupe d'espèces, ce rapport retourne les poids capturés (en tonnes) par zone FPA et par devenir
    
    24
    +syntax.rows=-1
    
    25
    +syntax.columns=-1
    
    26
    +syntax.columnsHeader=
    
    27
    +syntax.rowsHeader=
    
    28
    +syntax.nbRequests=1
    
    29
    +result.columns=2
    
    30
    +result.rows=2
    
    31
    +result.0=Zone FPA^Echappe du filet (pour requin-baleine et cétacés)
    
    32
    +result.1=CIV - Côte d'Ivoire^12.0

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService.properties
    ... ... @@ -19,4 +19,4 @@
    19 19
     # <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20 20
     # #L%
    
    21 21
     ###
    
    22
    -report.count=37
    22
    +report.count=39