2017-12-19 15:09:49 +01:00
|
|
|
package eu.eudat.models.listingmodels;
|
|
|
|
|
|
|
|
import eu.eudat.entities.DMP;
|
|
|
|
import eu.eudat.entities.DataRepository;
|
|
|
|
import eu.eudat.models.DataModel;
|
|
|
|
import eu.eudat.models.dmp.Organisation;
|
|
|
|
import eu.eudat.models.dmp.Researcher;
|
|
|
|
import eu.eudat.utilities.builders.DomainModelConverter;
|
|
|
|
import eu.eudat.utilities.helpers.LabelBuilder;
|
|
|
|
import eu.eudat.utilities.helpers.LabelGenerator;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by ikalyvas on 12/19/2017.
|
|
|
|
*/
|
|
|
|
public class DataManagementPlanListingModel implements DataModel<DMP> {
|
|
|
|
private String id;
|
|
|
|
private String label;
|
|
|
|
private String project;
|
|
|
|
private String profile;
|
|
|
|
private String researchers;
|
|
|
|
private String organisations;
|
|
|
|
private String version;
|
|
|
|
|
|
|
|
public String getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getProject() {
|
|
|
|
return project;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setProject(String project) {
|
|
|
|
this.project = project;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getProfile() {
|
|
|
|
return profile;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setProfile(String profile) {
|
|
|
|
this.profile = profile;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getResearchers() {
|
|
|
|
return researchers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setResearchers(String researchers) {
|
|
|
|
this.researchers = researchers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getOrganisations() {
|
|
|
|
return organisations;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setOrganisations(String organisations) {
|
|
|
|
this.organisations = organisations;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getVersion() {
|
|
|
|
return version;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setVersion(String version) {
|
|
|
|
this.version = version;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void fromDataModel(DMP entity) throws InstantiationException, IllegalAccessException {
|
|
|
|
this.id = entity.getId().toString();
|
|
|
|
this.label = entity.getLabel();
|
|
|
|
this.project = entity.getProject().getLabel();
|
2017-12-20 15:52:09 +01:00
|
|
|
if(entity.getProfile()!=null)this.profile = entity.getProfile().getLabel();
|
2017-12-19 17:22:30 +01:00
|
|
|
this.organisations =LabelBuilder.getLabel(new DomainModelConverter<eu.eudat.entities.Organisation,Organisation>().fromDataModel(entity.getOrganisations().stream().collect(Collectors.toList()),Organisation.class));
|
|
|
|
this.researchers =LabelBuilder.getLabel(new DomainModelConverter<eu.eudat.entities.Researcher,Researcher>().fromDataModel(entity.getResearchers().stream().collect(Collectors.toList()),Researcher.class));
|
2017-12-19 15:09:49 +01:00
|
|
|
this.version = ""+entity.getVersion();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public DMP toDataModel() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2017-12-19 17:22:30 +01:00
|
|
|
|
2017-12-19 15:09:49 +01:00
|
|
|
}
|