Adds user information on DMP listing.

This commit is contained in:
gkolokythas 2019-05-06 12:41:13 +03:00
parent ffbcd91c54
commit 1edd38c09e
3 changed files with 53 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
private UUID groupId;
private List<DatasetUrlListing> datasets;
private List<AssociatedProfile> associatedProfiles;
private List<UserInfoListingModel> users;
public String getId() {
return id;
@ -117,6 +118,13 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
this.associatedProfiles = associatedProfiles;
}
public List<UserInfoListingModel> getUsers() {
return users;
}
public void setUsers(List<UserInfoListingModel> users) {
this.users = users;
}
@Override
public DataManagementPlanListingModel fromDataModel(DMP entity) {
this.id = entity.getId().toString();
@ -135,6 +143,7 @@ public class DataManagementPlanListingModel implements DataModel<DMP, DataManage
this.modifiedTime = entity.getModified();
this.organisations = LabelBuilder.getLabel(entity.getOrganisations().stream().map(item -> new Organisation().fromDataModel(item)).collect(Collectors.toList()));
this.datasets = entity.getDataset().stream().map(x-> new DatasetUrlListing().fromDataModel(x)).collect(Collectors.toList());
this.users = entity.getUsers().stream().map(x -> new UserInfoListingModel().fromDataModel(x)).collect(Collectors.toList());
if (entity.getAssociatedDmps() != null && !entity.getAssociatedDmps().isEmpty()) {
Document viewStyleDoc = XmlBuilder.fromXml(entity.getAssociatedDmps());

View File

@ -0,0 +1,43 @@
package eu.eudat.models.data.listingmodels;
import eu.eudat.data.entities.UserInfo;
import eu.eudat.models.DataModel;
import java.util.UUID;
public class UserInfoListingModel implements DataModel<UserInfo, UserInfoListingModel> {
private UUID id;
private String name;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public UserInfoListingModel fromDataModel(UserInfo entity) {
this.id = entity.getId();
this.name = entity.getName();
return this;
}
@Override
public UserInfo toDataModel() throws Exception {
return null;
}
@Override
public String getHint() {
return "UserInfoListingModel";
}
}

View File

@ -13,4 +13,5 @@ export interface DmpListingModel {
version: number;
datasets: any[];
associatedProfiles: any[];
users: any[];
}