Skip to content

Retract DOI#2542

Draft
lasse-cs wants to merge 2 commits intoseek4science:mainfrom
lasse-cs:retract-doi
Draft

Retract DOI#2542
lasse-cs wants to merge 2 commits intoseek4science:mainfrom
lasse-cs:retract-doi

Conversation

@lasse-cs
Copy link
Copy Markdown
Contributor

Resolves #2497

Allows a user to send a DELETE DOI request to datacite.

This will mark the resource as no longer findable.

After retracting, an AssetDoiLog entry is created to log the retraction and the resource is deleted.

If a user follows the DOI - the AssetDoiLog is queried and a tombstone page is displayed.

Copy link
Copy Markdown
Contributor

@fbacall fbacall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments, the main thing is: lets just use AssetDoiLog::DELETE instead of coming up with a new action.

klass = controller_name.singularize.camelize
version = params[:version]

retract_log = AssetDoiLog.where(asset_type: klass, asset_id: params[:id], asset_version: version, action: AssetDoiLog::RETRACT).last
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should also check for the existence of a AssetDoiLog without the asset_version too?

For example if there is a DOI on a "parent" resource which gets retracted, and all its versions are thus deleted, but then someone visits e.g. /workflows/123?version=1 somehow.

(No idea if this can happen - disregard if not)

@@ -0,0 +1,58 @@
module Seek
module Doi
module Retracting
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just put all this code in Seek::Doi::Minting, since you can't really have one without the other.

MINT = 1
DELETE = 2
UNPUBLISH = 3
RETRACT = 4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've thought a bit about this, and think we should use DELETE.

From looking at the two places where DELETE and UNPUBLISH are used - it seems their intent was to handle cases where something was deleted and something was made private (as in, deleted or unpublished from SEEK, not from the DOI provider), respectively. In our case we're deleting the resource from SEEK, so lets use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting resources with DOIs

2 participants