Tony CHEMIT pushed to branch feature/issue-2886 at ultreiaio / ird-observe
Commits:
-
f46a8dbc
by Tony Chemit at 2024-05-22T10:10:55+02:00
-
de9f80df
by Tony Chemit at 2024-05-22T10:27:28+02:00
-
43955452
by Tony Chemit at 2024-05-22T10:27:28+02:00
-
93664ef5
by Tony Chemit at 2024-05-22T10:27:28+02:00
-
e7f98efe
by Tony Chemit at 2024-05-22T10:27:34+02:00
-
629f25bb
by Tony Chemit at 2024-05-22T10:27:34+02:00
-
7024b23b
by Tony Chemit at 2024-05-22T10:27:34+02:00
28 changed files:
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/common/TripSpi.java
- + core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/logbook/SetInterceptorCallback.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/logbook/SetSpi.java
- + core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/observation/SetInterceptorCallback.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/observation/SetSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripBatchSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/localmarket/SurveySpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/ActivitySpi.java
- + core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleInterceptorCallback.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/SampleSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/RouteSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SampleSpi.java
- + core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetInterceptorCallback.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetSpi.java
- core/services/local/src/test/java/fr/ird/observe/services/local/service/api/DataEntityServiceLocalWriteTest.java
- + core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/data/ll/common/TripService-issue2886.json
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/DecoratorProviderInitializerHelper.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/context/EditableDtoEntityContext.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/context/OpenableDtoEntityContext.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/EntityInterceptor.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/EntityInterceptors.java
- toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/ValidationMessageDetector.java
- + toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/callback/DefaultEntityInterceptorCallback.java
- + toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/callback/EdiableEntityInterceptorCallback.java
- + toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/callback/EntityInterceptorCallback.java
- + toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/callback/EntityInterceptorCallbacks.java
- + toolkit/persistence/src/main/java/fr/ird/observe/spi/validation/callback/OpenableEntityInterceptorCallback.java
Changes:
| ... | ... | @@ -98,7 +98,6 @@ public class TripSpi extends GeneratedTripSpi { |
| 98 | 98 | |
| 99 | 99 | @Override
|
| 100 | 100 | public void loadDtoForValidation(ServiceContext context, Trip entity, TripDto dto) {
|
| 101 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 102 | 101 | if (dto.getEndDate() == null) {
|
| 103 | 102 | Date date = Dates.getEndOfDay(context.now());
|
| 104 | 103 | dto.setEndDate(date);
|
| 1 | +package fr.ird.observe.entities.data.ll.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 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.dto.BusinessDto;
|
|
| 27 | +import fr.ird.observe.dto.data.ll.logbook.SetDto;
|
|
| 28 | +import fr.ird.observe.entities.Entity;
|
|
| 29 | +import fr.ird.observe.entities.data.ll.common.Trip;
|
|
| 30 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 31 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 32 | + |
|
| 33 | +import java.util.Deque;
|
|
| 34 | + |
|
| 35 | +/**
|
|
| 36 | + * Created at 21/05/2024.
|
|
| 37 | + *
|
|
| 38 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 39 | + * @since 9.3.4
|
|
| 40 | + */
|
|
| 41 | +@SuppressWarnings("rawtypes")
|
|
| 42 | +@AutoService(EntityInterceptorCallback.class)
|
|
| 43 | +public class SetInterceptorCallback implements EntityInterceptorCallback<SetDto, Set, SetSpi> {
|
|
| 44 | + |
|
| 45 | + @Override
|
|
| 46 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 47 | + return Set.class.equals(entityType);
|
|
| 48 | + }
|
|
| 49 | + |
|
| 50 | + @Override
|
|
| 51 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, SetSpi spi, Set set, SetDto dto) {
|
|
| 52 | + Trip trip = (Trip) path.getFirst();
|
|
| 53 | + Activity activity = EntityInterceptorCallback.getParent(path, set, Activity.class);
|
|
| 54 | + spi.loadDtoForValidation(context, trip, activity, dto);
|
|
| 55 | + }
|
|
| 56 | +} |
| ... | ... | @@ -72,21 +72,28 @@ public class SetSpi extends GeneratedSetSpi { |
| 72 | 72 | preCreated.setLightsticksUsed(false);
|
| 73 | 73 | // by default (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2685)
|
| 74 | 74 | preCreated.setMonitored(false);
|
| 75 | - Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 76 | - form.getObject().setOtherSets(getBrothers(context, parent));
|
|
| 77 | - return form;
|
|
| 75 | + //FIXME super.preCreate does already this?
|
|
| 76 | +// Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 77 | +// form.getObject().setOtherSets(getBrothers(context, parent));
|
|
| 78 | + return super.preCreate(context, parent, preCreated);
|
|
| 78 | 79 | }
|
| 79 | 80 | |
| 80 | 81 | @Override
|
| 81 | 82 | public void loadDtoForValidation(ServiceContext context, Activity parent, Set entity, SetDto dto) {
|
| 82 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 83 | 83 | dto.setOtherSets(getBrothers(context, parent));
|
| 84 | 84 | }
|
| 85 | 85 | |
| 86 | + public void loadDtoForValidation(ServiceContext context, Trip trip, Activity parent, SetDto dto) {
|
|
| 87 | + dto.setOtherSets(getBrothers(context.getReferentialLocale(), parent, trip));
|
|
| 88 | + }
|
|
| 89 | + |
|
| 86 | 90 | public java.util.Set<SetStubDto> getBrothers(ServiceContext context, Activity parent) {
|
| 87 | - java.util.Set<SetStubDto> result = new HashSet<>();
|
|
| 88 | - ReferentialLocale referentialLocale = context.getReferentialLocale();
|
|
| 89 | 91 | Trip trip = Activity.SPI.getParent(context, parent.getTopiaId());
|
| 92 | + return getBrothers(context.getReferentialLocale(), parent, trip);
|
|
| 93 | + }
|
|
| 94 | + |
|
| 95 | + private java.util.Set<SetStubDto> getBrothers(ReferentialLocale referentialLocale, Activity parent, Trip trip) {
|
|
| 96 | + java.util.Set<SetStubDto> result = new HashSet<>();
|
|
| 90 | 97 | trip.getActivityLogbook().stream().filter(a -> a.getVesselActivity().isAllowSet() && !Objects.equals(a, parent) && a.getSet() != null).forEach(
|
| 91 | 98 | oneParent -> {
|
| 92 | 99 | Set otherSet = oneParent.getSet();
|
| 1 | +package fr.ird.observe.entities.data.ll.observation;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 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.dto.BusinessDto;
|
|
| 27 | +import fr.ird.observe.dto.data.ll.observation.SetDto;
|
|
| 28 | +import fr.ird.observe.entities.Entity;
|
|
| 29 | +import fr.ird.observe.entities.data.ll.common.Trip;
|
|
| 30 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 31 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 32 | + |
|
| 33 | +import java.util.Deque;
|
|
| 34 | + |
|
| 35 | +/**
|
|
| 36 | + * Created at 21/05/2024.
|
|
| 37 | + *
|
|
| 38 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 39 | + * @since 9.3.4
|
|
| 40 | + */
|
|
| 41 | +@SuppressWarnings("rawtypes")
|
|
| 42 | +@AutoService(EntityInterceptorCallback.class)
|
|
| 43 | +public class SetInterceptorCallback implements EntityInterceptorCallback<SetDto, Set, SetSpi> {
|
|
| 44 | + |
|
| 45 | + |
|
| 46 | + @Override
|
|
| 47 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 48 | + return Set.class.equals(entityType);
|
|
| 49 | + }
|
|
| 50 | + |
|
| 51 | + @Override
|
|
| 52 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, SetSpi spi, Set set, SetDto dto) {
|
|
| 53 | + Trip trip = (Trip) path.getFirst();
|
|
| 54 | + Activity activity = EntityInterceptorCallback.getParent(path, set, Activity.class);
|
|
| 55 | + spi.loadDtoForValidation(context, trip, activity, dto);
|
|
| 56 | + }
|
|
| 57 | +} |
| ... | ... | @@ -109,20 +109,28 @@ public class SetSpi extends GeneratedSetSpi { |
| 109 | 109 | // on reporte la position de l'activité pour la position de début de filage
|
| 110 | 110 | preCreated.setSettingStartLatitude(parent.getLatitude());
|
| 111 | 111 | preCreated.setSettingStartLongitude(parent.getLongitude());
|
| 112 | - Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 113 | - form.getObject().setOtherSets(getBrothers(context, parent));
|
|
| 114 | - return form;
|
|
| 112 | + //FIXME super.preCreate does already this?
|
|
| 113 | +// Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 114 | +// form.getObject().setOtherSets(getBrothers(context, parent));
|
|
| 115 | + return super.preCreate(context, parent, preCreated);
|
|
| 115 | 116 | }
|
| 116 | 117 | |
| 117 | 118 | @Override
|
| 118 | - public void loadDtoForValidation(ServiceContext context, Activity parent, Set entity, SetDto dto) {
|
|
| 119 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 119 | + public void loadDtoForValidation(ServiceContext context, Activity parent, Set entity, SetDto dto) {
|
|
| 120 | 120 | dto.setOtherSets(getBrothers(context, parent));
|
| 121 | 121 | }
|
| 122 | 122 | |
| 123 | + public void loadDtoForValidation(ServiceContext context, Trip trip, Activity parent, SetDto dto) {
|
|
| 124 | + dto.setOtherSets(getBrothers(context, trip, parent));
|
|
| 125 | + }
|
|
| 126 | + |
|
| 123 | 127 | public java.util.Set<SetStubDto> getBrothers(ServiceContext context, Activity parent) {
|
| 124 | - java.util.Set<SetStubDto> result = new HashSet<>();
|
|
| 125 | 128 | Trip trip = Activity.SPI.getParent(context, parent.getTopiaId());
|
| 129 | + return getBrothers(context, trip, parent);
|
|
| 130 | + }
|
|
| 131 | + |
|
| 132 | + public java.util.Set<SetStubDto> getBrothers(ServiceContext context, Trip trip, Activity parent) {
|
|
| 133 | + java.util.Set<SetStubDto> result = new HashSet<>();
|
|
| 126 | 134 | ReferentialLocale referentialLocale = context.getReferentialLocale();
|
| 127 | 135 | trip.getActivityObs().stream().filter(a -> a.getVesselActivity().isAllowSet()).filter(a -> !Objects.equals(a, parent) && a.getSet() != null).forEach(
|
| 128 | 136 | oneParent -> {
|
| ... | ... | @@ -38,7 +38,6 @@ public class TripBatchSpi extends GeneratedTripBatchSpi { |
| 38 | 38 | |
| 39 | 39 | @Override
|
| 40 | 40 | public void loadDtoForValidation(ServiceContext context, Trip entity, TripBatchDto dto) {
|
| 41 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 42 | 41 | LinkedHashSet<String> availablePackagingIds = getAvailablePackagingIds(context, entity);
|
| 43 | 42 | dto.setAvailablePackagingIds(availablePackagingIds);
|
| 44 | 43 | LinkedHashSet<String> availableBuyerIds = getAvailableBuyerIds(context, entity);
|
| ... | ... | @@ -143,7 +143,6 @@ public class TripSpi extends GeneratedTripSpi { |
| 143 | 143 | |
| 144 | 144 | @Override
|
| 145 | 145 | public void loadDtoForValidation(ServiceContext context, Trip entity, TripDto dto) {
|
| 146 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 147 | 146 | entity.buildStatistics(dto);
|
| 148 | 147 | }
|
| 149 | 148 |
| ... | ... | @@ -47,15 +47,16 @@ public class SurveySpi extends GeneratedSurveySpi { |
| 47 | 47 | |
| 48 | 48 | @Override
|
| 49 | 49 | public Form<SurveyDto> preCreate(ServiceContext context, Trip parent, Survey preCreated) {
|
| 50 | - Form<SurveyDto> form = super.preCreate(context, parent, preCreated);
|
|
| 51 | - form.getObject().setNumber(parent.getLocalmarketSurveySize() + 1);
|
|
| 52 | - fillFormObject(context.getReferentialLocale(), parent, preCreated, form.getObject());
|
|
| 53 | - return form;
|
|
| 50 | + preCreated.setNumber(parent.getLocalmarketSurveySize() + 1);
|
|
| 51 | +// Form<SurveyDto> form = super.preCreate(context, parent, preCreated);
|
|
| 52 | +// form.getObject().setNumber(parent.getLocalmarketSurveySize() + 1);
|
|
| 53 | + //FIXME super.preCreate does already this?
|
|
| 54 | +// fillFormObject(context.getReferentialLocale(), parent, preCreated, form.getObject());
|
|
| 55 | + return super.preCreate(context, parent, preCreated);
|
|
| 54 | 56 | }
|
| 55 | 57 | |
| 56 | 58 | @Override
|
| 57 | 59 | public void loadDtoForValidation(ServiceContext context, Trip parent, Survey entity, SurveyDto dto) {
|
| 58 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 59 | 60 | fillFormObject(context.getReferentialLocale(), parent, entity, dto);
|
| 60 | 61 | }
|
| 61 | 62 |
| ... | ... | @@ -105,9 +105,10 @@ public class ActivitySpi extends GeneratedActivitySpi { |
| 105 | 105 | preCreated.setNumber(number);
|
| 106 | 106 | preCreated.setSetCount(1);
|
| 107 | 107 | preCreated.setInformationSource(InformationSource.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_ACTIVITY_DEFAULT_INFORMATION_SOURCE_ID));
|
| 108 | - Form<ActivityDto> form = super.preCreate(context, parent, preCreated);
|
|
| 109 | - addRouteDate(parent, form.getObject());
|
|
| 110 | - return form;
|
|
| 108 | + //FIXME super.preCreate does already this?
|
|
| 109 | +// Form<ActivityDto> form = super.preCreate(context, parent, preCreated);
|
|
| 110 | +// addRouteDate(parent, form.getObject());
|
|
| 111 | + return super.preCreate(context, parent, preCreated);
|
|
| 111 | 112 | }
|
| 112 | 113 | |
| 113 | 114 | @Override
|
| 1 | +package fr.ird.observe.entities.data.ps.logbook;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 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.dto.BusinessDto;
|
|
| 27 | +import fr.ird.observe.dto.data.ps.logbook.SampleDto;
|
|
| 28 | +import fr.ird.observe.entities.Entity;
|
|
| 29 | +import fr.ird.observe.entities.data.ps.common.Trip;
|
|
| 30 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 31 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 32 | + |
|
| 33 | +import java.util.Deque;
|
|
| 34 | + |
|
| 35 | +/**
|
|
| 36 | + * Created at 22/05/2024.
|
|
| 37 | + *
|
|
| 38 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 39 | + * @since 9.3.4
|
|
| 40 | + */
|
|
| 41 | +@SuppressWarnings("rawtypes")
|
|
| 42 | +@AutoService(EntityInterceptorCallback.class)
|
|
| 43 | +public class SampleInterceptorCallback implements EntityInterceptorCallback<SampleDto, Sample, SampleSpi> {
|
|
| 44 | + |
|
| 45 | + @Override
|
|
| 46 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 47 | + return Sample.class.equals(entityType);
|
|
| 48 | + }
|
|
| 49 | + |
|
| 50 | + @Override
|
|
| 51 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, SampleSpi spi, Sample sample, SampleDto dto) {
|
|
| 52 | + Trip trip = EntityInterceptorCallback.getParent(path, sample, Trip.class);
|
|
| 53 | + spi.loadDtoForValidation(context, trip, dto);
|
|
| 54 | + }
|
|
| 55 | +} |
| ... | ... | @@ -23,6 +23,7 @@ package fr.ird.observe.entities.data.ps.logbook; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import fr.ird.observe.dto.ProtectedIdsPs;
|
| 26 | +import fr.ird.observe.dto.data.ps.logbook.ActivityStubDto;
|
|
| 26 | 27 | import fr.ird.observe.dto.data.ps.logbook.SampleDto;
|
| 27 | 28 | import fr.ird.observe.dto.form.Form;
|
| 28 | 29 | import fr.ird.observe.dto.referential.ReferentialLocale;
|
| ... | ... | @@ -33,6 +34,8 @@ import fr.ird.observe.services.service.SaveResultDto; |
| 33 | 34 | import fr.ird.observe.spi.result.AddEntityToUpdateStep;
|
| 34 | 35 | import fr.ird.observe.spi.service.ServiceContext;
|
| 35 | 36 | |
| 37 | +import java.util.LinkedList;
|
|
| 38 | +import java.util.List;
|
|
| 36 | 39 | import java.util.Objects;
|
| 37 | 40 | import java.util.function.Consumer;
|
| 38 | 41 | |
| ... | ... | @@ -45,7 +48,6 @@ import java.util.function.Consumer; |
| 45 | 48 | public class SampleSpi extends GeneratedSampleSpi {
|
| 46 | 49 | @Override
|
| 47 | 50 | public void loadDtoForValidation(ServiceContext context, Trip parent, Sample entity, SampleDto dto) {
|
| 48 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 49 | 51 | dto.setActivity(Trip.SPI.getLogbookSetActivities(context, parent.getId()));
|
| 50 | 52 | }
|
| 51 | 53 | |
| ... | ... | @@ -64,9 +66,10 @@ public class SampleSpi extends GeneratedSampleSpi { |
| 64 | 66 | preCreated.setSampleType(SampleType.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_TYPE_ID));
|
| 65 | 67 | preCreated.setSampleQuality(SampleQuality.loadEntity(context, ProtectedIdsPs.PS_LOGBOOK_SAMPLE_DEFAULT_SAMPLE_QUALITY_ID));
|
| 66 | 68 | preCreated.setSuperSample(false);
|
| 67 | - Form<SampleDto> form = super.preCreate(context, parent, preCreated);
|
|
| 68 | - form.getObject().setActivity(Trip.SPI.getLogbookSetActivities(context, parent.getTopiaId()));
|
|
| 69 | - return form;
|
|
| 69 | + //FIXME super.preCreate does already this?
|
|
| 70 | +// Form<SampleDto> form = super.preCreate(context, parent, preCreated);
|
|
| 71 | +// form.getObject().setActivity(Trip.SPI.getLogbookSetActivities(context, parent.getTopiaId()));
|
|
| 72 | + return super.preCreate(context, parent, preCreated);
|
|
| 70 | 73 | }
|
| 71 | 74 | |
| 72 | 75 | @Override
|
| ... | ... | @@ -90,6 +93,15 @@ public class SampleSpi extends GeneratedSampleSpi { |
| 90 | 93 | return super.onSave(context, parent, entity, dto, needCopy);
|
| 91 | 94 | }
|
| 92 | 95 | |
| 96 | + public void loadDtoForValidation(ServiceContext context, Trip parent, SampleDto dto) {
|
|
| 97 | + List<ActivityStubDto> logbookSetActivities = new LinkedList<>();
|
|
| 98 | + for (Route route : parent.getRouteLogbook()) {
|
|
| 99 | + List<ActivityStubDto> routeActivities = Activity.ACTIVITY_STUB_SPI.toDataDtoList(context.getReferentialLocale(), route.getActivity());
|
|
| 100 | + logbookSetActivities.addAll(routeActivities);
|
|
| 101 | + }
|
|
| 102 | + dto.setActivity(logbookSetActivities);
|
|
| 103 | + }
|
|
| 104 | + |
|
| 93 | 105 | private int getSampleSpeciesSubNumber(Sample entity) {
|
| 94 | 106 | return (int) entity.getSampleSpecies().stream().mapToInt(SampleSpecies::getSubSampleNumber).distinct().count();
|
| 95 | 107 | }
|
| ... | ... | @@ -76,7 +76,6 @@ public class RouteSpi extends GeneratedRouteSpi { |
| 76 | 76 | |
| 77 | 77 | @Override
|
| 78 | 78 | public void loadDtoForValidation(ServiceContext context, Trip parent, Route entity, RouteDto dto) {
|
| 79 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 80 | 79 | bindEndOfSearchingProperties(entity.getActivity(), dto.getActivity());
|
| 81 | 80 | }
|
| 82 | 81 |
| ... | ... | @@ -48,7 +48,6 @@ public class SampleSpi extends GeneratedSampleSpi { |
| 48 | 48 | |
| 49 | 49 | @Override
|
| 50 | 50 | public void loadDtoForValidation(ServiceContext context, Set parent, Sample entity, SampleDto dto) {
|
| 51 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 52 | 51 | dto.setId(parent.getTopiaId());
|
| 53 | 52 | dto.setSpeciesFateBySpeciesMap(getCatchesSpeciesFateBySpeciesId(parent));
|
| 54 | 53 | }
|
| 1 | +package fr.ird.observe.entities.data.ps.observation;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Core :: Persistence :: Java
|
|
| 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.dto.BusinessDto;
|
|
| 27 | +import fr.ird.observe.dto.data.ps.observation.SetDto;
|
|
| 28 | +import fr.ird.observe.entities.Entity;
|
|
| 29 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 30 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 31 | + |
|
| 32 | +import java.util.Deque;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * Created at 21/05/2024.
|
|
| 36 | + *
|
|
| 37 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 38 | + * @since 9.3.4
|
|
| 39 | + */
|
|
| 40 | +@SuppressWarnings("rawtypes")
|
|
| 41 | +@AutoService(EntityInterceptorCallback.class)
|
|
| 42 | +public class SetInterceptorCallback implements EntityInterceptorCallback<SetDto, Set, SetSpi> {
|
|
| 43 | + |
|
| 44 | + @Override
|
|
| 45 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 46 | + return Set.class.equals(entityType);
|
|
| 47 | + }
|
|
| 48 | + |
|
| 49 | + @Override
|
|
| 50 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, SetSpi spi, Set set, SetDto dto) {
|
|
| 51 | + Activity activity = EntityInterceptorCallback.getParent(path, set, Activity.class);
|
|
| 52 | + Route route = EntityInterceptorCallback.getParent(path, activity, Route.class);
|
|
| 53 | + spi.loadDtoForValidation(route, dto);
|
|
| 54 | + }
|
|
| 55 | +} |
| ... | ... | @@ -62,19 +62,24 @@ public class SetSpi extends GeneratedSetSpi { |
| 62 | 62 | // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2573
|
| 63 | 63 | SchoolType schoolType = SchoolType.loadEntity(context, ProtectedIdsPs.PS_COMMON_SCHOOL_TYPE_UNDEFINED_ID);
|
| 64 | 64 | preCreated.setSchoolType(schoolType);
|
| 65 | - Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 66 | - form.getObject().setStartSetDate(routeDate);
|
|
| 67 | - return form;
|
|
| 65 | + //FIXME super.preCreate does already this?
|
|
| 66 | +// Form<SetDto> form = super.preCreate(context, parent, preCreated);
|
|
| 67 | +// form.getObject().setStartSetDate(routeDate);
|
|
| 68 | + return super.preCreate(context, parent, preCreated);
|
|
| 68 | 69 | }
|
| 69 | 70 | |
| 70 | 71 | @Override
|
| 71 | 72 | public void loadDtoForValidation(ServiceContext context, Activity parent, Set entity, SetDto dto) {
|
| 72 | - super.loadDtoForValidation(context, parent, entity, dto);
|
|
| 73 | 73 | Route route = Activity.SPI.getParent(context, parent.getTopiaId());
|
| 74 | 74 | Date routeDate = route.getDate();
|
| 75 | 75 | dto.setStartSetDate(routeDate);
|
| 76 | 76 | }
|
| 77 | 77 | |
| 78 | + public void loadDtoForValidation(Route route, SetDto dto) {
|
|
| 79 | + Date routeDate = route.getDate();
|
|
| 80 | + dto.setStartSetDate(routeDate);
|
|
| 81 | + }
|
|
| 82 | + |
|
| 78 | 83 | @Override
|
| 79 | 84 | public void onSave(ServiceContext context, Activity parent, Set entity, SetDto dto) {
|
| 80 | 85 | entity.setActivity(parent);
|
| ... | ... | @@ -34,7 +34,6 @@ import fr.ird.observe.test.DatabaseName; |
| 34 | 34 | import fr.ird.observe.test.spi.CopyDatabaseConfiguration;
|
| 35 | 35 | import fr.ird.observe.test.spi.DatabaseNameConfiguration;
|
| 36 | 36 | import org.junit.Assert;
|
| 37 | -import org.junit.Ignore;
|
|
| 38 | 37 | import org.junit.Test;
|
| 39 | 38 | |
| 40 | 39 | import java.util.Collection;
|
| ... | ... | @@ -70,7 +69,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 70 | 69 | }
|
| 71 | 70 | |
| 72 | 71 | @Test
|
| 73 | - @Ignore
|
|
| 74 | 72 | @CopyDatabaseConfiguration
|
| 75 | 73 | @DatabaseNameConfiguration(DatabaseName.referential)
|
| 76 | 74 | public void createPsTrip() throws InvalidDataException {
|
| ... | ... | @@ -113,7 +111,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 113 | 111 | |
| 114 | 112 | |
| 115 | 113 | @Test
|
| 116 | - @Ignore
|
|
| 117 | 114 | @CopyDatabaseConfiguration
|
| 118 | 115 | public void createPsTrip2() throws InvalidDataException {
|
| 119 | 116 | DataSourceValidationMode validationMode = TOPIA_TEST_CLASS_RESOURCE.getServiceInitializerConfig().getValidationMode();
|
| ... | ... | @@ -270,7 +267,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 270 | 267 | }
|
| 271 | 268 | |
| 272 | 269 | @Test
|
| 273 | - @Ignore
|
|
| 274 | 270 | @CopyDatabaseConfiguration
|
| 275 | 271 | public void createLlTrip() throws InvalidDataException {
|
| 276 | 272 | TOPIA_TEST_CLASS_RESOURCE.getServiceInitializerConfig().setValidationMode(DataSourceValidationMode.NONE);
|
| ... | ... | @@ -296,6 +292,16 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 296 | 292 | }
|
| 297 | 293 | }
|
| 298 | 294 | |
| 295 | + @Test
|
|
| 296 | + @CopyDatabaseConfiguration
|
|
| 297 | + public void createLlTrip_2886() throws InvalidDataException {
|
|
| 298 | + TOPIA_TEST_CLASS_RESOURCE.getServiceInitializerConfig().setValidationMode(DataSourceValidationMode.STRONG);
|
|
| 299 | + {
|
|
| 300 | + Map<String, Object> data = assertCreateTrip0(fr.ird.observe.services.service.data.ll.common.TripService.class,
|
|
| 301 | + fr.ird.observe.dto.data.ll.common.TripDto.class, "issue2886");
|
|
| 302 | + Assert.assertNotNull(data);
|
|
| 303 | + }
|
|
| 304 | + }
|
|
| 299 | 305 | |
| 300 | 306 | @Test
|
| 301 | 307 | @CopyDatabaseConfiguration
|
| ... | ... | @@ -308,7 +314,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 308 | 314 | }
|
| 309 | 315 | }
|
| 310 | 316 | |
| 311 | - |
|
| 312 | 317 | @Test
|
| 313 | 318 | @CopyDatabaseConfiguration
|
| 314 | 319 | public void createLlTripActivityObs() throws InvalidDataException {
|
| ... | ... | @@ -320,7 +325,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 320 | 325 | }
|
| 321 | 326 | }
|
| 322 | 327 | |
| 323 | - |
|
| 324 | 328 | @Test
|
| 325 | 329 | @CopyDatabaseConfiguration
|
| 326 | 330 | public void createLlTripActivityLogbook() throws InvalidDataException {
|
| ... | ... | @@ -332,7 +336,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 332 | 336 | }
|
| 333 | 337 | }
|
| 334 | 338 | |
| 335 | - |
|
| 336 | 339 | @Test
|
| 337 | 340 | @CopyDatabaseConfiguration
|
| 338 | 341 | public void createLlTripAll() throws InvalidDataException {
|
| ... | ... | @@ -372,7 +375,6 @@ public class DataEntityServiceLocalWriteTest extends GeneratedDataEntityServiceL |
| 372 | 375 | return data;
|
| 373 | 376 | }
|
| 374 | 377 | |
| 375 | - |
|
| 376 | 378 | protected Map<String, Object> assertCreateTrip0(Class<?> serviceType, Class<? extends DataDto> dtoType, String classifier) throws InvalidDataException {
|
| 377 | 379 | String json = fixtures.loadContent(serviceType, classifier);
|
| 378 | 380 | ToolkitTreeNodeStates result = fixtures.testCreate(service, dtoType, json);
|
| 1 | +{
|
|
| 2 | + "homeId": null,
|
|
| 3 | + "startDate": "2023-03-08T00:00:00.000Z",
|
|
| 4 | + "endDate": "2023-03-30T00:00:00.000Z",
|
|
| 5 | + "noOfCrewMembers": "27",
|
|
| 6 | + "ersId": null,
|
|
| 7 | + "gearUseFeatures": null,
|
|
| 8 | + "activityObs": null,
|
|
| 9 | + "activityLogbook": [
|
|
| 10 | + {
|
|
| 11 | + "homeId": null,
|
|
| 12 | + "comment": null,
|
|
| 13 | + "startTimeStamp": "2023-03-08T00:00:00.000Z",
|
|
| 14 | + "endTimeStamp": null,
|
|
| 15 | + "latitude": -20.15,
|
|
| 16 | + "longitude": 57.483333333333334,
|
|
| 17 | + "seaSurfaceTemperature": null,
|
|
| 18 | + "wind": null,
|
|
| 19 | + "windDirection": null,
|
|
| 20 | + "currentSpeed": null,
|
|
| 21 | + "currentDirection": null,
|
|
| 22 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 23 | + "dataQuality": null,
|
|
| 24 | + "fpaZone": null,
|
|
| 25 | + "relatedObservedActivity": null,
|
|
| 26 | + "set": null,
|
|
| 27 | + "sample": null
|
|
| 28 | + },
|
|
| 29 | + {
|
|
| 30 | + "homeId": null,
|
|
| 31 | + "comment": null,
|
|
| 32 | + "startTimeStamp": "2023-03-09T00:00:00.000Z",
|
|
| 33 | + "endTimeStamp": null,
|
|
| 34 | + "latitude": -21.883333333333333,
|
|
| 35 | + "longitude": 55.63333333333333,
|
|
| 36 | + "seaSurfaceTemperature": null,
|
|
| 37 | + "wind": null,
|
|
| 38 | + "windDirection": null,
|
|
| 39 | + "currentSpeed": null,
|
|
| 40 | + "currentDirection": null,
|
|
| 41 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 42 | + "dataQuality": null,
|
|
| 43 | + "fpaZone": null,
|
|
| 44 | + "relatedObservedActivity": null,
|
|
| 45 | + "set": null,
|
|
| 46 | + "sample": null
|
|
| 47 | + },
|
|
| 48 | + {
|
|
| 49 | + "homeId": null,
|
|
| 50 | + "comment": null,
|
|
| 51 | + "startTimeStamp": "2023-03-10T00:00:00.000Z",
|
|
| 52 | + "endTimeStamp": null,
|
|
| 53 | + "latitude": -24.116666666666667,
|
|
| 54 | + "longitude": 52.63333333333333,
|
|
| 55 | + "seaSurfaceTemperature": null,
|
|
| 56 | + "wind": null,
|
|
| 57 | + "windDirection": null,
|
|
| 58 | + "currentSpeed": null,
|
|
| 59 | + "currentDirection": null,
|
|
| 60 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 61 | + "dataQuality": null,
|
|
| 62 | + "fpaZone": null,
|
|
| 63 | + "relatedObservedActivity": null,
|
|
| 64 | + "set": null,
|
|
| 65 | + "sample": null
|
|
| 66 | + },
|
|
| 67 | + {
|
|
| 68 | + "homeId": null,
|
|
| 69 | + "comment": null,
|
|
| 70 | + "startTimeStamp": "2023-03-11T00:00:00.000Z",
|
|
| 71 | + "endTimeStamp": null,
|
|
| 72 | + "latitude": -24.05,
|
|
| 73 | + "longitude": 52.333333333333336,
|
|
| 74 | + "seaSurfaceTemperature": null,
|
|
| 75 | + "wind": null,
|
|
| 76 | + "windDirection": null,
|
|
| 77 | + "currentSpeed": null,
|
|
| 78 | + "currentDirection": null,
|
|
| 79 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 80 | + "dataQuality": null,
|
|
| 81 | + "fpaZone": null,
|
|
| 82 | + "relatedObservedActivity": null,
|
|
| 83 | + "set": null,
|
|
| 84 | + "sample": null
|
|
| 85 | + },
|
|
| 86 | + {
|
|
| 87 | + "homeId": null,
|
|
| 88 | + "comment": null,
|
|
| 89 | + "startTimeStamp": "2023-03-12T00:00:00.000Z",
|
|
| 90 | + "endTimeStamp": null,
|
|
| 91 | + "latitude": -21.5,
|
|
| 92 | + "longitude": 53.333333333333336,
|
|
| 93 | + "seaSurfaceTemperature": null,
|
|
| 94 | + "wind": null,
|
|
| 95 | + "windDirection": null,
|
|
| 96 | + "currentSpeed": null,
|
|
| 97 | + "currentDirection": null,
|
|
| 98 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 99 | + "dataQuality": null,
|
|
| 100 | + "fpaZone": null,
|
|
| 101 | + "relatedObservedActivity": null,
|
|
| 102 | + "set": null,
|
|
| 103 | + "sample": null
|
|
| 104 | + },
|
|
| 105 | + {
|
|
| 106 | + "homeId": null,
|
|
| 107 | + "comment": null,
|
|
| 108 | + "startTimeStamp": "2023-03-13T00:00:00.000Z",
|
|
| 109 | + "endTimeStamp": null,
|
|
| 110 | + "latitude": -17.0,
|
|
| 111 | + "longitude": 52.28333333333333,
|
|
| 112 | + "seaSurfaceTemperature": null,
|
|
| 113 | + "wind": null,
|
|
| 114 | + "windDirection": null,
|
|
| 115 | + "currentSpeed": null,
|
|
| 116 | + "currentDirection": null,
|
|
| 117 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 118 | + "dataQuality": null,
|
|
| 119 | + "fpaZone": null,
|
|
| 120 | + "relatedObservedActivity": null,
|
|
| 121 | + "set": null,
|
|
| 122 | + "sample": null
|
|
| 123 | + },
|
|
| 124 | + {
|
|
| 125 | + "homeId": null,
|
|
| 126 | + "comment": null,
|
|
| 127 | + "startTimeStamp": "2023-03-14T00:00:00.000Z",
|
|
| 128 | + "endTimeStamp": null,
|
|
| 129 | + "latitude": -13.366666666666667,
|
|
| 130 | + "longitude": 53.3,
|
|
| 131 | + "seaSurfaceTemperature": null,
|
|
| 132 | + "wind": null,
|
|
| 133 | + "windDirection": null,
|
|
| 134 | + "currentSpeed": null,
|
|
| 135 | + "currentDirection": null,
|
|
| 136 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 137 | + "dataQuality": null,
|
|
| 138 | + "fpaZone": null,
|
|
| 139 | + "relatedObservedActivity": null,
|
|
| 140 | + "set": null,
|
|
| 141 | + "sample": null
|
|
| 142 | + },
|
|
| 143 | + {
|
|
| 144 | + "homeId": null,
|
|
| 145 | + "comment": null,
|
|
| 146 | + "startTimeStamp": "2023-03-15T00:00:00.000Z",
|
|
| 147 | + "endTimeStamp": null,
|
|
| 148 | + "latitude": -10.1,
|
|
| 149 | + "longitude": 52.5,
|
|
| 150 | + "seaSurfaceTemperature": null,
|
|
| 151 | + "wind": null,
|
|
| 152 | + "windDirection": null,
|
|
| 153 | + "currentSpeed": null,
|
|
| 154 | + "currentDirection": null,
|
|
| 155 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 156 | + "dataQuality": null,
|
|
| 157 | + "fpaZone": null,
|
|
| 158 | + "relatedObservedActivity": null,
|
|
| 159 | + "set": null,
|
|
| 160 | + "sample": null
|
|
| 161 | + },
|
|
| 162 | + {
|
|
| 163 | + "homeId": null,
|
|
| 164 | + "comment": null,
|
|
| 165 | + "startTimeStamp": "2023-03-16T00:00:00.000Z",
|
|
| 166 | + "endTimeStamp": null,
|
|
| 167 | + "latitude": -7.016666666666667,
|
|
| 168 | + "longitude": 50.86666666666667,
|
|
| 169 | + "seaSurfaceTemperature": null,
|
|
| 170 | + "wind": null,
|
|
| 171 | + "windDirection": null,
|
|
| 172 | + "currentSpeed": null,
|
|
| 173 | + "currentDirection": null,
|
|
| 174 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 175 | + "dataQuality": null,
|
|
| 176 | + "fpaZone": null,
|
|
| 177 | + "relatedObservedActivity": null,
|
|
| 178 | + "set": null,
|
|
| 179 | + "sample": null
|
|
| 180 | + },
|
|
| 181 | + {
|
|
| 182 | + "homeId": null,
|
|
| 183 | + "comment": null,
|
|
| 184 | + "startTimeStamp": "2023-03-17T00:00:00.000Z",
|
|
| 185 | + "endTimeStamp": null,
|
|
| 186 | + "latitude": -4.733333333333333,
|
|
| 187 | + "longitude": 48.166666666666664,
|
|
| 188 | + "seaSurfaceTemperature": null,
|
|
| 189 | + "wind": null,
|
|
| 190 | + "windDirection": null,
|
|
| 191 | + "currentSpeed": null,
|
|
| 192 | + "currentDirection": null,
|
|
| 193 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 194 | + "dataQuality": null,
|
|
| 195 | + "fpaZone": null,
|
|
| 196 | + "relatedObservedActivity": null,
|
|
| 197 | + "set": null,
|
|
| 198 | + "sample": null
|
|
| 199 | + },
|
|
| 200 | + {
|
|
| 201 | + "homeId": null,
|
|
| 202 | + "comment": null,
|
|
| 203 | + "startTimeStamp": "2023-03-18T05:00:00.000Z",
|
|
| 204 | + "endTimeStamp": null,
|
|
| 205 | + "latitude": -3.5,
|
|
| 206 | + "longitude": 46.86666666666667,
|
|
| 207 | + "seaSurfaceTemperature": 30,
|
|
| 208 | + "wind": null,
|
|
| 209 | + "windDirection": null,
|
|
| 210 | + "currentSpeed": null,
|
|
| 211 | + "currentDirection": null,
|
|
| 212 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 213 | + "dataQuality": null,
|
|
| 214 | + "fpaZone": null,
|
|
| 215 | + "relatedObservedActivity": null,
|
|
| 216 | + "set": {
|
|
| 217 | + "homeId": null,
|
|
| 218 | + "comment": null,
|
|
| 219 | + "number": null,
|
|
| 220 | + "basketsPerSectionCount": null,
|
|
| 221 | + "branchlinesPerBasketCount": null,
|
|
| 222 | + "totalSectionsCount": null,
|
|
| 223 | + "totalBasketsCount": 175.0,
|
|
| 224 | + "totalHooksCount": 3500,
|
|
| 225 | + "totalLightsticksCount": null,
|
|
| 226 | + "weightedSnap": false,
|
|
| 227 | + "snapWeight": null,
|
|
| 228 | + "weightedSwivel": false,
|
|
| 229 | + "swivelWeight": null,
|
|
| 230 | + "timeBetweenHooks": null,
|
|
| 231 | + "shooterUsed": false,
|
|
| 232 | + "shooterSpeed": null,
|
|
| 233 | + "maxDepthTargeted": null,
|
|
| 234 | + "settingStartTimeStamp": "2023-03-18T05:00:00.000Z",
|
|
| 235 | + "settingStartLatitude": -3.5,
|
|
| 236 | + "settingStartLongitude": 46.86666666666667,
|
|
| 237 | + "settingEndTimeStamp": null,
|
|
| 238 | + "settingEndLatitude": null,
|
|
| 239 | + "settingEndLongitude": null,
|
|
| 240 | + "settingVesselSpeed": null,
|
|
| 241 | + "haulingDirectionSameAsSetting": null,
|
|
| 242 | + "haulingStartTimeStamp": null,
|
|
| 243 | + "haulingStartLatitude": null,
|
|
| 244 | + "haulingStartLongitude": null,
|
|
| 245 | + "haulingEndTimeStamp": null,
|
|
| 246 | + "haulingEndLatitude": null,
|
|
| 247 | + "haulingEndLongitude": null,
|
|
| 248 | + "haulingBreaks": null,
|
|
| 249 | + "monitored": false,
|
|
| 250 | + "totalLineLength": null,
|
|
| 251 | + "basketLineLength": null,
|
|
| 252 | + "lengthBetweenBranchlines": 37,
|
|
| 253 | + "baitsComposition": [
|
|
| 254 | + {
|
|
| 255 | + "homeId": null,
|
|
| 256 | + "proportion": 50.0,
|
|
| 257 | + "individualSize": null,
|
|
| 258 | + "individualWeight": null,
|
|
| 259 | + "baitSettingStatus": null,
|
|
| 260 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 261 | + },
|
|
| 262 | + {
|
|
| 263 | + "homeId": null,
|
|
| 264 | + "proportion": 50.0,
|
|
| 265 | + "individualSize": null,
|
|
| 266 | + "individualWeight": null,
|
|
| 267 | + "baitSettingStatus": null,
|
|
| 268 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 269 | + }
|
|
| 270 | + ],
|
|
| 271 | + "floatlinesComposition": [
|
|
| 272 | + {
|
|
| 273 | + "homeId": null,
|
|
| 274 | + "length": 30,
|
|
| 275 | + "proportion": 100,
|
|
| 276 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 277 | + }
|
|
| 278 | + ],
|
|
| 279 | + "hooksComposition": [],
|
|
| 280 | + "settingShape": null,
|
|
| 281 | + "catches": [
|
|
| 282 | + {
|
|
| 283 | + "homeId": null,
|
|
| 284 | + "comment": null,
|
|
| 285 | + "count": 1.0,
|
|
| 286 | + "totalWeight": 14.0,
|
|
| 287 | + "hookWhenDiscarded": null,
|
|
| 288 | + "depredated": null,
|
|
| 289 | + "beatDiameter": null,
|
|
| 290 | + "photoReferences": null,
|
|
| 291 | + "number": null,
|
|
| 292 | + "acquisitionMode": null,
|
|
| 293 | + "countDepredated": null,
|
|
| 294 | + "depredatedProportion": null,
|
|
| 295 | + "tagNumber": null,
|
|
| 296 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 297 | + "discardHealthStatus": null,
|
|
| 298 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 299 | + "predator": [],
|
|
| 300 | + "catchHealthStatus": null,
|
|
| 301 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 302 | + "weightMeasureMethod": null
|
|
| 303 | + },
|
|
| 304 | + {
|
|
| 305 | + "homeId": null,
|
|
| 306 | + "comment": null,
|
|
| 307 | + "count": 15.0,
|
|
| 308 | + "totalWeight": 310.0,
|
|
| 309 | + "hookWhenDiscarded": null,
|
|
| 310 | + "depredated": null,
|
|
| 311 | + "beatDiameter": null,
|
|
| 312 | + "photoReferences": null,
|
|
| 313 | + "number": null,
|
|
| 314 | + "acquisitionMode": null,
|
|
| 315 | + "countDepredated": null,
|
|
| 316 | + "depredatedProportion": null,
|
|
| 317 | + "tagNumber": null,
|
|
| 318 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 319 | + "discardHealthStatus": null,
|
|
| 320 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 321 | + "predator": [],
|
|
| 322 | + "catchHealthStatus": null,
|
|
| 323 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 324 | + "weightMeasureMethod": null
|
|
| 325 | + },
|
|
| 326 | + {
|
|
| 327 | + "homeId": null,
|
|
| 328 | + "comment": null,
|
|
| 329 | + "count": 2.0,
|
|
| 330 | + "totalWeight": 34.0,
|
|
| 331 | + "hookWhenDiscarded": null,
|
|
| 332 | + "depredated": null,
|
|
| 333 | + "beatDiameter": null,
|
|
| 334 | + "photoReferences": null,
|
|
| 335 | + "number": null,
|
|
| 336 | + "acquisitionMode": null,
|
|
| 337 | + "countDepredated": null,
|
|
| 338 | + "depredatedProportion": null,
|
|
| 339 | + "tagNumber": null,
|
|
| 340 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 341 | + "discardHealthStatus": null,
|
|
| 342 | + "species": "fr.ird.referential.common.Species#1239832683791#0.20975568563021063",
|
|
| 343 | + "predator": [],
|
|
| 344 | + "catchHealthStatus": null,
|
|
| 345 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 346 | + "weightMeasureMethod": null
|
|
| 347 | + },
|
|
| 348 | + {
|
|
| 349 | + "homeId": null,
|
|
| 350 | + "comment": null,
|
|
| 351 | + "count": 6.0,
|
|
| 352 | + "totalWeight": 191.0,
|
|
| 353 | + "hookWhenDiscarded": null,
|
|
| 354 | + "depredated": null,
|
|
| 355 | + "beatDiameter": null,
|
|
| 356 | + "photoReferences": null,
|
|
| 357 | + "number": null,
|
|
| 358 | + "acquisitionMode": null,
|
|
| 359 | + "countDepredated": null,
|
|
| 360 | + "depredatedProportion": null,
|
|
| 361 | + "tagNumber": null,
|
|
| 362 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 363 | + "discardHealthStatus": null,
|
|
| 364 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 365 | + "predator": [],
|
|
| 366 | + "catchHealthStatus": null,
|
|
| 367 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 368 | + "weightMeasureMethod": null
|
|
| 369 | + },
|
|
| 370 | + {
|
|
| 371 | + "homeId": null,
|
|
| 372 | + "comment": null,
|
|
| 373 | + "count": 1.0,
|
|
| 374 | + "totalWeight": 96.0,
|
|
| 375 | + "hookWhenDiscarded": null,
|
|
| 376 | + "depredated": null,
|
|
| 377 | + "beatDiameter": null,
|
|
| 378 | + "photoReferences": null,
|
|
| 379 | + "number": null,
|
|
| 380 | + "acquisitionMode": null,
|
|
| 381 | + "countDepredated": null,
|
|
| 382 | + "depredatedProportion": null,
|
|
| 383 | + "tagNumber": null,
|
|
| 384 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 385 | + "discardHealthStatus": null,
|
|
| 386 | + "species": "fr.ird.referential.common.Species#1239832683731#0.3892121873590658",
|
|
| 387 | + "predator": [],
|
|
| 388 | + "catchHealthStatus": null,
|
|
| 389 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 390 | + "weightMeasureMethod": null
|
|
| 391 | + }
|
|
| 392 | + ],
|
|
| 393 | + "lineType": null,
|
|
| 394 | + "lightsticksUsed": false,
|
|
| 395 | + "lightsticksType": null,
|
|
| 396 | + "lightsticksColor": null,
|
|
| 397 | + "mitigationType": [],
|
|
| 398 | + "branchlinesComposition": []
|
|
| 399 | + }
|
|
| 400 | + },
|
|
| 401 | + {
|
|
| 402 | + "homeId": null,
|
|
| 403 | + "comment": null,
|
|
| 404 | + "startTimeStamp": "2023-03-19T10:00:00.000Z",
|
|
| 405 | + "endTimeStamp": null,
|
|
| 406 | + "latitude": -3.3833333333333333,
|
|
| 407 | + "longitude": 46.7,
|
|
| 408 | + "seaSurfaceTemperature": 31,
|
|
| 409 | + "wind": null,
|
|
| 410 | + "windDirection": null,
|
|
| 411 | + "currentSpeed": null,
|
|
| 412 | + "currentDirection": null,
|
|
| 413 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 414 | + "dataQuality": null,
|
|
| 415 | + "fpaZone": null,
|
|
| 416 | + "relatedObservedActivity": null,
|
|
| 417 | + "set": {
|
|
| 418 | + "homeId": null,
|
|
| 419 | + "comment": null,
|
|
| 420 | + "number": null,
|
|
| 421 | + "basketsPerSectionCount": null,
|
|
| 422 | + "branchlinesPerBasketCount": null,
|
|
| 423 | + "totalSectionsCount": null,
|
|
| 424 | + "totalBasketsCount": 150.0,
|
|
| 425 | + "totalHooksCount": 3000,
|
|
| 426 | + "totalLightsticksCount": null,
|
|
| 427 | + "weightedSnap": false,
|
|
| 428 | + "snapWeight": null,
|
|
| 429 | + "weightedSwivel": false,
|
|
| 430 | + "swivelWeight": null,
|
|
| 431 | + "timeBetweenHooks": null,
|
|
| 432 | + "shooterUsed": false,
|
|
| 433 | + "shooterSpeed": null,
|
|
| 434 | + "maxDepthTargeted": null,
|
|
| 435 | + "settingStartTimeStamp": "2023-03-19T10:00:00.000Z",
|
|
| 436 | + "settingStartLatitude": -3.3833333333333333,
|
|
| 437 | + "settingStartLongitude": 46.7,
|
|
| 438 | + "settingEndTimeStamp": null,
|
|
| 439 | + "settingEndLatitude": null,
|
|
| 440 | + "settingEndLongitude": null,
|
|
| 441 | + "settingVesselSpeed": null,
|
|
| 442 | + "haulingDirectionSameAsSetting": null,
|
|
| 443 | + "haulingStartTimeStamp": null,
|
|
| 444 | + "haulingStartLatitude": null,
|
|
| 445 | + "haulingStartLongitude": null,
|
|
| 446 | + "haulingEndTimeStamp": null,
|
|
| 447 | + "haulingEndLatitude": null,
|
|
| 448 | + "haulingEndLongitude": null,
|
|
| 449 | + "haulingBreaks": null,
|
|
| 450 | + "monitored": false,
|
|
| 451 | + "totalLineLength": null,
|
|
| 452 | + "basketLineLength": null,
|
|
| 453 | + "lengthBetweenBranchlines": 37,
|
|
| 454 | + "baitsComposition": [
|
|
| 455 | + {
|
|
| 456 | + "homeId": null,
|
|
| 457 | + "proportion": 50.0,
|
|
| 458 | + "individualSize": null,
|
|
| 459 | + "individualWeight": null,
|
|
| 460 | + "baitSettingStatus": null,
|
|
| 461 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 462 | + },
|
|
| 463 | + {
|
|
| 464 | + "homeId": null,
|
|
| 465 | + "proportion": 50.0,
|
|
| 466 | + "individualSize": null,
|
|
| 467 | + "individualWeight": null,
|
|
| 468 | + "baitSettingStatus": null,
|
|
| 469 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 470 | + }
|
|
| 471 | + ],
|
|
| 472 | + "floatlinesComposition": [
|
|
| 473 | + {
|
|
| 474 | + "homeId": null,
|
|
| 475 | + "length": 30,
|
|
| 476 | + "proportion": 100,
|
|
| 477 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 478 | + }
|
|
| 479 | + ],
|
|
| 480 | + "hooksComposition": [],
|
|
| 481 | + "settingShape": null,
|
|
| 482 | + "catches": [
|
|
| 483 | + {
|
|
| 484 | + "homeId": null,
|
|
| 485 | + "comment": null,
|
|
| 486 | + "count": 3.0,
|
|
| 487 | + "totalWeight": 262.0,
|
|
| 488 | + "hookWhenDiscarded": null,
|
|
| 489 | + "depredated": null,
|
|
| 490 | + "beatDiameter": null,
|
|
| 491 | + "photoReferences": null,
|
|
| 492 | + "number": null,
|
|
| 493 | + "acquisitionMode": null,
|
|
| 494 | + "countDepredated": null,
|
|
| 495 | + "depredatedProportion": null,
|
|
| 496 | + "tagNumber": null,
|
|
| 497 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 498 | + "discardHealthStatus": null,
|
|
| 499 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 500 | + "predator": [],
|
|
| 501 | + "catchHealthStatus": null,
|
|
| 502 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 503 | + "weightMeasureMethod": null
|
|
| 504 | + },
|
|
| 505 | + {
|
|
| 506 | + "homeId": null,
|
|
| 507 | + "comment": null,
|
|
| 508 | + "count": 11.0,
|
|
| 509 | + "totalWeight": 221.0,
|
|
| 510 | + "hookWhenDiscarded": null,
|
|
| 511 | + "depredated": null,
|
|
| 512 | + "beatDiameter": null,
|
|
| 513 | + "photoReferences": null,
|
|
| 514 | + "number": null,
|
|
| 515 | + "acquisitionMode": null,
|
|
| 516 | + "countDepredated": null,
|
|
| 517 | + "depredatedProportion": null,
|
|
| 518 | + "tagNumber": null,
|
|
| 519 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 520 | + "discardHealthStatus": null,
|
|
| 521 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 522 | + "predator": [],
|
|
| 523 | + "catchHealthStatus": null,
|
|
| 524 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 525 | + "weightMeasureMethod": null
|
|
| 526 | + },
|
|
| 527 | + {
|
|
| 528 | + "homeId": null,
|
|
| 529 | + "comment": null,
|
|
| 530 | + "count": 3.0,
|
|
| 531 | + "totalWeight": 70.0,
|
|
| 532 | + "hookWhenDiscarded": null,
|
|
| 533 | + "depredated": null,
|
|
| 534 | + "beatDiameter": null,
|
|
| 535 | + "photoReferences": null,
|
|
| 536 | + "number": null,
|
|
| 537 | + "acquisitionMode": null,
|
|
| 538 | + "countDepredated": null,
|
|
| 539 | + "depredatedProportion": null,
|
|
| 540 | + "tagNumber": null,
|
|
| 541 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 542 | + "discardHealthStatus": null,
|
|
| 543 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 544 | + "predator": [],
|
|
| 545 | + "catchHealthStatus": null,
|
|
| 546 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 547 | + "weightMeasureMethod": null
|
|
| 548 | + },
|
|
| 549 | + {
|
|
| 550 | + "homeId": null,
|
|
| 551 | + "comment": null,
|
|
| 552 | + "count": 1.0,
|
|
| 553 | + "totalWeight": 39.0,
|
|
| 554 | + "hookWhenDiscarded": null,
|
|
| 555 | + "depredated": null,
|
|
| 556 | + "beatDiameter": null,
|
|
| 557 | + "photoReferences": null,
|
|
| 558 | + "number": null,
|
|
| 559 | + "acquisitionMode": null,
|
|
| 560 | + "countDepredated": null,
|
|
| 561 | + "depredatedProportion": null,
|
|
| 562 | + "tagNumber": null,
|
|
| 563 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 564 | + "discardHealthStatus": null,
|
|
| 565 | + "species": "fr.ird.referential.common.Species#1239832683731#0.3892121873590658",
|
|
| 566 | + "predator": [],
|
|
| 567 | + "catchHealthStatus": null,
|
|
| 568 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 569 | + "weightMeasureMethod": null
|
|
| 570 | + }
|
|
| 571 | + ],
|
|
| 572 | + "lineType": null,
|
|
| 573 | + "lightsticksUsed": false,
|
|
| 574 | + "lightsticksType": null,
|
|
| 575 | + "lightsticksColor": null,
|
|
| 576 | + "mitigationType": [],
|
|
| 577 | + "branchlinesComposition": []
|
|
| 578 | + }
|
|
| 579 | + },
|
|
| 580 | + {
|
|
| 581 | + "homeId": null,
|
|
| 582 | + "comment": null,
|
|
| 583 | + "startTimeStamp": "2023-03-20T09:00:00.000Z",
|
|
| 584 | + "endTimeStamp": null,
|
|
| 585 | + "latitude": -3.3,
|
|
| 586 | + "longitude": 47.083333333333336,
|
|
| 587 | + "seaSurfaceTemperature": 30,
|
|
| 588 | + "wind": null,
|
|
| 589 | + "windDirection": null,
|
|
| 590 | + "currentSpeed": null,
|
|
| 591 | + "currentDirection": null,
|
|
| 592 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 593 | + "dataQuality": null,
|
|
| 594 | + "fpaZone": null,
|
|
| 595 | + "relatedObservedActivity": null,
|
|
| 596 | + "set": {
|
|
| 597 | + "homeId": null,
|
|
| 598 | + "comment": null,
|
|
| 599 | + "number": null,
|
|
| 600 | + "basketsPerSectionCount": null,
|
|
| 601 | + "branchlinesPerBasketCount": null,
|
|
| 602 | + "totalSectionsCount": null,
|
|
| 603 | + "totalBasketsCount": 150.0,
|
|
| 604 | + "totalHooksCount": 3000,
|
|
| 605 | + "totalLightsticksCount": null,
|
|
| 606 | + "weightedSnap": false,
|
|
| 607 | + "snapWeight": null,
|
|
| 608 | + "weightedSwivel": false,
|
|
| 609 | + "swivelWeight": null,
|
|
| 610 | + "timeBetweenHooks": null,
|
|
| 611 | + "shooterUsed": false,
|
|
| 612 | + "shooterSpeed": null,
|
|
| 613 | + "maxDepthTargeted": null,
|
|
| 614 | + "settingStartTimeStamp": "2023-03-20T09:00:00.000Z",
|
|
| 615 | + "settingStartLatitude": -3.3,
|
|
| 616 | + "settingStartLongitude": 47.083333333333336,
|
|
| 617 | + "settingEndTimeStamp": null,
|
|
| 618 | + "settingEndLatitude": null,
|
|
| 619 | + "settingEndLongitude": null,
|
|
| 620 | + "settingVesselSpeed": null,
|
|
| 621 | + "haulingDirectionSameAsSetting": null,
|
|
| 622 | + "haulingStartTimeStamp": null,
|
|
| 623 | + "haulingStartLatitude": null,
|
|
| 624 | + "haulingStartLongitude": null,
|
|
| 625 | + "haulingEndTimeStamp": null,
|
|
| 626 | + "haulingEndLatitude": null,
|
|
| 627 | + "haulingEndLongitude": null,
|
|
| 628 | + "haulingBreaks": null,
|
|
| 629 | + "monitored": false,
|
|
| 630 | + "totalLineLength": null,
|
|
| 631 | + "basketLineLength": null,
|
|
| 632 | + "lengthBetweenBranchlines": 37,
|
|
| 633 | + "baitsComposition": [
|
|
| 634 | + {
|
|
| 635 | + "homeId": null,
|
|
| 636 | + "proportion": 50.0,
|
|
| 637 | + "individualSize": null,
|
|
| 638 | + "individualWeight": null,
|
|
| 639 | + "baitSettingStatus": null,
|
|
| 640 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 641 | + },
|
|
| 642 | + {
|
|
| 643 | + "homeId": null,
|
|
| 644 | + "proportion": 50.0,
|
|
| 645 | + "individualSize": null,
|
|
| 646 | + "individualWeight": null,
|
|
| 647 | + "baitSettingStatus": null,
|
|
| 648 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 649 | + }
|
|
| 650 | + ],
|
|
| 651 | + "floatlinesComposition": [
|
|
| 652 | + {
|
|
| 653 | + "homeId": null,
|
|
| 654 | + "length": 30,
|
|
| 655 | + "proportion": 100,
|
|
| 656 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 657 | + }
|
|
| 658 | + ],
|
|
| 659 | + "hooksComposition": [],
|
|
| 660 | + "settingShape": null,
|
|
| 661 | + "catches": [
|
|
| 662 | + {
|
|
| 663 | + "homeId": null,
|
|
| 664 | + "comment": null,
|
|
| 665 | + "count": 5.0,
|
|
| 666 | + "totalWeight": 321.0,
|
|
| 667 | + "hookWhenDiscarded": null,
|
|
| 668 | + "depredated": null,
|
|
| 669 | + "beatDiameter": null,
|
|
| 670 | + "photoReferences": null,
|
|
| 671 | + "number": null,
|
|
| 672 | + "acquisitionMode": null,
|
|
| 673 | + "countDepredated": null,
|
|
| 674 | + "depredatedProportion": null,
|
|
| 675 | + "tagNumber": null,
|
|
| 676 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 677 | + "discardHealthStatus": null,
|
|
| 678 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 679 | + "predator": [],
|
|
| 680 | + "catchHealthStatus": null,
|
|
| 681 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 682 | + "weightMeasureMethod": null
|
|
| 683 | + },
|
|
| 684 | + {
|
|
| 685 | + "homeId": null,
|
|
| 686 | + "comment": null,
|
|
| 687 | + "count": 12.0,
|
|
| 688 | + "totalWeight": 210.0,
|
|
| 689 | + "hookWhenDiscarded": null,
|
|
| 690 | + "depredated": null,
|
|
| 691 | + "beatDiameter": null,
|
|
| 692 | + "photoReferences": null,
|
|
| 693 | + "number": null,
|
|
| 694 | + "acquisitionMode": null,
|
|
| 695 | + "countDepredated": null,
|
|
| 696 | + "depredatedProportion": null,
|
|
| 697 | + "tagNumber": null,
|
|
| 698 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 699 | + "discardHealthStatus": null,
|
|
| 700 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 701 | + "predator": [],
|
|
| 702 | + "catchHealthStatus": null,
|
|
| 703 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 704 | + "weightMeasureMethod": null
|
|
| 705 | + },
|
|
| 706 | + {
|
|
| 707 | + "homeId": null,
|
|
| 708 | + "comment": null,
|
|
| 709 | + "count": 2.0,
|
|
| 710 | + "totalWeight": 55.0,
|
|
| 711 | + "hookWhenDiscarded": null,
|
|
| 712 | + "depredated": null,
|
|
| 713 | + "beatDiameter": null,
|
|
| 714 | + "photoReferences": null,
|
|
| 715 | + "number": null,
|
|
| 716 | + "acquisitionMode": null,
|
|
| 717 | + "countDepredated": null,
|
|
| 718 | + "depredatedProportion": null,
|
|
| 719 | + "tagNumber": null,
|
|
| 720 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 721 | + "discardHealthStatus": null,
|
|
| 722 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 723 | + "predator": [],
|
|
| 724 | + "catchHealthStatus": null,
|
|
| 725 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 726 | + "weightMeasureMethod": null
|
|
| 727 | + },
|
|
| 728 | + {
|
|
| 729 | + "homeId": null,
|
|
| 730 | + "comment": null,
|
|
| 731 | + "count": 1.0,
|
|
| 732 | + "totalWeight": 105.0,
|
|
| 733 | + "hookWhenDiscarded": null,
|
|
| 734 | + "depredated": null,
|
|
| 735 | + "beatDiameter": null,
|
|
| 736 | + "photoReferences": null,
|
|
| 737 | + "number": null,
|
|
| 738 | + "acquisitionMode": null,
|
|
| 739 | + "countDepredated": null,
|
|
| 740 | + "depredatedProportion": null,
|
|
| 741 | + "tagNumber": null,
|
|
| 742 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 743 | + "discardHealthStatus": null,
|
|
| 744 | + "species": "fr.ird.referential.common.Species#1239832683731#0.3892121873590658",
|
|
| 745 | + "predator": [],
|
|
| 746 | + "catchHealthStatus": null,
|
|
| 747 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 748 | + "weightMeasureMethod": null
|
|
| 749 | + }
|
|
| 750 | + ],
|
|
| 751 | + "lineType": null,
|
|
| 752 | + "lightsticksUsed": false,
|
|
| 753 | + "lightsticksType": null,
|
|
| 754 | + "lightsticksColor": null,
|
|
| 755 | + "mitigationType": [],
|
|
| 756 | + "branchlinesComposition": []
|
|
| 757 | + }
|
|
| 758 | + },
|
|
| 759 | + {
|
|
| 760 | + "homeId": null,
|
|
| 761 | + "comment": null,
|
|
| 762 | + "startTimeStamp": "2023-03-21T08:00:00.000Z",
|
|
| 763 | + "endTimeStamp": null,
|
|
| 764 | + "latitude": -3.466666666666667,
|
|
| 765 | + "longitude": 47.0,
|
|
| 766 | + "seaSurfaceTemperature": 30,
|
|
| 767 | + "wind": null,
|
|
| 768 | + "windDirection": null,
|
|
| 769 | + "currentSpeed": null,
|
|
| 770 | + "currentDirection": null,
|
|
| 771 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 772 | + "dataQuality": null,
|
|
| 773 | + "fpaZone": null,
|
|
| 774 | + "relatedObservedActivity": null,
|
|
| 775 | + "set": {
|
|
| 776 | + "homeId": null,
|
|
| 777 | + "comment": null,
|
|
| 778 | + "number": null,
|
|
| 779 | + "basketsPerSectionCount": null,
|
|
| 780 | + "branchlinesPerBasketCount": null,
|
|
| 781 | + "totalSectionsCount": null,
|
|
| 782 | + "totalBasketsCount": 150.0,
|
|
| 783 | + "totalHooksCount": 3000,
|
|
| 784 | + "totalLightsticksCount": null,
|
|
| 785 | + "weightedSnap": false,
|
|
| 786 | + "snapWeight": null,
|
|
| 787 | + "weightedSwivel": false,
|
|
| 788 | + "swivelWeight": null,
|
|
| 789 | + "timeBetweenHooks": null,
|
|
| 790 | + "shooterUsed": false,
|
|
| 791 | + "shooterSpeed": null,
|
|
| 792 | + "maxDepthTargeted": null,
|
|
| 793 | + "settingStartTimeStamp": "2023-03-21T08:00:00.000Z",
|
|
| 794 | + "settingStartLatitude": -3.466666666666667,
|
|
| 795 | + "settingStartLongitude": 47.0,
|
|
| 796 | + "settingEndTimeStamp": null,
|
|
| 797 | + "settingEndLatitude": null,
|
|
| 798 | + "settingEndLongitude": null,
|
|
| 799 | + "settingVesselSpeed": null,
|
|
| 800 | + "haulingDirectionSameAsSetting": null,
|
|
| 801 | + "haulingStartTimeStamp": null,
|
|
| 802 | + "haulingStartLatitude": null,
|
|
| 803 | + "haulingStartLongitude": null,
|
|
| 804 | + "haulingEndTimeStamp": null,
|
|
| 805 | + "haulingEndLatitude": null,
|
|
| 806 | + "haulingEndLongitude": null,
|
|
| 807 | + "haulingBreaks": null,
|
|
| 808 | + "monitored": false,
|
|
| 809 | + "totalLineLength": null,
|
|
| 810 | + "basketLineLength": null,
|
|
| 811 | + "lengthBetweenBranchlines": 37,
|
|
| 812 | + "baitsComposition": [
|
|
| 813 | + {
|
|
| 814 | + "homeId": null,
|
|
| 815 | + "proportion": 50.0,
|
|
| 816 | + "individualSize": null,
|
|
| 817 | + "individualWeight": null,
|
|
| 818 | + "baitSettingStatus": null,
|
|
| 819 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 820 | + },
|
|
| 821 | + {
|
|
| 822 | + "homeId": null,
|
|
| 823 | + "proportion": 50.0,
|
|
| 824 | + "individualSize": null,
|
|
| 825 | + "individualWeight": null,
|
|
| 826 | + "baitSettingStatus": null,
|
|
| 827 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 828 | + }
|
|
| 829 | + ],
|
|
| 830 | + "floatlinesComposition": [
|
|
| 831 | + {
|
|
| 832 | + "homeId": null,
|
|
| 833 | + "length": 30,
|
|
| 834 | + "proportion": 100,
|
|
| 835 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 836 | + }
|
|
| 837 | + ],
|
|
| 838 | + "hooksComposition": [],
|
|
| 839 | + "settingShape": null,
|
|
| 840 | + "catches": [],
|
|
| 841 | + "lineType": null,
|
|
| 842 | + "lightsticksUsed": false,
|
|
| 843 | + "lightsticksType": null,
|
|
| 844 | + "lightsticksColor": null,
|
|
| 845 | + "mitigationType": [],
|
|
| 846 | + "branchlinesComposition": []
|
|
| 847 | + }
|
|
| 848 | + },
|
|
| 849 | + {
|
|
| 850 | + "homeId": null,
|
|
| 851 | + "comment": null,
|
|
| 852 | + "startTimeStamp": "2023-03-22T09:00:00.000Z",
|
|
| 853 | + "endTimeStamp": null,
|
|
| 854 | + "latitude": -3.3833333333333333,
|
|
| 855 | + "longitude": 47.28333333333333,
|
|
| 856 | + "seaSurfaceTemperature": 30,
|
|
| 857 | + "wind": null,
|
|
| 858 | + "windDirection": null,
|
|
| 859 | + "currentSpeed": null,
|
|
| 860 | + "currentDirection": null,
|
|
| 861 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 862 | + "dataQuality": null,
|
|
| 863 | + "fpaZone": null,
|
|
| 864 | + "relatedObservedActivity": null,
|
|
| 865 | + "set": {
|
|
| 866 | + "homeId": null,
|
|
| 867 | + "comment": null,
|
|
| 868 | + "number": null,
|
|
| 869 | + "basketsPerSectionCount": null,
|
|
| 870 | + "branchlinesPerBasketCount": null,
|
|
| 871 | + "totalSectionsCount": null,
|
|
| 872 | + "totalBasketsCount": 150.0,
|
|
| 873 | + "totalHooksCount": 3000,
|
|
| 874 | + "totalLightsticksCount": null,
|
|
| 875 | + "weightedSnap": false,
|
|
| 876 | + "snapWeight": null,
|
|
| 877 | + "weightedSwivel": false,
|
|
| 878 | + "swivelWeight": null,
|
|
| 879 | + "timeBetweenHooks": null,
|
|
| 880 | + "shooterUsed": false,
|
|
| 881 | + "shooterSpeed": null,
|
|
| 882 | + "maxDepthTargeted": null,
|
|
| 883 | + "settingStartTimeStamp": "2023-03-22T09:00:00.000Z",
|
|
| 884 | + "settingStartLatitude": -3.3833333333333333,
|
|
| 885 | + "settingStartLongitude": 47.28333333333333,
|
|
| 886 | + "settingEndTimeStamp": null,
|
|
| 887 | + "settingEndLatitude": null,
|
|
| 888 | + "settingEndLongitude": null,
|
|
| 889 | + "settingVesselSpeed": null,
|
|
| 890 | + "haulingDirectionSameAsSetting": null,
|
|
| 891 | + "haulingStartTimeStamp": null,
|
|
| 892 | + "haulingStartLatitude": null,
|
|
| 893 | + "haulingStartLongitude": null,
|
|
| 894 | + "haulingEndTimeStamp": null,
|
|
| 895 | + "haulingEndLatitude": null,
|
|
| 896 | + "haulingEndLongitude": null,
|
|
| 897 | + "haulingBreaks": null,
|
|
| 898 | + "monitored": false,
|
|
| 899 | + "totalLineLength": null,
|
|
| 900 | + "basketLineLength": null,
|
|
| 901 | + "lengthBetweenBranchlines": 37,
|
|
| 902 | + "baitsComposition": [
|
|
| 903 | + {
|
|
| 904 | + "homeId": null,
|
|
| 905 | + "proportion": 50.0,
|
|
| 906 | + "individualSize": null,
|
|
| 907 | + "individualWeight": null,
|
|
| 908 | + "baitSettingStatus": null,
|
|
| 909 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 910 | + },
|
|
| 911 | + {
|
|
| 912 | + "homeId": null,
|
|
| 913 | + "proportion": 50.0,
|
|
| 914 | + "individualSize": null,
|
|
| 915 | + "individualWeight": null,
|
|
| 916 | + "baitSettingStatus": null,
|
|
| 917 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 918 | + }
|
|
| 919 | + ],
|
|
| 920 | + "floatlinesComposition": [
|
|
| 921 | + {
|
|
| 922 | + "homeId": null,
|
|
| 923 | + "length": 30,
|
|
| 924 | + "proportion": 100,
|
|
| 925 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 926 | + }
|
|
| 927 | + ],
|
|
| 928 | + "hooksComposition": [],
|
|
| 929 | + "settingShape": null,
|
|
| 930 | + "catches": [
|
|
| 931 | + {
|
|
| 932 | + "homeId": null,
|
|
| 933 | + "comment": null,
|
|
| 934 | + "count": 2.0,
|
|
| 935 | + "totalWeight": 114.0,
|
|
| 936 | + "hookWhenDiscarded": null,
|
|
| 937 | + "depredated": null,
|
|
| 938 | + "beatDiameter": null,
|
|
| 939 | + "photoReferences": null,
|
|
| 940 | + "number": null,
|
|
| 941 | + "acquisitionMode": null,
|
|
| 942 | + "countDepredated": null,
|
|
| 943 | + "depredatedProportion": null,
|
|
| 944 | + "tagNumber": null,
|
|
| 945 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 946 | + "discardHealthStatus": null,
|
|
| 947 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 948 | + "predator": [],
|
|
| 949 | + "catchHealthStatus": null,
|
|
| 950 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 951 | + "weightMeasureMethod": null
|
|
| 952 | + },
|
|
| 953 | + {
|
|
| 954 | + "homeId": null,
|
|
| 955 | + "comment": null,
|
|
| 956 | + "count": 5.0,
|
|
| 957 | + "totalWeight": 93.0,
|
|
| 958 | + "hookWhenDiscarded": null,
|
|
| 959 | + "depredated": null,
|
|
| 960 | + "beatDiameter": null,
|
|
| 961 | + "photoReferences": null,
|
|
| 962 | + "number": null,
|
|
| 963 | + "acquisitionMode": null,
|
|
| 964 | + "countDepredated": null,
|
|
| 965 | + "depredatedProportion": null,
|
|
| 966 | + "tagNumber": null,
|
|
| 967 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 968 | + "discardHealthStatus": null,
|
|
| 969 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 970 | + "predator": [],
|
|
| 971 | + "catchHealthStatus": null,
|
|
| 972 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 973 | + "weightMeasureMethod": null
|
|
| 974 | + },
|
|
| 975 | + {
|
|
| 976 | + "homeId": null,
|
|
| 977 | + "comment": null,
|
|
| 978 | + "count": 2.0,
|
|
| 979 | + "totalWeight": 51.0,
|
|
| 980 | + "hookWhenDiscarded": null,
|
|
| 981 | + "depredated": null,
|
|
| 982 | + "beatDiameter": null,
|
|
| 983 | + "photoReferences": null,
|
|
| 984 | + "number": null,
|
|
| 985 | + "acquisitionMode": null,
|
|
| 986 | + "countDepredated": null,
|
|
| 987 | + "depredatedProportion": null,
|
|
| 988 | + "tagNumber": null,
|
|
| 989 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 990 | + "discardHealthStatus": null,
|
|
| 991 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 992 | + "predator": [],
|
|
| 993 | + "catchHealthStatus": null,
|
|
| 994 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 995 | + "weightMeasureMethod": null
|
|
| 996 | + },
|
|
| 997 | + {
|
|
| 998 | + "homeId": null,
|
|
| 999 | + "comment": null,
|
|
| 1000 | + "count": 1.0,
|
|
| 1001 | + "totalWeight": 70.0,
|
|
| 1002 | + "hookWhenDiscarded": null,
|
|
| 1003 | + "depredated": null,
|
|
| 1004 | + "beatDiameter": null,
|
|
| 1005 | + "photoReferences": null,
|
|
| 1006 | + "number": null,
|
|
| 1007 | + "acquisitionMode": null,
|
|
| 1008 | + "countDepredated": null,
|
|
| 1009 | + "depredatedProportion": null,
|
|
| 1010 | + "tagNumber": null,
|
|
| 1011 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1012 | + "discardHealthStatus": null,
|
|
| 1013 | + "species": "fr.ird.referential.common.Species#1239832683731#0.3892121873590658",
|
|
| 1014 | + "predator": [],
|
|
| 1015 | + "catchHealthStatus": null,
|
|
| 1016 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1017 | + "weightMeasureMethod": null
|
|
| 1018 | + }
|
|
| 1019 | + ],
|
|
| 1020 | + "lineType": null,
|
|
| 1021 | + "lightsticksUsed": false,
|
|
| 1022 | + "lightsticksType": null,
|
|
| 1023 | + "lightsticksColor": null,
|
|
| 1024 | + "mitigationType": [],
|
|
| 1025 | + "branchlinesComposition": []
|
|
| 1026 | + }
|
|
| 1027 | + },
|
|
| 1028 | + {
|
|
| 1029 | + "homeId": null,
|
|
| 1030 | + "comment": null,
|
|
| 1031 | + "startTimeStamp": "2023-03-23T00:00:00.000Z",
|
|
| 1032 | + "endTimeStamp": null,
|
|
| 1033 | + "latitude": -1.95,
|
|
| 1034 | + "longitude": 47.916666666666664,
|
|
| 1035 | + "seaSurfaceTemperature": null,
|
|
| 1036 | + "wind": null,
|
|
| 1037 | + "windDirection": null,
|
|
| 1038 | + "currentSpeed": null,
|
|
| 1039 | + "currentDirection": null,
|
|
| 1040 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 1041 | + "dataQuality": null,
|
|
| 1042 | + "fpaZone": null,
|
|
| 1043 | + "relatedObservedActivity": null,
|
|
| 1044 | + "set": null,
|
|
| 1045 | + "sample": null
|
|
| 1046 | + },
|
|
| 1047 | + {
|
|
| 1048 | + "homeId": null,
|
|
| 1049 | + "comment": null,
|
|
| 1050 | + "startTimeStamp": "2023-03-24T03:00:00.000Z",
|
|
| 1051 | + "endTimeStamp": null,
|
|
| 1052 | + "latitude": -0.65,
|
|
| 1053 | + "longitude": 48.45,
|
|
| 1054 | + "seaSurfaceTemperature": 30,
|
|
| 1055 | + "wind": null,
|
|
| 1056 | + "windDirection": null,
|
|
| 1057 | + "currentSpeed": null,
|
|
| 1058 | + "currentDirection": null,
|
|
| 1059 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 1060 | + "dataQuality": null,
|
|
| 1061 | + "fpaZone": null,
|
|
| 1062 | + "relatedObservedActivity": null,
|
|
| 1063 | + "set": {
|
|
| 1064 | + "homeId": null,
|
|
| 1065 | + "comment": null,
|
|
| 1066 | + "number": null,
|
|
| 1067 | + "basketsPerSectionCount": null,
|
|
| 1068 | + "branchlinesPerBasketCount": null,
|
|
| 1069 | + "totalSectionsCount": null,
|
|
| 1070 | + "totalBasketsCount": 175.0,
|
|
| 1071 | + "totalHooksCount": 3500,
|
|
| 1072 | + "totalLightsticksCount": null,
|
|
| 1073 | + "weightedSnap": false,
|
|
| 1074 | + "snapWeight": null,
|
|
| 1075 | + "weightedSwivel": false,
|
|
| 1076 | + "swivelWeight": null,
|
|
| 1077 | + "timeBetweenHooks": null,
|
|
| 1078 | + "shooterUsed": false,
|
|
| 1079 | + "shooterSpeed": null,
|
|
| 1080 | + "maxDepthTargeted": null,
|
|
| 1081 | + "settingStartTimeStamp": "2023-03-24T03:00:00.000Z",
|
|
| 1082 | + "settingStartLatitude": -0.65,
|
|
| 1083 | + "settingStartLongitude": 48.45,
|
|
| 1084 | + "settingEndTimeStamp": null,
|
|
| 1085 | + "settingEndLatitude": null,
|
|
| 1086 | + "settingEndLongitude": null,
|
|
| 1087 | + "settingVesselSpeed": null,
|
|
| 1088 | + "haulingDirectionSameAsSetting": null,
|
|
| 1089 | + "haulingStartTimeStamp": null,
|
|
| 1090 | + "haulingStartLatitude": null,
|
|
| 1091 | + "haulingStartLongitude": null,
|
|
| 1092 | + "haulingEndTimeStamp": null,
|
|
| 1093 | + "haulingEndLatitude": null,
|
|
| 1094 | + "haulingEndLongitude": null,
|
|
| 1095 | + "haulingBreaks": null,
|
|
| 1096 | + "monitored": false,
|
|
| 1097 | + "totalLineLength": null,
|
|
| 1098 | + "basketLineLength": null,
|
|
| 1099 | + "lengthBetweenBranchlines": 37,
|
|
| 1100 | + "baitsComposition": [
|
|
| 1101 | + {
|
|
| 1102 | + "homeId": null,
|
|
| 1103 | + "proportion": 50.0,
|
|
| 1104 | + "individualSize": null,
|
|
| 1105 | + "individualWeight": null,
|
|
| 1106 | + "baitSettingStatus": null,
|
|
| 1107 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 1108 | + },
|
|
| 1109 | + {
|
|
| 1110 | + "homeId": null,
|
|
| 1111 | + "proportion": 50.0,
|
|
| 1112 | + "individualSize": null,
|
|
| 1113 | + "individualWeight": null,
|
|
| 1114 | + "baitSettingStatus": null,
|
|
| 1115 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 1116 | + }
|
|
| 1117 | + ],
|
|
| 1118 | + "floatlinesComposition": [
|
|
| 1119 | + {
|
|
| 1120 | + "homeId": null,
|
|
| 1121 | + "length": 30,
|
|
| 1122 | + "proportion": 100,
|
|
| 1123 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 1124 | + }
|
|
| 1125 | + ],
|
|
| 1126 | + "hooksComposition": [],
|
|
| 1127 | + "settingShape": null,
|
|
| 1128 | + "catches": [
|
|
| 1129 | + {
|
|
| 1130 | + "homeId": null,
|
|
| 1131 | + "comment": null,
|
|
| 1132 | + "count": 7.0,
|
|
| 1133 | + "totalWeight": 181.0,
|
|
| 1134 | + "hookWhenDiscarded": null,
|
|
| 1135 | + "depredated": null,
|
|
| 1136 | + "beatDiameter": null,
|
|
| 1137 | + "photoReferences": null,
|
|
| 1138 | + "number": null,
|
|
| 1139 | + "acquisitionMode": null,
|
|
| 1140 | + "countDepredated": null,
|
|
| 1141 | + "depredatedProportion": null,
|
|
| 1142 | + "tagNumber": null,
|
|
| 1143 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1144 | + "discardHealthStatus": null,
|
|
| 1145 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 1146 | + "predator": [],
|
|
| 1147 | + "catchHealthStatus": null,
|
|
| 1148 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1149 | + "weightMeasureMethod": null
|
|
| 1150 | + },
|
|
| 1151 | + {
|
|
| 1152 | + "homeId": null,
|
|
| 1153 | + "comment": null,
|
|
| 1154 | + "count": 8.0,
|
|
| 1155 | + "totalWeight": 224.0,
|
|
| 1156 | + "hookWhenDiscarded": null,
|
|
| 1157 | + "depredated": null,
|
|
| 1158 | + "beatDiameter": null,
|
|
| 1159 | + "photoReferences": null,
|
|
| 1160 | + "number": null,
|
|
| 1161 | + "acquisitionMode": null,
|
|
| 1162 | + "countDepredated": null,
|
|
| 1163 | + "depredatedProportion": null,
|
|
| 1164 | + "tagNumber": null,
|
|
| 1165 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1166 | + "discardHealthStatus": null,
|
|
| 1167 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 1168 | + "predator": [],
|
|
| 1169 | + "catchHealthStatus": null,
|
|
| 1170 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1171 | + "weightMeasureMethod": null
|
|
| 1172 | + },
|
|
| 1173 | + {
|
|
| 1174 | + "homeId": null,
|
|
| 1175 | + "comment": null,
|
|
| 1176 | + "count": 4.0,
|
|
| 1177 | + "totalWeight": 95.0,
|
|
| 1178 | + "hookWhenDiscarded": null,
|
|
| 1179 | + "depredated": null,
|
|
| 1180 | + "beatDiameter": null,
|
|
| 1181 | + "photoReferences": null,
|
|
| 1182 | + "number": null,
|
|
| 1183 | + "acquisitionMode": null,
|
|
| 1184 | + "countDepredated": null,
|
|
| 1185 | + "depredatedProportion": null,
|
|
| 1186 | + "tagNumber": null,
|
|
| 1187 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1188 | + "discardHealthStatus": null,
|
|
| 1189 | + "species": "fr.ird.referential.common.Species#1239832683791#0.20975568563021063",
|
|
| 1190 | + "predator": [],
|
|
| 1191 | + "catchHealthStatus": null,
|
|
| 1192 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1193 | + "weightMeasureMethod": null
|
|
| 1194 | + },
|
|
| 1195 | + {
|
|
| 1196 | + "homeId": null,
|
|
| 1197 | + "comment": null,
|
|
| 1198 | + "count": 2.0,
|
|
| 1199 | + "totalWeight": 51.0,
|
|
| 1200 | + "hookWhenDiscarded": null,
|
|
| 1201 | + "depredated": null,
|
|
| 1202 | + "beatDiameter": null,
|
|
| 1203 | + "photoReferences": null,
|
|
| 1204 | + "number": null,
|
|
| 1205 | + "acquisitionMode": null,
|
|
| 1206 | + "countDepredated": null,
|
|
| 1207 | + "depredatedProportion": null,
|
|
| 1208 | + "tagNumber": null,
|
|
| 1209 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1210 | + "discardHealthStatus": null,
|
|
| 1211 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 1212 | + "predator": [],
|
|
| 1213 | + "catchHealthStatus": null,
|
|
| 1214 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1215 | + "weightMeasureMethod": null
|
|
| 1216 | + },
|
|
| 1217 | + {
|
|
| 1218 | + "homeId": null,
|
|
| 1219 | + "comment": "Other fish non specified",
|
|
| 1220 | + "count": 5.0,
|
|
| 1221 | + "totalWeight": 28.0,
|
|
| 1222 | + "hookWhenDiscarded": null,
|
|
| 1223 | + "depredated": null,
|
|
| 1224 | + "beatDiameter": null,
|
|
| 1225 | + "photoReferences": null,
|
|
| 1226 | + "number": null,
|
|
| 1227 | + "acquisitionMode": null,
|
|
| 1228 | + "countDepredated": null,
|
|
| 1229 | + "depredatedProportion": null,
|
|
| 1230 | + "tagNumber": null,
|
|
| 1231 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1232 | + "discardHealthStatus": null,
|
|
| 1233 | + "species": "fr.ird.referential.common.Species#1433499266610#0.696541526820511",
|
|
| 1234 | + "predator": [],
|
|
| 1235 | + "catchHealthStatus": null,
|
|
| 1236 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.1",
|
|
| 1237 | + "weightMeasureMethod": null
|
|
| 1238 | + }
|
|
| 1239 | + ],
|
|
| 1240 | + "lineType": null,
|
|
| 1241 | + "lightsticksUsed": false,
|
|
| 1242 | + "lightsticksType": null,
|
|
| 1243 | + "lightsticksColor": null,
|
|
| 1244 | + "mitigationType": [],
|
|
| 1245 | + "branchlinesComposition": []
|
|
| 1246 | + }
|
|
| 1247 | + },
|
|
| 1248 | + {
|
|
| 1249 | + "homeId": null,
|
|
| 1250 | + "comment": null,
|
|
| 1251 | + "startTimeStamp": "2023-03-25T04:00:00.000Z",
|
|
| 1252 | + "endTimeStamp": null,
|
|
| 1253 | + "latitude": -0.9166666666666666,
|
|
| 1254 | + "longitude": 47.983333333333334,
|
|
| 1255 | + "seaSurfaceTemperature": 30,
|
|
| 1256 | + "wind": null,
|
|
| 1257 | + "windDirection": null,
|
|
| 1258 | + "currentSpeed": null,
|
|
| 1259 | + "currentDirection": null,
|
|
| 1260 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 1261 | + "dataQuality": null,
|
|
| 1262 | + "fpaZone": null,
|
|
| 1263 | + "relatedObservedActivity": null,
|
|
| 1264 | + "set": {
|
|
| 1265 | + "homeId": null,
|
|
| 1266 | + "comment": null,
|
|
| 1267 | + "number": null,
|
|
| 1268 | + "basketsPerSectionCount": null,
|
|
| 1269 | + "branchlinesPerBasketCount": null,
|
|
| 1270 | + "totalSectionsCount": null,
|
|
| 1271 | + "totalBasketsCount": 175.0,
|
|
| 1272 | + "totalHooksCount": 3500,
|
|
| 1273 | + "totalLightsticksCount": null,
|
|
| 1274 | + "weightedSnap": false,
|
|
| 1275 | + "snapWeight": null,
|
|
| 1276 | + "weightedSwivel": false,
|
|
| 1277 | + "swivelWeight": null,
|
|
| 1278 | + "timeBetweenHooks": null,
|
|
| 1279 | + "shooterUsed": false,
|
|
| 1280 | + "shooterSpeed": null,
|
|
| 1281 | + "maxDepthTargeted": null,
|
|
| 1282 | + "settingStartTimeStamp": "2023-03-25T04:00:00.000Z",
|
|
| 1283 | + "settingStartLatitude": -0.9166666666666666,
|
|
| 1284 | + "settingStartLongitude": 47.983333333333334,
|
|
| 1285 | + "settingEndTimeStamp": null,
|
|
| 1286 | + "settingEndLatitude": null,
|
|
| 1287 | + "settingEndLongitude": null,
|
|
| 1288 | + "settingVesselSpeed": null,
|
|
| 1289 | + "haulingDirectionSameAsSetting": null,
|
|
| 1290 | + "haulingStartTimeStamp": null,
|
|
| 1291 | + "haulingStartLatitude": null,
|
|
| 1292 | + "haulingStartLongitude": null,
|
|
| 1293 | + "haulingEndTimeStamp": null,
|
|
| 1294 | + "haulingEndLatitude": null,
|
|
| 1295 | + "haulingEndLongitude": null,
|
|
| 1296 | + "haulingBreaks": null,
|
|
| 1297 | + "monitored": false,
|
|
| 1298 | + "totalLineLength": null,
|
|
| 1299 | + "basketLineLength": null,
|
|
| 1300 | + "lengthBetweenBranchlines": 37,
|
|
| 1301 | + "baitsComposition": [
|
|
| 1302 | + {
|
|
| 1303 | + "homeId": null,
|
|
| 1304 | + "proportion": 50.0,
|
|
| 1305 | + "individualSize": null,
|
|
| 1306 | + "individualWeight": null,
|
|
| 1307 | + "baitSettingStatus": null,
|
|
| 1308 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 1309 | + },
|
|
| 1310 | + {
|
|
| 1311 | + "homeId": null,
|
|
| 1312 | + "proportion": 50.0,
|
|
| 1313 | + "individualSize": null,
|
|
| 1314 | + "individualWeight": null,
|
|
| 1315 | + "baitSettingStatus": null,
|
|
| 1316 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 1317 | + }
|
|
| 1318 | + ],
|
|
| 1319 | + "floatlinesComposition": [
|
|
| 1320 | + {
|
|
| 1321 | + "homeId": null,
|
|
| 1322 | + "length": 30,
|
|
| 1323 | + "proportion": 100,
|
|
| 1324 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 1325 | + }
|
|
| 1326 | + ],
|
|
| 1327 | + "hooksComposition": [],
|
|
| 1328 | + "settingShape": null,
|
|
| 1329 | + "catches": [
|
|
| 1330 | + {
|
|
| 1331 | + "homeId": null,
|
|
| 1332 | + "comment": null,
|
|
| 1333 | + "count": 6.0,
|
|
| 1334 | + "totalWeight": 375.0,
|
|
| 1335 | + "hookWhenDiscarded": null,
|
|
| 1336 | + "depredated": null,
|
|
| 1337 | + "beatDiameter": null,
|
|
| 1338 | + "photoReferences": null,
|
|
| 1339 | + "number": null,
|
|
| 1340 | + "acquisitionMode": null,
|
|
| 1341 | + "countDepredated": null,
|
|
| 1342 | + "depredatedProportion": null,
|
|
| 1343 | + "tagNumber": null,
|
|
| 1344 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1345 | + "discardHealthStatus": null,
|
|
| 1346 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 1347 | + "predator": [],
|
|
| 1348 | + "catchHealthStatus": null,
|
|
| 1349 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1350 | + "weightMeasureMethod": null
|
|
| 1351 | + },
|
|
| 1352 | + {
|
|
| 1353 | + "homeId": null,
|
|
| 1354 | + "comment": null,
|
|
| 1355 | + "count": 11.0,
|
|
| 1356 | + "totalWeight": 309.0,
|
|
| 1357 | + "hookWhenDiscarded": null,
|
|
| 1358 | + "depredated": null,
|
|
| 1359 | + "beatDiameter": null,
|
|
| 1360 | + "photoReferences": null,
|
|
| 1361 | + "number": null,
|
|
| 1362 | + "acquisitionMode": null,
|
|
| 1363 | + "countDepredated": null,
|
|
| 1364 | + "depredatedProportion": null,
|
|
| 1365 | + "tagNumber": null,
|
|
| 1366 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1367 | + "discardHealthStatus": null,
|
|
| 1368 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 1369 | + "predator": [],
|
|
| 1370 | + "catchHealthStatus": null,
|
|
| 1371 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1372 | + "weightMeasureMethod": null
|
|
| 1373 | + },
|
|
| 1374 | + {
|
|
| 1375 | + "homeId": null,
|
|
| 1376 | + "comment": null,
|
|
| 1377 | + "count": 3.0,
|
|
| 1378 | + "totalWeight": 98.0,
|
|
| 1379 | + "hookWhenDiscarded": null,
|
|
| 1380 | + "depredated": null,
|
|
| 1381 | + "beatDiameter": null,
|
|
| 1382 | + "photoReferences": null,
|
|
| 1383 | + "number": null,
|
|
| 1384 | + "acquisitionMode": null,
|
|
| 1385 | + "countDepredated": null,
|
|
| 1386 | + "depredatedProportion": null,
|
|
| 1387 | + "tagNumber": null,
|
|
| 1388 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1389 | + "discardHealthStatus": null,
|
|
| 1390 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 1391 | + "predator": [],
|
|
| 1392 | + "catchHealthStatus": null,
|
|
| 1393 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1394 | + "weightMeasureMethod": null
|
|
| 1395 | + }
|
|
| 1396 | + ],
|
|
| 1397 | + "lineType": null,
|
|
| 1398 | + "lightsticksUsed": false,
|
|
| 1399 | + "lightsticksType": null,
|
|
| 1400 | + "lightsticksColor": null,
|
|
| 1401 | + "mitigationType": [],
|
|
| 1402 | + "branchlinesComposition": []
|
|
| 1403 | + }
|
|
| 1404 | + },
|
|
| 1405 | + {
|
|
| 1406 | + "homeId": null,
|
|
| 1407 | + "comment": null,
|
|
| 1408 | + "startTimeStamp": "2023-03-26T05:00:00.000Z",
|
|
| 1409 | + "endTimeStamp": null,
|
|
| 1410 | + "latitude": -1.0833333333333333,
|
|
| 1411 | + "longitude": 47.63333333333333,
|
|
| 1412 | + "seaSurfaceTemperature": 30,
|
|
| 1413 | + "wind": null,
|
|
| 1414 | + "windDirection": null,
|
|
| 1415 | + "currentSpeed": null,
|
|
| 1416 | + "currentDirection": null,
|
|
| 1417 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 1418 | + "dataQuality": null,
|
|
| 1419 | + "fpaZone": null,
|
|
| 1420 | + "relatedObservedActivity": null,
|
|
| 1421 | + "set": {
|
|
| 1422 | + "homeId": null,
|
|
| 1423 | + "comment": null,
|
|
| 1424 | + "number": null,
|
|
| 1425 | + "basketsPerSectionCount": null,
|
|
| 1426 | + "branchlinesPerBasketCount": null,
|
|
| 1427 | + "totalSectionsCount": null,
|
|
| 1428 | + "totalBasketsCount": 175.0,
|
|
| 1429 | + "totalHooksCount": 3500,
|
|
| 1430 | + "totalLightsticksCount": null,
|
|
| 1431 | + "weightedSnap": false,
|
|
| 1432 | + "snapWeight": null,
|
|
| 1433 | + "weightedSwivel": false,
|
|
| 1434 | + "swivelWeight": null,
|
|
| 1435 | + "timeBetweenHooks": null,
|
|
| 1436 | + "shooterUsed": false,
|
|
| 1437 | + "shooterSpeed": null,
|
|
| 1438 | + "maxDepthTargeted": null,
|
|
| 1439 | + "settingStartTimeStamp": "2023-03-26T05:00:00.000Z",
|
|
| 1440 | + "settingStartLatitude": -1.0833333333333333,
|
|
| 1441 | + "settingStartLongitude": 47.63333333333333,
|
|
| 1442 | + "settingEndTimeStamp": null,
|
|
| 1443 | + "settingEndLatitude": null,
|
|
| 1444 | + "settingEndLongitude": null,
|
|
| 1445 | + "settingVesselSpeed": null,
|
|
| 1446 | + "haulingDirectionSameAsSetting": null,
|
|
| 1447 | + "haulingStartTimeStamp": null,
|
|
| 1448 | + "haulingStartLatitude": null,
|
|
| 1449 | + "haulingStartLongitude": null,
|
|
| 1450 | + "haulingEndTimeStamp": null,
|
|
| 1451 | + "haulingEndLatitude": null,
|
|
| 1452 | + "haulingEndLongitude": null,
|
|
| 1453 | + "haulingBreaks": null,
|
|
| 1454 | + "monitored": false,
|
|
| 1455 | + "totalLineLength": null,
|
|
| 1456 | + "basketLineLength": null,
|
|
| 1457 | + "lengthBetweenBranchlines": 37,
|
|
| 1458 | + "baitsComposition": [
|
|
| 1459 | + {
|
|
| 1460 | + "homeId": null,
|
|
| 1461 | + "proportion": 50.0,
|
|
| 1462 | + "individualSize": null,
|
|
| 1463 | + "individualWeight": null,
|
|
| 1464 | + "baitSettingStatus": null,
|
|
| 1465 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 1466 | + },
|
|
| 1467 | + {
|
|
| 1468 | + "homeId": null,
|
|
| 1469 | + "proportion": 50.0,
|
|
| 1470 | + "individualSize": null,
|
|
| 1471 | + "individualWeight": null,
|
|
| 1472 | + "baitSettingStatus": null,
|
|
| 1473 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 1474 | + }
|
|
| 1475 | + ],
|
|
| 1476 | + "floatlinesComposition": [
|
|
| 1477 | + {
|
|
| 1478 | + "homeId": null,
|
|
| 1479 | + "length": 30,
|
|
| 1480 | + "proportion": 100,
|
|
| 1481 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 1482 | + }
|
|
| 1483 | + ],
|
|
| 1484 | + "hooksComposition": [],
|
|
| 1485 | + "settingShape": null,
|
|
| 1486 | + "catches": [
|
|
| 1487 | + {
|
|
| 1488 | + "homeId": null,
|
|
| 1489 | + "comment": null,
|
|
| 1490 | + "count": 4.0,
|
|
| 1491 | + "totalWeight": 268.0,
|
|
| 1492 | + "hookWhenDiscarded": null,
|
|
| 1493 | + "depredated": null,
|
|
| 1494 | + "beatDiameter": null,
|
|
| 1495 | + "photoReferences": null,
|
|
| 1496 | + "number": null,
|
|
| 1497 | + "acquisitionMode": null,
|
|
| 1498 | + "countDepredated": null,
|
|
| 1499 | + "depredatedProportion": null,
|
|
| 1500 | + "tagNumber": null,
|
|
| 1501 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1502 | + "discardHealthStatus": null,
|
|
| 1503 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 1504 | + "predator": [],
|
|
| 1505 | + "catchHealthStatus": null,
|
|
| 1506 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1507 | + "weightMeasureMethod": null
|
|
| 1508 | + },
|
|
| 1509 | + {
|
|
| 1510 | + "homeId": null,
|
|
| 1511 | + "comment": null,
|
|
| 1512 | + "count": 4.0,
|
|
| 1513 | + "totalWeight": 84.0,
|
|
| 1514 | + "hookWhenDiscarded": null,
|
|
| 1515 | + "depredated": null,
|
|
| 1516 | + "beatDiameter": null,
|
|
| 1517 | + "photoReferences": null,
|
|
| 1518 | + "number": null,
|
|
| 1519 | + "acquisitionMode": null,
|
|
| 1520 | + "countDepredated": null,
|
|
| 1521 | + "depredatedProportion": null,
|
|
| 1522 | + "tagNumber": null,
|
|
| 1523 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1524 | + "discardHealthStatus": null,
|
|
| 1525 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 1526 | + "predator": [],
|
|
| 1527 | + "catchHealthStatus": null,
|
|
| 1528 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1529 | + "weightMeasureMethod": null
|
|
| 1530 | + },
|
|
| 1531 | + {
|
|
| 1532 | + "homeId": null,
|
|
| 1533 | + "comment": null,
|
|
| 1534 | + "count": 3.0,
|
|
| 1535 | + "totalWeight": 78.0,
|
|
| 1536 | + "hookWhenDiscarded": null,
|
|
| 1537 | + "depredated": null,
|
|
| 1538 | + "beatDiameter": null,
|
|
| 1539 | + "photoReferences": null,
|
|
| 1540 | + "number": null,
|
|
| 1541 | + "acquisitionMode": null,
|
|
| 1542 | + "countDepredated": null,
|
|
| 1543 | + "depredatedProportion": null,
|
|
| 1544 | + "tagNumber": null,
|
|
| 1545 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1546 | + "discardHealthStatus": null,
|
|
| 1547 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 1548 | + "predator": [],
|
|
| 1549 | + "catchHealthStatus": null,
|
|
| 1550 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1551 | + "weightMeasureMethod": null
|
|
| 1552 | + }
|
|
| 1553 | + ],
|
|
| 1554 | + "lineType": null,
|
|
| 1555 | + "lightsticksUsed": false,
|
|
| 1556 | + "lightsticksType": null,
|
|
| 1557 | + "lightsticksColor": null,
|
|
| 1558 | + "mitigationType": [],
|
|
| 1559 | + "branchlinesComposition": []
|
|
| 1560 | + }
|
|
| 1561 | + },
|
|
| 1562 | + {
|
|
| 1563 | + "homeId": null,
|
|
| 1564 | + "comment": null,
|
|
| 1565 | + "startTimeStamp": "2023-03-27T11:30:00.000Z",
|
|
| 1566 | + "endTimeStamp": null,
|
|
| 1567 | + "latitude": -0.6333333333333333,
|
|
| 1568 | + "longitude": 48.03333333333333,
|
|
| 1569 | + "seaSurfaceTemperature": 30,
|
|
| 1570 | + "wind": null,
|
|
| 1571 | + "windDirection": null,
|
|
| 1572 | + "currentSpeed": null,
|
|
| 1573 | + "currentDirection": null,
|
|
| 1574 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#1239832686138#0.1",
|
|
| 1575 | + "dataQuality": null,
|
|
| 1576 | + "fpaZone": null,
|
|
| 1577 | + "relatedObservedActivity": null,
|
|
| 1578 | + "set": {
|
|
| 1579 | + "homeId": null,
|
|
| 1580 | + "comment": null,
|
|
| 1581 | + "number": null,
|
|
| 1582 | + "basketsPerSectionCount": null,
|
|
| 1583 | + "branchlinesPerBasketCount": null,
|
|
| 1584 | + "totalSectionsCount": null,
|
|
| 1585 | + "totalBasketsCount": 125.0,
|
|
| 1586 | + "totalHooksCount": 2500,
|
|
| 1587 | + "totalLightsticksCount": null,
|
|
| 1588 | + "weightedSnap": false,
|
|
| 1589 | + "snapWeight": null,
|
|
| 1590 | + "weightedSwivel": false,
|
|
| 1591 | + "swivelWeight": null,
|
|
| 1592 | + "timeBetweenHooks": null,
|
|
| 1593 | + "shooterUsed": false,
|
|
| 1594 | + "shooterSpeed": null,
|
|
| 1595 | + "maxDepthTargeted": null,
|
|
| 1596 | + "settingStartTimeStamp": "2023-03-27T11:30:00.000Z",
|
|
| 1597 | + "settingStartLatitude": -0.6333333333333333,
|
|
| 1598 | + "settingStartLongitude": 48.03333333333333,
|
|
| 1599 | + "settingEndTimeStamp": null,
|
|
| 1600 | + "settingEndLatitude": null,
|
|
| 1601 | + "settingEndLongitude": null,
|
|
| 1602 | + "settingVesselSpeed": null,
|
|
| 1603 | + "haulingDirectionSameAsSetting": null,
|
|
| 1604 | + "haulingStartTimeStamp": null,
|
|
| 1605 | + "haulingStartLatitude": null,
|
|
| 1606 | + "haulingStartLongitude": null,
|
|
| 1607 | + "haulingEndTimeStamp": null,
|
|
| 1608 | + "haulingEndLatitude": null,
|
|
| 1609 | + "haulingEndLongitude": null,
|
|
| 1610 | + "haulingBreaks": null,
|
|
| 1611 | + "monitored": false,
|
|
| 1612 | + "totalLineLength": null,
|
|
| 1613 | + "basketLineLength": null,
|
|
| 1614 | + "lengthBetweenBranchlines": 37,
|
|
| 1615 | + "baitsComposition": [
|
|
| 1616 | + {
|
|
| 1617 | + "homeId": null,
|
|
| 1618 | + "proportion": 50.0,
|
|
| 1619 | + "individualSize": null,
|
|
| 1620 | + "individualWeight": null,
|
|
| 1621 | + "baitSettingStatus": null,
|
|
| 1622 | + "baitType": "fr.ird.referential.ll.common.BaitType#1433499458077#0.820353789720684"
|
|
| 1623 | + },
|
|
| 1624 | + {
|
|
| 1625 | + "homeId": null,
|
|
| 1626 | + "proportion": 50.0,
|
|
| 1627 | + "individualSize": null,
|
|
| 1628 | + "individualWeight": null,
|
|
| 1629 | + "baitSettingStatus": null,
|
|
| 1630 | + "baitType": "fr.ird.referential.ll.common.BaitType#1239832686124#1.0"
|
|
| 1631 | + }
|
|
| 1632 | + ],
|
|
| 1633 | + "floatlinesComposition": [
|
|
| 1634 | + {
|
|
| 1635 | + "homeId": null,
|
|
| 1636 | + "length": 30,
|
|
| 1637 | + "proportion": 100,
|
|
| 1638 | + "lineType": "fr.ird.referential.ll.common.LineType#1239832686157#0.9"
|
|
| 1639 | + }
|
|
| 1640 | + ],
|
|
| 1641 | + "hooksComposition": [],
|
|
| 1642 | + "settingShape": null,
|
|
| 1643 | + "catches": [
|
|
| 1644 | + {
|
|
| 1645 | + "homeId": null,
|
|
| 1646 | + "comment": null,
|
|
| 1647 | + "count": 1.0,
|
|
| 1648 | + "totalWeight": 73.0,
|
|
| 1649 | + "hookWhenDiscarded": null,
|
|
| 1650 | + "depredated": null,
|
|
| 1651 | + "beatDiameter": null,
|
|
| 1652 | + "photoReferences": null,
|
|
| 1653 | + "number": null,
|
|
| 1654 | + "acquisitionMode": null,
|
|
| 1655 | + "countDepredated": null,
|
|
| 1656 | + "depredatedProportion": null,
|
|
| 1657 | + "tagNumber": null,
|
|
| 1658 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1659 | + "discardHealthStatus": null,
|
|
| 1660 | + "species": "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 1661 | + "predator": [],
|
|
| 1662 | + "catchHealthStatus": null,
|
|
| 1663 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1664 | + "weightMeasureMethod": null
|
|
| 1665 | + },
|
|
| 1666 | + {
|
|
| 1667 | + "homeId": null,
|
|
| 1668 | + "comment": null,
|
|
| 1669 | + "count": 4.0,
|
|
| 1670 | + "totalWeight": 73.0,
|
|
| 1671 | + "hookWhenDiscarded": null,
|
|
| 1672 | + "depredated": null,
|
|
| 1673 | + "beatDiameter": null,
|
|
| 1674 | + "photoReferences": null,
|
|
| 1675 | + "number": null,
|
|
| 1676 | + "acquisitionMode": null,
|
|
| 1677 | + "countDepredated": null,
|
|
| 1678 | + "depredatedProportion": null,
|
|
| 1679 | + "tagNumber": null,
|
|
| 1680 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1681 | + "discardHealthStatus": null,
|
|
| 1682 | + "species": "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 1683 | + "predator": [],
|
|
| 1684 | + "catchHealthStatus": null,
|
|
| 1685 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.4",
|
|
| 1686 | + "weightMeasureMethod": null
|
|
| 1687 | + },
|
|
| 1688 | + {
|
|
| 1689 | + "homeId": null,
|
|
| 1690 | + "comment": null,
|
|
| 1691 | + "count": 2.0,
|
|
| 1692 | + "totalWeight": 54.0,
|
|
| 1693 | + "hookWhenDiscarded": null,
|
|
| 1694 | + "depredated": null,
|
|
| 1695 | + "beatDiameter": null,
|
|
| 1696 | + "photoReferences": null,
|
|
| 1697 | + "number": null,
|
|
| 1698 | + "acquisitionMode": null,
|
|
| 1699 | + "countDepredated": null,
|
|
| 1700 | + "depredatedProportion": null,
|
|
| 1701 | + "tagNumber": null,
|
|
| 1702 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1703 | + "discardHealthStatus": null,
|
|
| 1704 | + "species": "fr.ird.referential.common.Species#1239832683791#0.20975568563021063",
|
|
| 1705 | + "predator": [],
|
|
| 1706 | + "catchHealthStatus": null,
|
|
| 1707 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1708 | + "weightMeasureMethod": null
|
|
| 1709 | + },
|
|
| 1710 | + {
|
|
| 1711 | + "homeId": null,
|
|
| 1712 | + "comment": null,
|
|
| 1713 | + "count": 3.0,
|
|
| 1714 | + "totalWeight": 88.0,
|
|
| 1715 | + "hookWhenDiscarded": null,
|
|
| 1716 | + "depredated": null,
|
|
| 1717 | + "beatDiameter": null,
|
|
| 1718 | + "photoReferences": null,
|
|
| 1719 | + "number": null,
|
|
| 1720 | + "acquisitionMode": null,
|
|
| 1721 | + "countDepredated": null,
|
|
| 1722 | + "depredatedProportion": null,
|
|
| 1723 | + "tagNumber": null,
|
|
| 1724 | + "catchFate": "fr.ird.referential.ll.common.CatchFate#1239832686125#0.2",
|
|
| 1725 | + "discardHealthStatus": null,
|
|
| 1726 | + "species": "fr.ird.referential.common.Species#1239832683785#0.49501050869628815",
|
|
| 1727 | + "predator": [],
|
|
| 1728 | + "catchHealthStatus": null,
|
|
| 1729 | + "onBoardProcessing": "fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.3",
|
|
| 1730 | + "weightMeasureMethod": null
|
|
| 1731 | + }
|
|
| 1732 | + ],
|
|
| 1733 | + "lineType": null,
|
|
| 1734 | + "lightsticksUsed": false,
|
|
| 1735 | + "lightsticksType": null,
|
|
| 1736 | + "lightsticksColor": null,
|
|
| 1737 | + "mitigationType": [],
|
|
| 1738 | + "branchlinesComposition": []
|
|
| 1739 | + }
|
|
| 1740 | + },
|
|
| 1741 | + {
|
|
| 1742 | + "homeId": null,
|
|
| 1743 | + "comment": null,
|
|
| 1744 | + "startTimeStamp": "2023-03-28T00:00:00.000Z",
|
|
| 1745 | + "endTimeStamp": null,
|
|
| 1746 | + "latitude": 0.18333333333333332,
|
|
| 1747 | + "longitude": 49.733333333333334,
|
|
| 1748 | + "seaSurfaceTemperature": null,
|
|
| 1749 | + "wind": null,
|
|
| 1750 | + "windDirection": null,
|
|
| 1751 | + "currentSpeed": null,
|
|
| 1752 | + "currentDirection": null,
|
|
| 1753 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 1754 | + "dataQuality": null,
|
|
| 1755 | + "fpaZone": null,
|
|
| 1756 | + "relatedObservedActivity": null,
|
|
| 1757 | + "set": null,
|
|
| 1758 | + "sample": null
|
|
| 1759 | + },
|
|
| 1760 | + {
|
|
| 1761 | + "homeId": null,
|
|
| 1762 | + "comment": null,
|
|
| 1763 | + "startTimeStamp": "2023-03-29T00:00:00.000Z",
|
|
| 1764 | + "endTimeStamp": null,
|
|
| 1765 | + "latitude": 1.6333333333333333,
|
|
| 1766 | + "longitude": 52.416666666666664,
|
|
| 1767 | + "seaSurfaceTemperature": null,
|
|
| 1768 | + "wind": null,
|
|
| 1769 | + "windDirection": null,
|
|
| 1770 | + "currentSpeed": null,
|
|
| 1771 | + "currentDirection": null,
|
|
| 1772 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 1773 | + "dataQuality": null,
|
|
| 1774 | + "fpaZone": null,
|
|
| 1775 | + "relatedObservedActivity": null,
|
|
| 1776 | + "set": null,
|
|
| 1777 | + "sample": null
|
|
| 1778 | + },
|
|
| 1779 | + {
|
|
| 1780 | + "homeId": null,
|
|
| 1781 | + "comment": null,
|
|
| 1782 | + "startTimeStamp": "2023-03-30T00:00:00.000Z",
|
|
| 1783 | + "endTimeStamp": null,
|
|
| 1784 | + "latitude": 3.4166666666666665,
|
|
| 1785 | + "longitude": 55.4,
|
|
| 1786 | + "seaSurfaceTemperature": null,
|
|
| 1787 | + "wind": null,
|
|
| 1788 | + "windDirection": null,
|
|
| 1789 | + "currentSpeed": null,
|
|
| 1790 | + "currentDirection": null,
|
|
| 1791 | + "vesselActivity": "fr.ird.referential.ll.common.VesselActivity#666#01",
|
|
| 1792 | + "dataQuality": null,
|
|
| 1793 | + "fpaZone": null,
|
|
| 1794 | + "relatedObservedActivity": null,
|
|
| 1795 | + "set": null,
|
|
| 1796 | + "sample": null
|
|
| 1797 | + }
|
|
| 1798 | + ],
|
|
| 1799 | + "landing": null,
|
|
| 1800 | + "sample": null,
|
|
| 1801 | + "tripType": "fr.ird.referential.ll.common.TripType#1464000000000#02",
|
|
| 1802 | + "observationMethod": null,
|
|
| 1803 | + "observer": "fr.ird.referential.common.Person#1254317601353#0.6617065204572095",
|
|
| 1804 | + "vessel": "fr.ird.referential.common.Vessel#1239832677756#0.4935293150142165",
|
|
| 1805 | + "observationsProgram": null,
|
|
| 1806 | + "logbookProgram": "fr.ird.referential.ll.common.Program#1239832686139#0.1",
|
|
| 1807 | + "captain": "fr.ird.referential.common.Person#1254317601353#0.6617065204572095",
|
|
| 1808 | + "observationsDataEntryOperator": null,
|
|
| 1809 | + "logbookDataEntryOperator": "fr.ird.referential.common.Person#1254317601353#0.6617065204572095",
|
|
| 1810 | + "sampleDataEntryOperator": null,
|
|
| 1811 | + "landingDataEntryOperator": null,
|
|
| 1812 | + "ocean": "fr.ird.referential.common.Ocean#1239832686152#0.8325731048817705",
|
|
| 1813 | + "departureHarbour": "fr.ird.referential.common.Harbour#11#0.42",
|
|
| 1814 | + "landingHarbour": null,
|
|
| 1815 | + "observationsDataQuality": null,
|
|
| 1816 | + "logbookDataQuality": null,
|
|
| 1817 | + "generalComment": null,
|
|
| 1818 | + "observationsComment": null,
|
|
| 1819 | + "logbookComment": null,
|
|
| 1820 | + "species": [
|
|
| 1821 | + "fr.ird.referential.common.Species#1239832685474#0.8943253454598569",
|
|
| 1822 | + "fr.ird.referential.common.Species#1239832685475#0.13349466123905152",
|
|
| 1823 | + "fr.ird.referential.common.Species#1239832685476#0.5618871286604711",
|
|
| 1824 | + "fr.ird.referential.common.Species#1239832683791#0.20975568563021063"
|
|
| 1825 | + ],
|
|
| 1826 | + "observationsAvailability": false,
|
|
| 1827 | + "logbookAvailability": true
|
|
| 1828 | +} |
|
| \ No newline at end of file |
| ... | ... | @@ -50,15 +50,15 @@ public class DecoratorProviderInitializerHelper { |
| 50 | 50 | DecoratorProvider provider,
|
| 51 | 51 | Supplier<List<DecoratorDefinition<?, ?>>> listSupplier,
|
| 52 | 52 | Supplier<Stream<? extends DataGroupByDefinition<?, ?>>> groupByDefinitionsSupplier) {
|
| 53 | - log.info(String.format("Initializing... %s", initializer));
|
|
| 53 | + log.info("Initializing... {}", initializer);
|
|
| 54 | 54 | |
| 55 | 55 | List<DecoratorDefinition<?, ?>> list = listSupplier.get();
|
| 56 | 56 | |
| 57 | 57 | int count = DecoratorProviderInitializerHelper.registerGroupByDecorators(provider, list, groupByDefinitionsSupplier.get());
|
| 58 | - log.info(String.format("Initialization done %s, register %d DataGroupByDecoratorDefinition(s).", initializer, count));
|
|
| 58 | + log.info("Initialization done {}, register {} DataGroupByDecoratorDefinition(s).", initializer, count);
|
|
| 59 | 59 | |
| 60 | 60 | int index = DecoratorProviderInitializerHelper.registerToolkitLabels(provider, initializer.codeProperties(), list);
|
| 61 | - log.info(String.format("Initialization done %s, register %d ToolkitIdLabelDecoratorDefinition(s).", initializer, index));
|
|
| 61 | + log.info("Initialization done {}, register {} ToolkitIdLabelDecoratorDefinition(s).", initializer, index);
|
|
| 62 | 62 | }
|
| 63 | 63 | |
| 64 | 64 | public static int registerGroupByDecorators(DecoratorProvider provider, List<DecoratorDefinition<?, ?>> list, Stream<? extends DataGroupByDefinition<?, ?>> defs) {
|
| ... | ... | @@ -102,11 +102,10 @@ public abstract class EditableDtoEntityContext< |
| 102 | 102 | }
|
| 103 | 103 | |
| 104 | 104 | public void loadDtoForValidation(ServiceContext context, PE parent, E entity, D dto) {
|
| 105 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 106 | 105 | }
|
| 107 | 106 | |
| 108 | 107 | @Override
|
| 109 | - public void loadDtoForValidation(ServiceContext context, E entity, D dto) {
|
|
| 108 | + public final void loadDtoForValidation(ServiceContext context, E entity, D dto) {
|
|
| 110 | 109 | PE parent = getParent(context, entity.getTopiaId());
|
| 111 | 110 | loadDtoForValidation(context, parent, entity, dto);
|
| 112 | 111 | }
|
| ... | ... | @@ -181,12 +181,12 @@ public abstract class OpenableDtoEntityContext< |
| 181 | 181 | ToolkitParentIdDtoBean parentId = getParentId(context, id);
|
| 182 | 182 | return parentSpi().loadEntity(context, parentId.getTopiaId());
|
| 183 | 183 | }
|
| 184 | + |
|
| 184 | 185 | public void loadDtoForValidation(ServiceContext context, PE parent, E entity, D dto) {
|
| 185 | - super.loadDtoForValidation(context, entity, dto);
|
|
| 186 | 186 | }
|
| 187 | 187 | |
| 188 | 188 | @Override
|
| 189 | - public void loadDtoForValidation(ServiceContext context, E entity, D dto) {
|
|
| 189 | + public final void loadDtoForValidation(ServiceContext context, E entity, D dto) {
|
|
| 190 | 190 | PE parent = getParent(context, entity.getTopiaId());
|
| 191 | 191 | loadDtoForValidation(context, parent, entity, dto);
|
| 192 | 192 | }
|
| ... | ... | @@ -23,15 +23,11 @@ package fr.ird.observe.spi.validation; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import fr.ird.observe.dto.BusinessDto;
|
| 26 | -import fr.ird.observe.dto.data.EditableDto;
|
|
| 27 | -import fr.ird.observe.dto.data.OpenableDto;
|
|
| 28 | 26 | import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 29 | 27 | import fr.ird.observe.entities.Entity;
|
| 30 | -import fr.ird.observe.entities.data.DataEntity;
|
|
| 31 | 28 | import fr.ird.observe.spi.context.DtoEntityContext;
|
| 32 | -import fr.ird.observe.spi.context.EditableDtoEntityContext;
|
|
| 33 | -import fr.ird.observe.spi.context.OpenableDtoEntityContext;
|
|
| 34 | 29 | import fr.ird.observe.spi.service.ServiceContext;
|
| 30 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 35 | 31 | import fr.ird.observe.validation.ValidationContextSupport;
|
| 36 | 32 | import fr.ird.observe.validation.api.result.ValidationResultDtoMessage;
|
| 37 | 33 | import io.ultreia.java4all.decoration.Decorator;
|
| ... | ... | @@ -40,7 +36,6 @@ import org.nuiton.validator.bean.simple.SimpleBeanValidatorListener; |
| 40 | 36 | |
| 41 | 37 | import java.util.Deque;
|
| 42 | 38 | import java.util.LinkedList;
|
| 43 | -import java.util.List;
|
|
| 44 | 39 | import java.util.Objects;
|
| 45 | 40 | import java.util.TreeMap;
|
| 46 | 41 | import java.util.function.Consumer;
|
| ... | ... | @@ -50,24 +45,27 @@ import java.util.function.Consumer; |
| 50 | 45 | *
|
| 51 | 46 | * @author Tony Chemit - dev@tchemit.fr
|
| 52 | 47 | */
|
| 53 | -public class EntityInterceptor<D extends BusinessDto, E extends Entity> {
|
|
| 54 | - private final DtoEntityContext<D, ?, E, ?> spi;
|
|
| 48 | +public class EntityInterceptor<D extends BusinessDto, E extends Entity, S extends DtoEntityContext<D, ?, E, ?>> {
|
|
| 49 | + private final S spi;
|
|
| 55 | 50 | private final Consumer<String> dataContextConsumer;
|
| 56 | 51 | private final SimpleBeanValidator<D> validator;
|
| 57 | 52 | private final TreeMap<String, D> cache;
|
| 58 | 53 | private final ReferentialLocale referentialLocale;
|
| 59 | 54 | private final Decorator decorator;
|
| 55 | + private final EntityInterceptorCallback<D, E, S> callback;
|
|
| 60 | 56 | |
| 61 | - EntityInterceptor(DtoEntityContext<D, ?, E, ?> spi,
|
|
| 57 | + EntityInterceptor(S spi,
|
|
| 62 | 58 | Consumer<String> dataContextConsumer,
|
| 63 | 59 | SimpleBeanValidator<D> validator,
|
| 64 | 60 | ReferentialLocale referentialLocale,
|
| 65 | - Decorator decorator) {
|
|
| 61 | + Decorator decorator,
|
|
| 62 | + EntityInterceptorCallback<D, E, S> callback) {
|
|
| 66 | 63 | this.spi = spi;
|
| 67 | 64 | this.dataContextConsumer = dataContextConsumer;
|
| 68 | 65 | this.validator = validator;
|
| 69 | 66 | this.referentialLocale = referentialLocale;
|
| 70 | 67 | this.decorator = decorator;
|
| 68 | + this.callback = Objects.requireNonNull(callback);
|
|
| 71 | 69 | this.cache = new TreeMap<>();
|
| 72 | 70 | }
|
| 73 | 71 | |
| ... | ... | @@ -77,17 +75,7 @@ public class EntityInterceptor<D extends BusinessDto, E extends Entity> { |
| 77 | 75 | if (validator != null) {
|
| 78 | 76 | D dto = cache.computeIfAbsent(e.getTopiaId(), id -> {
|
| 79 | 77 | D result = spi.toDto(referentialLocale, e);
|
| 80 | - if (result instanceof EditableDto) {
|
|
| 81 | - @SuppressWarnings("rawtypes") EditableDtoEntityContext spi1 = (EditableDtoEntityContext) spi;
|
|
| 82 | - Entity parent = getParent(path, e, spi1.parentSpi().toEntityType());
|
|
| 83 | - spi1.loadDtoForValidation(context, parent, (DataEntity) e, (EditableDto) result);
|
|
| 84 | - } else if (result instanceof OpenableDto) {
|
|
| 85 | - @SuppressWarnings("rawtypes") OpenableDtoEntityContext spi1 = (OpenableDtoEntityContext) spi;
|
|
| 86 | - Entity parent = getParent(path, e, spi1.parentSpi().toEntityType());
|
|
| 87 | - spi1.loadDtoForValidation(context, parent, (DataEntity) e, (OpenableDto) result);
|
|
| 88 | - } else {
|
|
| 89 | - spi.loadDtoForValidation(context, e, result);
|
|
| 90 | - }
|
|
| 78 | + callback.loadDtoForValidation(context, path, spi, e, result);
|
|
| 91 | 79 | return result;
|
| 92 | 80 | });
|
| 93 | 81 | if (dataContextConsumer != null) {
|
| ... | ... | @@ -99,16 +87,6 @@ public class EntityInterceptor<D extends BusinessDto, E extends Entity> { |
| 99 | 87 | return null;
|
| 100 | 88 | }
|
| 101 | 89 | |
| 102 | - private Entity getParent(Deque<Entity> path, E e, Class<? extends DataEntity> parentType) {
|
|
| 103 | - List<Entity> copy = List.copyOf(path);
|
|
| 104 | - int parentPosition = copy.indexOf(e) - 1;
|
|
| 105 | - Entity parent = copy.get(parentPosition);
|
|
| 106 | - while (!parentType.isAssignableFrom(parent.getClass())) {
|
|
| 107 | - parent = copy.get(--parentPosition);
|
|
| 108 | - }
|
|
| 109 | - return Objects.requireNonNull(parent);
|
|
| 110 | - }
|
|
| 111 | - |
|
| 112 | 90 | void release(ValidationContextSupport validationContext, String id) {
|
| 113 | 91 | if (dataContextConsumer != null) {
|
| 114 | 92 | dataContextConsumer.accept(null);
|
| ... | ... | @@ -27,13 +27,16 @@ import fr.ird.observe.dto.data.DataDto; |
| 27 | 27 | import fr.ird.observe.dto.data.NotEntityDto;
|
| 28 | 28 | import fr.ird.observe.dto.referential.ReferentialDto;
|
| 29 | 29 | import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 30 | -import fr.ird.observe.entities.Entity;
|
|
| 30 | +import fr.ird.observe.entities.data.DataEntity;
|
|
| 31 | +import fr.ird.observe.entities.referential.ReferentialEntity;
|
|
| 31 | 32 | import fr.ird.observe.navigation.id.IdModel;
|
| 32 | 33 | import fr.ird.observe.navigation.id.IdNode;
|
| 33 | 34 | import fr.ird.observe.navigation.id.IdProject;
|
| 34 | 35 | import fr.ird.observe.spi.PersistenceBusinessProject;
|
| 35 | 36 | import fr.ird.observe.spi.context.DataDtoEntityContext;
|
| 36 | 37 | import fr.ird.observe.spi.context.ReferentialDtoEntityContext;
|
| 38 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallback;
|
|
| 39 | +import fr.ird.observe.spi.validation.callback.EntityInterceptorCallbacks;
|
|
| 37 | 40 | import fr.ird.observe.validation.ValidationContextSupport;
|
| 38 | 41 | import fr.ird.observe.validation.ValidatorsMap;
|
| 39 | 42 | import io.ultreia.java4all.decoration.Decorator;
|
| ... | ... | @@ -57,10 +60,12 @@ import java.util.Set; |
| 57 | 60 | public class EntityInterceptors {
|
| 58 | 61 | private static final Logger log = LogManager.getLogger(EntityInterceptors.class);
|
| 59 | 62 | |
| 60 | - public static Map<Class<?>, EntityInterceptor<?, ?>> forReferential(ValidatorsMap validators,
|
|
| 61 | - ValidationContextSupport validationDataContext,
|
|
| 62 | - ReferentialLocale referentialLocale) {
|
|
| 63 | - Map<Class<?>, EntityInterceptor<?, ?>> result = new LinkedHashMap<>();
|
|
| 63 | + private static final EntityInterceptorCallbacks CALLBACKS = new EntityInterceptorCallbacks();
|
|
| 64 | + |
|
| 65 | + public static Map<Class<?>, EntityInterceptor<?, ?, ?>> forReferential(ValidatorsMap validators,
|
|
| 66 | + ValidationContextSupport validationDataContext,
|
|
| 67 | + ReferentialLocale referentialLocale) {
|
|
| 68 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> result = new LinkedHashMap<>();
|
|
| 64 | 69 | Set<Class<?>> possibleTypes = new LinkedHashSet<>(validators.keySet());
|
| 65 | 70 | possibleTypes.removeIf(t -> NotEntityDto.class.isAssignableFrom(t) || DataDto.class.isAssignableFrom(t));
|
| 66 | 71 | DecoratorService decoratorService = validationDataContext.getDecoratorService();
|
| ... | ... | @@ -70,12 +75,12 @@ public class EntityInterceptors { |
| 70 | 75 | return result;
|
| 71 | 76 | }
|
| 72 | 77 | |
| 73 | - public static Map<Class<?>, EntityInterceptor<?, ?>> forData(ValidatorsMap validators,
|
|
| 74 | - ValidationContextSupport validationDataContext,
|
|
| 75 | - IdProject dataContext,
|
|
| 76 | - ReferentialLocale referentialLocale) {
|
|
| 78 | + public static Map<Class<?>, EntityInterceptor<?, ?, ?>> forData(ValidatorsMap validators,
|
|
| 79 | + ValidationContextSupport validationDataContext,
|
|
| 80 | + IdProject dataContext,
|
|
| 81 | + ReferentialLocale referentialLocale) {
|
|
| 77 | 82 | |
| 78 | - Map<Class<?>, EntityInterceptor<?, ?>> result = new LinkedHashMap<>();
|
|
| 83 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> result = new LinkedHashMap<>();
|
|
| 79 | 84 | |
| 80 | 85 | Set<Class<?>> possibleTypes = new LinkedHashSet<>(validators.keySet());
|
| 81 | 86 | possibleTypes.removeIf(t -> NotEntityDto.class.isAssignableFrom(t) || ReferentialDto.class.isAssignableFrom(t));
|
| ... | ... | @@ -114,43 +119,45 @@ public class EntityInterceptors { |
| 114 | 119 | }
|
| 115 | 120 | |
| 116 | 121 | static <D extends ReferentialDto> void toReferential(Class<D> dtoType,
|
| 117 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptorsBuilder,
|
|
| 122 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptorsBuilder,
|
|
| 118 | 123 | ValidatorsMap validators,
|
| 119 | 124 | ReferentialLocale referentialLocale,
|
| 120 | 125 | DecoratorService decoratorService) {
|
| 121 | 126 | SimpleBeanValidator<D> validator = validators.getValidator(dtoType);
|
| 122 | - ReferentialDtoEntityContext<D, ?, ?, ?> spi = PersistenceBusinessProject.fromReferentialDto(dtoType);
|
|
| 123 | - Class<? extends Entity> entityType = spi.toEntityType();
|
|
| 127 | + ReferentialDtoEntityContext<D, ?, ReferentialEntity, ?> spi = PersistenceBusinessProject.fromReferentialDto(dtoType);
|
|
| 128 | + Class<ReferentialEntity> entityType = spi.toEntityType();
|
|
| 124 | 129 | Decorator decorator = decoratorService.getDecoratorByType(entityType);
|
| 125 | - EntityInterceptor<D, ?> interceptor = new EntityInterceptor<>(spi, null, validator, referentialLocale, decorator);
|
|
| 130 | + EntityInterceptorCallback<D, ReferentialEntity, ReferentialDtoEntityContext<D, ?, ReferentialEntity, ?>> callback = CALLBACKS.getCallback(dtoType, entityType);
|
|
| 131 | + EntityInterceptor<D, ?, ?> interceptor = new EntityInterceptor<>(spi, null, validator, referentialLocale, decorator, callback);
|
|
| 126 | 132 | interceptorsBuilder.put(entityType, interceptor);
|
| 127 | 133 | }
|
| 128 | 134 | |
| 129 | - static <D extends DataDto> void toData(Class<D> dtoType,
|
|
| 130 | - IdNode<D> consumer,
|
|
| 131 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptorsBuilder,
|
|
| 132 | - ValidatorsMap validators,
|
|
| 133 | - ReferentialLocale referentialLocale,
|
|
| 134 | - DecoratorService decoratorService) {
|
|
| 135 | + static <D extends DataDto, E extends DataEntity> void toData(Class<D> dtoType,
|
|
| 136 | + IdNode<D> consumer,
|
|
| 137 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptorsBuilder,
|
|
| 138 | + ValidatorsMap validators,
|
|
| 139 | + ReferentialLocale referentialLocale,
|
|
| 140 | + DecoratorService decoratorService) {
|
|
| 135 | 141 | SimpleBeanValidator<D> validator = validators.getValidator(dtoType);
|
| 136 | 142 | if (validator == null) {
|
| 137 | 143 | log.warn(String.format("Not a main type (%s), skip it", dtoType));
|
| 138 | 144 | return;
|
| 139 | 145 | }
|
| 140 | 146 | |
| 141 | - DataDtoEntityContext<D, ?, ?, ?> spi = PersistenceBusinessProject.fromDataDto(dtoType);
|
|
| 142 | - Class<?> entityType = spi.toEntityType();
|
|
| 147 | + DataDtoEntityContext<D, ?, E, ?> spi = PersistenceBusinessProject.fromDataDto(dtoType);
|
|
| 148 | + Class<E> entityType = spi.toEntityType();
|
|
| 143 | 149 | Objects.requireNonNull(entityType);
|
| 144 | 150 | if (interceptorsBuilder.containsKey(entityType)) {
|
| 145 | 151 | return;
|
| 146 | 152 | }
|
| 147 | 153 | Decorator decorator = decoratorService.getDecoratorByType(entityType);
|
| 148 | - EntityInterceptor<D, ?> interceptor = new EntityInterceptor<>(spi, consumer == null ? null : consumer::setId, validator, referentialLocale, decorator);
|
|
| 154 | + EntityInterceptorCallback<D, E, DataDtoEntityContext<D, ?, E, ?>> callback = CALLBACKS.getCallback(dtoType, entityType);
|
|
| 155 | + EntityInterceptor<D, E, DataDtoEntityContext<D, ?, E, ?>> interceptor = new EntityInterceptor<>(spi, consumer == null ? null : consumer::setId, validator, referentialLocale, decorator, callback);
|
|
| 149 | 156 | interceptorsBuilder.put(entityType, interceptor);
|
| 150 | 157 | }
|
| 151 | 158 | |
| 152 | 159 | static <D extends DataDto> void toData(IdNode<D> consumer,
|
| 153 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptorsBuilder,
|
|
| 160 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptorsBuilder,
|
|
| 154 | 161 | ValidatorsMap validators,
|
| 155 | 162 | ReferentialLocale referentialLocale,
|
| 156 | 163 | DecoratorService decoratorService) {
|
| ... | ... | @@ -58,11 +58,74 @@ public class ValidationMessageDetector { |
| 58 | 58 | |
| 59 | 59 | private final ValidationEntityVisitor entityVisitor;
|
| 60 | 60 | |
| 61 | + private ValidationMessageDetector(ServiceContext context,
|
|
| 62 | + ReferentialLocale referentialLocale,
|
|
| 63 | + ValidationContextSupport validationDataContext,
|
|
| 64 | + ValidationResultBuilder resultBuilder,
|
|
| 65 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptors,
|
|
| 66 | + boolean canWalkInSubclasses) {
|
|
| 67 | + this.entityVisitor = new ValidationEntityVisitor(context,
|
|
| 68 | + validationDataContext,
|
|
| 69 | + interceptors,
|
|
| 70 | + resultBuilder,
|
|
| 71 | + new MessagesCollector(referentialLocale.getLocale()),
|
|
| 72 | + canWalkInSubclasses);
|
|
| 73 | + }
|
|
| 74 | + |
|
| 75 | + public static ValidationMessageDetector forData(ServiceContext context,
|
|
| 76 | + ValidatorsMap validators,
|
|
| 77 | + ValidationContextSupport validationDataContext,
|
|
| 78 | + IdProject selectModel,
|
|
| 79 | + ReferentialLocale referentialLocale,
|
|
| 80 | + ValidationResultBuilder resultBuilder) {
|
|
| 81 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptors = EntityInterceptors.forData(validators,
|
|
| 82 | + validationDataContext,
|
|
| 83 | + selectModel,
|
|
| 84 | + referentialLocale);
|
|
| 85 | + return new ValidationMessageDetector(context,
|
|
| 86 | + referentialLocale,
|
|
| 87 | + validationDataContext,
|
|
| 88 | + resultBuilder,
|
|
| 89 | + interceptors,
|
|
| 90 | + true);
|
|
| 91 | + }
|
|
| 92 | + |
|
| 93 | + public static ValidationMessageDetector forReferential(ServiceContext context,
|
|
| 94 | + ValidatorsMap validators,
|
|
| 95 | + ValidationContextSupport validationDataContext,
|
|
| 96 | + ReferentialLocale referentialLocale,
|
|
| 97 | + ValidationResultBuilder resultBuilder) {
|
|
| 98 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptors = EntityInterceptors.forReferential(validators,
|
|
| 99 | + validationDataContext,
|
|
| 100 | + referentialLocale);
|
|
| 101 | + return new ValidationMessageDetector(context,
|
|
| 102 | + referentialLocale,
|
|
| 103 | + validationDataContext,
|
|
| 104 | + resultBuilder,
|
|
| 105 | + interceptors,
|
|
| 106 | + false);
|
|
| 107 | + }
|
|
| 108 | + |
|
| 109 | + public <E extends Entity> void detectValidationMessages(E entity) {
|
|
| 110 | + try {
|
|
| 111 | + entity.accept(entityVisitor);
|
|
| 112 | + } finally {
|
|
| 113 | + entityVisitor.clear();
|
|
| 114 | + }
|
|
| 115 | + }
|
|
| 116 | + |
|
| 117 | + public <E extends Entity> void detectValidationMessages(Iterable<E> entities) {
|
|
| 118 | + for (E entity : entities) {
|
|
| 119 | + entity.accept(entityVisitor);
|
|
| 120 | + }
|
|
| 121 | + entityVisitor.clear();
|
|
| 122 | + }
|
|
| 123 | + |
|
| 61 | 124 | private static class ValidationEntityVisitor implements TopiaEntityVisitor {
|
| 62 | 125 | |
| 63 | 126 | private final ServiceContext context;
|
| 64 | 127 | private final ValidationContextSupport validationDataContext;
|
| 65 | - private final Map<Class<?>, EntityInterceptor<?, ?>> interceptors;
|
|
| 128 | + private final Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptors;
|
|
| 66 | 129 | private final Deque<Entity> path;
|
| 67 | 130 | private final Set<TopiaEntity> explored;
|
| 68 | 131 | private final ValidationResultBuilder resultBuilder;
|
| ... | ... | @@ -72,7 +135,7 @@ public class ValidationMessageDetector { |
| 72 | 135 | |
| 73 | 136 | ValidationEntityVisitor(ServiceContext context,
|
| 74 | 137 | ValidationContextSupport validationDataContext,
|
| 75 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptors,
|
|
| 138 | + Map<Class<?>, EntityInterceptor<?, ?, ?>> interceptors,
|
|
| 76 | 139 | ValidationResultBuilder resultBuilder,
|
| 77 | 140 | MessagesCollector messagesCollector, boolean canWalkInSubclasses) {
|
| 78 | 141 | this.context = context;
|
| ... | ... | @@ -140,16 +203,16 @@ public class ValidationMessageDetector { |
| 140 | 203 | }
|
| 141 | 204 | |
| 142 | 205 | private <D extends BusinessDto, E extends Entity> void start0(E e) {
|
| 143 | - EntityInterceptor<D, E> interceptor = getInterceptor(e);
|
|
| 206 | + EntityInterceptor<D, E, ?> interceptor = getInterceptor(e);
|
|
| 144 | 207 | if (interceptor == null) {
|
| 145 | 208 | return;
|
| 146 | 209 | }
|
| 147 | - LinkedList<ValidationResultDtoMessage> messages = interceptor.intercept(context,messagesCollector, validationDataContext, path, e);
|
|
| 210 | + LinkedList<ValidationResultDtoMessage> messages = interceptor.intercept(context, messagesCollector, validationDataContext, path, e);
|
|
| 148 | 211 | resultBuilder.addMessages(getPath(), messages);
|
| 149 | 212 | }
|
| 150 | 213 | |
| 151 | 214 | private <D extends BusinessDto, E extends Entity> void end0(E e) {
|
| 152 | - EntityInterceptor<D, E> interceptor = getInterceptor(e);
|
|
| 215 | + EntityInterceptor<D, E, ?> interceptor = getInterceptor(e);
|
|
| 153 | 216 | if (interceptor == null) {
|
| 154 | 217 | return;
|
| 155 | 218 | }
|
| ... | ... | @@ -176,74 +239,11 @@ public class ValidationMessageDetector { |
| 176 | 239 | }
|
| 177 | 240 | }
|
| 178 | 241 | |
| 179 | - public <D extends BusinessDto, E extends Entity> EntityInterceptor<D, E> getInterceptor(E e) {
|
|
| 180 | - @SuppressWarnings("unchecked") EntityInterceptor<D, E> interceptor = (EntityInterceptor<D, E>) interceptors.get(e.contractType());
|
|
| 242 | + public <D extends BusinessDto, E extends Entity> EntityInterceptor<D, E, ?> getInterceptor(E e) {
|
|
| 243 | + @SuppressWarnings("unchecked") EntityInterceptor<D, E, ?> interceptor = (EntityInterceptor<D, E, ?>) interceptors.get(e.contractType());
|
|
| 181 | 244 | return interceptor;
|
| 182 | 245 | }
|
| 183 | 246 | }
|
| 184 | - |
|
| 185 | - public static ValidationMessageDetector forData(ServiceContext context,
|
|
| 186 | - ValidatorsMap validators,
|
|
| 187 | - ValidationContextSupport validationDataContext,
|
|
| 188 | - IdProject selectModel,
|
|
| 189 | - ReferentialLocale referentialLocale,
|
|
| 190 | - ValidationResultBuilder resultBuilder) {
|
|
| 191 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptors = EntityInterceptors.forData(validators,
|
|
| 192 | - validationDataContext,
|
|
| 193 | - selectModel,
|
|
| 194 | - referentialLocale);
|
|
| 195 | - return new ValidationMessageDetector(context,
|
|
| 196 | - referentialLocale,
|
|
| 197 | - validationDataContext,
|
|
| 198 | - resultBuilder,
|
|
| 199 | - interceptors,
|
|
| 200 | - true);
|
|
| 201 | - }
|
|
| 202 | - |
|
| 203 | - public static ValidationMessageDetector forReferential(ServiceContext context,
|
|
| 204 | - ValidatorsMap validators,
|
|
| 205 | - ValidationContextSupport validationDataContext,
|
|
| 206 | - ReferentialLocale referentialLocale,
|
|
| 207 | - ValidationResultBuilder resultBuilder) {
|
|
| 208 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptors = EntityInterceptors.forReferential(validators,
|
|
| 209 | - validationDataContext,
|
|
| 210 | - referentialLocale);
|
|
| 211 | - return new ValidationMessageDetector(context,
|
|
| 212 | - referentialLocale,
|
|
| 213 | - validationDataContext,
|
|
| 214 | - resultBuilder,
|
|
| 215 | - interceptors,
|
|
| 216 | - false);
|
|
| 217 | - }
|
|
| 218 | - |
|
| 219 | - private ValidationMessageDetector(ServiceContext context,
|
|
| 220 | - ReferentialLocale referentialLocale,
|
|
| 221 | - ValidationContextSupport validationDataContext,
|
|
| 222 | - ValidationResultBuilder resultBuilder,
|
|
| 223 | - Map<Class<?>, EntityInterceptor<?, ?>> interceptors,
|
|
| 224 | - boolean canWalkInSubclasses) {
|
|
| 225 | - this.entityVisitor = new ValidationEntityVisitor(context,
|
|
| 226 | - validationDataContext,
|
|
| 227 | - interceptors,
|
|
| 228 | - resultBuilder,
|
|
| 229 | - new MessagesCollector(referentialLocale.getLocale()),
|
|
| 230 | - canWalkInSubclasses);
|
|
| 231 | - }
|
|
| 232 | - |
|
| 233 | - public <E extends Entity> void detectValidationMessages(E entity) {
|
|
| 234 | - try {
|
|
| 235 | - entity.accept(entityVisitor);
|
|
| 236 | - } finally {
|
|
| 237 | - entityVisitor.clear();
|
|
| 238 | - }
|
|
| 239 | - }
|
|
| 240 | - |
|
| 241 | - public <E extends Entity> void detectValidationMessages(Iterable<E> entities) {
|
|
| 242 | - for (E entity : entities) {
|
|
| 243 | - entity.accept(entityVisitor);
|
|
| 244 | - }
|
|
| 245 | - entityVisitor.clear();
|
|
| 246 | - }
|
|
| 247 | 247 | }
|
| 248 | 248 | |
| 249 | 249 |
| 1 | +package fr.ird.observe.spi.validation.callback;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Toolkit :: Persistence
|
|
| 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 | +import fr.ird.observe.entities.Entity;
|
|
| 27 | +import fr.ird.observe.spi.context.DtoEntityContext;
|
|
| 28 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 29 | + |
|
| 30 | +import java.util.Deque;
|
|
| 31 | + |
|
| 32 | +/**
|
|
| 33 | + * Created at 21/05/2024.
|
|
| 34 | + *
|
|
| 35 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 36 | + * @since 9.3.4
|
|
| 37 | + */
|
|
| 38 | +public class DefaultEntityInterceptorCallback<D extends BusinessDto, E extends Entity, S extends DtoEntityContext<D, ?, E, ?>> implements EntityInterceptorCallback<D, E, S> {
|
|
| 39 | + @Override
|
|
| 40 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 41 | + return true;
|
|
| 42 | + }
|
|
| 43 | + |
|
| 44 | + @Override
|
|
| 45 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, S spi, E e, D dto) {
|
|
| 46 | + spi.loadDtoForValidation(context, e, dto);
|
|
| 47 | + }
|
|
| 48 | +} |
| 1 | +package fr.ird.observe.spi.validation.callback;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Toolkit :: Persistence
|
|
| 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 | +import fr.ird.observe.dto.data.EditableDto;
|
|
| 27 | +import fr.ird.observe.entities.Entity;
|
|
| 28 | +import fr.ird.observe.entities.data.DataEntity;
|
|
| 29 | +import fr.ird.observe.spi.context.EditableDtoEntityContext;
|
|
| 30 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 31 | + |
|
| 32 | +import java.util.Deque;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * Created at 21/05/2024.
|
|
| 36 | + *
|
|
| 37 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 38 | + * @since 9.3.4
|
|
| 39 | + */
|
|
| 40 | +public class EdiableEntityInterceptorCallback<D extends EditableDto, E extends DataEntity, S extends EditableDtoEntityContext<Entity, D, ?, E, ?>> implements EntityInterceptorCallback<D, E, S> {
|
|
| 41 | + @Override
|
|
| 42 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 43 | + return EditableDto.class.isAssignableFrom(dtoType);
|
|
| 44 | + }
|
|
| 45 | + |
|
| 46 | + @Override
|
|
| 47 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, S spi, E e, D dto) {
|
|
| 48 | + Entity parent = EntityInterceptorCallback.getParent(path, e, spi.parentSpi().toEntityType());
|
|
| 49 | + spi.loadDtoForValidation(context, parent, e, dto);
|
|
| 50 | + }
|
|
| 51 | +} |
| 1 | +package fr.ird.observe.spi.validation.callback;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Toolkit :: Persistence
|
|
| 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 | +import fr.ird.observe.entities.Entity;
|
|
| 27 | +import fr.ird.observe.spi.context.DtoEntityContext;
|
|
| 28 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 29 | + |
|
| 30 | +import java.util.Deque;
|
|
| 31 | +import java.util.List;
|
|
| 32 | +import java.util.Objects;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * To perform extra actions on interception.
|
|
| 36 | + * <p>
|
|
| 37 | + * Created at 21/05/2024.
|
|
| 38 | + *
|
|
| 39 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 40 | + * @see fr.ird.observe.spi.validation.EntityInterceptor
|
|
| 41 | + * @since 9.3.4
|
|
| 42 | + */
|
|
| 43 | +public interface EntityInterceptorCallback<D extends BusinessDto, E extends Entity, S extends DtoEntityContext<D, ?, E, ?>> {
|
|
| 44 | + |
|
| 45 | + static <E extends Entity, P extends Entity> P getParent(Deque<Entity> path, E e, Class<P> parentType) {
|
|
| 46 | + List<Entity> copy = List.copyOf(path);
|
|
| 47 | + int parentPosition = copy.indexOf(e) - 1;
|
|
| 48 | + Entity parent = copy.get(parentPosition);
|
|
| 49 | + while (!parentType.isAssignableFrom(parent.contractType())) {
|
|
| 50 | + parent = copy.get(--parentPosition);
|
|
| 51 | + }
|
|
| 52 | + return parentType.cast(Objects.requireNonNull(parent, String.format("Could not find parent of type: %s for entity: %s on path: %s", parentType.getName(), e, path)));
|
|
| 53 | + }
|
|
| 54 | + |
|
| 55 | + boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType);
|
|
| 56 | + |
|
| 57 | + void loadDtoForValidation(ServiceContext context, Deque<Entity> path, S spi, E e, D dto);
|
|
| 58 | +} |
| 1 | +package fr.ird.observe.spi.validation.callback;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Toolkit :: Persistence
|
|
| 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 | +import fr.ird.observe.entities.Entity;
|
|
| 27 | +import fr.ird.observe.spi.context.DtoEntityContext;
|
|
| 28 | +import org.apache.logging.log4j.LogManager;
|
|
| 29 | +import org.apache.logging.log4j.Logger;
|
|
| 30 | + |
|
| 31 | +import java.util.LinkedList;
|
|
| 32 | +import java.util.List;
|
|
| 33 | +import java.util.ServiceLoader;
|
|
| 34 | + |
|
| 35 | +/**
|
|
| 36 | + * Created at 21/05/2024.
|
|
| 37 | + *
|
|
| 38 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 39 | + * @since 9.4.0
|
|
| 40 | + */
|
|
| 41 | +public final class EntityInterceptorCallbacks {
|
|
| 42 | + private static final Logger log = LogManager.getLogger(EntityInterceptorCallbacks.class);
|
|
| 43 | + |
|
| 44 | + private final List<EntityInterceptorCallback<?, ?, ?>> callbacks;
|
|
| 45 | + |
|
| 46 | + public EntityInterceptorCallbacks() {
|
|
| 47 | + log.info("Initializing... {}", this);
|
|
| 48 | + callbacks = new LinkedList<>();
|
|
| 49 | + for (EntityInterceptorCallback<?, ?, ?> entityInterceptorCallback : ServiceLoader.load(EntityInterceptorCallback.class)) {
|
|
| 50 | + callbacks.add(entityInterceptorCallback);
|
|
| 51 | + }
|
|
| 52 | + callbacks.add(new OpenableEntityInterceptorCallback<>());
|
|
| 53 | + callbacks.add(new EdiableEntityInterceptorCallback<>());
|
|
| 54 | + callbacks.add(new DefaultEntityInterceptorCallback<>());
|
|
| 55 | + log.info("Initialization done {}, register {} EntityInterceptorCallback(s).", this, callbacks.size());
|
|
| 56 | + }
|
|
| 57 | + |
|
| 58 | + @SuppressWarnings("unchecked")
|
|
| 59 | + public <D extends BusinessDto, E extends Entity, S extends DtoEntityContext<D, ?, E, ?>> EntityInterceptorCallback<D, E, S> getCallback(Class<D> dtoType, Class<E> entityType) {
|
|
| 60 | + return (EntityInterceptorCallback<D, E, S>) callbacks.stream().filter(entityInterceptorCallback -> entityInterceptorCallback.acceptType(dtoType, entityType)).findFirst().orElseThrow(() -> new IllegalStateException(String.format("Can't find callback for dto type: %s and entity type: %s", dtoType, entityType)));
|
|
| 61 | + }
|
|
| 62 | +} |
| 1 | +package fr.ird.observe.spi.validation.callback;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Toolkit :: Persistence
|
|
| 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 | +import fr.ird.observe.dto.data.OpenableDto;
|
|
| 27 | +import fr.ird.observe.entities.Entity;
|
|
| 28 | +import fr.ird.observe.entities.data.DataEntity;
|
|
| 29 | +import fr.ird.observe.spi.context.OpenableDtoEntityContext;
|
|
| 30 | +import fr.ird.observe.spi.service.ServiceContext;
|
|
| 31 | + |
|
| 32 | +import java.util.Deque;
|
|
| 33 | + |
|
| 34 | +/**
|
|
| 35 | + * Created at 21/05/2024.
|
|
| 36 | + *
|
|
| 37 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 38 | + * @since 9.3.4
|
|
| 39 | + */
|
|
| 40 | +public class OpenableEntityInterceptorCallback<D extends OpenableDto, E extends DataEntity, S extends OpenableDtoEntityContext<Entity, D, ?, E, ?>> implements EntityInterceptorCallback<D, E, S> {
|
|
| 41 | + @Override
|
|
| 42 | + public boolean acceptType(Class<? extends BusinessDto> dtoType, Class<? extends Entity> entityType) {
|
|
| 43 | + return OpenableDto.class.isAssignableFrom(dtoType);
|
|
| 44 | + }
|
|
| 45 | + |
|
| 46 | + @Override
|
|
| 47 | + public void loadDtoForValidation(ServiceContext context, Deque<Entity> path, S spi, E e, D dto) {
|
|
| 48 | + Entity parent = EntityInterceptorCallback.getParent(path, e, spi.parentSpi().toEntityType());
|
|
| 49 | + spi.loadDtoForValidation(context, parent, e, dto);
|
|
| 50 | + }
|
|
| 51 | +} |