Conversation
fbacall
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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
AssetDoiLogentry 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.