Adds datasets and dmp roles on DMP edit model.

This commit is contained in:
gkolokythas 2019-05-27 18:26:03 +03:00
parent 3d316176f8
commit dd0b23580c
1 changed files with 13 additions and 25 deletions

View File

@ -1,17 +1,14 @@
package eu.eudat.models.data.dmp;
import eu.eudat.data.entities.DMP;
import eu.eudat.data.entities.DMPProfile;
import eu.eudat.data.entities.Dataset;
import eu.eudat.data.entities.UserDMP;
import eu.eudat.data.entities.*;
import eu.eudat.logic.utilities.builders.XmlBuilder;
import eu.eudat.models.DataModel;
import eu.eudat.models.data.dynamicfields.DynamicFieldWithValue;
import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.DataManagementPlanProfile;
import eu.eudat.models.data.helpermodels.Tuple;
import eu.eudat.models.data.listingmodels.DatasetListingModel;
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
import eu.eudat.models.data.project.Project;
import eu.eudat.models.data.userinfo.UserInfo;
import eu.eudat.models.data.userinfo.UserListingModel;
import net.minidev.json.JSONObject;
import org.w3c.dom.Document;
@ -42,11 +39,11 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
private Date created;
private List<DynamicFieldWithValue> dynamicFields;
private Map<String, Object> properties;
private List<UserInfoListingModel> users;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
@ -54,7 +51,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public Tuple<UUID, String> getProfile() {
return profile;
}
public void setProfile(Tuple<UUID, String> profile) {
this.profile = profile;
}
@ -62,7 +58,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@ -70,7 +65,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public UUID getGroupId() {
return groupId;
}
public void setGroupId(UUID groupId) {
this.groupId = groupId;
}
@ -78,7 +72,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<UserListingModel> getAssociatedUsers() {
return associatedUsers;
}
public void setAssociatedUsers(List<UserListingModel> associatedUsers) {
this.associatedUsers = associatedUsers;
}
@ -86,7 +79,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
@ -94,7 +86,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<Organisation> getOrganisations() {
return organisations;
}
public void setOrganisations(List<Organisation> organizations) {
this.organisations = organizations;
}
@ -102,7 +93,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<Researcher> getResearchers() {
return researchers;
}
public void setResearchers(List<Researcher> researchers) {
this.researchers = researchers;
}
@ -110,7 +100,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@ -118,7 +107,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
@ -126,7 +114,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public eu.eudat.models.data.userinfo.UserInfo getCreator() {
return creator;
}
public void setCreator(eu.eudat.models.data.userinfo.UserInfo creator) {
this.creator = creator;
}
@ -134,7 +121,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<AssociatedProfile> getProfiles() {
return profiles;
}
public void setProfiles(List<AssociatedProfile> profiles) {
this.profiles = profiles;
}
@ -142,7 +128,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
@ -150,7 +135,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@ -158,7 +142,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public DataManagementPlanProfile getDefinition() {
return definition;
}
public void setDefinition(DataManagementPlanProfile definition) {
this.definition = definition;
}
@ -166,7 +149,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public Map<String, Object> getProperties() {
return properties;
}
public void setProperties(Map<String, Object> properties) {
this.properties = properties;
}
@ -174,7 +156,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<DynamicFieldWithValue> getDynamicFields() {
return dynamicFields;
}
public void setDynamicFields(List<DynamicFieldWithValue> dynamicFields) {
this.dynamicFields = dynamicFields;
}
@ -182,7 +163,6 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public boolean getLockable() {
return lockable;
}
public void setLockable(boolean lockable) {
this.lockable = lockable;
}
@ -190,11 +170,17 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
public List<DatasetListingModel> getDatasets() {
return datasets;
}
public void setDatasets(List<DatasetListingModel> datasets) {
this.datasets = datasets;
}
public List<UserInfoListingModel> getUsers() {
return users;
}
public void setUsers(List<UserInfoListingModel> users) {
this.users = users;
}
@Override
public DataManagementPlan fromDataModel(DMP entity) {
this.id = entity.getId();
@ -231,12 +217,14 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
this.profiles.add(new AssociatedProfile().fromXml((Element) associatedProfileElement));
}
}
}
}*/
}
this.datasets = entity.getDataset().stream().map(item -> new DatasetListingModel().fromDataModel(item)).collect(Collectors.toList());
this.created = entity.getCreated();
this.description = entity.getDescription();
this.status = entity.getStatus();
this.associatedUsers = entity.getUsers().stream().map(item -> new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList());
this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList());
return this;
}