We need an API endpoint to unpublish datasets in some cases where a user may mistakenly publish their dataset in root when it needs to be reviewed first in by a journal dataverse.
Here are the essential steps by hand that hopefully will become the endpoint:
Tables involved:
Dataset
Datasetlock
Datasetversion
Dvobject
To Unpublish a Dataset:
- Lock dataset
insert into datasetlock (reason, starttime, dataset_id, user_id) values ('InReview', now(), 3092, 7);
- (N/A) Reset DOIs to reserved, both dataset and files
log on to ezid console, manage dois, set dois from public to unavailable
Not really needed: would resolve to need perms link and works again once published.
- Change datasetversion table: releasetime, versionstate, versionnumber, minorversionnumber
update datasetversion set versionstate='DRAFT', releasetime=NULL, versionnumber=NULL, minorversionnumber=NULL where dataset_id=3092 and id=98;
- Change dvobject table for dataset: publicationdate, globalidcreatetime
- (N/A) Change dvobject table for datafiles: same as for dataset
update dvobject set publicationdate=NULL, globalidcreatetime=NULL where id in (3093, 3094, 3095);
Not really needed, no functional impact and ezid has original create time stored.
- Change dataset table: lastexporttime
update dataset set lastexporttime=NULL where id=3092;
We need an API endpoint to unpublish datasets in some cases where a user may mistakenly publish their dataset in root when it needs to be reviewed first in by a journal dataverse.
Here are the essential steps by hand that hopefully will become the endpoint:
Tables involved:
Dataset
Datasetlock
Datasetversion
Dvobject
To Unpublish a Dataset:
insert into datasetlock (reason, starttime, dataset_id, user_id) values ('InReview', now(), 3092, 7);
log on to ezid console, manage dois, set dois from public to unavailable
Not really needed: would resolve to need perms link and works again once published.
update datasetversion set versionstate='DRAFT', releasetime=NULL, versionnumber=NULL, minorversionnumber=NULL where dataset_id=3092 and id=98;
update dvobject set publicationdate=NULL, globalidcreatetime=NULL where id in (3093, 3094, 3095);
Not really needed, no functional impact and ezid has original create time stored.
update dataset set lastexporttime=NULL where id=3092;