From 51c91a387852a1068c1de74adbe12035cb328fce Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 27 Apr 2022 13:10:23 +0200 Subject: [PATCH] Fixing groups refs #23215 --- .../grsf_publish_ws/custom_annotations/Group.java | 6 +++--- .../grsf_publish_ws/json/input/record/Common.java | 2 +- .../grsf_publish_ws/json/input/record/FisheryRecord.java | 3 +-- .../grsf_publish_ws/json/input/record/StockRecord.java | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/custom_annotations/Group.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/custom_annotations/Group.java index 3b9a219..656bbbe 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/custom_annotations/Group.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/custom_annotations/Group.java @@ -21,8 +21,8 @@ public @interface Group { String condition() default ""; /** - * If this value is set, it is the name of the group (apart the source, i.e. "grsf", "ram", "firms", "fishsource" that will be prepended) to which the - * record needs to be put. + * If this value is set, it is used as name of the group in place of the filed value. + * (apart the source, i.e. "grsf", "ram", "firms", "fishsource" that will be prepended depending on prependSourceToGroupName) * @return */ String groupNameOverValue() default ""; @@ -32,6 +32,6 @@ public @interface Group { * Set to false to avoid source prepending * @return */ - boolean prependSourceToGroupName() default true; + boolean prependSourceToGroupName() default false; } 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 590e505..3c52abc 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_CUSTOM_KEY, prependSourceToGroupName=true) // record is added to group grsf-sdg-flag if sdg Flag is true + @Group(condition="true", groupNameOverValue=Constants.SDG_FLAG_GROUP_NAME, prependSourceToGroupName=false) // 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) 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 52f215b..c38d87a 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 @@ -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_CUSTOM_KEY, prependSourceToGroupName=true) // record is added to group grsf-traceability-flag if Traceability Flag is true + @Group(condition="true", groupNameOverValue=Constants.TRACEABILITY_FLAG_GROUP_NAME, prependSourceToGroupName=false) // record is added to group grsf-traceability-flag if Traceability Flag is true private Boolean traceabilityFlag; @JsonProperty(Constants.FISHING_AREA_JSON_KEY) @@ -62,7 +62,6 @@ public class FisheryRecord extends Common { @JsonProperty(Constants.GRSF_TYPE_JSON_KEY) @CustomField(key=Constants.GRSF_TYPE_CUSTOM_KEY) - @Group(prependSourceToGroupName = false) @Tag private Fishery_Type type; 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 0153c47..04af637 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 @@ -109,7 +109,6 @@ public class StockRecord extends Common{ @JsonProperty(Constants.GRSF_TYPE_JSON_KEY) @CustomField(key=Constants.GRSF_TYPE_CUSTOM_KEY) - @Group(prependSourceToGroupName = false) @Tag private Stock_Type type;