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.
- How the plugin works
- Installation
- Configuration
- Minting DOIs from the interface
- Automatic deposit
- Management commands
- Testing
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:
registercreates a draft DOI that is not yet findable.publishmakes 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.
- Clone this repository into your Janeway installation's
src/pluginsfolder. - Check out the required version.
- From the
srcfolder, runpython manage.py install_plugins datacite. - Restart your server.
Once installed, the plugin is accessible from a journal's plugins page at
/manager/plugins/.
The following values are defined in plugin_settings.py and apply to the
whole installation:
DATACITE_USERNAMEandDATACITE_PASSWORD: your DataCite repository credentials.DATACITE_PREFIX: the DOI prefix to mint under, for example10.1234.DATACITE_API_URL: the DataCite API endpoint. When Django'sDEBUGsetting 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 toTrue(the default), generated DOIs include the journal code, as in10.1234/orbit.123.
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.
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.
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
publishevent, 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.
The plugin provides four management commands. Run each one from the src
folder with python manage.py <command>.
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]
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.
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]
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.
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.