From 2b984aa7126f85326163fa13bd35787f0f71c9b0 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 22 Apr 2022 15:57:00 +0200 Subject: [PATCH] Aligned code --- .../grsf_publish_ws/json/input/record/Common.java | 6 +----- .../grsf_publish_ws/json/input/record/FisheryRecord.java | 5 +++-- .../grsf_publish_ws/json/input/record/StockRecord.java | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/Common.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/Common.java index 1d0528d..3e78687 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/Common.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/Common.java @@ -55,7 +55,7 @@ public abstract class Common extends Base { @JsonProperty(Constants.SDG_FLAG_JSON_KEY) @CustomField(key=Constants.SDG_FLAG_CUSTOM_KEY) - @Group(condition="true", groupNameOverValue=Constants.SDG_FLAG_GROUP_NAME) // record is added to group grsf-sdg-flag if sdg Flag is true + @Group(condition="true", groupNameOverValue=Constants.SDG_FLAG_GROUP_NAME, prependSourceToGroupName=true) // record is added to group grsf-sdg-flag if sdg Flag is true private Boolean sdgFlag; @JsonProperty(Constants.STATUS_OF_THE_GRSF_RECORD_JSON_KEY) @@ -89,10 +89,6 @@ public abstract class Common extends Base { @CustomField(key=Constants.SIMILAR_GRSF_RECORDS_CUSTOM_KEY) private List similarGRSFRecords; -// @JsonProperty(Constants.SIMILAR_SOURCE_RECORDS_JSON_KEY) -// @CustomField(key=Constants.SIMILAR_SOURCE_RECORDS_CUSTOM_KEY) -// private List similarSourceRecords; - // automatically set @CustomField(key=Constants.DOMAIN_CUSTOM_KEY) private String domain; diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/FisheryRecord.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/FisheryRecord.java index d6e69a8..46d09b9 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/FisheryRecord.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/FisheryRecord.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class FisheryRecord extends Common { @JsonProperty(Constants.FISHERY_NAME_JSON_KEY) + @CustomField(key=Constants.FISHERY_NAME_CUSTOM_KEY) @NotNull(message="fishery_name cannot be null") @Size(min=1, message="fishery_name cannot be empty") - @CustomField(key=Constants.FISHERY_NAME_CUSTOM_KEY) private String fisheryName; @JsonProperty(Constants.GRSF_SEMANTIC_IDENTIFIER_JSON_KEY) @@ -33,7 +33,7 @@ public class FisheryRecord extends Common { @JsonProperty(Constants.TRACEABILITY_FLAG_JSON_KEY) @CustomField(key=Constants.TRACEABILITY_FLAG_CUSTOM_KEY) - @Group(condition="true", groupNameOverValue=Constants.TRACEABILITY_FLAG_GROUP_NAME) // record is added to group grsf-traceability-flag if Traceability Flag is true + @Group(condition="true", groupNameOverValue=Constants.TRACEABILITY_FLAG_CUSTOM_KEY, prependSourceToGroupName=true) // record is added to group grsf-traceability-flag if Traceability Flag is true private Boolean traceabilityFlag; @JsonProperty(Constants.FISHING_AREA_JSON_KEY) @@ -43,6 +43,7 @@ public class FisheryRecord extends Common { @JsonProperty(Constants.JURISDICTION_AREA_JSON_KEY) @CustomField(key=Constants.JURISDICTION_AREA_CUSTOM_KEY) + @Tag private List jurisdictionArea; @JsonProperty(Constants.RESOURCES_EXPLOITED_JSON_KEY) diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/StockRecord.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/StockRecord.java index d0a83c6..820b24f 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/StockRecord.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/json/input/record/StockRecord.java @@ -26,9 +26,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class StockRecord extends Common{ @JsonProperty(Constants.STOCK_NAME_JSON_KEY) + @CustomField(key=Constants.STOCK_NAME_CUSTOM_KEY) @NotNull(message=Constants.STOCK_NAME_JSON_KEY + " cannot be null") @Size(min=2, message=Constants.STOCK_NAME_JSON_KEY + " cannot be empty") - @CustomField(key=Constants.STOCK_NAME_CUSTOM_KEY) private String stockName; @JsonProperty(Constants.GRSF_SEMANTIC_IDENTIFIER_JSON_KEY)