Adds "isPublic", "publishedAt" and "finalizedAt" properties on DMP overview model.

This commit is contained in:
gkolokythas 2019-06-28 11:25:27 +03:00
parent 758c72ed2e
commit 326757f2c3
1 changed files with 27 additions and 0 deletions

View File

@ -29,6 +29,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
private ProjectOverviewModel project; private ProjectOverviewModel project;
private Date creationTime; private Date creationTime;
private Date modifiedTime; private Date modifiedTime;
private Date finalizedAt;
private List<Organisation> organisations; private List<Organisation> organisations;
private int version; private int version;
private int status; private int status;
@ -38,6 +39,8 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
private List<Researcher> researchers; private List<Researcher> researchers;
private List<UserInfoListingModel> users; private List<UserInfoListingModel> users;
private String description; private String description;
private boolean isPublic;
private Date publishedAt;
public String getId() { public String getId() {
@ -82,6 +85,13 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.modifiedTime = modifiedTime; this.modifiedTime = modifiedTime;
} }
public Date getFinalizedAt() {
return finalizedAt;
}
public void setFinalizedAt(Date finalizedAt) {
this.finalizedAt = finalizedAt;
}
public List<Organisation> getOrganisations() { public List<Organisation> getOrganisations() {
return organisations; return organisations;
} }
@ -145,6 +155,20 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.researchers = researchers; this.researchers = researchers;
} }
public boolean getIsPublic() {
return isPublic;
}
public void setIsPublic(boolean aPublic) {
isPublic = aPublic;
}
public Date getPublishedAt() {
return publishedAt;
}
public void setPublishedAt(Date publishedAt) {
this.publishedAt = publishedAt;
}
@Override @Override
public DataManagementPlanOverviewModel fromDataModel(DMP entity) { public DataManagementPlanOverviewModel fromDataModel(DMP entity) {
this.id = entity.getId().toString(); this.id = entity.getId().toString();
@ -161,6 +185,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
if (entity.getProfile() != null) this.profile = entity.getProfile().getLabel(); if (entity.getProfile() != null) this.profile = entity.getProfile().getLabel();
this.creationTime = entity.getCreated(); this.creationTime = entity.getCreated();
this.modifiedTime = entity.getModified(); this.modifiedTime = entity.getModified();
this.finalizedAt = entity.getFinalizedAt();
this.organisations = entity.getOrganisations().stream().map(item -> new Organisation().fromDataModel(item)).collect(Collectors.toList()); this.organisations = entity.getOrganisations().stream().map(item -> new Organisation().fromDataModel(item)).collect(Collectors.toList());
this.datasets = entity.getDataset().stream().filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue()) && !dataset.getStatus().equals(Dataset.Status.CANCELED.getValue())).map(x-> new DatasetOverviewModel().fromDataModel(x)).collect(Collectors.toList()); this.datasets = entity.getDataset().stream().filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue()) && !dataset.getStatus().equals(Dataset.Status.CANCELED.getValue())).map(x-> new DatasetOverviewModel().fromDataModel(x)).collect(Collectors.toList());
this.users = entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList()); this.users = entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList());
@ -174,6 +199,8 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
this.associatedProfiles.add(associatedProfile); this.associatedProfiles.add(associatedProfile);
} }
} }
this.isPublic = entity.isPublic();
this.publishedAt = entity.getPublishedAt();
return this; return this;
} }