More bugfixes
This commit is contained in:
parent
818c6378c2
commit
0067ecef26
|
@ -154,7 +154,9 @@ public class Dataset implements ElasticEntity<Dataset> {
|
|||
builder.field("template", this.template.toString());
|
||||
builder.field("status", this.status.toString());
|
||||
builder.field("dmp", this.dmp.toString());
|
||||
if (this.group != null) {
|
||||
builder.field("group", this.group.toString());
|
||||
}
|
||||
builder.field("grant", this.grant.toString());
|
||||
if (collaborators != null) {
|
||||
builder.startArray("collaborators");
|
||||
|
|
|
@ -568,12 +568,14 @@ public class DatasetManager {
|
|||
dataset.setDmp(datasetWizardModel.getDmp().getId());
|
||||
dataset.setGroup(datasetWizardModel.getDmp().getGroupId());
|
||||
dataset.setGrant(datasetWizardModel.getDmp().getGrant().getId());
|
||||
if (datasetWizardModel.getDmp().getUsers() != null) {
|
||||
dataset.setCollaborators(datasetWizardModel.getDmp().getUsers().stream().map(user -> {
|
||||
Collaborator collaborator = new Collaborator();
|
||||
collaborator.setId(user.getId().toString());
|
||||
collaborator.setName(user.getName());
|
||||
return collaborator;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
DataManagementPlanCriteria dmpCriteria = new DataManagementPlanCriteria();
|
||||
dmpCriteria.setAllVersions(true);
|
||||
dmpCriteria.setGroupIds(Collections.singletonList(datasetWizardModel.getDmp().getGroupId()));
|
||||
|
@ -582,12 +584,14 @@ public class DatasetManager {
|
|||
if (dataset.getLastVersion() == null) {
|
||||
dataset.setLastVersion(true);
|
||||
}
|
||||
if (datasetWizardModel.getDmp().getOrganisations() != null) {
|
||||
dataset.setOrganizations(datasetWizardModel.getDmp().getOrganisations().stream().map(org -> {
|
||||
Organization organization = new Organization();
|
||||
organization.setId(org.getId());
|
||||
organization.setName(org.getName());
|
||||
return organization;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
datasetRepository.createOrUpdate(dataset);
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue