First import of the web service

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@132940 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-10-07 16:23:23 +00:00
parent d2f5229fae
commit f60226a244
16 changed files with 1121 additions and 0 deletions

26
.classpath Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>grsf-publisher-ws</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

193
pom.xml Normal file
View File

@ -0,0 +1,193 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
<relativePath />
</parent>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>grsf-publisher-ws</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>grsf-publisher-ws</name>
<description>
Utility library to publish GRSF products on data catalogue.
</description>
<scm>
<connection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/${serviceClass}/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/${serviceClass}/${project.artifactId}</developerConnection>
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/${serviceClass}/${project.artifactId}</url>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-smartgears-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.jersey>2.22.1</version.jersey>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<distroDirectory>distro</distroDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>ckan-util-library</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
<artifactId>jersey-container-servlet-core</artifactId>
<version>${version.jersey}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${version.jersey}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-processing</artifactId>
<version>${version.jersey}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${version.jersey}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-sse</artifactId>
<version>${version.jersey}</version>
</dependency>
<!-- SmartGears -->
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${name}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<!-- <goals> -->
<!-- <goal>exploded</goal> -->
<!-- </goals> -->
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- SA Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-profile</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<directory>${distroDirectory}</directory>
<filtering>true</filtering>
<includes>
<include>profile.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,210 @@
package org.gcube.data_catalogue.grsf_publish_ws.json;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Source;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Status;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Information that both Stock and Fishery must contain
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class Common {
@JsonProperty("description")
private String description;
@JsonProperty("license")
private String license;
@JsonProperty("author")
private String author; // this will be filled with the username of the token's owner
@JsonProperty("version")
private long version;
@JsonProperty("author_contact")
private String authorContact;
@JsonProperty("maintainer")
private String maintainer;
@JsonProperty("maintainer_contact")
private String maintainerContact;
@JsonProperty("catches_or_landings")
private String catchesOrLandings;
@JsonProperty("database_sources")
private Source databaseSources;
@JsonProperty("source_of_information")
private String sourceOfInformation;
@JsonProperty("data_owner")
private String dataOwner;
@JsonProperty("type")
private Type type;
@JsonProperty("status")
private Status status;
public Common() {
super();
}
/**
* @param description
* @param license
* @param author
* @param version
* @param authorContact
* @param maintainer
* @param maintainerContact
* @param catchesOrLandings
* @param databaseSources
* @param sourceOfInformation
* @param dataOwner
* @param type
* @param status
*/
public Common(String description, String license, String author,
long version, String authorContact, String maintainer,
String maintainerContact, String catchesOrLandings,
Source databaseSources, String sourceOfInformation,
String dataOwner, Type type, Status status) {
super();
this.description = description;
this.license = license;
this.author = author;
this.version = version;
this.authorContact = authorContact;
this.maintainer = maintainer;
this.maintainerContact = maintainerContact;
this.catchesOrLandings = catchesOrLandings;
this.databaseSources = databaseSources;
this.sourceOfInformation = sourceOfInformation;
this.dataOwner = dataOwner;
this.type = type;
this.status = status;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLicense() {
return license;
}
public void setLicense(String license) {
this.license = license;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public long getVersion() {
return version;
}
public void setVersion(long version) {
this.version = version;
}
public String getAuthorContact() {
return authorContact;
}
public void setAuthorContact(String authorContact) {
this.authorContact = authorContact;
}
public String getMaintainer() {
return maintainer;
}
public void setMaintainer(String maintainer) {
this.maintainer = maintainer;
}
public String getMaintainerContact() {
return maintainerContact;
}
public void setMaintainerContact(String maintainerContact) {
this.maintainerContact = maintainerContact;
}
public String getCatchesOrLandings() {
return catchesOrLandings;
}
public void setCatchesOrLandings(String catchesOrLandings) {
this.catchesOrLandings = catchesOrLandings;
}
public Source getDatabaseSources() {
return databaseSources;
}
public void setDatabaseSources(Source databaseSources) {
this.databaseSources = databaseSources;
}
public String getSourceOfInformation() {
return sourceOfInformation;
}
public void setSourceOfInformation(String sourceOfInformation) {
this.sourceOfInformation = sourceOfInformation;
}
public String getDataOwner() {
return dataOwner;
}
public void setDataOwner(String dataOwner) {
this.dataOwner = dataOwner;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
@Override
public String toString() {
return "Common [description=" + description + ", license=" + license
+ ", author=" + author + ", version=" + version
+ ", authorContact=" + authorContact + ", maintainer="
+ maintainer + ", maintainerContact=" + maintainerContact
+ ", catchesOrLandings=" + catchesOrLandings
+ ", databaseSources=" + databaseSources
+ ", sourceOfInformation=" + sourceOfInformation
+ ", dataOwner=" + dataOwner + ", type=" + type + ", status="
+ status + "]";
}
}

View File

@ -0,0 +1,169 @@
package org.gcube.data_catalogue.grsf_publish_ws.json;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Production_System_Type;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A fishery record bean
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class FisheryRecord extends Common{
@JsonProperty("fishery_name")
private String fisheryName;
@JsonProperty("fishery_id")
private String fisheryId;
@JsonProperty("scientific_name")
private String scientificName;
@JsonProperty("fishing_area")
private String fishingArea;
@JsonProperty("exploiting_stocks")
private String exploitingStocks;
@JsonProperty("management_entity")
private String managementEntity;
@JsonProperty("jurisdiction_area")
private String jurisdictionArea;
@JsonProperty("production_system_type")
private Production_System_Type productionSystemType;
@JsonProperty("flag_state")
private String flagState;
@JsonProperty("fishing_gear")
private String fishingGear;
public FisheryRecord() {
super();
}
/**
* @param fisheryName
* @param fisheryId
* @param scientificName
* @param fishingArea
* @param exploitingStocks
* @param managementEntity
* @param jurisdictionArea
* @param productionSystemType
* @param flagState
* @param fishingGear
*/
public FisheryRecord(String fisheryName, String fisheryId,
String scientificName, String fishingArea, String exploitingStocks,
String managementEntity, String jurisdictionArea,
Production_System_Type productionSystemType, String flagState,
String fishingGear) {
super();
this.fisheryName = fisheryName;
this.fisheryId = fisheryId;
this.scientificName = scientificName;
this.fishingArea = fishingArea;
this.exploitingStocks = exploitingStocks;
this.managementEntity = managementEntity;
this.jurisdictionArea = jurisdictionArea;
this.productionSystemType = productionSystemType;
this.flagState = flagState;
this.fishingGear = fishingGear;
}
public String getFisheryName() {
return fisheryName;
}
public void setFisheryName(String fisheryName) {
this.fisheryName = fisheryName;
}
public String getFisheryId() {
return fisheryId;
}
public void setFisheryId(String fisheryId) {
this.fisheryId = fisheryId;
}
public String getScientificName() {
return scientificName;
}
public void setScientificName(String scientificName) {
this.scientificName = scientificName;
}
public String getFishingArea() {
return fishingArea;
}
public void setFishingArea(String fishingArea) {
this.fishingArea = fishingArea;
}
public String getExploitingStocks() {
return exploitingStocks;
}
public void setExploitingStocks(String exploitingStocks) {
this.exploitingStocks = exploitingStocks;
}
public String getManagementEntity() {
return managementEntity;
}
public void setManagementEntity(String managementEntity) {
this.managementEntity = managementEntity;
}
public String getJurisdictionArea() {
return jurisdictionArea;
}
public void setJurisdictionArea(String jurisdictionArea) {
this.jurisdictionArea = jurisdictionArea;
}
public Production_System_Type getProductionSystemType() {
return productionSystemType;
}
public void setProductionSystemType(Production_System_Type productionSystemType) {
this.productionSystemType = productionSystemType;
}
public String getFlagState() {
return flagState;
}
public void setFlagState(String flagState) {
this.flagState = flagState;
}
public String getFishingGear() {
return fishingGear;
}
public void setFishingGear(String fishingGear) {
this.fishingGear = fishingGear;
}
@Override
public String toString() {
return "FisheryRecord [fisheryName=" + fisheryName + ", fisheryId="
+ fisheryId + ", scientificName=" + scientificName
+ ", fishingArea=" + fishingArea + ", exploitingStocks="
+ exploitingStocks + ", managementEntity=" + managementEntity
+ ", jurisdictionArea=" + jurisdictionArea
+ ", productionSystemType=" + productionSystemType
+ ", flagState=" + flagState + ", fishingGear=" + fishingGear
+ "]";
}
}

View File

@ -0,0 +1,230 @@
package org.gcube.data_catalogue.grsf_publish_ws.json;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Abundance_Level;
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Exploitation_Rate;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A stock record bean
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class StockRecord extends Common{
@JsonProperty("stock_name")
private String stockName;
@JsonProperty("stock_id")
private String stockID;
@JsonProperty("species_scientific_name")
private String speciesScientificName;
@JsonProperty("area")
private String area;
@JsonProperty("exploiting_fishery")
private String exploitingFishery;
@JsonProperty("management_entity")
private String managementEntity;
@JsonProperty("assessment_methods")
private String assessmentMethods;
@JsonProperty("state_of_marine_resource")
private String stateOfMarineResource;
@JsonProperty("exploitation_rate")
private Exploitation_Rate exploitationRate;
@JsonProperty("abundance_level")
private Abundance_Level abundanceLevel;
@JsonProperty("narrative_state_and_trend")
private String narrativeStateAndTrend;
@JsonProperty("scientific_advice")
private String scientificAdvice;
@JsonProperty("reporting_entity")
private String reportingEntity;
@JsonProperty("reporting_year")
private long reportingYear;
/**
*
*/
public StockRecord() {
super();
}
/**
* @param stockName
* @param stockID
* @param speciesScientificName
* @param area
* @param exploitingFishery
* @param managementEntity
* @param assessmentMethods
* @param stateOfMarineResource
* @param exploitationRate
* @param abundanceLevel
* @param narrativeStateAndTrend
* @param scientificAdvice
* @param reportingEntity
* @param reportingYear
*/
public StockRecord(String stockName, String stockID,
String speciesScientificName, String area,
String exploitingFishery, String managementEntity,
String assessmentMethods, String stateOfMarineResource,
Exploitation_Rate exploitationRate, Abundance_Level abundanceLevel,
String narrativeStateAndTrend, String scientificAdvice,
String reportingEntity, long reportingYear) {
super();
this.stockName = stockName;
this.stockID = stockID;
this.speciesScientificName = speciesScientificName;
this.area = area;
this.exploitingFishery = exploitingFishery;
this.managementEntity = managementEntity;
this.assessmentMethods = assessmentMethods;
this.stateOfMarineResource = stateOfMarineResource;
this.exploitationRate = exploitationRate;
this.abundanceLevel = abundanceLevel;
this.narrativeStateAndTrend = narrativeStateAndTrend;
this.scientificAdvice = scientificAdvice;
this.reportingEntity = reportingEntity;
this.reportingYear = reportingYear;
}
public String getStockName() {
return stockName;
}
public void setStockName(String stockName) {
this.stockName = stockName;
}
public String getStockID() {
return stockID;
}
public void setStockID(String stockID) {
this.stockID = stockID;
}
public String getSpeciesScientificName() {
return speciesScientificName;
}
public void setSpeciesScientificName(String speciesScientificName) {
this.speciesScientificName = speciesScientificName;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getExploitingFishery() {
return exploitingFishery;
}
public void setExploitingFishery(String exploitingFishery) {
this.exploitingFishery = exploitingFishery;
}
public String getManagementEntity() {
return managementEntity;
}
public void setManagementEntity(String managementEntity) {
this.managementEntity = managementEntity;
}
public String getAssessmentMethods() {
return assessmentMethods;
}
public void setAssessmentMethods(String assessmentMethods) {
this.assessmentMethods = assessmentMethods;
}
public String getStateOfMarineResource() {
return stateOfMarineResource;
}
public void setStateOfMarineResource(String stateOfMarineResource) {
this.stateOfMarineResource = stateOfMarineResource;
}
public Exploitation_Rate getExploitationRate() {
return exploitationRate;
}
public void setExploitationRate(Exploitation_Rate exploitationRate) {
this.exploitationRate = exploitationRate;
}
public Abundance_Level getAbundanceLevel() {
return abundanceLevel;
}
public void setAbundanceLevel(Abundance_Level abundanceLevel) {
this.abundanceLevel = abundanceLevel;
}
public String getNarrativeStateAndTrend() {
return narrativeStateAndTrend;
}
public void setNarrativeStateAndTrend(String narrativeStateAndTrend) {
this.narrativeStateAndTrend = narrativeStateAndTrend;
}
public String getScientificAdvice() {
return scientificAdvice;
}
public void setScientificAdvice(String scientificAdvice) {
this.scientificAdvice = scientificAdvice;
}
public String getReportingEntity() {
return reportingEntity;
}
public void setReportingEntity(String reportingEntity) {
this.reportingEntity = reportingEntity;
}
public long getReportingYear() {
return reportingYear;
}
public void setReportingYear(long reportingYear) {
this.reportingYear = reportingYear;
}
@Override
public String toString() {
return "StockRecord [stockName=" + stockName + ", stockID=" + stockID
+ ", speciesScientificName=" + speciesScientificName
+ ", area=" + area + ", exploitingFishery=" + exploitingFishery
+ ", managementEntity=" + managementEntity
+ ", assessmentMethods=" + assessmentMethods
+ ", stateOfMarineResource=" + stateOfMarineResource
+ ", exploitationRate=" + exploitationRate
+ ", abundanceLevel=" + abundanceLevel
+ ", narrativeStateAndTrend=" + narrativeStateAndTrend
+ ", scientificAdvice=" + scientificAdvice
+ ", reportingEntity=" + reportingEntity + ", reportingYear="
+ reportingYear + "]";
}
}

View File

@ -0,0 +1,19 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils;
/**
* Helper methods
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public abstract class HelperMethods {
public static String getGroupNameOnCkan(String origName){
if(origName == null)
throw new IllegalArgumentException("origName cannot be null");
return origName.trim().toLowerCase().replaceAll("[^A-Za-z0-9_.]", "_");
}
}

View File

@ -0,0 +1,38 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Abundance_Level for Stock records
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Abundance_Level {
Intermediate_Abundance("Intermediate abundance"),
Low_Abundance("Low abundance"),
Uncertain_Not_Assesed("Uncertain/Not assesed");
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Abundance_Level(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}

View File

@ -0,0 +1,38 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Exploitation_Rate for Stock records
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Exploitation_Rate {
Moderate_Fishing_Mortality("Moderate fishing mortality"),
High_Fishing_Mortality("High fishing mortality"),
No_Or_Low_Fishing_Mortality("No or low fishing mortality");
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Exploitation_Rate(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}

View File

@ -0,0 +1,44 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Production_System_Type for Fishery records
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Production_System_Type {
Subsistence("Subsistence"),
Recreational("Recreational"),
Commercial("Commercial"),
Artisanal("Artisanal"),
Semi_Industrial("Semi-industrial"),
Industrial("Industrial"),
Exploratory_fisher("Exploratory_fisher"),
Unspecified("Unspecified");
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Production_System_Type(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}

View File

@ -0,0 +1,38 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Source Group and sub groups (for both Stock and Fishery) -> look at "Database Sources"
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Source {
FIRMS("FIRMS"),
RAM("RAM"),
FishSource("FishSource");
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Source(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}

View File

@ -0,0 +1,38 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Status Group and sub groups (for both Stock and Fishery)
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Status {
Pending("Pending"),
Confirmed("Confirmed");
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Status(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}

View File

@ -0,0 +1,42 @@
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods;
/**
* Type for Stock/Fishery records
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public enum Type {
Assesment_Unit("Assesment Unit"),
Resource("Resource"),
Fishing_Activity("Fishing Activity"), // for fishery
Fishing_Description("Fishing Description") // for fishery
;
private String subGroupNameOrig;
private String subGroupNameOnCkan;
private Type(String origName) {
this.subGroupNameOrig = origName;
this.subGroupNameOnCkan = HelperMethods.getGroupNameOnCkan(origName);
}
/**
* Return the name the group has on ckan
* @return
*/
public String getNameCkan(){
return subGroupNameOnCkan;
}
/**
* Return the original name
* @return
*/
public String getOrigName(){
return subGroupNameOrig;
}
}