Replace dmp and grant form String to DataManagementOverviewMaodel and GrantOverviewModel on DatasetOverviewModel

This commit is contained in:
George Kalampokis 2020-07-06 11:58:59 +03:00
parent a8528ee5b1
commit d10615d13a
1 changed files with 10 additions and 8 deletions

View File

@ -3,6 +3,8 @@ package eu.eudat.models.data.dataset;
import eu.eudat.data.entities.Dataset; import eu.eudat.data.entities.Dataset;
import eu.eudat.models.DataModel; import eu.eudat.models.DataModel;
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel; import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
import eu.eudat.models.data.grant.GrantOverviewModel;
import eu.eudat.models.data.listingmodels.DataManagementPlanOverviewModel;
import eu.eudat.models.data.listingmodels.UserInfoListingModel; import eu.eudat.models.data.listingmodels.UserInfoListingModel;
import java.util.Date; import java.util.Date;
@ -17,8 +19,8 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
private short status; private short status;
private DatasetProfileOverviewModel datasetTemplate; private DatasetProfileOverviewModel datasetTemplate;
private List<UserInfoListingModel> users; private List<UserInfoListingModel> users;
private String dmp; private DataManagementPlanOverviewModel dmp;
private String grant; private GrantOverviewModel grant;
private String description; private String description;
private Boolean isPublic; private Boolean isPublic;
private Date modified; private Date modified;
@ -59,19 +61,19 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
this.users = users; this.users = users;
} }
public String getDmp() { public DataManagementPlanOverviewModel getDmp() {
return dmp; return dmp;
} }
public void setDmp(String dmp) { public void setDmp(DataManagementPlanOverviewModel dmp) {
this.dmp = dmp; this.dmp = dmp;
} }
public String getGrant() { public GrantOverviewModel getGrant() {
return grant; return grant;
} }
public void setGrant(String grant) { public void setGrant(GrantOverviewModel grant) {
this.grant = grant; this.grant = grant;
} }
@ -106,8 +108,8 @@ public class DatasetOverviewModel implements DataModel<Dataset, DatasetOverviewM
this.status = entity.getStatus(); this.status = entity.getStatus();
this.datasetTemplate = new DatasetProfileOverviewModel().fromDataModel(entity.getProfile()); this.datasetTemplate = new DatasetProfileOverviewModel().fromDataModel(entity.getProfile());
this.users = entity.getDmp().getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList()); this.users = entity.getDmp().getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList());
this.dmp = entity.getDmp().getLabel(); this.dmp = new DataManagementPlanOverviewModel().fromDataModel(entity.getDmp());
this.grant = entity.getDmp().getGrant().getLabel(); this.grant = new GrantOverviewModel().fromDataModel(entity.getDmp().getGrant());
this.description = entity.getDescription(); this.description = entity.getDescription();
this.isPublic = entity.getDmp().isPublic(); this.isPublic = entity.getDmp().isPublic();
this.modified = entity.getModified(); this.modified = entity.getModified();