Adds missing properties when creating a new version of a published DMP.

This commit is contained in:
gkolokythas 2020-01-09 14:36:56 +02:00
parent 9d8de0c2fb
commit eba3ee137d
1 changed files with 5 additions and 1 deletions

View File

@ -584,7 +584,11 @@ public class DataManagementPlanManager {
if (latestVersionDMP.get(0).getVersion().equals(oldDmp.getVersion())) { if (latestVersionDMP.get(0).getVersion().equals(oldDmp.getVersion())) {
DMP newDmp = dataManagementPlan.toDataModel(); DMP newDmp = dataManagementPlan.toDataModel();
if (oldDmp.isPublic()) {
newDmp.setPublic(true);
newDmp.setFinalizedAt(new Date());
newDmp.setPublishedAt(new Date());
}
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build(); UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao()); createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user); createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);