diff --git a/CHANGELOG.md b/CHANGELOG.md
index 884e3de..ed6c3be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v1.3.3-SNAPSHOT]
+
+- Adding support for "FAO SDG 14.4.1 Questionnaire" source [#23670]
+
## [v1.3.2]
- Updated Labels [#23167]
diff --git a/pom.xml b/pom.xml
index d4365e9..9796668 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
org.gcube.data-catalogue
grsf-common-library
jar
- 1.3.2
+ 1.3.3-SNAPSHOT
Common library for GRSF service and management panel
diff --git a/src/main/java/org/gcube/datacatalogue/common/enums/Sources.java b/src/main/java/org/gcube/datacatalogue/common/enums/Sources.java
index dbcfeb7..49629d2 100644
--- a/src/main/java/org/gcube/datacatalogue/common/enums/Sources.java
+++ b/src/main/java/org/gcube/datacatalogue/common/enums/Sources.java
@@ -1,7 +1,6 @@
package org.gcube.datacatalogue.common.enums;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -13,60 +12,69 @@ import com.fasterxml.jackson.annotation.JsonValue;
*/
public enum Sources {
- FIRMS("FIRMS"),
- RAM("RAM"),
- FISHSOURCE("FishSource"),
- GRSF("GRSF");
+ FIRMS("FIRMS","firms"),
+ RAM("RAM","ram"),
+ FISHSOURCE("FishSource", "fishsource"),
+ GRSF("GRSF", "grsf"),
+ SDG("FAO SDG 14.4.1 Questionnaire","sdg14.4.1");
- private String subGroupNameOrig;
+ private String sourceName;
+ private String urlPath;
- private Sources(String origName) {
- this.subGroupNameOrig = origName;
+ private Sources(String sourceName, String urlPath) {
+ this.sourceName = sourceName;
+ this.urlPath = urlPath;
}
/**
* Return the original name
* @return
*/
- public String getOrigName(){
- return subGroupNameOrig;
+ public String getSourceName(){
+ return sourceName;
}
@JsonValue
public String onSerialize(){
- return subGroupNameOrig.toLowerCase();
+ return urlPath;
}
@JsonCreator
public static Sources onDeserialize(String sourceString) {
if(sourceString != null) {
for(Sources source : Sources.values()) {
- if (source.toString().equalsIgnoreCase(sourceString.trim()))
+ if (source.urlPath.equalsIgnoreCase(sourceString.trim()))
return source;
}
}
return null;
}
+ public String getURLPath() {
+ return urlPath;
+ }
+
@Override
public String toString() {
- return getOrigName();
+ return urlPath;
}
- public static String getAsList(){
- return "[" + Arrays.asList(
- FIRMS.toString().toLowerCase(),
- RAM.toString().toLowerCase(),
- FISHSOURCE.toString().toLowerCase(),
- GRSF.toString().toLowerCase()) + "]";
+ public static String getJsonArrayAsString(){
+ return "[" + FIRMS.urlPath + "," +
+ RAM.urlPath + "," +
+ FISHSOURCE.urlPath + "," +
+ GRSF.urlPath + "," +
+ SDG.urlPath + "," + "]";
}
- public static List getListNames(){
+ public static List listNames(){
List valuesString = new ArrayList(Sources.values().length);
- for(Sources source : Sources.values())
- valuesString.add(source.getOrigName());
+ for(Sources source : Sources.values()) {
+ valuesString.add(source.getSourceName());
+ }
return valuesString;
}
+
}