2016-10-08 20:46:17 +02:00
|
|
|
package org.gcube.data_catalogue.grsf_publish_ws.json.input;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
2016-10-15 22:34:57 +02:00
|
|
|
import javax.validation.Valid;
|
2016-10-13 11:46:42 +02:00
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
2016-11-01 22:35:52 +01:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CkanResource;
|
2016-10-08 23:10:25 +02:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
2016-10-08 20:46:17 +02:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Tag;
|
2016-11-04 16:26:19 +01:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Source;
|
2016-10-27 11:40:19 +02:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Status;
|
2016-10-07 18:23:23 +02:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.utils.groups.Type;
|
|
|
|
|
2016-10-09 16:28:24 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
2016-10-07 18:23:23 +02:00
|
|
|
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)
|
|
|
|
*/
|
2016-11-04 16:26:19 +01:00
|
|
|
@JsonIgnoreProperties(value = {"author", "author_contact", "extras", "product_type"}, ignoreUnknown = true) // ignore in serialization/deserialization
|
2016-10-07 18:23:23 +02:00
|
|
|
public class Common {
|
|
|
|
|
|
|
|
@JsonProperty("description")
|
|
|
|
private String description;
|
|
|
|
|
2016-10-11 11:39:25 +02:00
|
|
|
@JsonProperty("license_id")
|
2016-10-07 18:23:23 +02:00
|
|
|
private String license;
|
2016-10-10 18:50:11 +02:00
|
|
|
|
2016-10-11 19:51:35 +02:00
|
|
|
// filled automatically by the service
|
|
|
|
@JsonProperty("author")
|
2016-10-08 23:10:25 +02:00
|
|
|
private String author;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
|
|
|
@JsonProperty("version")
|
2016-10-08 23:10:25 +02:00
|
|
|
private Long version;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
2016-10-10 18:50:11 +02:00
|
|
|
// filled automatically by the service
|
2016-10-11 19:51:35 +02:00
|
|
|
@JsonProperty("author_contact")
|
2016-10-07 18:23:23 +02:00
|
|
|
private String authorContact;
|
|
|
|
|
|
|
|
@JsonProperty("maintainer")
|
|
|
|
private String maintainer;
|
|
|
|
|
|
|
|
@JsonProperty("maintainer_contact")
|
|
|
|
private String maintainerContact;
|
|
|
|
|
|
|
|
@JsonProperty("catches_or_landings")
|
2016-11-01 22:35:52 +01:00
|
|
|
@CkanResource
|
2016-11-04 16:26:19 +01:00
|
|
|
@Valid
|
|
|
|
private Resource<String> catchesOrLandings;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
|
|
|
@JsonProperty("database_sources")
|
2016-10-13 11:46:42 +02:00
|
|
|
@NotNull(message="database_source cannot be null")
|
|
|
|
@Size(min=1, message="database_source cannot be empty")
|
2016-11-04 16:26:19 +01:00
|
|
|
@CkanResource
|
2016-10-15 22:34:57 +02:00
|
|
|
@Valid
|
2016-11-04 16:26:19 +01:00
|
|
|
private List<Resource<Source>> databaseSources;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
|
|
|
@JsonProperty("source_of_information")
|
2016-10-13 11:46:42 +02:00
|
|
|
@NotNull(message="source_of_information cannot be null")
|
|
|
|
@Size(min=1, message="source_of_information cannot be empty")
|
2016-11-01 22:35:52 +01:00
|
|
|
@CkanResource
|
2016-10-15 22:34:57 +02:00
|
|
|
@Valid
|
2016-11-04 16:26:19 +01:00
|
|
|
private List<Resource<String>> sourceOfInformation;
|
2016-10-07 18:23:23 +02:00
|
|
|
|
|
|
|
@JsonProperty("data_owner")
|
2016-10-08 23:10:25 +02:00
|
|
|
@CustomField(key="Data owner")
|
2016-10-07 18:23:23 +02:00
|
|
|
private String dataOwner;
|
|
|
|
|
|
|
|
@JsonProperty("type")
|
2016-10-08 20:46:17 +02:00
|
|
|
@Tag
|
|
|
|
@Group
|
2016-10-08 23:10:25 +02:00
|
|
|
@CustomField(key="Type")
|
2016-10-07 18:23:23 +02:00
|
|
|
private Type type;
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-26 18:40:10 +02:00
|
|
|
@JsonProperty("short_title")
|
|
|
|
@CustomField(key="Short Title")
|
2016-11-04 16:26:19 +01:00
|
|
|
@NotNull(message="short_title cannot be null")
|
2016-11-02 16:02:28 +01:00
|
|
|
@Size(min=1, message="short_title cannot be empty")
|
2016-10-26 18:40:10 +02:00
|
|
|
private String shortTitle;
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-26 18:40:10 +02:00
|
|
|
@JsonProperty("uuid_knowledge_base")
|
|
|
|
@CustomField(key="UUID Knowledge Base")
|
2016-11-04 16:26:19 +01:00
|
|
|
@NotNull(message="uuid_knowledge_base cannot be null")
|
2016-10-27 11:40:19 +02:00
|
|
|
@Size(min=1, message="uuid_knowledge_base cannot be empty")
|
2016-11-04 16:26:19 +01:00
|
|
|
// This will be the identifier of the product!!
|
2016-10-26 18:40:10 +02:00
|
|
|
private String uuid;
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-26 18:40:10 +02:00
|
|
|
@JsonProperty("traceability_flag")
|
|
|
|
@CustomField(key="Traceability Flag")
|
2016-11-04 16:26:19 +01:00
|
|
|
@NotNull(message="traceability_flag cannot be null")
|
2016-10-26 18:40:10 +02:00
|
|
|
private boolean traceabilityFlag;
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
@JsonProperty("extras")
|
2016-10-27 11:40:19 +02:00
|
|
|
private Map<String, List<String>> extras = new HashMap<>();
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-27 11:40:19 +02:00
|
|
|
@JsonProperty("status")
|
|
|
|
@CustomField(key="Status")
|
|
|
|
@Group
|
|
|
|
@Tag
|
|
|
|
@NotNull(message="status cannot be null")
|
|
|
|
private Status status;
|
2016-10-08 20:46:17 +02:00
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
// automatically compiled
|
|
|
|
@JsonProperty("product_type")
|
|
|
|
@CustomField(key="Product type")
|
|
|
|
@Tag
|
|
|
|
private String productType;
|
|
|
|
|
2016-10-07 18:23:23 +02:00
|
|
|
public Common() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
2016-10-13 11:46:42 +02:00
|
|
|
/**
|
|
|
|
* @param description
|
|
|
|
* @param license
|
|
|
|
* @param author
|
|
|
|
* @param version
|
|
|
|
* @param authorContact
|
|
|
|
* @param maintainer
|
|
|
|
* @param maintainerContact
|
|
|
|
* @param catchesOrLandings
|
|
|
|
* @param databaseSources
|
|
|
|
* @param sourceOfInformation
|
|
|
|
* @param dataOwner
|
|
|
|
* @param type
|
2016-10-26 18:40:10 +02:00
|
|
|
* @param shortTitle
|
|
|
|
* @param uuid
|
|
|
|
* @param traceabilityFlag
|
2016-10-13 11:46:42 +02:00
|
|
|
* @param extras
|
2016-11-04 16:26:19 +01:00
|
|
|
* @param status
|
|
|
|
* @param productType
|
2016-10-13 11:46:42 +02:00
|
|
|
*/
|
2016-10-07 18:23:23 +02:00
|
|
|
public Common(String description, String license, String author,
|
2016-10-08 23:10:25 +02:00
|
|
|
Long version, String authorContact, String maintainer,
|
2016-11-04 16:26:19 +01:00
|
|
|
String maintainerContact, Resource<String> catchesOrLandings,
|
|
|
|
List<Resource<Source>> databaseSources,
|
|
|
|
List<Resource<String>> sourceOfInformation, String dataOwner,
|
|
|
|
Type type, String shortTitle, String uuid,
|
|
|
|
boolean traceabilityFlag, Map<String, List<String>> extras,
|
|
|
|
Status status, String productType) {
|
2016-10-07 18:23:23 +02:00
|
|
|
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;
|
2016-10-26 18:40:10 +02:00
|
|
|
this.shortTitle = shortTitle;
|
|
|
|
this.uuid = uuid;
|
|
|
|
this.traceabilityFlag = traceabilityFlag;
|
2016-10-08 22:16:59 +02:00
|
|
|
this.extras = extras;
|
2016-11-04 16:26:19 +01:00
|
|
|
this.status = status;
|
|
|
|
this.productType = productType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getProductType() {
|
|
|
|
return productType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setProductType(String productType) {
|
|
|
|
this.productType = productType;
|
2016-10-08 20:46:17 +02:00
|
|
|
}
|
|
|
|
|
2016-10-07 18:23:23 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-10-08 23:10:25 +02:00
|
|
|
public Long getVersion() {
|
2016-10-07 18:23:23 +02:00
|
|
|
return version;
|
|
|
|
}
|
|
|
|
|
2016-10-08 23:10:25 +02:00
|
|
|
public void setVersion(Long version) {
|
2016-10-07 18:23:23 +02:00
|
|
|
this.version = version;
|
|
|
|
}
|
2016-10-10 18:50:11 +02:00
|
|
|
|
2016-10-07 18:23:23 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public Resource<String> getCatchesOrLandings() {
|
2016-10-07 18:23:23 +02:00
|
|
|
return catchesOrLandings;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public void setCatchesOrLandings(Resource<String> catchesOrLandings) {
|
2016-10-07 18:23:23 +02:00
|
|
|
this.catchesOrLandings = catchesOrLandings;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public List<Resource<Source>> getDatabaseSources() {
|
2016-10-07 18:23:23 +02:00
|
|
|
return databaseSources;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public void setDatabaseSources(List<Resource<Source>> databaseSources) {
|
2016-10-07 18:23:23 +02:00
|
|
|
this.databaseSources = databaseSources;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public List<Resource<String>> getSourceOfInformation() {
|
2016-10-07 18:23:23 +02:00
|
|
|
return sourceOfInformation;
|
|
|
|
}
|
|
|
|
|
2016-11-04 16:26:19 +01:00
|
|
|
public void setSourceOfInformation(List<Resource<String>> sourceOfInformation) {
|
2016-10-07 18:23:23 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-10-27 11:40:19 +02:00
|
|
|
public void setExtras(Map<String, List<String>> extras) {
|
2016-10-08 22:16:59 +02:00
|
|
|
this.extras = extras;
|
2016-10-08 20:46:17 +02:00
|
|
|
}
|
|
|
|
|
2016-10-27 11:40:19 +02:00
|
|
|
public Map<String, List<String>> getExtras() {
|
2016-10-08 22:16:59 +02:00
|
|
|
return extras;
|
2016-10-08 20:46:17 +02:00
|
|
|
}
|
|
|
|
|
2016-10-26 18:40:10 +02:00
|
|
|
public String getShortTitle() {
|
|
|
|
return shortTitle;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setShortTitle(String shortTitle) {
|
|
|
|
this.shortTitle = shortTitle;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUuid() {
|
|
|
|
return uuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setUuid(String uuid) {
|
|
|
|
this.uuid = uuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isTraceabilityFlag() {
|
|
|
|
return traceabilityFlag;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTraceabilityFlag(boolean traceabilityFlag) {
|
|
|
|
this.traceabilityFlag = traceabilityFlag;
|
|
|
|
}
|
2016-11-01 22:35:52 +01:00
|
|
|
|
2016-10-27 11:40:19 +02:00
|
|
|
public Status getStatus() {
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStatus(Status status) {
|
|
|
|
this.status = status;
|
|
|
|
}
|
2016-10-26 18:40:10 +02:00
|
|
|
|
2016-10-07 18:23:23 +02:00
|
|
|
@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
|
2016-10-26 18:40:10 +02:00
|
|
|
+ ", dataOwner=" + dataOwner + ", type=" + type
|
|
|
|
+ ", shortTitle=" + shortTitle + ", uuid=" + uuid
|
|
|
|
+ ", traceabilityFlag=" + traceabilityFlag + ", extras="
|
2016-11-04 16:26:19 +01:00
|
|
|
+ extras + ", status=" + status + ", productType="
|
|
|
|
+ productType + "]";
|
2016-10-07 18:23:23 +02:00
|
|
|
}
|
|
|
|
}
|