101 lines
2.6 KiB
Java
101 lines
2.6 KiB
Java
package eu.eudat.models.data.rda;
|
|
|
|
import eu.eudat.data.entities.DMP;
|
|
import eu.eudat.data.entities.UserDMP;
|
|
|
|
import java.util.Date;
|
|
import java.util.UUID;
|
|
|
|
public class DmpRDAExportModel {
|
|
private UUID id;
|
|
private String title;
|
|
private String description;
|
|
private Date created;
|
|
private Date modified;
|
|
private ContactRDAExportModel contact;
|
|
private String language;
|
|
private String ethical_issues_exist;
|
|
private ProjectRDAExportModel project;
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
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 ContactRDAExportModel getContact() {
|
|
return contact;
|
|
}
|
|
public void setContact(ContactRDAExportModel contact) {
|
|
this.contact = contact;
|
|
}
|
|
|
|
public String getLanguage() {
|
|
return language;
|
|
}
|
|
public void setLanguage(String language) {
|
|
this.language = language;
|
|
}
|
|
|
|
public String getEthical_issues_exist() {
|
|
return ethical_issues_exist;
|
|
}
|
|
public void setEthical_issues_exist(String ethical_issues_exist) {
|
|
this.ethical_issues_exist = ethical_issues_exist;
|
|
}
|
|
|
|
public ProjectRDAExportModel getProject() {
|
|
return project;
|
|
}
|
|
public void setProject(ProjectRDAExportModel project) {
|
|
this.project = project;
|
|
}
|
|
|
|
|
|
public DmpRDAExportModel fromDataModel(DMP entity) {
|
|
this.id = entity.getId();
|
|
this.title = entity.getLabel();
|
|
this.description = entity.getDescription();
|
|
this.created = entity.getCreated();
|
|
this.modified = entity.getModified();
|
|
this.contact = new ContactRDAExportModel().fromDataModel(entity.getUsers().stream().filter(x -> x.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())).findFirst().get().getUser());
|
|
|
|
// Mock up data on "language" and "ethical_issues" for now.
|
|
this.language = "en";
|
|
this.ethical_issues_exist = "unknown";
|
|
|
|
this.project = new ProjectRDAExportModel().fromDataModel(entity.getGrant());
|
|
|
|
return this;
|
|
}
|
|
}
|