Skip to content

Repository files navigation

Datacite plugin

The Datacite plugin registers and manages DOIs for Janeway articles using the DataCite REST API. Staff can mint DOIs manually from a journal's management interface, and journals can opt in to automatic deposit so that a DOI is registered when an article is accepted and made findable when it is published.

In this guide

How the plugin works

The plugin builds a DataCite metadata payload from an article's metadata (authors, title, abstract, keywords, licence, issue, and journal ISSN) and sends it to the DataCite API with HTTP basic authentication. Every deposit passes through one of two events:

  • register creates a draft DOI that is not yet findable.
  • publish makes the DOI findable.

When the plugin deposits a publish event for an article that already has a DOI, it updates the existing DataCite record in place. If DataCite reports that the record does not exist, the plugin creates it instead, so a failed earlier registration does not block publication.

Successful deposits are recorded locally as a doi identifier on the article, using Janeway's identifiers app.

DOIs generated by the plugin follow the Janeway pattern {prefix}/{journal_code}.{article_id}, for example 10.1234/orbit.123.

Installation

  1. Clone this repository into your Janeway installation's src/plugins folder.
  2. Check out the required version.
  3. From the src folder, run python manage.py install_plugins datacite.
  4. Restart your server.

Once installed, the plugin is accessible from a journal's plugins page at /manager/plugins/.

Configuration

Deployment settings

The following values are defined in plugin_settings.py and apply to the whole installation:

  • DATACITE_USERNAME and DATACITE_PASSWORD: your DataCite repository credentials.
  • DATACITE_PREFIX: the DOI prefix to mint under, for example 10.1234.
  • DATACITE_API_URL: the DataCite API endpoint. When Django's DEBUG setting is on, the plugin uses the DataCite test API automatically, so development deposits never reach the production DOI registry.

Note

While a site runs in debug mode, the plugin deposits to DataCite's test API rather than the live one. DOIs minted against the test system do not resolve and are periodically cleared by DataCite.

  • JOURNAL_PREFIX: when set to True (the default), generated DOIs include the journal code, as in 10.1234/orbit.123.

Journal settings

To enable automatic deposit for a journal, go to the plugin's Manager page and select Enable Datacite Auto Deposit. Automatic deposit is off by default for every journal.

To restrict automatic deposit to particular sections, go to the plugin's Sections page and select the sections that can mint DOIs. If you do not select any sections, all sections can mint DOIs.

Minting DOIs from the interface

The plugin's article list shows every article in the journal that has been accepted and not subsequently declined, archived, or moved back into review, alongside any DOI each article holds.

  • If an article has no DOI, you can add one. The form is pre-filled with the Janeway DOI pattern, and you can edit it before depositing. Clear the Findable checkbox to register a draft DOI instead of a findable one. The identifier is only saved in Janeway if the deposit succeeds.
  • If an article already has a DOI, you can re-deposit it to push updated metadata to DataCite.
  • You can also export the metadata payload for any article as JSON to check what the plugin sends before you deposit.

Automatic deposit

If automatic deposit is enabled for a journal, the plugin listens for two Janeway events:

  • When an article is accepted, the plugin registers a draft DOI.
  • When an article is published, the plugin deposits a publish event, which makes the DOI findable.

In both cases the plugin generates the DOI from the Janeway pattern and records it on the article once the deposit succeeds. If section restrictions are configured, articles outside the selected sections are skipped.

Management commands

The plugin provides four management commands. Run each one from the src folder with python manage.py <command>.

create_new_dois

Creates and deposits a Janeway-pattern DOI for every published article in a journal that does not have one.

python manage.py create_new_dois <journal_code> [--dry_run]

desposit_doi

Re-deposits DOIs for a single article or for every article in an issue, with your choice of event.

python manage.py desposit_doi (--article <id> | --issue <id>) {publish|update|register}

Articles without a DOI are skipped, and the command reports a success and failure count when it finishes.

update_all_dois

Updates the landing page URL at DataCite for every DOI stored in Janeway. This is useful after a change of domain or URL structure. The command waits two seconds between requests to avoid flooding the API.

python manage.py update_all_dois [--dry_run]

reset_dois

Replaces the existing DOI of every published article in a journal with a Janeway-pattern DOI and deposits it with DataCite. The command writes a CSV audit file recording the Janeway ID, old DOI, and new DOI for every article processed.

python manage.py reset_dois <journal_code> [--article_id <id>] [--output <path>] [--dry_run]

Use --article_id to test the command against a single article before processing the whole journal. If a deposit fails, the command restores the article's previous DOI, so an article is never left holding a DOI that was not successfully deposited.

Warning

reset_dois deletes each article's existing DOI record in Janeway before depositing the replacement. Run it with --dry_run first and review the planned changes, and keep the CSV output as a record of the old DOIs.

Testing

Run the plugin's tests from the src folder:

python manage.py test plugins.datacite

The tests mock the DataCite API, so no network access or credentials are required.

About

Datacite Plugin

Topics

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages