2017-12-15 00:01:26 +01:00
|
|
|
package eu.eudat.models.dataset;
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2017-12-15 00:01:26 +01:00
|
|
|
import eu.eudat.models.DataModel;
|
2018-05-28 11:50:42 +02:00
|
|
|
import eu.eudat.utilities.builders.XmlBuilder;
|
2017-12-19 17:22:30 +01:00
|
|
|
import eu.eudat.utilities.helpers.LabelGenerator;
|
2017-12-09 23:31:07 +01:00
|
|
|
|
2017-12-08 15:52:12 +01:00
|
|
|
import java.util.Date;
|
|
|
|
|
2018-03-21 11:57:56 +01:00
|
|
|
public class DataRepository implements DataModel<eu.eudat.data.entities.DataRepository, DataRepository>, LabelGenerator {
|
2018-02-16 11:34:02 +01:00
|
|
|
private String pid;
|
2017-12-08 15:52:12 +01:00
|
|
|
private String name;
|
2018-02-16 11:34:02 +01:00
|
|
|
private String uri;
|
2018-05-28 11:50:42 +02:00
|
|
|
private String info;
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public String getPid() {
|
|
|
|
return pid;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public void setPid(String pid) {
|
|
|
|
this.pid = pid;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public String getUri() {
|
|
|
|
return uri;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
|
2018-02-16 11:34:02 +01:00
|
|
|
public void setUri(String uri) {
|
|
|
|
this.uri = uri;
|
|
|
|
}
|
2017-12-19 17:22:30 +01:00
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
public String getInfo() {
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInfo(String info) {
|
|
|
|
this.info = info;
|
|
|
|
}
|
|
|
|
|
2018-03-21 11:57:56 +01:00
|
|
|
public DataRepository fromDataModel(eu.eudat.data.entities.DataRepository entity) {
|
2018-02-16 11:34:02 +01:00
|
|
|
this.pid = entity.getReference();
|
|
|
|
this.name = entity.getLabel();
|
|
|
|
this.uri = entity.getUri();
|
|
|
|
return this;
|
|
|
|
}
|
2018-01-19 10:31:05 +01:00
|
|
|
|
2018-03-21 11:57:56 +01:00
|
|
|
public eu.eudat.data.entities.DataRepository toDataModel() {
|
|
|
|
eu.eudat.data.entities.DataRepository entity = new eu.eudat.data.entities.DataRepository();
|
2018-02-16 11:34:02 +01:00
|
|
|
entity.setReference(this.pid);
|
|
|
|
entity.setLabel(this.name);
|
|
|
|
entity.setUri(this.uri);
|
|
|
|
entity.setCreated(new Date());
|
|
|
|
entity.setModified(new Date());
|
|
|
|
entity.setStatus((short) 0);
|
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String generateLabel() {
|
|
|
|
return this.getName();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getHint() {
|
|
|
|
return null;
|
|
|
|
}
|
2017-12-08 15:52:12 +01:00
|
|
|
}
|