connections are now managed as urls
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@162849 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3aa3e31309
commit
aef2ec2d2a
|
@ -1,97 +0,0 @@
|
|||
package org.gcube.data_catalogue.grsf_publish_ws.json.input.others;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.gcube.datacatalogue.common.Constants;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Connected grsf-records bean
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
public class ConnectedBean {
|
||||
|
||||
@JsonProperty(Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY)
|
||||
@Size(min=1, message= Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY + " cannot be empty")
|
||||
private String semanticIdentifier;
|
||||
|
||||
@JsonProperty(Constants.CONNECTED_RECORD_SHORT_NAME_JSON_KEY)
|
||||
private String shortName;
|
||||
|
||||
@JsonProperty(Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY)
|
||||
@Size(min=1, message= Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY + " cannot be empty")
|
||||
private String knowledeBaseId;
|
||||
|
||||
// @JsonProperty(Constants.CONNECTED_JSON_KEY)
|
||||
// private boolean connected;
|
||||
|
||||
public ConnectedBean() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param semanticIdentifier
|
||||
* @param shortName
|
||||
* @param knowledeBaseId
|
||||
* @param connected
|
||||
*/
|
||||
public ConnectedBean(String semanticIdentifier, String shortName,
|
||||
String knowledeBaseId, boolean connected) {
|
||||
super();
|
||||
this.semanticIdentifier = semanticIdentifier;
|
||||
this.shortName = shortName;
|
||||
this.knowledeBaseId = knowledeBaseId;
|
||||
// this.connected = connected;
|
||||
}
|
||||
|
||||
// public boolean isConnected() {
|
||||
// return connected;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// public void setConnected(boolean connected) {
|
||||
// this.connected = connected;
|
||||
// }
|
||||
|
||||
public String getSemanticIdentifier() {
|
||||
return semanticIdentifier;
|
||||
}
|
||||
|
||||
public void setSemanticIdentifier(String semanticIdentifier) {
|
||||
this.semanticIdentifier = semanticIdentifier;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getKnowledeBaseId() {
|
||||
return knowledeBaseId;
|
||||
}
|
||||
|
||||
public void setKnowledeBaseId(String knowledeBaseId) {
|
||||
this.knowledeBaseId = knowledeBaseId;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(Constants.CONNECTED_RECORD_SHORT_NAME_JSON_KEY, shortName);
|
||||
obj.put(Constants.CONNECTED_RECORD_SEMANTIC_IDENTIFIER_JSON_KEY, semanticIdentifier);
|
||||
obj.put(Constants.CONNECTED_RECORD_KNOWLEDGE_BASE_ID_JSON_KEY, knowledeBaseId);
|
||||
// obj.put(Constants.CONNECTED_JSON_KEY, connected);
|
||||
return obj.toJSONString();
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,6 @@ import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group;
|
|||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Tag;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.TimeSeries;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.AnnotationBean;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.ConnectedBean;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.RefersToBean;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.Resource;
|
||||
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.SimilarRecordBean;
|
||||
|
@ -111,7 +110,7 @@ public class Common extends Base{
|
|||
|
||||
@JsonProperty(Constants.CONNECTED_JSON_KEY)
|
||||
@CustomField(key=Constants.CONNECTED_CUSTOM_KEY)
|
||||
private List<ConnectedBean> connectedBeans;
|
||||
private List<String> connectedBeans;
|
||||
|
||||
@JsonProperty(Constants.ANNOTATION_PUBLISHER_JSON_KEY)
|
||||
@CustomField(key=Constants.ANNOTATION_PUBLISHER_CUSTOM_KEY)
|
||||
|
@ -152,7 +151,7 @@ public class Common extends Base{
|
|||
List<String> species, List<SimilarRecordBean> similarGRSFRecords,
|
||||
List<SimilarRecordBean> similarSourceRecords, String domain,
|
||||
String uuid, List<String> managementBodyAuthorities,
|
||||
String spatial, List<ConnectedBean> connectedBeans,
|
||||
String spatial, List<String> connectedBeans,
|
||||
List<AnnotationBean> annotations) {
|
||||
super();
|
||||
this.dataOwner = dataOwner;
|
||||
|
@ -315,11 +314,11 @@ public class Common extends Base{
|
|||
this.spatial = spatial;
|
||||
}
|
||||
|
||||
public List<ConnectedBean> getConnectedBeans() {
|
||||
public List<String> getConnectedBeans() {
|
||||
return connectedBeans;
|
||||
}
|
||||
|
||||
public void setConnectedBeans(List<ConnectedBean> connectedBeans) {
|
||||
public void setConnectedBeans(List<String> connectedBeans) {
|
||||
this.connectedBeans = connectedBeans;
|
||||
}
|
||||
|
||||
|
@ -332,38 +331,6 @@ public class Common extends Base{
|
|||
this.annotations = annotations;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Clean the semantic id
|
||||
// * @param id
|
||||
// * @return
|
||||
// */
|
||||
// public static String cleanSemanticId(String id){
|
||||
//
|
||||
// if(id == null)
|
||||
// return null;
|
||||
// else{
|
||||
// String idmodified = "";
|
||||
// if(id != null){
|
||||
//
|
||||
// String[] splitCodesValues = id.split("\\+");
|
||||
// for (int i = 0; i < splitCodesValues.length; i++) {
|
||||
// String prefixAndCode = splitCodesValues[i];
|
||||
// if(prefixAndCode.length() == 0)
|
||||
// idmodified += "+";
|
||||
// else{
|
||||
// String prefix = prefixAndCode.split(":")[0];
|
||||
// String code = prefixAndCode.split(":")[1];
|
||||
// idmodified += prefix.toLowerCase() + ":" + code.toUpperCase();
|
||||
// if(splitCodesValues.length > 1 && i < (splitCodesValues.length - 1))
|
||||
// idmodified += "+";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return idmodified;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Common [dataOwner=" + dataOwner + ", databaseSources="
|
||||
|
|
Loading…
Reference in New Issue