Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
68981f33
by Tony CHEMIT at 2018-07-11T11:59:50Z
12 changed files:
- client/src/main/java/fr/ird/observe/client/ui/actions/content/LonglineDetailCompositionDeleteAllSectionsAction.java
- client/src/main/java/fr/ird/observe/client/ui/actions/content/LonglineDetailCompositionGenerateAllSectionsAction.java
- dto/src/main/java/fr/ird/observe/dto/referential/LengthLengthParameterDto.java
- dto/src/main/java/fr/ird/observe/dto/referential/LengthWeightParameterDto.java
- − dto/src/main/java/fr/ird/observe/dto/referential/WithLengthFormula.java
- − dto/src/main/java/fr/ird/observe/dto/referential/WithStartEndDate.java
- dto/src/main/models/Observe.model
- persistence/src/main/java/fr/ird/observe/entities/referentiel/FormulaSupportImpl.java
- persistence/src/main/models/Observe.model
- pom.xml
- + services/src/main/java/fr/ird/observe/services/gson/FloatingObjectModificationAdapter.java
- services/src/main/java/fr/ird/observe/services/gson/ObserveDtoGsonSupplier.java
Changes:
| 1 | 1 |
package fr.ird.observe.client.ui.actions.content;
|
| 2 | 2 |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 3 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 4 | 26 |
import fr.ird.observe.client.ui.ObserveKeyStrokes;
|
| 5 | 27 |
import fr.ird.observe.client.ui.ObserveMainUI;
|
| 1 | 1 |
package fr.ird.observe.client.ui.actions.content;
|
| 2 | 2 |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 3 | 25 |
import com.google.common.collect.Lists;
|
| 4 | 26 |
import fr.ird.observe.client.ui.ObserveKeyStrokes;
|
| 5 | 27 |
import fr.ird.observe.client.ui.ObserveMainUI;
|
| ... | ... | @@ -22,11 +22,6 @@ package fr.ird.observe.dto.referential; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
-import io.ultreia.java4all.bean.definition.JavaBeanDefinition;
|
|
| 26 |
-import io.ultreia.java4all.bean.definition.JavaBeanDefinitionStore;
|
|
| 27 |
-import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
|
|
| 28 |
- |
|
| 29 |
-@GenerateJavaBeanDefinition
|
|
| 30 | 25 |
public class LengthLengthParameterDto extends GeneratedLengthLengthParameterDto {
|
| 31 | 26 |
|
| 32 | 27 |
private static final long serialVersionUID = 1L;
|
| ... | ... | @@ -83,8 +78,4 @@ public class LengthLengthParameterDto extends GeneratedLengthLengthParameterDto |
| 83 | 78 |
setOutputInputFormulaValid(formulaTwoValid);
|
| 84 | 79 |
}
|
| 85 | 80 |
|
| 86 |
- @Override
|
|
| 87 |
- public JavaBeanDefinition javaBeanDefinition() {
|
|
| 88 |
- return JavaBeanDefinitionStore.definition(LengthLengthParameterDtoJavaBeanDefinition.class);
|
|
| 89 |
- }
|
|
| 90 | 81 |
}
|
| ... | ... | @@ -23,11 +23,7 @@ package fr.ird.observe.dto.referential; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import io.ultreia.java4all.bean.JavaBean;
|
| 26 |
-import io.ultreia.java4all.bean.definition.JavaBeanDefinition;
|
|
| 27 |
-import io.ultreia.java4all.bean.definition.JavaBeanDefinitionStore;
|
|
| 28 |
-import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
|
|
| 29 | 26 |
|
| 30 |
-@GenerateJavaBeanDefinition
|
|
| 31 | 27 |
public class LengthWeightParameterDto extends GeneratedLengthWeightParameterDto implements JavaBean {
|
| 32 | 28 |
|
| 33 | 29 |
private static final long serialVersionUID = 1L;
|
| ... | ... | @@ -84,8 +80,4 @@ public class LengthWeightParameterDto extends GeneratedLengthWeightParameterDto |
| 84 | 80 |
setWeightLengthFormulaValid(formulaTwoValid);
|
| 85 | 81 |
}
|
| 86 | 82 |
|
| 87 |
- @Override
|
|
| 88 |
- public JavaBeanDefinition javaBeanDefinition() {
|
|
| 89 |
- return JavaBeanDefinitionStore.definition(LengthWeightParameterDtoJavaBeanDefinition.class);
|
|
| 90 |
- }
|
|
| 91 | 83 |
}
|
| 1 |
-package fr.ird.observe.dto.referential;
|
|
| 2 |
- |
|
| 3 |
-/*-
|
|
| 4 |
- * #%L
|
|
| 5 |
- * ObServe Toolkit :: Common Dto
|
|
| 6 |
- * %%
|
|
| 7 |
- * Copyright (C) 2017 - 2018 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 java.util.Comparator;
|
|
| 26 |
-import java.util.Date;
|
|
| 27 |
-import java.util.List;
|
|
| 28 |
-import java.util.Set;
|
|
| 29 |
- |
|
| 30 |
-/**
|
|
| 31 |
- * Created on 22/12/16.
|
|
| 32 |
- *
|
|
| 33 |
- * @author Tony Chemit - dev@tchemit.fr
|
|
| 34 |
- * @since 6.0
|
|
| 35 |
- */
|
|
| 36 |
-public interface WithLengthFormula extends WithFormula, WithStartEndDate {
|
|
| 37 |
- |
|
| 38 |
- String PROPERTY_OCEAN = "ocean";
|
|
| 39 |
- String PROPERTY_SPECIES = "species";
|
|
| 40 |
- String PROPERTY_SEX = "sex";
|
|
| 41 |
- String PROPERTY_START_DATE = "startDate";
|
|
| 42 |
- String PROPERTY_END_DATE = "endDate";
|
|
| 43 |
- String PROPERTY_COEFFICIENTS = "coefficients";
|
|
| 44 |
- String PROPERTY_SOURCE = "source";
|
|
| 45 |
- |
|
| 46 |
- Comparator<WithLengthFormula> FORMULA_SUPPORT_START_DATE_COMPARATOR = Comparator.comparing(WithStartEndDate::getStartDate, WithStartEndDate.START_DATE_COMPARATOR);
|
|
| 47 |
- Comparator<WithLengthFormula> FORMULA_SUPPORT_END_DATE_COMPARATOR = Comparator.comparing(WithStartEndDate::getEndDate, WithStartEndDate.END_DATE_COMPARATOR);
|
|
| 48 |
- Comparator<WithLengthFormula> FORMULA_SUPPORT_COMPARATOR = FORMULA_SUPPORT_START_DATE_COMPARATOR.thenComparing(FORMULA_SUPPORT_END_DATE_COMPARATOR);
|
|
| 49 |
- |
|
| 50 |
- static <D extends WithLengthFormula> void sort(List<D> list) {
|
|
| 51 |
- list.sort(FORMULA_SUPPORT_COMPARATOR);
|
|
| 52 |
- }
|
|
| 53 |
- |
|
| 54 |
-// static <D extends WithStartEndDate> List<D> filter(List<D> list, Date date) {
|
|
| 55 |
-// return list.stream()
|
|
| 56 |
-// .filter(f -> WithStartEndDate.START_DATE_COMPARATOR.compare(f.getStartDate(), date) <= 0 && WithStartEndDate.END_DATE_COMPARATOR.compare(date, f.getEndDate()) <= 0)
|
|
| 57 |
-// .collect(Collectors.toList());
|
|
| 58 |
-// }
|
|
| 59 |
- |
|
| 60 |
- String getFormulaOneVariableName();
|
|
| 61 |
- |
|
| 62 |
- String getFormulaTwoVariableName();
|
|
| 63 |
- |
|
| 64 |
- void setStartDate(Date startDate);
|
|
| 65 |
- |
|
| 66 |
- void setEndDate(Date endDate);
|
|
| 67 |
- |
|
| 68 |
- void setCoefficients(String coefficients);
|
|
| 69 |
- |
|
| 70 |
- String getSource();
|
|
| 71 |
- |
|
| 72 |
- void setSource(String source);
|
|
| 73 |
- |
|
| 74 |
- default Set<String> getCoefficientNames() {
|
|
| 75 |
- return getCoefficientValues().keySet();
|
|
| 76 |
- }
|
|
| 77 |
- |
|
| 78 |
- String getFormulaOne();
|
|
| 79 |
- |
|
| 80 |
- String getFormulaTwo();
|
|
| 81 |
- |
|
| 82 |
- default void revalidateFormulaOne() {
|
|
| 83 |
- boolean result = FormulaHelper.validateRelation(this, getFormulaOne(), getFormulaOneVariableName());
|
|
| 84 |
- setFormulaOneValid(result);
|
|
| 85 |
- }
|
|
| 86 |
- |
|
| 87 |
- boolean isFormulaOneValid();
|
|
| 88 |
- |
|
| 89 |
- void setFormulaOneValid(boolean formulaOneValid);
|
|
| 90 |
- |
|
| 91 |
- boolean isFormulaTwoValid();
|
|
| 92 |
- |
|
| 93 |
- void setFormulaTwoValid(boolean formulaTwoValid);
|
|
| 94 |
- |
|
| 95 |
- default void revalidateFormulaTwo() {
|
|
| 96 |
- boolean result = FormulaHelper.validateRelation(this, getFormulaTwo(), getFormulaTwoVariableName());
|
|
| 97 |
- setFormulaTwoValid(result);
|
|
| 98 |
- }
|
|
| 99 |
- |
|
| 100 |
- default Double getCoefficientValue(String coefficientName) {
|
|
| 101 |
- return getCoefficientValues().get(coefficientName);
|
|
| 102 |
- }
|
|
| 103 |
-}
|
| 1 |
-package fr.ird.observe.dto.referential;
|
|
| 2 |
- |
|
| 3 |
-import com.google.common.collect.Ordering;
|
|
| 4 |
-import fr.ird.observe.dto.reference.DtoReferenceAware;
|
|
| 5 |
- |
|
| 6 |
-import java.util.Comparator;
|
|
| 7 |
-import java.util.Date;
|
|
| 8 |
- |
|
| 9 |
-/**
|
|
| 10 |
- * Created by tchemit on 10/07/2018.
|
|
| 11 |
- *
|
|
| 12 |
- * @author Tony Chemit - dev@tchemit.fr
|
|
| 13 |
- */
|
|
| 14 |
-public interface WithStartEndDate extends DtoReferenceAware {
|
|
| 15 |
- |
|
| 16 |
- Comparator<Date> START_DATE_COMPARATOR = Ordering.natural().nullsFirst();
|
|
| 17 |
- Comparator<Date> END_DATE_COMPARATOR = Ordering.natural().nullsLast();
|
|
| 18 |
- |
|
| 19 |
- Comparator<WithStartEndDate> WITH_START_DATE_COMPARATOR = Comparator.comparing(WithStartEndDate::getStartDate, START_DATE_COMPARATOR);
|
|
| 20 |
- Comparator<WithStartEndDate> WITH_END_DATE_COMPARATOR = Comparator.comparing(WithStartEndDate::getEndDate, END_DATE_COMPARATOR);
|
|
| 21 |
- |
|
| 22 |
- Date getStartDate();
|
|
| 23 |
- |
|
| 24 |
- Date getEndDate();
|
|
| 25 |
- |
|
| 26 |
-}
|
| ... | ... | @@ -12,19 +12,9 @@ package fr.ird.observe.dto.form |
| 12 | 12 |
|
| 13 | 13 |
enum constants.ObserveDbRole
|
| 14 | 14 |
|
| 15 |
-enum data.seine.SetSeineConstants
|
|
| 16 |
-targetSampleCapture
|
|
| 17 |
-endSetDate
|
|
| 18 |
-endPursingDate
|
|
| 19 |
-endSetTime
|
|
| 20 |
-endPursingTime
|
|
| 21 |
- |
|
| 22 |
-enum data.seine.TargetLengthConstants
|
|
| 23 |
-totalWeight
|
|
| 24 |
- |
|
| 25 | 15 |
interface ObserveDto
|
| 26 | 16 |
|
| 27 |
-interface referential.WithLengthFormula
|
|
| 17 |
+interface referential.WithFormula
|
|
| 28 | 18 |
|
| 29 | 19 |
interface WithComment
|
| 30 | 20 |
getComment() String
|
| ... | ... | @@ -70,7 +60,7 @@ label6 + {*:1} String |
| 70 | 60 |
label7 + {*:1} String
|
| 71 | 61 |
label8 + {*:1} String
|
| 72 | 62 |
|
| 73 |
-abstract referential.LengthFormulaSupport > referential.Referential >> referential.WithLengthFormula
|
|
| 63 |
+abstract referential.LengthFormulaSupport > referential.Referential >> referential.WithFormula
|
|
| 74 | 64 |
startDate + {*:1} Date
|
| 75 | 65 |
endDate + {*:1} Date
|
| 76 | 66 |
coefficients + {*:1} String
|
| ... | ... | @@ -750,7 +740,7 @@ totalWeight + {*:1} Integer |
| 750 | 740 |
meanWeight + {*:1} Integer
|
| 751 | 741 |
species {*:1} fr.ird.observe.dto.referential.SpeciesReference
|
| 752 | 742 |
|
| 753 |
-data.seine.SetSeine > data.Commentable | references=comment
|
|
| 743 |
+data.seine.SetSeine > data.Commentable | references=comment constants=targetSampleCapture,endSetDate,endPursingDate,endSetTime,endPursingTime
|
|
| 754 | 744 |
startTime + {*:1} Date
|
| 755 | 745 |
endPursingTimeStamp + {*:1} Date
|
| 756 | 746 |
endSetTimeStamp + {*:1} Date
|
| ... | ... | @@ -795,7 +785,7 @@ weightCategory {*:1} fr.ird.observe.dto.referential.seine.WeightCategoryReferenc |
| 795 | 785 |
reasonForDiscard {*:0..1} fr.ird.observe.dto.referential.seine.ReasonForDiscardReference
|
| 796 | 786 |
species {*:1} fr.ird.observe.dto.referential.SpeciesReference
|
| 797 | 787 |
|
| 798 |
-data.seine.TargetLength > data.Data | references=speciesLabel,length,count
|
|
| 788 |
+data.seine.TargetLength > data.Data | references=speciesLabel,length,count constants=totalWeight
|
|
| 799 | 789 |
length + {*:1} Float
|
| 800 | 790 |
isLengthComputed + {*:1} boolean
|
| 801 | 791 |
count + {*:1} Integer
|
| ... | ... | @@ -23,7 +23,6 @@ package fr.ird.observe.entities.referentiel; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import fr.ird.observe.dto.referential.FormulaHelper;
|
| 26 |
-import fr.ird.observe.dto.referential.WithLengthFormula;
|
|
| 27 | 26 |
import org.apache.commons.lang3.BooleanUtils;
|
| 28 | 27 |
|
| 29 | 28 |
import java.util.Map;
|
| ... | ... | @@ -34,7 +33,7 @@ import java.util.Map; |
| 34 | 33 |
* @author Tony Chemit - dev@tchemit.fr
|
| 35 | 34 |
* @since 6.0
|
| 36 | 35 |
*/
|
| 37 |
-public abstract class FormulaSupportImpl extends FormulaSupportAbstract implements WithLengthFormula {
|
|
| 36 |
+public abstract class FormulaSupportImpl extends FormulaSupportAbstract {
|
|
| 38 | 37 |
|
| 39 | 38 |
private static final long serialVersionUID = 1L;
|
| 40 | 39 |
|
| ... | ... | @@ -25,62 +25,6 @@ enum !fr.ird.observe.dto.data.seine.TypeTransmittingBuoyOperation |
| 25 | 25 |
|
| 26 | 26 |
enum !fr.ird.observe.dto.data.seine.DcpComputedValue
|
| 27 | 27 |
|
| 28 |
-enum longline.ActivityLonglineConstants
|
|
| 29 |
-date
|
|
| 30 |
-time
|
|
| 31 |
- |
|
| 32 |
-enum longline.BranchlineConstants
|
|
| 33 |
-timerTimeOnBoardDate
|
|
| 34 |
-timerTimeOnBoardTime
|
|
| 35 |
- |
|
| 36 |
-enum longline.SetLonglineConstants
|
|
| 37 |
-settingStartDate
|
|
| 38 |
-settingStartTime
|
|
| 39 |
-settingStartQuadrant
|
|
| 40 |
-settingEndDate
|
|
| 41 |
-settingEndTime
|
|
| 42 |
-settingEndQuadrant
|
|
| 43 |
-haulingStartDate
|
|
| 44 |
-haulingStartTime
|
|
| 45 |
-haulingStartQuadrant
|
|
| 46 |
-haulingEndDate
|
|
| 47 |
-haulingEndTime
|
|
| 48 |
-haulingEndQuadrant
|
|
| 49 |
-floatlinesCompositionProportionSum
|
|
| 50 |
-branchlinesCompositionProportionSum
|
|
| 51 |
-hooksCompositionProportionSum
|
|
| 52 |
-baitsCompositionProportionSum
|
|
| 53 |
- |
|
| 54 |
-enum longline.TdrConstants
|
|
| 55 |
-deployementStartDate
|
|
| 56 |
-deployementStartTime
|
|
| 57 |
-deployementEndDate
|
|
| 58 |
-deployementEndTime
|
|
| 59 |
-fishingStartDate
|
|
| 60 |
-fishingStartTime
|
|
| 61 |
-fishingEndDate
|
|
| 62 |
-fishingEndTime
|
|
| 63 |
- |
|
| 64 |
-enum referentiel.FormulaSupportConstants
|
|
| 65 |
-formulaOneValid
|
|
| 66 |
-formulaTwoValid
|
|
| 67 |
- |
|
| 68 |
-enum referentiel.HarbourConstants
|
|
| 69 |
-quadrant
|
|
| 70 |
- |
|
| 71 |
-enum referentiel.ProgramConstants
|
|
| 72 |
-gearTypePrefix
|
|
| 73 |
- |
|
| 74 |
-enum seine.SetConstants
|
|
| 75 |
-targetSampleCapture
|
|
| 76 |
-endSetDate
|
|
| 77 |
-endPursingDate
|
|
| 78 |
-endSetTime
|
|
| 79 |
-endPursingTime
|
|
| 80 |
- |
|
| 81 |
-enum seine.TargetLengthConstants
|
|
| 82 |
-totalWeight
|
|
| 83 |
- |
|
| 84 | 28 |
interface Activity
|
| 85 | 29 |
|
| 86 | 30 |
interface LengthWeightComputable
|
| ... | ... | @@ -122,7 +66,7 @@ abstract ObserveDataEntity > ObserveEntity | entity |
| 122 | 66 |
abstract ObserveEntity >> fr.ird.observe.dto.reference.DtoReferenceAware | entity
|
| 123 | 67 |
lastUpdateDate + {*:1} Date | notNull
|
| 124 | 68 |
|
| 125 |
-longline.ActivityLongline > CommentableEntity >> Activity | entity dbName=Activity
|
|
| 69 |
+longline.ActivityLongline > CommentableEntity >> Activity | entity dbName=Activity constants=date,time
|
|
| 126 | 70 |
timeStamp + {*:1} Date
|
| 127 | 71 |
latitude + {*:1} Float
|
| 128 | 72 |
longitude + {*:1} Float
|
| ... | ... | @@ -156,7 +100,7 @@ catchLongline {*} longline.CatchLongline |
| 156 | 100 |
tdr {*} longline.Tdr
|
| 157 | 101 |
setLongline {*:1} longline.SetLongline | dbName=set
|
| 158 | 102 |
|
| 159 |
-longline.Branchline > CommentableEntity >> longline.LonglineCompositionEntity | entity
|
|
| 103 |
+longline.Branchline > CommentableEntity >> longline.LonglineCompositionEntity | entity constants=timerTimeOnBoardDate,timerTimeOnBoardTime
|
|
| 160 | 104 |
settingIdentifier + {*:1} Integer | notNull
|
| 161 | 105 |
haulingIdentifier + {*:1} Integer
|
| 162 | 106 |
depthRecorder + {*:1} Boolean
|
| ... | ... | @@ -265,7 +209,7 @@ sensorType {*:1} referentiel.longline.SensorType |
| 265 | 209 |
sensorDataFormat {*:0..1} referentiel.longline.SensorDataFormat
|
| 266 | 210 |
sensorBrand {*:1} referentiel.longline.SensorBrand
|
| 267 | 211 |
|
| 268 |
-longline.SetLongline > CommentableEntity >> ObserveSet | entity dbName=Set
|
|
| 212 |
+longline.SetLongline > CommentableEntity >> ObserveSet | entity dbName=Set constants=settingStartTime,settingStartQuadrant,settingEndDate,settingEndTime,settingEndQuadrant,haulingStartDate,haulingStartTime,haulingStartQuadrant,haulingEndDate,haulingEndTime,haulingEndQuadrant,floatlinesCompositionProportionSum,branchlinesCompositionProportionSum,hooksCompositionProportionSum,baitsCompositionProportionSum
|
|
| 269 | 213 |
homeId + {*:1} String
|
| 270 | 214 |
number + {*:1} Integer
|
| 271 | 215 |
basketsPerSectionCount + {*:1} Integer
|
| ... | ... | @@ -347,7 +291,7 @@ longline.SizeMeasure > ObserveDataEntity | entity |
| 347 | 291 |
size + {*:1} Float | sqlType=numeric
|
| 348 | 292 |
sizeMeasureType {*:1} referentiel.SizeMeasureType
|
| 349 | 293 |
|
| 350 |
-longline.Tdr > ObserveDataEntity >> longline.LonglinePositionAware | entity
|
|
| 294 |
+longline.Tdr > ObserveDataEntity >> longline.LonglinePositionAware | entity constants=deployementStartDate,deployementStartTime,deployementEndDate,deployementEndTime,fishingStartDate,fishingStartTime,fishingEndDate,fishingEndTime
|
|
| 351 | 295 |
homeId + {*:1} String
|
| 352 | 296 |
floatline1Length + {*:1} Float | sqlType=numeric
|
| 353 | 297 |
floatline2Length + {*:1} Float | sqlType=numeric
|
| ... | ... | @@ -427,7 +371,7 @@ iso3Code + {*:1} String |
| 427 | 371 |
|
| 428 | 372 |
referentiel.DataQuality > referentiel.I18nReferentialEntity | entity
|
| 429 | 373 |
|
| 430 |
-abstract referentiel.FormulaSupport > referentiel.ObserveReferentialEntity >> fr.ird.observe.dto.referential.WithLengthFormula | entity
|
|
| 374 |
+abstract referentiel.FormulaSupport > referentiel.ObserveReferentialEntity >> fr.ird.observe.dto.referential.WithFormula | entity constants=formulaOneValid,formulaTwoValid
|
|
| 431 | 375 |
ocean {*:0..1} referentiel.Ocean | notNull lazy=false
|
| 432 | 376 |
species {*:1} referentiel.Species | notNull lazy=false
|
| 433 | 377 |
sex {*:1} referentiel.Sex | notNull lazy=false
|
| ... | ... | @@ -451,7 +395,7 @@ gearCaracteristicType {*:1} referentiel.GearCaracteristicType | lazy=false |
| 451 | 395 |
|
| 452 | 396 |
referentiel.GearCaracteristicType > referentiel.I18nReferentialEntity | entity
|
| 453 | 397 |
|
| 454 |
-referentiel.Harbour > referentiel.ObserveReferentialEntity | entity
|
|
| 398 |
+referentiel.Harbour > referentiel.ObserveReferentialEntity | entity constants=quadrant
|
|
| 455 | 399 |
country {*:1} referentiel.Country
|
| 456 | 400 |
locode + {*:1} String
|
| 457 | 401 |
name + {*:1} String
|
| ... | ... | @@ -508,7 +452,7 @@ captain + {*:1} boolean |
| 508 | 452 |
dataEntryOperator + {*:1} boolean
|
| 509 | 453 |
country {*:0..1} referentiel.Country
|
| 510 | 454 |
|
| 511 |
-referentiel.Program > referentiel.I18nReferentialEntity | entity
|
|
| 455 |
+referentiel.Program > referentiel.I18nReferentialEntity | entity constants=gearTypePrefix
|
|
| 512 | 456 |
organism {*:1} referentiel.Organism | lazy=false
|
| 513 | 457 |
nonTargetObservation + {*:1} int
|
| 514 | 458 |
targetDiscardsObservation + {*:1} int
|
| ... | ... | @@ -827,7 +771,7 @@ meanWeight + {*:1} Integer |
| 827 | 771 |
setSeine {*:1} seine.SetSeine | naturalId dbName=set
|
| 828 | 772 |
species {*:1} referentiel.Species | naturalId
|
| 829 | 773 |
|
| 830 |
-seine.SetSeine > CommentableEntity >> ObserveSet | entity dbName=Set
|
|
| 774 |
+seine.SetSeine > CommentableEntity >> ObserveSet | entity dbName=Set constants=targetSampleCapture,endSetDate,endPursingDate,endSetTime,endPursingTime
|
|
| 831 | 775 |
startTime + {*:1} Date | hibernateAttributeType.java.util.Date=time
|
| 832 | 776 |
endPursingTimeStamp + {*:1} Date
|
| 833 | 777 |
endSetTimeStamp + {*:1} Date
|
| ... | ... | @@ -879,7 +823,7 @@ reasonForDiscard {*:0..1} referentiel.seine.ReasonForDiscard | naturalId notNull |
| 879 | 823 |
getSpecies() referentiel.Species
|
| 880 | 824 |
setSpecies(species referentiel.Species)
|
| 881 | 825 |
|
| 882 |
-seine.TargetLength > ObserveDataEntity >> LengthWeightComputable | entity
|
|
| 826 |
+seine.TargetLength > ObserveDataEntity >> LengthWeightComputable | entity constants=totalWeight
|
|
| 883 | 827 |
length + {*:1} Float | sqlType=numeric
|
| 884 | 828 |
isLengthComputed + {*:1} boolean
|
| 885 | 829 |
count + {*:1} Integer
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>io.ultreia.maven</groupId>
|
| 28 | 28 |
<artifactId>pom</artifactId>
|
| 29 |
- <version>2018.36</version>
|
|
| 29 |
+ <version>2018.40</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<groupId>fr.ird.observe</groupId>
|
| ... | ... | @@ -152,8 +152,7 @@ |
| 152 | 152 |
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| 153 | 153 |
<buildDate>${maven.build.timestamp}</buildDate>
|
| 154 | 154 |
|
| 155 |
- <observeToolkitVersion>3.7.1</observeToolkitVersion>
|
|
| 156 |
- |
|
| 155 |
+ <observeToolkitVersion>3.7.2</observeToolkitVersion>
|
|
| 157 | 156 |
<!--<lib.version.java4all.jaxx>3.0-alpha-31</lib.version.java4all.jaxx>-->
|
| 158 | 157 |
<!--<lib.version.nuiton.topia>3.4.2-SNAPSHOT</lib.version.nuiton.topia>-->
|
| 159 | 158 |
<lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
|
| ... | ... | @@ -162,7 +161,8 @@ |
| 162 | 161 |
<!--<lib.version.hibernate>5.2.10.Final</lib.version.hibernate>-->
|
| 163 | 162 |
<!--can't use 1.4.197 (date has changed + blob also-->
|
| 164 | 163 |
<lib.version.h2>1.4.196</lib.version.h2>
|
| 165 |
- <lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>
|
|
| 164 |
+ <!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>-->
|
|
| 165 |
+ <lib.version.java4all.eugene>3.0-alpha-23</lib.version.java4all.eugene>
|
|
| 166 | 166 |
<!--<lib.version.java4all.topia>1.1.2-SNAPSHOT</lib.version.java4all.topia>-->
|
| 167 | 167 |
<!-- license header configuration -->
|
| 168 | 168 |
<license.licenseName>gpl_v3</license.licenseName>
|
| 1 |
+package fr.ird.observe.services.gson;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.gson.JsonDeserializationContext;
|
|
| 26 |
+import com.google.gson.JsonDeserializer;
|
|
| 27 |
+import com.google.gson.JsonElement;
|
|
| 28 |
+import com.google.gson.JsonObject;
|
|
| 29 |
+import com.google.gson.JsonParseException;
|
|
| 30 |
+import com.google.gson.JsonSerializationContext;
|
|
| 31 |
+import com.google.gson.JsonSerializer;
|
|
| 32 |
+import fr.ird.observe.services.service.actions.consolidate.dcp.FloatingObjectModification;
|
|
| 33 |
+ |
|
| 34 |
+import java.io.Serializable;
|
|
| 35 |
+import java.lang.reflect.Type;
|
|
| 36 |
+ |
|
| 37 |
+/**
|
|
| 38 |
+ * Created by tchemit on 11/07/2018.
|
|
| 39 |
+ *
|
|
| 40 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 41 |
+ */
|
|
| 42 |
+public class FloatingObjectModificationAdapter implements JsonDeserializer<FloatingObjectModification>, JsonSerializer<FloatingObjectModification> {
|
|
| 43 |
+ |
|
| 44 |
+ @Override
|
|
| 45 |
+ public FloatingObjectModification deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
|
| 46 |
+ JsonObject reportVariableJson = json.getAsJsonObject();
|
|
| 47 |
+ |
|
| 48 |
+ String dcpId = context.deserialize(reportVariableJson.get("dcpId"), String.class);
|
|
| 49 |
+ String propertyName = context.deserialize(reportVariableJson.get("propertyName"), String.class);
|
|
| 50 |
+ Class<?> type = context.deserialize(reportVariableJson.get("type"), Class.class);
|
|
| 51 |
+ Serializable newValue1 = context.deserialize(reportVariableJson.get("newValue"), type);
|
|
| 52 |
+ return new FloatingObjectModification(dcpId, propertyName, newValue1);
|
|
| 53 |
+ }
|
|
| 54 |
+ |
|
| 55 |
+ @Override
|
|
| 56 |
+ public JsonElement serialize(FloatingObjectModification src, Type typeOfSrc, JsonSerializationContext context) {
|
|
| 57 |
+ JsonObject element2 = new JsonObject();
|
|
| 58 |
+ element2.add("dcpId", context.serialize(src.getDcpId()));
|
|
| 59 |
+ element2.add("propertyName", context.serialize(src.getPropertyName()));
|
|
| 60 |
+ Serializable newValue = src.getNewValue();
|
|
| 61 |
+ element2.add("type", context.serialize(newValue == null ? String.class : newValue.getClass()));
|
|
| 62 |
+ element2.add("newValue", context.serialize(newValue));
|
|
| 63 |
+ return null;
|
|
| 64 |
+ }
|
|
| 65 |
+}
|
| ... | ... | @@ -23,6 +23,7 @@ package fr.ird.observe.services.gson; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import com.google.gson.GsonBuilder;
|
| 26 |
+import fr.ird.observe.services.service.actions.consolidate.dcp.FloatingObjectModification;
|
|
| 26 | 27 |
import fr.ird.observe.services.service.actions.report.ReportVariable;
|
| 27 | 28 |
import io.ultreia.java4all.http.HResponseError;
|
| 28 | 29 |
import io.ultreia.java4all.http.HResponseErrorAdapter;
|
| ... | ... | @@ -49,6 +50,7 @@ public class ObserveDtoGsonSupplier extends ObserveDtoGsonSupplierSupport { |
| 49 | 50 |
if (create) {
|
| 50 | 51 |
gsonBuilder.registerTypeAdapter(ReportVariable.class, new ReportVariableAdapter());
|
| 51 | 52 |
gsonBuilder.registerTypeAdapter(HResponseError.class, new HResponseErrorAdapter());
|
| 53 |
+ gsonBuilder.registerTypeAdapter(FloatingObjectModification.class, new FloatingObjectModificationAdapter());
|
|
| 52 | 54 |
|
| 53 | 55 |
}
|
| 54 | 56 |
return gsonBuilder;
|