Adds "isPublic", "publishedAt" and "finalizedAt" properties on DMP overview model.
This commit is contained in:
parent
758c72ed2e
commit
326757f2c3
|
@ -29,6 +29,7 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
|
|||
private ProjectOverviewModel project;
|
||||
private Date creationTime;
|
||||
private Date modifiedTime;
|
||||
private Date finalizedAt;
|
||||
private List<Organisation> organisations;
|
||||
private int version;
|
||||
private int status;
|
||||
|
@ -38,6 +39,8 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
|
|||
private List<Researcher> researchers;
|
||||
private List<UserInfoListingModel> users;
|
||||
private String description;
|
||||
private boolean isPublic;
|
||||
private Date publishedAt;
|
||||
|
||||
|
||||
public String getId() {
|
||||
|
@ -82,6 +85,13 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
|
|||
this.modifiedTime = modifiedTime;
|
||||
}
|
||||
|
||||
public Date getFinalizedAt() {
|
||||
return finalizedAt;
|
||||
}
|
||||
public void setFinalizedAt(Date finalizedAt) {
|
||||
this.finalizedAt = finalizedAt;
|
||||
}
|
||||
|
||||
public List<Organisation> getOrganisations() {
|
||||
return organisations;
|
||||
}
|
||||
|
@ -145,6 +155,20 @@ public class DataManagementPlanOverviewModel implements DataModel<DMP, DataManag
|
|||
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
|
||||
public DataManagementPlanOverviewModel fromDataModel(DMP entity) {
|
||||
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();
|
||||
this.creationTime = entity.getCreated();
|
||||
this.modifiedTime = entity.getModified();
|
||||
this.finalizedAt = entity.getFinalizedAt();
|
||||
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.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.isPublic = entity.isPublic();
|
||||
this.publishedAt = entity.getPublishedAt();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue