Adds researchers to DMP overview model.

This commit is contained in:
gkolokythas 2019-05-20 10:27:32 +03:00
parent dd973d4b78
commit 392eb0d36e
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import eu.eudat.logic.utilities.builders.XmlBuilder;
import eu.eudat.models.DataModel;
import eu.eudat.models.data.dmp.AssociatedProfile;
import eu.eudat.models.data.dmp.Organisation;
import eu.eudat.models.data.dmp.Researcher;
import eu.eudat.models.data.urls.DatasetUrlListing;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@ -34,6 +35,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
private String description;
private String projectAbbreviation;
private String projectId;
private List<Researcher> researchers;
public String getId() {
@ -148,6 +150,13 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.projectId = projectId;
}
public List<Researcher> getResearchers() {
return researchers;
}
public void setResearchers(List<Researcher> researchers) {
this.researchers = researchers;
}
@Override
public DataManagementPlanOverviewModel fromDataModel(DMP entity) {
this.id = entity.getId().toString();
@ -170,6 +179,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.description = entity.getDescription();
this.projectAbbreviation = entity.getProject().getAbbreviation();
this.projectId = entity.getProject().getId().toString();
this.researchers = entity.getResearchers().stream().map(item -> new Researcher().fromDataModel(item)).collect(Collectors.toList());
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps());