@ -794,7 +794,9 @@ public class DataManagementPlanManager {
} ) ;
UserInfo user = apiContext . getOperationsContext ( ) . getDatabaseRepository ( ) . getUserInfoDao ( ) . find ( principal . getId ( ) ) ;
sendNotification ( dmp , user , NotificationType . DMP_PUBLISH ) ;
this . createZenodoDoi ( dmp . getId ( ) , principal , null , true ) ;
if ( dmp . getDoi ( ) ! = null & & ! dmp . getDoi ( ) . isEmpty ( ) ) {
this . createZenodoDoi ( dmp . getId ( ) , principal , null , true ) ;
}
}
public void makeFinalize ( UUID id , Principal principal , DatasetsToBeFinalized datasetsToBeFinalized ) throws Exception {
@ -850,6 +852,17 @@ public class DataManagementPlanManager {
this . updateDatasetsIndex ( indexDatasets ) ;
}
public void undoFinalize ( UUID id , Principal principal ) throws Exception {
DMP dmp = this . apiContext . getOperationsContext ( ) . getDatabaseRepository ( ) . getDmpDao ( ) . find ( id ) ;
if ( ! isUserOwnerOfDmp ( dmp , principal ) )
throw new Exception ( "User does not have the privilege to do this action." ) ;
if ( dmp . getStatus ( ) . equals ( DMP . DMPStatus . ACTIVE . getValue ( ) ) )
throw new Exception ( "DMP is already Active" ) ;
dmp . setStatus ( DMP . DMPStatus . ACTIVE . getValue ( ) ) ;
apiContext . getOperationsContext ( ) . getDatabaseRepository ( ) . getDmpDao ( ) . createOrUpdate ( dmp ) ;
this . updateIndex ( dmp ) ;
}
/ *
* Export Data
* * /