Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
8ab949b2
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
50711231
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
2b8167b1
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
3b026463
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
2e5cdb3f
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
2680d23a
by Tony Chemit at 2021-10-20T08:31:31+02:00
-
bad538ef
by Tony Chemit at 2021-10-20T08:31:59+02:00
19 changed files:
- client/core/src/main/java/fr/ird/observe/client/util/table/JXTableUtil.java
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/LonglinePositionAware.jcss
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/ActivityCatchUITableModel.java
- client/datasource/editor/spi/src/main/java/fr/ird/observe/client/datasource/editor/spi/content/data/table/GenerateContentTableUITableModel.java
- models/definition/src/main/models/Observe/dto/attribute/notNullIf.properties
- models/definition/src/main/models/Observe/dto/class/containerChildDataDtoProperties.properties
- models/definition/src/main/models/Observe/dto/class/decorator.properties
- models/definition/src/main/models/Observe/dto/class/i18nLabels.properties
- models/definition/src/main/models/Observe/dto/class/references.properties
- models/dto/i18n/src/main/i18n/getters/labels.getter
- models/dto/java/src/main/i18n/getters/java.getter
- + models/dto/java/src/main/java/fr/ird/observe/spi/decoration/ObserveDefaultDecoratorRenderer.java
- + models/dto/java/src/main/java/fr/ird/observe/spi/decoration/ObserveDtoDecoratorRenderer.java
- + models/dto/java/src/main/java/fr/ird/observe/spi/decoration/ObserveDtoReferenceDecoratorRenderer.java
- + models/persistence/java/src/main/java/fr/ird/observe/spi/decoration/ObserveEntityDecoratorRenderer.java
- services/i18n/src/main/i18n/translations/services_en_GB.properties
- services/i18n/src/main/i18n/translations/services_es_ES.properties
- services/i18n/src/main/i18n/translations/services_fr_FR.properties
Changes:
| ... | ... | @@ -31,11 +31,14 @@ import org.jdesktop.swingx.JXTable; |
| 31 | 31 |
import org.jdesktop.swingx.renderer.DefaultTableRenderer;
|
| 32 | 32 |
import org.jdesktop.swingx.renderer.StringValue;
|
| 33 | 33 |
|
| 34 |
+import javax.swing.JComponent;
|
|
| 34 | 35 |
import javax.swing.JScrollPane;
|
| 36 |
+import javax.swing.JTable;
|
|
| 35 | 37 |
import javax.swing.table.TableCellEditor;
|
| 36 | 38 |
import javax.swing.table.TableCellRenderer;
|
| 37 | 39 |
import javax.swing.table.TableColumn;
|
| 38 | 40 |
import javax.swing.table.TableColumnModel;
|
| 41 |
+import java.awt.Component;
|
|
| 39 | 42 |
import java.awt.Dimension;
|
| 40 | 43 |
import java.util.EnumSet;
|
| 41 | 44 |
import java.util.Enumeration;
|
| ... | ... | @@ -107,7 +110,7 @@ public class JXTableUtil { |
| 107 | 110 |
reference.registerDecorator(decorator);
|
| 108 | 111 |
return reference.decorate();
|
| 109 | 112 |
};
|
| 110 |
- return new DefaultTableRenderer(sv);
|
|
| 113 |
+ return getDefaultTableRenderer(sv, true);
|
|
| 111 | 114 |
}
|
| 112 | 115 |
|
| 113 | 116 |
public static TableCellRenderer newEmptyNumberTableCellRenderer() {
|
| ... | ... | @@ -128,7 +131,7 @@ public class JXTableUtil { |
| 128 | 131 |
}
|
| 129 | 132 |
return result;
|
| 130 | 133 |
};
|
| 131 |
- return new DefaultTableRenderer(sv);
|
|
| 134 |
+ return getDefaultTableRenderer(sv, true);
|
|
| 132 | 135 |
}
|
| 133 | 136 |
|
| 134 | 137 |
public static TableCellRenderer newBooleanTableCellRenderer2() {
|
| ... | ... | @@ -139,10 +142,10 @@ public class JXTableUtil { |
| 139 | 142 |
Boolean reference = (Boolean) value;
|
| 140 | 143 |
return reference ? t("boolean.true") : t("boolean.false");
|
| 141 | 144 |
};
|
| 142 |
- return new DefaultTableRenderer(sv);
|
|
| 145 |
+ return getDefaultTableRenderer(sv, true);
|
|
| 143 | 146 |
}
|
| 144 | 147 |
|
| 145 |
- public static TableCellRenderer newStringTableCellRenderer(int length, boolean tooltip) {
|
|
| 148 |
+ public static TableCellRenderer newStringTableCellRenderer(int length) {
|
|
| 146 | 149 |
StringValue sv = value -> {
|
| 147 | 150 |
if (value == null) {
|
| 148 | 151 |
return null;
|
| ... | ... | @@ -150,7 +153,7 @@ public class JXTableUtil { |
| 150 | 153 |
String reference = (String) value;
|
| 151 | 154 |
return reference.length() > length ? reference.substring(0, length - 3) + "..." : reference;
|
| 152 | 155 |
};
|
| 153 |
- return new DefaultTableRenderer(sv);
|
|
| 156 |
+ return getDefaultTableRenderer(sv, false);
|
|
| 154 | 157 |
}
|
| 155 | 158 |
|
| 156 | 159 |
public static <E extends Enum<E>> TableCellRenderer newEnumTableCellRenderer(Class<E> enumClass) {
|
| ... | ... | @@ -172,7 +175,19 @@ public class JXTableUtil { |
| 172 | 175 |
}
|
| 173 | 176 |
return null;
|
| 174 | 177 |
};
|
| 175 |
- return new DefaultTableRenderer(sv);
|
|
| 178 |
+ return getDefaultTableRenderer(sv, true);
|
|
| 179 |
+ }
|
|
| 180 |
+ |
|
| 181 |
+ private static DefaultTableRenderer getDefaultTableRenderer(StringValue sv, boolean useStringValue) {
|
|
| 182 |
+ return new DefaultTableRenderer(sv) {
|
|
| 183 |
+ @Override
|
|
| 184 |
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
|
| 185 |
+ JComponent tableCellRendererComponent = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
|
| 186 |
+ String toolTipText = useStringValue ? sv.getString(value) : value == null ? null : String.valueOf(value);
|
|
| 187 |
+ tableCellRendererComponent.setToolTipText(toolTipText);
|
|
| 188 |
+ return tableCellRendererComponent;
|
|
| 189 |
+ }
|
|
| 190 |
+ };
|
|
| 176 | 191 |
}
|
| 177 | 192 |
|
| 178 | 193 |
}
|
| ... | ... | @@ -26,15 +26,15 @@ |
| 26 | 26 |
|
| 27 | 27 |
#section {
|
| 28 | 28 |
_listNoLoad:{true};
|
| 29 |
- /*_decoratorClassifier:{SectionReference.ONLY_HAULING_IDENTIFIER};*/
|
|
| 29 |
+ _decoratorClassifier:{SectionReference.ONLY_HAULING_IDENTIFIER};
|
|
| 30 | 30 |
}
|
| 31 | 31 |
|
| 32 | 32 |
#basket {
|
| 33 | 33 |
_listNoLoad:{true};
|
| 34 |
- /*_decoratorClassifier:{BasketReference.ONLY_HAULING_IDENTIFIER};*/
|
|
| 34 |
+ _decoratorClassifier:{BasketReference.ONLY_HAULING_IDENTIFIER};
|
|
| 35 | 35 |
}
|
| 36 | 36 |
|
| 37 | 37 |
#branchline {
|
| 38 | 38 |
_listNoLoad:{true};
|
| 39 |
- /*_decoratorClassifier:{BranchlineReference.ONLY_HAULING_IDENTIFIER};*/
|
|
| 39 |
+ _decoratorClassifier:{BranchlineReference.ONLY_HAULING_IDENTIFIER};
|
|
| 40 | 40 |
}
|
| ... | ... | @@ -91,20 +91,13 @@ public class TripUIModelStates extends GeneratedTripUIModelStates { |
| 91 | 91 |
referenceCache.addReferentialFilter(TripDto.PROPERTY_ADVANCED_SAMPLING_ACQUISITION_STATUS, newAcquisitionStatusList(TripDto::isAdvancedSamplingFilled, AcquisitionStatusReference::isAdvancedSampling));
|
| 92 | 92 |
}
|
| 93 | 93 |
|
| 94 |
- //FIXME Check this is ok to move it to copyFormToBean
|
|
| 95 |
-// @Override
|
|
| 96 |
-// public void setForm(Form<TripDto> form) {
|
|
| 97 |
-// super.setForm(form);
|
|
| 98 |
-// // set end date to current day if necessary
|
|
| 99 |
-// if (isUpdatingMode() && getBean().getEndDate() == null) {
|
|
| 100 |
-// Date date = Dates.getEndOfDay(new Date());
|
|
| 101 |
-// getBean().setEndDate(date);
|
|
| 102 |
-// }
|
|
| 103 |
-// }
|
|
| 104 |
- |
|
| 105 | 94 |
@Override
|
| 106 | 95 |
protected void copyFormToBean(Form<TripDto> form) {
|
| 107 | 96 |
super.copyFormToBean(form);
|
| 97 |
+ if (isCreatingMode()) {
|
|
| 98 |
+ // reset logbook default values
|
|
| 99 |
+ setDefaultLogbookValues(true);
|
|
| 100 |
+ }
|
|
| 108 | 101 |
// set end date to current day if necessary
|
| 109 | 102 |
if (isUpdatingMode() && getBean().getEndDate() == null) {
|
| 110 | 103 |
Date date = Dates.getEndOfDay(new Date());
|
| ... | ... | @@ -37,7 +37,9 @@ class ActivityCatchUITableModel extends GeneratedActivityCatchUITableModel { |
| 37 | 37 |
@Override
|
| 38 | 38 |
public void initTableUISize(JTable table) {
|
| 39 | 39 |
UIHelper.fixTableColumnWidth(table, 3, 55);
|
| 40 |
- UIHelper.fixTableColumnWidth(table, 4, 65);
|
|
| 40 |
+ UIHelper.fixTableColumnWidth(table, 4, 55);
|
|
| 41 |
+ UIHelper.fixTableColumnWidth(table, 5, 55);
|
|
| 42 |
+ UIHelper.fixTableColumnWidth(table, 6, 55);
|
|
| 41 | 43 |
}
|
| 42 | 44 |
|
| 43 | 45 |
@Override
|
| ... | ... | @@ -26,7 +26,6 @@ import fr.ird.observe.client.datasource.editor.api.content.EditableContentUI; |
| 26 | 26 |
import fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableMeta;
|
| 27 | 27 |
import fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableUITableModel;
|
| 28 | 28 |
import fr.ird.observe.client.util.table.JXTableUtil;
|
| 29 |
-import fr.ird.observe.dto.data.ll.observation.LonglineElementAware;
|
|
| 30 | 29 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 31 | 30 |
import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
| 32 | 31 |
import fr.ird.observe.spi.TagValues;
|
| ... | ... | @@ -150,15 +149,12 @@ public class GenerateContentTableUITableModel extends GenerateContentTableUISupp |
| 150 | 149 |
if (Number.class.isAssignableFrom(propertyType)) {
|
| 151 | 150 |
rendererBuilder.append("\n , JXTableUtil.newEmptyNumberTableCellRenderer()");
|
| 152 | 151 |
} else if (String.class.isAssignableFrom(propertyType)) {
|
| 153 |
- rendererBuilder.append("\n , JXTableUtil.newStringTableCellRenderer(10, true)");
|
|
| 152 |
+ rendererBuilder.append("\n , JXTableUtil.newStringTableCellRenderer(10)");
|
|
| 154 | 153 |
} else if (ReferentialDtoReference.class.isAssignableFrom(propertyType)) {
|
| 155 |
- rendererBuilder.append(String.format("\n , JXTableUtil.newDecoratedRenderer(%s.class)", propertyType.getName()));
|
|
| 154 |
+ String classifier = String.format("(String) getContext().get%s().getClientProperty(fr.ird.observe.client.util.init.UIInitHelper.DECORATOR_CLASSIFIER)", StringUtils.capitalize(propertyName));
|
|
| 155 |
+ rendererBuilder.append(String.format("\n , JXTableUtil.newDecoratedRenderer(%s.class, %s)", propertyType.getName(), classifier));
|
|
| 156 | 156 |
} else if (DataDtoReference.class.isAssignableFrom(propertyType)) {
|
| 157 |
- //FIXME Decorator Using hardcoded name was HAULING_IDENTIFIER
|
|
| 158 |
- String classifier = "null";
|
|
| 159 |
- if (LonglineElementAware.class.isAssignableFrom(propertyType)) {
|
|
| 160 |
- classifier = propertyType.getName() + ".ONLY_HAULING_IDENTIFIER";
|
|
| 161 |
- }
|
|
| 157 |
+ String classifier = String.format("(String) getContext().get%s().getClientProperty(fr.ird.observe.client.util.init.UIInitHelper.DECORATOR_CLASSIFIER)", StringUtils.capitalize(propertyName));
|
|
| 162 | 158 |
rendererBuilder.append(String.format("\n , JXTableUtil.newDecoratedRenderer(%s.class, %s)", propertyType.getName(), classifier));
|
| 163 | 159 |
} else if (boolean.class.isAssignableFrom(propertyType)) {
|
| 164 | 160 |
rendererBuilder.append("\n ,table.getDefaultRenderer(Boolean.class)");
|
| ... | ... | @@ -40,7 +40,7 @@ data.ps.localmarket.Batch.attribute.count=countOrWeightValid |
| 40 | 40 |
data.ps.localmarket.Batch.attribute.weight=countOrWeightValid
|
| 41 | 41 |
data.ps.logbook.Sample.attribute.bigsWeight=totalWeight != null && totalWeight > 0
|
| 42 | 42 |
data.ps.logbook.Sample.attribute.smallsWeight=totalWeight != null && totalWeight > 0
|
| 43 |
-data.ps.logbook.Sample.attribute.totalWeight=bigsWeight != null && bigsWeight > 0 && smallsWeight != null && smallsWeight > 0
|
|
| 43 |
+data.ps.logbook.Sample.attribute.totalWeight=bigsWeight != null && bigsWeight >= 0 && smallsWeight != null && smallsWeight >= 0
|
|
| 44 | 44 |
data.ps.observation.Catch.attribute.catchWeight=totalCount != null
|
| 45 | 45 |
data.ps.observation.Catch.attribute.totalCount=catchWeight != null
|
| 46 | 46 |
data.ps.observation.SampleMeasure.attribute.length=acquisitionMode == 1 && weight != null
|
| ... | ... | @@ -39,7 +39,7 @@ data.ps.common.GearUseFeatures=gear,number,usedInTrip,comment |
| 39 | 39 |
data.ps.landing.Landing=species,weightCategory,weight,destination,fate,fateVessel
|
| 40 | 40 |
data.ps.localmarket.Batch=species,packaging,count,weight
|
| 41 | 41 |
data.ps.localmarket.SampleSpecies=species,sizeMeasureType,measuredCount,comment
|
| 42 |
-data.ps.logbook.Catch=species,speciesFate,weightCategory,well,weight,count,comment
|
|
| 42 |
+data.ps.logbook.Catch=species,weightCategory,speciesFate,well,weight,count,comment
|
|
| 43 | 43 |
data.ps.logbook.SampleSpecies=subSampleNumber,species,sizeMeasureType,measuredCount,totalCount,comment
|
| 44 | 44 |
data.ps.logbook.WellPlan=activity,well,species,weightCategory,weight
|
| 45 | 45 |
data.ps.observation.Catch=species,speciesFate,reasonForDiscard,well,catchWeight,totalCount,meanWeight,meanLength,comment
|
| ... | ... | @@ -24,7 +24,7 @@ data.ll.common.GearUseFeaturesMeasurement=${gearCharacteristic::label}##${measur |
| 24 | 24 |
data.ll.common.Program=[${gearType/prefix}]##$(observe.Common.program) ${this::label}
|
| 25 | 25 |
data.ll.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}
|
| 26 | 26 |
data.ll.landing.Landing=${startDate::date}##${harbour::label}##${vessel::label}
|
| 27 |
-data.ll.landing.LandingPart=${species::scientificLabel}##${categoryMin}##${categoryMax}##${weight}
|
|
| 27 |
+data.ll.landing.LandingPart=${species::speciesLabel}##${categoryMin}##${categoryMax}##${weight}
|
|
| 28 | 28 |
data.ll.logbook.Activity=${startTimeStamp::timestamp}##${vesselActivity::label}
|
| 29 | 29 |
data.ll.logbook.ActivitySample=${timeStamp::timestamp}##${coordinateStr}
|
| 30 | 30 |
data.ll.logbook.BaitsComposition=${baitType::label}##${proportion}
|
| ... | ... | @@ -33,7 +33,7 @@ data.ll.logbook.Catch=${homeId} |
| 33 | 33 |
data.ll.logbook.FloatlinesComposition=${lineType::label}##${proportion}
|
| 34 | 34 |
data.ll.logbook.HooksComposition=${hookType::label}##${proportion}
|
| 35 | 35 |
data.ll.logbook.Sample=${timeStamp::timestamp}##${coordinateStr}
|
| 36 |
-data.ll.logbook.SamplePart=${species::scientificLabel}##${length}##${weight}
|
|
| 36 |
+data.ll.logbook.SamplePart=${species::speciesLabel}##${length}##${weight}
|
|
| 37 | 37 |
data.ll.logbook.Set=$(observe.data.ll.logbook.Set.type)
|
| 38 | 38 |
data.ll.observation.Activity=${timeStamp::timestamp}##${vesselActivity::label}
|
| 39 | 39 |
data.ll.observation.BaitsComposition=${baitType::label}##${proportion}
|
| ... | ... | @@ -41,7 +41,7 @@ data.ll.observation.Basket=${settingIdentifier} ( $(observe.Common.settingIdenti |
| 41 | 41 |
data.ll.observation.Branchline=${settingIdentifier} ( $(observe.Common.settingIdentifier) )##${haulingIdentifier} ( $(observe.Common.haulingIdentifier) )
|
| 42 | 42 |
data.ll.observation.BranchlinesComposition=${length}##${proportion}
|
| 43 | 43 |
data.ll.observation.Catch=${homeId}
|
| 44 |
-data.ll.observation.Encounter=${encounterType::label}##${species::scientificLabel}
|
|
| 44 |
+data.ll.observation.Encounter=${encounterType::label}##${species::speciesLabel}
|
|
| 45 | 45 |
data.ll.observation.FloatlinesComposition=${lineType::label}##${proportion}
|
| 46 | 46 |
data.ll.observation.HooksComposition=${hookType::label}##${proportion}
|
| 47 | 47 |
data.ll.observation.Section=${settingIdentifier} ( $(observe.Common.settingIdentifier) )##${haulingIdentifier} ( $(observe.Common.haulingIdentifier) )
|
| ... | ... | @@ -56,38 +56,38 @@ data.ps.common.GearUseFeatures=${gear::label}##${number} |
| 56 | 56 |
data.ps.common.GearUseFeaturesMeasurement=${gearCharacteristic::label}##${measurementValue}
|
| 57 | 57 |
data.ps.common.Program=[${gearType/prefix}]##$(observe.Common.program) ${this::label}
|
| 58 | 58 |
data.ps.common.Trip=${startDate::date}##${endDate::date}##${vessel::label}
|
| 59 |
-data.ps.landing.Landing=${species::scientificLabel}##${weightCategory::label}##${weight}
|
|
| 60 |
-data.ps.localmarket.Batch=${species::scientificLabel}##${packaging::label}##${count}
|
|
| 59 |
+data.ps.landing.Landing=${species::speciesLabel}##${weightCategory::label}##${weight}
|
|
| 60 |
+data.ps.localmarket.Batch=${species::speciesLabel}##${packaging::label}##${count}
|
|
| 61 | 61 |
data.ps.localmarket.Sample=${date::niceDate}##${number}
|
| 62 |
-data.ps.localmarket.SampleSpecies=${species::scientificLabel}##${sizeMeasureType::label}
|
|
| 62 |
+data.ps.localmarket.SampleSpecies=${species::speciesLabel}##${sizeMeasureType::label}
|
|
| 63 | 63 |
data.ps.localmarket.SampleSpeciesMeasure=${sizeClass}##${count}
|
| 64 | 64 |
data.ps.localmarket.Survey=${number}##${date::niceDate}
|
| 65 |
-data.ps.localmarket.SurveyPart=${species::scientificLabel}##${proportion}
|
|
| 65 |
+data.ps.localmarket.SurveyPart=${species::speciesLabel}##${proportion}
|
|
| 66 | 66 |
data.ps.localmarket.WellId=${well}
|
| 67 | 67 |
data.ps.logbook.Activity=${number}##${time::niceTime}##${vesselActivity::label}
|
| 68 | 68 |
data.ps.logbook.ActivityStub=${number}%s##${time::niceTime}
|
| 69 |
-data.ps.logbook.Catch=${species::scientificLabel}##${speciesFate::label}
|
|
| 69 |
+data.ps.logbook.Catch=${species::speciesLabel}##${speciesFate::label}
|
|
| 70 | 70 |
data.ps.logbook.FloatingObject=DCP ${objectOperation::label}
|
| 71 | 71 |
data.ps.logbook.FloatingObjectPart=${objectMaterial::label}##${whenArriving}##${whenLeaving}
|
| 72 | 72 |
data.ps.logbook.Route=${date::niceDate}
|
| 73 | 73 |
data.ps.logbook.Sample=$(observe.Common.well) ${wellLabel}##${sampleType::label}
|
| 74 | 74 |
data.ps.logbook.SampleActivity=${activityLabel}##${weightedWeight}
|
| 75 |
-data.ps.logbook.SampleSpecies=$(observe.Common.sample) ${subSampleNumber}##${species::scientificLabel}##${sizeMeasureType::label}
|
|
| 75 |
+data.ps.logbook.SampleSpecies=$(observe.Common.sample) ${subSampleNumber}##${species::speciesLabel}##${sizeMeasureType::label}
|
|
| 76 | 76 |
data.ps.logbook.SampleSpeciesMeasure=${sizeClass}##${count}
|
| 77 | 77 |
data.ps.logbook.TransmittingBuoy=${transmittingBuoyType::label}##${transmittingBuoyOperation::label}##${code}##${comment}
|
| 78 |
-data.ps.logbook.WellPlan=${species::scientificLabel}##$(observe.Common.well) ${wellLabel}##${weightCategory::label}##${weight}
|
|
| 78 |
+data.ps.logbook.WellPlan=${species::speciesLabel}##$(observe.Common.well) ${wellLabel}##${weightCategory::label}##${weight}
|
|
| 79 | 79 |
data.ps.observation.Activity=${time::niceTime}##${vesselActivity::label}
|
| 80 | 80 |
data.ps.observation.ActivityStub=${time::niceTime}
|
| 81 |
-data.ps.observation.Catch=${species::scientificLabel}##${speciesFate::label}
|
|
| 81 |
+data.ps.observation.Catch=${species::speciesLabel}##${speciesFate::label}
|
|
| 82 | 82 |
data.ps.observation.FloatingObject=DCP ${objectOperation::label}
|
| 83 | 83 |
data.ps.observation.FloatingObjectPart=${objectMaterial::label}##${whenArriving}##${whenLeaving}
|
| 84 |
-data.ps.observation.NonTargetCatchRelease=${species::scientificLabel}##${speciesGroupReleaseMode::label}
|
|
| 85 |
-data.ps.observation.ObjectObservedSpecies=${species::scientificLabel}##${speciesStatus::label}##${count}
|
|
| 86 |
-data.ps.observation.ObjectSchoolEstimate=${species::scientificLabel}##${totalWeight}
|
|
| 84 |
+data.ps.observation.NonTargetCatchRelease=${species::speciesLabel}##${speciesGroupReleaseMode::label}
|
|
| 85 |
+data.ps.observation.ObjectObservedSpecies=${species::speciesLabel}##${speciesStatus::label}##${count}
|
|
| 86 |
+data.ps.observation.ObjectSchoolEstimate=${species::speciesLabel}##${totalWeight}
|
|
| 87 | 87 |
data.ps.observation.Route=${date::niceDate}
|
| 88 | 88 |
data.ps.observation.Sample=${homeId}
|
| 89 |
-data.ps.observation.SampleMeasure=${species::scientificLabel}##${length}##${sex::label}
|
|
| 90 |
-data.ps.observation.SchoolEstimate=${species::scientificLabel}##${totalWeight}##${meanWeight}
|
|
| 89 |
+data.ps.observation.SampleMeasure=${species::speciesLabel}##${length}##${sex::label}
|
|
| 90 |
+data.ps.observation.SchoolEstimate=${species::speciesLabel}##${totalWeight}##${meanWeight}
|
|
| 91 | 91 |
data.ps.observation.Set=$(observe.data.ps.observation.Set.type)
|
| 92 | 92 |
data.ps.observation.TransmittingBuoy=${transmittingBuoyType::label}##${transmittingBuoyOperation::label}##${code}##${comment}
|
| 93 | 93 |
referential.common.FpaZone=${code}##${this::label}##${validityRangeLabel}
|
| ... | ... | @@ -102,7 +102,7 @@ referential.common.Vessel=${code}##${this::label}##${validityRangeLabel} |
| 102 | 102 |
referential.common.VesselSizeCategory=${code}##${gaugeLabel}##${capacityLabel}
|
| 103 | 103 |
referential.common.Wind=${code}##${this::label}##${speedRange}##${swellHeight}
|
| 104 | 104 |
referential.ll.observation.SensorBrand=${code}##${brandName}
|
| 105 |
-referential.ps.common.AcquisitionStatus=${code}##${this::label}
|
|
| 105 |
+referential.ps.common.AcquisitionStatus=${code}##${this::label}##${_fieldEnabler::fieldEnabler}
|
|
| 106 | 106 |
referential.ps.common.ObjectMaterial=${code::noCode}##${this::label}
|
| 107 |
-referential.ps.common.WeightCategory=${code}##${species::scientificLabel}##${this::label}
|
|
| 107 |
+referential.ps.common.WeightCategory=${code}##${species::speciesLabel}##${this::label}
|
|
| 108 | 108 |
referential.ps.localmarket.Packaging=${code}##${this::label}##${harbour::label}##${batchComposition::label}##${batchWeightType::label}##${validityRangeLabel}
|
| ... | ... | @@ -115,7 +115,7 @@ referential.common.WeightMeasureType=action.reset.to.default.tip |
| 115 | 115 |
referential.common.Wind=maxSpeed,maxSwellHeight,minSpeed,minSwellHeight,speedMinMax,swellHeightMinMax
|
| 116 | 116 |
referential.ll.observation.MaturityStatus=lowerValue,upperValue,lowerValueUpperValue
|
| 117 | 117 |
referential.ll.observation.SensorBrand=brandName
|
| 118 |
-referential.ps.common.AcquisitionStatus=advancedSampling,fieldEnabler,landing,localMarket,localMarketSurveySampling,localMarketWellsSampling,logbook,observation,targetWellsSampling
|
|
| 118 |
+referential.ps.common.AcquisitionStatus=advancedSampling,fieldEnabler,fieldEnabled,fieldDisabled,landing,localMarket,localMarketSurveySampling,localMarketWellsSampling,logbook,observation,targetWellsSampling
|
|
| 119 | 119 |
referential.ps.common.ObjectMaterial=biodegradable,childSelectionMandatory,childrenMultiSelectable,legacyCode,nonEntangling,objectMaterialType,parent,standardCode,validation,legacyCodeStandardCode,parentCode,validationInformation
|
| 120 | 120 |
referential.ps.common.ObjectOperation=whenArriving,whenLeaving
|
| 121 | 121 |
referential.ps.common.ObservedSystem=allowLogbook,allowObservation,schoolType
|
| ... | ... | @@ -24,7 +24,7 @@ data.ll.common.GearUseFeaturesMeasurement=measurementValue,gearCharacteristicLab |
| 24 | 24 |
data.ll.common.Program=code,label,uri,gearType,childrenSize,startDate,endDate,status,needComment,homeId
|
| 25 | 25 |
data.ll.common.Trip=startDate,endDate,program,tripTypeId,activityObsSize,activityLogbookSize,landingSize,sampleSize,vessel,observationsAvailability,logbookAvailability,gearUseFeaturesSize
|
| 26 | 26 |
data.ll.landing.Landing=startDate,harbourLabel,vesselLabel
|
| 27 |
-data.ll.landing.LandingPart=speciesLabel,categoryMin,categoryMax,weight
|
|
| 27 |
+data.ll.landing.LandingPart=species,categoryMin,categoryMax,weight
|
|
| 28 | 28 |
data.ll.logbook.Activity=startTimeStamp,endTimeStamp,latitude,longitude,vesselActivity,set,activitySample,relatedObservedActivity
|
| 29 | 29 |
data.ll.logbook.ActivitySample=timeStamp,latitude,longitude
|
| 30 | 30 |
data.ll.logbook.BaitsComposition=proportion,baitTypeLabel,baitSettingStatusLabel,individualSize,individualWeight
|
| ... | ... | @@ -33,7 +33,7 @@ data.ll.logbook.Catch=homeId |
| 33 | 33 |
data.ll.logbook.FloatlinesComposition=proportion,lineTypeLabel,length
|
| 34 | 34 |
data.ll.logbook.HooksComposition=proportion,hookTypeLabel,hookSizeLabel,hookOffset
|
| 35 | 35 |
data.ll.logbook.Sample=timeStamp,latitude,longitude
|
| 36 |
-data.ll.logbook.SamplePart=speciesLabel,length,weight
|
|
| 36 |
+data.ll.logbook.SamplePart=species,length,weight
|
|
| 37 | 37 |
data.ll.logbook.Set=homeId,catchesSize
|
| 38 | 38 |
data.ll.observation.Activity=timeStamp,latitude,longitude,vesselActivity,set,encounterSize,sensorUsedSize
|
| 39 | 39 |
data.ll.observation.BaitsComposition=proportion,baitTypeLabel,baitSettingStatusLabel,individualSize,individualWeight
|
| ... | ... | @@ -41,7 +41,7 @@ data.ll.observation.Basket=settingIdentifier,haulingIdentifier,parentId,notUsed |
| 41 | 41 |
data.ll.observation.Branchline=settingIdentifier,haulingIdentifier,parentId,notUsed
|
| 42 | 42 |
data.ll.observation.BranchlinesComposition=proportion,topTypeLabel,tracelineTypeLabel,length
|
| 43 | 43 |
data.ll.observation.Catch=homeId
|
| 44 |
-data.ll.observation.Encounter=encounterTypeLabel,speciesLabel
|
|
| 44 |
+data.ll.observation.Encounter=encounterTypeLabel,species
|
|
| 45 | 45 |
data.ll.observation.FloatlinesComposition=proportion,lineTypeLabel,length
|
| 46 | 46 |
data.ll.observation.HooksComposition=proportion,hookTypeLabel,hookSizeLabel,hookOffset
|
| 47 | 47 |
data.ll.observation.Section=settingIdentifier,haulingIdentifier,parentId,notUsed
|
| ... | ... | @@ -54,35 +54,35 @@ data.ps.common.GearUseFeatures=gearLabel,number,usedInTrip |
| 54 | 54 |
data.ps.common.GearUseFeaturesMeasurement=measurementValue,gearCharacteristicLabel
|
| 55 | 55 |
data.ps.common.Program=code,label,uri,gearType,childrenSize,startDate,endDate,status,needComment,homeId
|
| 56 | 56 |
data.ps.common.Trip=startDate,endDate,program,gearUseFeaturesSize,routeObsSize,routeLogbookSize,landingSize,wellPlanSize,sampleSize,localmarketBatchSize,localmarketSurveySize,localmarketSampleSize,vessel,observationsAcquisitionStatus,logbookAcquisitionStatus,targetWellsSamplingAcquisitionStatus,landingAcquisitionStatus,localMarketAcquisitionStatus,localMarketWellsSamplingAcquisitionStatus,localMarketSurveySamplingAcquisitionStatus,advancedSamplingAcquisitionStatus,observationsFilled,logbookFilled,targetWellsSamplingFilled,landingFilled,localMarketFilled,localMarketWellsSamplingFilled,localMarketSurveySamplingFilled,advancedSamplingFilled
|
| 57 |
-data.ps.landing.Landing=date,speciesLabel,weightCategory,fateLabel,fateVesselLabel,weight
|
|
| 57 |
+data.ps.landing.Landing=date,species,weightCategory,fateLabel,fateVesselLabel,weight
|
|
| 58 | 58 |
data.ps.localmarket.Batch=species,packaging,count,weight
|
| 59 | 59 |
data.ps.localmarket.Sample=number,date,sampleSpeciesSize
|
| 60 |
-data.ps.localmarket.SampleSpecies=speciesLabel,sizeMeasureTypeLabel,measuredCount
|
|
| 60 |
+data.ps.localmarket.SampleSpecies=species,sizeMeasureTypeLabel,measuredCount
|
|
| 61 | 61 |
data.ps.localmarket.SampleSpeciesMeasure=sizeClass,count
|
| 62 | 62 |
data.ps.localmarket.Survey=number,date
|
| 63 | 63 |
data.ps.localmarket.SurveyPart=species,proportion
|
| 64 | 64 |
data.ps.logbook.Activity=number,date,time,latitude,longitude,vesselActivity,relatedObservedActivity,catchesSize
|
| 65 |
-data.ps.logbook.Catch=speciesLabel,speciesFateLabel,well
|
|
| 65 |
+data.ps.logbook.Catch=species,speciesFateLabel,well
|
|
| 66 | 66 |
data.ps.logbook.FloatingObject=objectOperationLabel
|
| 67 | 67 |
data.ps.logbook.FloatingObjectPart=objectMaterialId,objectMaterialLabel,whenArriving,whenLeaving
|
| 68 | 68 |
data.ps.logbook.Route=date,comment,activitySize
|
| 69 | 69 |
data.ps.logbook.Sample=well,number,superSample,sampleTypeLabel,sampleSpeciesSize,totalWeight,bigsWeight,smallsWeight
|
| 70 | 70 |
data.ps.logbook.SampleActivity=activity,weightedWeight
|
| 71 |
-data.ps.logbook.SampleSpecies=subSampleNumber,speciesLabel,sizeMeasureTypeLabel,measuredCount,totalCount
|
|
| 71 |
+data.ps.logbook.SampleSpecies=subSampleNumber,species,sizeMeasureTypeLabel,measuredCount,totalCount
|
|
| 72 | 72 |
data.ps.logbook.SampleSpeciesMeasure=sizeClass,count
|
| 73 | 73 |
data.ps.logbook.TransmittingBuoy=code,comment,transmittingBuoyTypeLabel,transmittingBuoyOperationLabel
|
| 74 | 74 |
data.ps.logbook.WellPlan=species,well,weight,weightCategoryLabel
|
| 75 | 75 |
data.ps.observation.Activity=date,time,latitude,longitude,vesselActivity,set
|
| 76 |
-data.ps.observation.Catch=speciesLabel,speciesFateLabel,catchWeight,meanWeight,meanLength,well
|
|
| 76 |
+data.ps.observation.Catch=species,speciesFateLabel,catchWeight,meanWeight,meanLength,well
|
|
| 77 | 77 |
data.ps.observation.FloatingObject=objectOperationLabel,objectSchoolEstimateSize,objectObservedSpeciesSize
|
| 78 | 78 |
data.ps.observation.FloatingObjectPart=objectMaterialId,objectMaterialLabel,whenArriving,whenLeaving
|
| 79 |
-data.ps.observation.NonTargetCatchRelease=speciesLabel,speciesGroupReleaseModeLabel,statusLabel,conformityLabel,releasingTimeLabel,length
|
|
| 80 |
-data.ps.observation.ObjectObservedSpecies=speciesLabel,speciesStatusLabel,count
|
|
| 81 |
-data.ps.observation.ObjectSchoolEstimate=speciesLabel,totalWeight
|
|
| 79 |
+data.ps.observation.NonTargetCatchRelease=species,speciesGroupReleaseModeLabel,statusLabel,conformityLabel,releasingTimeLabel,length
|
|
| 80 |
+data.ps.observation.ObjectObservedSpecies=species,speciesStatusLabel,count
|
|
| 81 |
+data.ps.observation.ObjectSchoolEstimate=species,totalWeight
|
|
| 82 | 82 |
data.ps.observation.Route=date,startLogValue,endLogValue,comment,activitySize
|
| 83 | 83 |
data.ps.observation.Sample=homeId
|
| 84 |
-data.ps.observation.SampleMeasure=speciesLabel,length,weight,count,sexLabel
|
|
| 85 |
-data.ps.observation.SchoolEstimate=speciesLabel,meanWeight,totalWeight
|
|
| 84 |
+data.ps.observation.SampleMeasure=species,length,weight,count,sexLabel
|
|
| 85 |
+data.ps.observation.SchoolEstimate=species,meanWeight,totalWeight
|
|
| 86 | 86 |
data.ps.observation.Set=comment,sampleMeasureEnabled,nonTargetCatchReleaseEnabled,catchesSize,nonTargetCatchReleaseSize,schoolEstimateSize,sampleMeasureSize
|
| 87 | 87 |
data.ps.observation.TransmittingBuoy=code,comment,transmittingBuoyTypeLabel,transmittingBuoyOperationLabel
|
| 88 | 88 |
referential.common.Country=code,label,uri,iso2Code,iso3Code
|
| ... | ... | @@ -1266,6 +1266,8 @@ observe.referential.ll.observation.SensorDataFormat.type |
| 1266 | 1266 |
observe.referential.ll.observation.SensorType.type
|
| 1267 | 1267 |
observe.referential.ll.observation.StomachFullness.type
|
| 1268 | 1268 |
observe.referential.ps.common.AcquisitionStatus.advancedSampling
|
| 1269 |
+observe.referential.ps.common.AcquisitionStatus.fieldDisabled
|
|
| 1270 |
+observe.referential.ps.common.AcquisitionStatus.fieldEnabled
|
|
| 1269 | 1271 |
observe.referential.ps.common.AcquisitionStatus.fieldEnabler
|
| 1270 | 1272 |
observe.referential.ps.common.AcquisitionStatus.landing
|
| 1271 | 1273 |
observe.referential.ps.common.AcquisitionStatus.localMarket
|
| ... | ... | @@ -22,3 +22,5 @@ observe.data.pairing.ActivityPairingResultItem.type |
| 22 | 22 |
observe.data.ps.observation.Set.type
|
| 23 | 23 |
observe.referential.common.Vessel.flagCountry
|
| 24 | 24 |
observe.referential.common.Vessel.fleetCountry
|
| 25 |
+observe.referential.ps.common.AcquisitionStatus.fieldDisabled
|
|
| 26 |
+observe.referential.ps.common.AcquisitionStatus.fieldEnabled
|
| 1 |
+package fr.ird.observe.spi.decoration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe Models :: Dto :: Java
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2021 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 io.ultreia.java4all.i18n.I18n;
|
|
| 26 |
+ |
|
| 27 |
+import java.util.Locale;
|
|
| 28 |
+ |
|
| 29 |
+/**
|
|
| 30 |
+ * Created on 19/10/2021.
|
|
| 31 |
+ *
|
|
| 32 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 33 |
+ * @since 9.0.0
|
|
| 34 |
+ */
|
|
| 35 |
+public interface ObserveDefaultDecoratorRenderer {
|
|
| 36 |
+ |
|
| 37 |
+ default String speciesLabel(String faoCode, String scientificLabel, String label) {
|
|
| 38 |
+ if ("xx".equals(scientificLabel)) {
|
|
| 39 |
+ return String.format("%s - %s", faoCode, label);
|
|
| 40 |
+ }
|
|
| 41 |
+ return String.format("%s - %s - %s", faoCode, scientificLabel, label);
|
|
| 42 |
+ }
|
|
| 43 |
+ |
|
| 44 |
+ default String fieldEnabler(Locale locale, boolean fieldEnabler) {
|
|
| 45 |
+ return fieldEnabler ? I18n.l(locale, "observe.referential.ps.common.AcquisitionStatus.fieldEnabled") : I18n.l(locale, "observe.referential.ps.common.AcquisitionStatus.fieldDisabled");
|
|
| 46 |
+ }
|
|
| 47 |
+}
|
| 1 |
+package fr.ird.observe.spi.decoration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe Models :: Dto :: Java
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2021 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 fr.ird.observe.dto.BusinessDto;
|
|
| 26 |
+import fr.ird.observe.dto.referential.common.SpeciesReference;
|
|
| 27 |
+import fr.ird.observe.dto.referential.ps.common.AcquisitionStatusReference;
|
|
| 28 |
+ |
|
| 29 |
+import java.util.Locale;
|
|
| 30 |
+ |
|
| 31 |
+/**
|
|
| 32 |
+ * Created on 19/10/2021.
|
|
| 33 |
+ *
|
|
| 34 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 35 |
+ * @since 9.0.0
|
|
| 36 |
+ */
|
|
| 37 |
+public class ObserveDtoDecoratorRenderer<O extends BusinessDto> extends DtoDecoratorRenderer<O> implements ObserveDefaultDecoratorRenderer {
|
|
| 38 |
+ |
|
| 39 |
+ public ObserveDtoDecoratorRenderer(Class<O> type) {
|
|
| 40 |
+ super(type);
|
|
| 41 |
+ }
|
|
| 42 |
+ |
|
| 43 |
+ public String speciesLabel(Locale locale, SpeciesReference species) {
|
|
| 44 |
+ if (species == null) {
|
|
| 45 |
+ return onNullValue(locale, null);
|
|
| 46 |
+ }
|
|
| 47 |
+ String faoCode = species.getFaoCode();
|
|
| 48 |
+ String scientificLabel = species.getScientificLabel();
|
|
| 49 |
+ String label = label(locale, species);
|
|
| 50 |
+ return speciesLabel(faoCode, scientificLabel, label);
|
|
| 51 |
+ }
|
|
| 52 |
+ |
|
| 53 |
+ public String fieldEnabler(Locale locale, AcquisitionStatusReference reference) {
|
|
| 54 |
+ return fieldEnabler(locale, reference.isFieldEnabler());
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+}
|
| 1 |
+package fr.ird.observe.spi.decoration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe Models :: Dto :: Java
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2021 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 fr.ird.observe.dto.reference.DtoReference;
|
|
| 26 |
+import fr.ird.observe.dto.referential.common.SpeciesReference;
|
|
| 27 |
+import fr.ird.observe.dto.referential.ps.common.AcquisitionStatusReference;
|
|
| 28 |
+ |
|
| 29 |
+import java.util.Locale;
|
|
| 30 |
+ |
|
| 31 |
+/**
|
|
| 32 |
+ * Created on 19/10/2021.
|
|
| 33 |
+ *
|
|
| 34 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 35 |
+ * @since 9.0.0
|
|
| 36 |
+ */
|
|
| 37 |
+public class ObserveDtoReferenceDecoratorRenderer<O extends DtoReference> extends DtoReferenceDecoratorRenderer<O> implements ObserveDefaultDecoratorRenderer{
|
|
| 38 |
+ |
|
| 39 |
+ public ObserveDtoReferenceDecoratorRenderer(Class<O> type) {
|
|
| 40 |
+ super(type);
|
|
| 41 |
+ }
|
|
| 42 |
+ |
|
| 43 |
+ public String speciesLabel(Locale locale, SpeciesReference species) {
|
|
| 44 |
+ if (species == null) {
|
|
| 45 |
+ return onNullValue(locale, null);
|
|
| 46 |
+ }
|
|
| 47 |
+ String faoCode = species.getFaoCode();
|
|
| 48 |
+ String scientificLabel = species.getScientificLabel();
|
|
| 49 |
+ String label = label(locale, species);
|
|
| 50 |
+ return speciesLabel(faoCode, scientificLabel, label);
|
|
| 51 |
+ }
|
|
| 52 |
+ |
|
| 53 |
+ public String fieldEnabler(Locale locale, AcquisitionStatusReference reference) {
|
|
| 54 |
+ return fieldEnabler(locale, reference.isFieldEnabler());
|
|
| 55 |
+ }
|
|
| 56 |
+}
|
| 1 |
+package fr.ird.observe.spi.decoration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe Models :: Persistence :: Java
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2021 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 fr.ird.observe.entities.Entity;
|
|
| 26 |
+import fr.ird.observe.entities.referential.common.Species;
|
|
| 27 |
+import fr.ird.observe.entities.referential.ps.common.AcquisitionStatus;
|
|
| 28 |
+ |
|
| 29 |
+import java.util.Locale;
|
|
| 30 |
+ |
|
| 31 |
+/**
|
|
| 32 |
+ * Created on 19/10/2021.
|
|
| 33 |
+ *
|
|
| 34 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 35 |
+ * @since 9.0.0
|
|
| 36 |
+ */
|
|
| 37 |
+public class ObserveEntityDecoratorRenderer<O extends Entity> extends EntityDecoratorRenderer<O> implements ObserveDefaultDecoratorRenderer {
|
|
| 38 |
+ |
|
| 39 |
+ public ObserveEntityDecoratorRenderer(Class<O> type) {
|
|
| 40 |
+ super(type);
|
|
| 41 |
+ }
|
|
| 42 |
+ |
|
| 43 |
+ public String speciesLabel(Locale locale, Species species) {
|
|
| 44 |
+ if (species == null) {
|
|
| 45 |
+ return onNullValue(locale, null);
|
|
| 46 |
+ }
|
|
| 47 |
+ String faoCode = species.getFaoCode();
|
|
| 48 |
+ String scientificLabel = species.getScientificLabel();
|
|
| 49 |
+ String label = label(locale, species);
|
|
| 50 |
+ return speciesLabel(faoCode, scientificLabel, label);
|
|
| 51 |
+ }
|
|
| 52 |
+ |
|
| 53 |
+ public String fieldEnabler(Locale locale, AcquisitionStatus reference) {
|
|
| 54 |
+ return fieldEnabler(locale, reference.isFieldEnabler());
|
|
| 55 |
+ }
|
|
| 56 |
+}
|
| ... | ... | @@ -1503,6 +1503,8 @@ observe.referential.ll.observation.SensorDataFormat.type=Sensor data format |
| 1503 | 1503 |
observe.referential.ll.observation.SensorType.type=Sensor type
|
| 1504 | 1504 |
observe.referential.ll.observation.StomachFullness.type=Stomac fullness
|
| 1505 | 1505 |
observe.referential.ps.common.AcquisitionStatus.advancedSampling=Advanced Sampling
|
| 1506 |
+observe.referential.ps.common.AcquisitionStatus.fieldDisabled=Data acquisition not allowed
|
|
| 1507 |
+observe.referential.ps.common.AcquisitionStatus.fieldEnabled=Data acquisition allowed
|
|
| 1506 | 1508 |
observe.referential.ps.common.AcquisitionStatus.fieldEnabler=Can acquire data?
|
| 1507 | 1509 |
observe.referential.ps.common.AcquisitionStatus.landing=Landing
|
| 1508 | 1510 |
observe.referential.ps.common.AcquisitionStatus.localMarket=Local market
|
| ... | ... | @@ -1503,6 +1503,8 @@ observe.referential.ll.observation.SensorDataFormat.type=Formato de los datos de |
| 1503 | 1503 |
observe.referential.ll.observation.SensorType.type=Tipo de sensor
|
| 1504 | 1504 |
observe.referential.ll.observation.StomachFullness.type=Nivel de llenado del estomago
|
| 1505 | 1505 |
observe.referential.ps.common.AcquisitionStatus.advancedSampling=Advanced Sampling \#TODO
|
| 1506 |
+observe.referential.ps.common.AcquisitionStatus.fieldDisabled=Data acquisition not allowed
|
|
| 1507 |
+observe.referential.ps.common.AcquisitionStatus.fieldEnabled=Data acquisition allowed
|
|
| 1506 | 1508 |
observe.referential.ps.common.AcquisitionStatus.fieldEnabler=Can acquire data? \#TODO
|
| 1507 | 1509 |
observe.referential.ps.common.AcquisitionStatus.landing=Landing
|
| 1508 | 1510 |
observe.referential.ps.common.AcquisitionStatus.localMarket=Local market
|
| ... | ... | @@ -1503,6 +1503,8 @@ observe.referential.ll.observation.SensorDataFormat.type=Format de données de c |
| 1503 | 1503 |
observe.referential.ll.observation.SensorType.type=Type de capteur
|
| 1504 | 1504 |
observe.referential.ll.observation.StomachFullness.type=Niveau de remplissage de l'estomac
|
| 1505 | 1505 |
observe.referential.ps.common.AcquisitionStatus.advancedSampling=Échantillonnage avancé
|
| 1506 |
+observe.referential.ps.common.AcquisitionStatus.fieldDisabled=Saisie de données non autorisée
|
|
| 1507 |
+observe.referential.ps.common.AcquisitionStatus.fieldEnabled=Saisie de données autorisée
|
|
| 1506 | 1508 |
observe.referential.ps.common.AcquisitionStatus.fieldEnabler=Saisie de données autorisée ?
|
| 1507 | 1509 |
observe.referential.ps.common.AcquisitionStatus.landing=Débarquement
|
| 1508 | 1510 |
observe.referential.ps.common.AcquisitionStatus.localMarket=Marché local
|