set creator in new/cloned/newVersioned dmp
This commit is contained in:
parent
b6b7a2444c
commit
63c866d74f
|
@ -481,6 +481,7 @@ public class DataManagementPlanManager {
|
||||||
checkDmpValidationRules(newDmp);
|
checkDmpValidationRules(newDmp);
|
||||||
}
|
}
|
||||||
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
||||||
|
newDmp.setCreator(user);
|
||||||
|
|
||||||
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
||||||
createResearchersIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getResearcherDao(), user);
|
createResearchersIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getResearcherDao(), user);
|
||||||
|
@ -645,6 +646,7 @@ 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();
|
||||||
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||||
|
newDmp.setCreator(user);
|
||||||
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
|
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
|
||||||
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);
|
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);
|
||||||
|
|
||||||
|
@ -705,6 +707,7 @@ public class DataManagementPlanManager {
|
||||||
DMP newDmp = dataManagementPlan.toDataModel();
|
DMP newDmp = dataManagementPlan.toDataModel();
|
||||||
|
|
||||||
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||||
|
newDmp.setCreator(user);
|
||||||
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
|
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
|
||||||
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);
|
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue