Fixes bug with QuickWizard Profile name on backend model
This commit is contained in:
parent
5ae18beb5d
commit
90aace8e68
|
@ -51,7 +51,6 @@ public class QuickWizardController extends BaseController {
|
||||||
//Create Dmp
|
//Create Dmp
|
||||||
eu.eudat.data.entities.DMP dmpEntity = this.quickWizardManager.createOrUpdate(
|
eu.eudat.data.entities.DMP dmpEntity = this.quickWizardManager.createOrUpdate(
|
||||||
quickWizard.getDmp().toDataDmp(
|
quickWizard.getDmp().toDataDmp(
|
||||||
this.getApiContext().getOperationsContext().getDatabaseRepository().getUserInfoDao(),
|
|
||||||
projectEntity,
|
projectEntity,
|
||||||
principal),
|
principal),
|
||||||
principal);
|
principal);
|
||||||
|
@ -60,7 +59,6 @@ public class QuickWizardController extends BaseController {
|
||||||
quickWizard.getDmp().setId(dmpEntity.getId());
|
quickWizard.getDmp().setId(dmpEntity.getId());
|
||||||
for (DatasetDescriptionQuickWizardModel dataset : quickWizard.getDatasets().getDatasetsList()) {
|
for (DatasetDescriptionQuickWizardModel dataset : quickWizard.getDatasets().getDatasetsList()) {
|
||||||
this.datasetManager.createOrUpdate(dataset.toDataModel(quickWizard.getDmp().toDataDmp(
|
this.datasetManager.createOrUpdate(dataset.toDataModel(quickWizard.getDmp().toDataDmp(
|
||||||
this.getApiContext().getOperationsContext().getDatabaseRepository().getUserInfoDao(),
|
|
||||||
projectEntity,
|
projectEntity,
|
||||||
principal),
|
principal),
|
||||||
quickWizard.getDmp().getDatasetProfile().getId()),
|
quickWizard.getDmp().getDatasetProfile().getId()),
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class DatasetManager {
|
||||||
private DatasetRepository datasetRepository;
|
private DatasetRepository datasetRepository;
|
||||||
private BuilderFactory builderFactory;
|
private BuilderFactory builderFactory;
|
||||||
private UserManager userManager;
|
private UserManager userManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DatasetManager(ApiContext apiContext, UserManager userManager) {
|
public DatasetManager(ApiContext apiContext, UserManager userManager) {
|
||||||
this.apiContext = apiContext;
|
this.apiContext = apiContext;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.eudat.models.data.quickwizard;
|
package eu.eudat.models.data.quickwizard;
|
||||||
|
|
||||||
import eu.eudat.data.dao.entities.UserInfoDao;
|
|
||||||
import eu.eudat.data.entities.Project;
|
import eu.eudat.data.entities.Project;
|
||||||
import eu.eudat.models.data.dmp.AssociatedProfile;
|
import eu.eudat.models.data.dmp.AssociatedProfile;
|
||||||
import eu.eudat.models.data.security.Principal;
|
import eu.eudat.models.data.security.Principal;
|
||||||
|
@ -16,7 +15,7 @@ public class DmpQuickWizardModel {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String label;
|
private String label;
|
||||||
private int status;
|
private int status;
|
||||||
private AssociatedProfile profile;
|
private AssociatedProfile datasetProfile;
|
||||||
private String description;
|
private String description;
|
||||||
private eu.eudat.models.data.project.Project project;
|
private eu.eudat.models.data.project.Project project;
|
||||||
|
|
||||||
|
@ -45,12 +44,8 @@ public class DmpQuickWizardModel {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AssociatedProfile getProfile() {
|
public void setDatasetProfile(AssociatedProfile datasetProfile) {
|
||||||
return profile;
|
this.datasetProfile = datasetProfile;
|
||||||
}
|
|
||||||
|
|
||||||
public void setProfile(AssociatedProfile profile) {
|
|
||||||
this.profile = profile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
@ -69,7 +64,7 @@ public class DmpQuickWizardModel {
|
||||||
this.project = project;
|
this.project = project;
|
||||||
}
|
}
|
||||||
|
|
||||||
public eu.eudat.models.data.dmp.DataManagementPlan toDataDmp(UserInfoDao userInfoRepository ,Project project, Principal principal) {
|
public eu.eudat.models.data.dmp.DataManagementPlan toDataDmp(Project project, Principal principal) {
|
||||||
eu.eudat.models.data.dmp.DataManagementPlan dataManagementPlanEntity = new eu.eudat.models.data.dmp.DataManagementPlan();
|
eu.eudat.models.data.dmp.DataManagementPlan dataManagementPlanEntity = new eu.eudat.models.data.dmp.DataManagementPlan();
|
||||||
|
|
||||||
dataManagementPlanEntity.setId(this.id);
|
dataManagementPlanEntity.setId(this.id);
|
||||||
|
@ -80,9 +75,9 @@ public class DmpQuickWizardModel {
|
||||||
eu.eudat.models.data.project.Project importProject = new eu.eudat.models.data.project.Project();
|
eu.eudat.models.data.project.Project importProject = new eu.eudat.models.data.project.Project();
|
||||||
dataManagementPlanEntity.setProject(importProject.fromDataModel(project));
|
dataManagementPlanEntity.setProject(importProject.fromDataModel(project));
|
||||||
}
|
}
|
||||||
if(this.profile!=null) {
|
if (this.datasetProfile != null) {
|
||||||
List<AssociatedProfile> assProfile = new LinkedList<>();
|
List<AssociatedProfile> assProfile = new LinkedList<>();
|
||||||
assProfile.add(this.profile);
|
assProfile.add(this.datasetProfile);
|
||||||
dataManagementPlanEntity.setProfiles(assProfile);
|
dataManagementPlanEntity.setProfiles(assProfile);
|
||||||
}
|
}
|
||||||
dataManagementPlanEntity.setStatus((short) this.status);
|
dataManagementPlanEntity.setStatus((short) this.status);
|
||||||
|
@ -90,9 +85,8 @@ public class DmpQuickWizardModel {
|
||||||
dataManagementPlanEntity.setProperties(null);
|
dataManagementPlanEntity.setProperties(null);
|
||||||
dataManagementPlanEntity.setCreated(new Date());
|
dataManagementPlanEntity.setCreated(new Date());
|
||||||
List<UserInfo> user = new LinkedList<UserInfo>();
|
List<UserInfo> user = new LinkedList<UserInfo>();
|
||||||
eu.eudat.models.data.userinfo.UserInfo usetInfo = new eu.eudat.models.data.userinfo.UserInfo();
|
eu.eudat.models.data.userinfo.UserInfo userInfo = new eu.eudat.models.data.userinfo.UserInfo();
|
||||||
usetInfo.fromDataModel(userInfoRepository.find(principal.getId()));
|
userInfo.setId(principal.getId());
|
||||||
user.add(usetInfo);
|
|
||||||
dataManagementPlanEntity.setAssociatedUsers(user);
|
dataManagementPlanEntity.setAssociatedUsers(user);
|
||||||
return dataManagementPlanEntity;
|
return dataManagementPlanEntity;
|
||||||
}
|
}
|
||||||
|
@ -100,9 +94,9 @@ public class DmpQuickWizardModel {
|
||||||
|
|
||||||
public eu.eudat.data.entities.DatasetProfile getDatasetProfile() {
|
public eu.eudat.data.entities.DatasetProfile getDatasetProfile() {
|
||||||
eu.eudat.data.entities.DatasetProfile datasetProfile = new eu.eudat.data.entities.DatasetProfile();
|
eu.eudat.data.entities.DatasetProfile datasetProfile = new eu.eudat.data.entities.DatasetProfile();
|
||||||
datasetProfile.setDefinition(this.profile.getLabel());
|
datasetProfile.setDefinition(this.datasetProfile.getLabel());
|
||||||
datasetProfile.setLabel(this.profile.getLabel());
|
datasetProfile.setLabel(this.datasetProfile.getLabel());
|
||||||
datasetProfile.setId(this.profile.getId());
|
datasetProfile.setId(this.datasetProfile.getId());
|
||||||
return datasetProfile;
|
return datasetProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue