stock_name and fishery_name cannot be null
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@135198 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6a91d90023
commit
291b542d61
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
||||||
|
@ -23,7 +24,7 @@ public class FisheryRecord extends Common{
|
||||||
|
|
||||||
@JsonProperty("fishery_name")
|
@JsonProperty("fishery_name")
|
||||||
@NotNull(message="fishery_name cannot be null")
|
@NotNull(message="fishery_name cannot be null")
|
||||||
// @Size(min=1, message="fishery_name cannot be empty")
|
@Size(min=1, message="fishery_name cannot be empty")
|
||||||
@CustomField(key="Fishery Name")
|
@CustomField(key="Fishery Name")
|
||||||
private String fisheryName;
|
private String fisheryName;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package org.gcube.data_catalogue.grsf_publish_ws.json.input;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField;
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
||||||
|
@ -22,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
public class StockRecord extends Common{
|
public class StockRecord extends Common{
|
||||||
|
|
||||||
@JsonProperty("stock_name")
|
@JsonProperty("stock_name")
|
||||||
// @NotNull(message="stock_name cannot be null")
|
@NotNull(message="stock_name cannot be null")
|
||||||
// @Size(min=2, message="stock_name cannot be empty")
|
@Size(min=2, message="stock_name cannot be empty")
|
||||||
@CustomField(key="Stock Name")
|
@CustomField(key="Stock Name")
|
||||||
private String stockName;
|
private String stockName;
|
||||||
|
|
||||||
|
|
|
@ -185,12 +185,18 @@ public class GrsfPublisherFisheryService {
|
||||||
record.setProductType(Record_Type.FISHERY.getOrigName());
|
record.setProductType(Record_Type.FISHERY.getOrigName());
|
||||||
|
|
||||||
// evaluate the tags of the product
|
// evaluate the tags of the product
|
||||||
Set<String> tags = new HashSet<String>();
|
Set<String> tags = new HashSet<String>();
|
||||||
CommonUtils.getTags(tags, record);
|
CommonUtils.getTags(tags, record);
|
||||||
|
|
||||||
// evaluate the groups
|
// evaluate the groups
|
||||||
Set<String> groups = new HashSet<String>();
|
Set<String> groups = new HashSet<String>();
|
||||||
CommonUtils.getGroups(groups, record);
|
CommonUtils.getGroups(groups, record);
|
||||||
|
|
||||||
|
// add the tag and group for the other sources
|
||||||
|
if(!sourceInPath.equals(Sources.GRSF)){
|
||||||
|
tags.add(sourceInPath.getOrigName());
|
||||||
|
groups.add(sourceInPath.getOrigName());
|
||||||
|
}
|
||||||
|
|
||||||
// evaluate the custom fields
|
// evaluate the custom fields
|
||||||
Map<String, List<String>> customFields = record.getExtrasFields();
|
Map<String, List<String>> customFields = record.getExtrasFields();
|
||||||
|
|
|
@ -181,6 +181,12 @@ public class GrsfPublisherStockService {
|
||||||
// evaluate the groups
|
// evaluate the groups
|
||||||
Set<String> groups = new HashSet<String>();
|
Set<String> groups = new HashSet<String>();
|
||||||
CommonUtils.getGroups(groups, record);
|
CommonUtils.getGroups(groups, record);
|
||||||
|
|
||||||
|
// add the tag and group for the other sources
|
||||||
|
if(!sourceInPath.equals(Sources.GRSF)){
|
||||||
|
tags.add(sourceInPath.getOrigName());
|
||||||
|
groups.add(sourceInPath.getOrigName());
|
||||||
|
}
|
||||||
|
|
||||||
// evaluate the custom fields
|
// evaluate the custom fields
|
||||||
Map<String, List<String>> customFields = record.getExtrasFields();
|
Map<String, List<String>> customFields = record.getExtrasFields();
|
||||||
|
|
Loading…
Reference in New Issue