Compare commits
No commits in common. "master" and "feature/23167" have entirely different histories.
master
...
feature/23
|
@ -2,4 +2,3 @@ target
|
|||
.classpath
|
||||
.project
|
||||
.settings
|
||||
/.DS_Store
|
||||
|
|
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -3,16 +3,6 @@
|
|||
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).
|
||||
|
||||
## [v2.0.0]
|
||||
|
||||
- Adding support for "FAO SDG 14.4.1 Questionnaire" source [#23670]
|
||||
- Upgraded gcube-bom version to 2.1.0
|
||||
|
||||
## [v1.3.2]
|
||||
|
||||
- Updated Labels [#23167]
|
||||
|
||||
|
||||
## [v1.3.1] - 2021-04-09
|
||||
|
||||
### Changed
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<groupId>org.gcube.data-catalogue</groupId>
|
||||
<artifactId>grsf-common-library</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.0.0</version>
|
||||
<version>1.3.1</version>
|
||||
<description>Common library for GRSF service and management panel</description>
|
||||
|
||||
<properties>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-bom</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.0.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -33,10 +33,8 @@ public class Constants {
|
|||
public static final String SHORT_NAME_JSON_KEY = "short_name";
|
||||
public static final String TRACEABILITY_FLAG_CUSTOM_KEY = "Traceability Flag";
|
||||
public static final String TRACEABILITY_FLAG_JSON_KEY = "traceability_flag";
|
||||
public static final String TRACEABILITY_FLAG_GROUP_NAME = "GRSF" + TRACEABILITY_FLAG_CUSTOM_KEY;
|
||||
public static final String SDG_FLAG_CUSTOM_KEY = "SDG Flag";
|
||||
public static final String SDG_FLAG_JSON_KEY = "sdg_flag";
|
||||
public static final String SDG_FLAG_GROUP_NAME = "GRSF " + SDG_FLAG_CUSTOM_KEY;
|
||||
public static final String CATCHES_CUSTOM_KEY = "Catch";
|
||||
public static final String CATCHES_JSON_KEY = "catches";
|
||||
public static final String LANDINGS_CUSTOM_KEY = "Landing";
|
||||
|
@ -88,14 +86,8 @@ public class Constants {
|
|||
public static final String SCIENTIFIC_ADVICE_JSON_KEY = "scientific_advice";
|
||||
public static final String ASSESSOR_CUSTOM_KEY = "Assessor";
|
||||
public static final String ASSESSOR_JSON_KEY = "assessor";
|
||||
|
||||
// Must be 'spatial' to allow the Solr plugin to properly index large GeoJson
|
||||
// The Key will be replaced in the language file to Geospatial as indicated in the wiki
|
||||
// https://wiki.gcube-system.org/gcube/GCube_Data_Catalogue_for_GRSF#Common_Metadata
|
||||
public static final String SPATIAL_GEOJSON_CUSTOM_KEY = "spatial";
|
||||
public static final String SPATIAL_GEOJSON_CUSTOM_KEY = "Geospatial";
|
||||
public static final String SPATIAL_GEOJSON_JSON_KEY = "spatial";
|
||||
|
||||
|
||||
public static final String FISHERY_URI = "fishery_uri";
|
||||
public static final String STOCK_URI = "stock_uri";
|
||||
|
||||
|
@ -122,7 +114,7 @@ public class Constants {
|
|||
// other fields/regex
|
||||
public static final String DEFAULT_LICENSE = "CC-BY-SA-4.0";
|
||||
public static final String SYSTEM_TYPE_CUSTOM_KEY = "system:type";
|
||||
public static final String SYSTEM_TYPE_LEGACY_RECORD = "Legacy";
|
||||
public static final String SYSTEM_TYPE_FOR_SOURCES_VALUE = "Legacy";
|
||||
public static final String GRSF_DATABASE_SOURCE = "Database Source";
|
||||
public static final int TIME_SERIES_TAKE_LAST_VALUES = 5;
|
||||
public static final String REGEX_TAGS = "[^\\s\\w-_.]";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.datacatalogue.common.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
@ -12,73 +13,60 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||
*/
|
||||
public enum Sources {
|
||||
|
||||
FIRMS("FIRMS","firms"),
|
||||
RAM("RAM","ram"),
|
||||
FISHSOURCE("FishSource", "fishsource"),
|
||||
GRSF("GRSF", "grsf"),
|
||||
SDG("FAO SDG 14.4.1 Questionnaire","sdg");
|
||||
FIRMS("FIRMS"),
|
||||
RAM("RAM"),
|
||||
FISHSOURCE("FishSource"),
|
||||
GRSF("GRSF");
|
||||
|
||||
private String sourceName;
|
||||
private String urlPath;
|
||||
private String subGroupNameOrig;
|
||||
|
||||
private Sources(String sourceName, String urlPath) {
|
||||
this.sourceName = sourceName;
|
||||
this.urlPath = urlPath;
|
||||
private Sources(String origName) {
|
||||
this.subGroupNameOrig = origName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the original name
|
||||
* @return
|
||||
*/
|
||||
public String getSourceName(){
|
||||
return sourceName;
|
||||
public String getOrigName(){
|
||||
return subGroupNameOrig;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String onSerialize(){
|
||||
return urlPath;
|
||||
return subGroupNameOrig.toLowerCase();
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static Sources onDeserialize(String sourceString) {
|
||||
if(sourceString != null) {
|
||||
for(Sources source : Sources.values()) {
|
||||
if (source.urlPath.equalsIgnoreCase(sourceString.trim())) {
|
||||
if (source.toString().equalsIgnoreCase(sourceString.trim()))
|
||||
return source;
|
||||
}
|
||||
if (source.sourceName.equalsIgnoreCase(sourceString.trim())) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getURLPath() {
|
||||
return urlPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return urlPath;
|
||||
return getOrigName();
|
||||
}
|
||||
|
||||
public static String getJsonArrayAsString(){
|
||||
return "[" + FIRMS.urlPath + "," +
|
||||
RAM.urlPath + "," +
|
||||
FISHSOURCE.urlPath + "," +
|
||||
GRSF.urlPath + "," +
|
||||
SDG.urlPath + "," + "]";
|
||||
public static String getAsList(){
|
||||
return "[" + Arrays.asList(
|
||||
FIRMS.toString().toLowerCase(),
|
||||
RAM.toString().toLowerCase(),
|
||||
FISHSOURCE.toString().toLowerCase(),
|
||||
GRSF.toString().toLowerCase()) + "]";
|
||||
}
|
||||
|
||||
public static List<String> listNames(){
|
||||
public static List<String> getListNames(){
|
||||
|
||||
List<String> valuesString = new ArrayList<String>(Sources.values().length);
|
||||
for(Sources source : Sources.values()) {
|
||||
valuesString.add(source.getSourceName());
|
||||
}
|
||||
for(Sources source : Sources.values())
|
||||
valuesString.add(source.getOrigName());
|
||||
|
||||
return valuesString;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue