2017-12-15 00:01:26 +01:00
|
|
|
package eu.eudat.models.project;
|
2017-12-14 18:07:09 +01:00
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2017-12-15 00:01:26 +01:00
|
|
|
import eu.eudat.entities.UserInfo;
|
|
|
|
import eu.eudat.models.DataModel;
|
|
|
|
import eu.eudat.models.dmp.DataManagementPlan;
|
2017-12-14 18:07:09 +01:00
|
|
|
|
2017-12-18 16:55:12 +01:00
|
|
|
|
2018-01-17 13:03:51 +01:00
|
|
|
public class Project implements DataModel<eu.eudat.entities.Project> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UUID id;
|
|
|
|
|
|
|
|
private List<DataManagementPlan> dmps;
|
|
|
|
|
|
|
|
private String label;
|
|
|
|
|
|
|
|
private String abbreviation;
|
|
|
|
|
|
|
|
private String reference;
|
|
|
|
|
|
|
|
private String uri;
|
|
|
|
|
|
|
|
private String definition;
|
|
|
|
|
|
|
|
private Date startDate;
|
|
|
|
|
|
|
|
private Date endDate;
|
|
|
|
|
2018-01-19 12:11:22 +01:00
|
|
|
private eu.eudat.entities.Project.Status status;
|
2018-01-17 13:03:51 +01:00
|
|
|
|
|
|
|
private UserInfo creationUser;
|
|
|
|
|
|
|
|
private Date created;
|
|
|
|
|
|
|
|
private Date modified;
|
|
|
|
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
|
|
public UUID getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(UUID id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<DataManagementPlan> getDmps() {
|
|
|
|
return dmps;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDmps(List<DataManagementPlan> dmps) {
|
|
|
|
this.dmps = dmps;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getAbbreviation() {
|
|
|
|
return abbreviation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAbbreviation(String abbreviation) {
|
|
|
|
this.abbreviation = abbreviation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getReference() {
|
|
|
|
return reference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setReference(String reference) {
|
|
|
|
this.reference = reference;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUri() {
|
|
|
|
return uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setUri(String uri) {
|
|
|
|
this.uri = uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDefinition() {
|
|
|
|
return definition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDefinition(String definition) {
|
|
|
|
this.definition = definition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getStartDate() {
|
|
|
|
return startDate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStartDate(Date startDate) {
|
|
|
|
this.startDate = startDate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getEndDate() {
|
|
|
|
return endDate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEndDate(Date endDate) {
|
|
|
|
this.endDate = endDate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public short getStatus() {
|
|
|
|
return status.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStatus(Short status) {
|
2018-01-19 12:11:22 +01:00
|
|
|
this.status = eu.eudat.entities.Project.Status.fromInteger(status);
|
2018-01-17 13:03:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public UserInfo getCreationUser() {
|
|
|
|
return creationUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreationUser(UserInfo creationUser) {
|
|
|
|
this.creationUser = creationUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getModified() {
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setModified(Date modified) {
|
|
|
|
this.modified = modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDescription(String description) {
|
|
|
|
this.description = description;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void fromDataModel(eu.eudat.entities.Project entity) throws InstantiationException, IllegalAccessException {
|
|
|
|
this.id = entity.getId();
|
|
|
|
this.label = entity.getLabel();
|
|
|
|
this.abbreviation = entity.getAbbreviation();
|
|
|
|
this.reference = entity.getReference();
|
|
|
|
this.uri = entity.getUri();
|
|
|
|
this.definition = entity.getDefinition();
|
|
|
|
this.startDate = entity.getStartdate();
|
|
|
|
this.endDate = entity.getEnddate();
|
|
|
|
this.setStatus(entity.getStatus());
|
|
|
|
this.created = entity.getCreated();
|
|
|
|
this.modified = entity.getModified();
|
|
|
|
this.description = entity.getDescription();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public eu.eudat.entities.Project toDataModel() {
|
|
|
|
eu.eudat.entities.Project entity = new eu.eudat.entities.Project();
|
|
|
|
entity.setId(this.id);
|
|
|
|
entity.setAbbreviation(this.abbreviation);
|
|
|
|
entity.setLabel(this.label);
|
|
|
|
entity.setReference(this.reference);
|
|
|
|
entity.setUri(this.uri);
|
|
|
|
entity.setDefinition(this.definition);
|
|
|
|
entity.setStartdate(this.startDate);
|
|
|
|
entity.setCreated(this.created == null ? new Date() : this.created);
|
|
|
|
entity.setEnddate(this.endDate);
|
2018-01-19 12:11:22 +01:00
|
|
|
entity.setStatus(this.status != null ? this.getStatus() : eu.eudat.entities.Project.Status.ACTIVE.getValue());
|
2018-01-17 13:03:51 +01:00
|
|
|
entity.setModified(new Date());
|
|
|
|
entity.setDescription(this.description);
|
|
|
|
return entity;
|
|
|
|
}
|
2018-01-19 10:31:05 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getHint() {
|
|
|
|
return null;
|
|
|
|
}
|
2017-12-14 18:07:09 +01:00
|
|
|
}
|