Skip to content

A PHP WebApp that bulk creates DataCite DOIs from a provided CSV file. DOIs are created in the findable state.

License

Notifications You must be signed in to change notification settings

gsu-library/datacite-bulk-doi-creator-webapp

Repository files navigation

DataCite Bulk DOI Creator - WebApp

Code Repository: https://github.com/gsu-library/datacite-bulk-doi-creator-webapp
Author: Matt Brooks mbrooks34@gsu.edu
Date Created: 2022-06-29
License: GPL3
Version: 1.3.1

Description

A PHP WebApp that bulk creates DataCite DOIs from a provided CSV file. DOIs are created in the findable state. If you are looking for the python version of this WebApp see DataCite Bulk DOI Creator.

For more information about DOIs please see DataCite's support page and/or resources from their homepage. Information on their metadata schemas is also available.

Setup

Put the repository files in a folder that is within your web server's webroot.

General Configuration

Rename config/config.sample.php to config/config.php and fill in your DOI prefix, username (repository ID), and password. If wanting to test the script out with the test DataCite API replace the URL with the test API URL (https://api.test.datacite.org/dois) and credentials. There are other configuration options that can be adjusted if wanted.

It is important that the config folder and its contents are not readable from a web browser. If not using Apache, the config/.htaccess file should be replaced with something denying web access to the contents of the folder.

PHP will also need read/write access to both the reports and uploads folders. Make sure owner/group permissions are set accordingly.

ORCID Configuration

Create an ORCID account, register a public API client, and set the client ID and secret in the configuration file. The token and API URLs can be adjusted if sandbox testing is wanted.

The config folder will need to be writable by PHP to save the ORCID acess token.

Authentication

Currently this application uses basic authentication provided by Apache (see Apache AuthType directive). To use basic authentication create a .htpasswd file within the config directory, rename .htaccess.sample to .htaccess in the root folder, and set the AuthUserFile directive to the absolute path of the .htpasswd file. The .htpasswd file does not have to live in the config folder, but wherever it lives should not be accessible from the web.

Usage

The 'Download CSV Template' menu item (template.csv) provides an example of valid headers this WebApp accepts (also see the fields below). Only one set of creator fields are required per record. Once a filled out CSV file is uploaded and submitted it will be processed. During proccessing, a copy of the uploaded file will be saved in the uploads folder and a report will be created in the reports folder.

CSV Fields

doi_suffix - DOI suffix
title - title of publication
year - publication year
type - resource type
description - abstract description
publisher - publisher
source_url - URL reference to resource
oricd - ORCID ID (not required, replaces creator fields when configured and present)
creator{n} - full creator name (header example: creator1, creator2, etc.)
creator{n}_type - Personal or Organizational (not required, defaults to Personal)
creator{n}_given - creator given name
creator{n}_family - creator family name

Errors

If an error occurs a verbose message will be logged on the page output and in the generated report. For more information on error codes please see DataCite's API error code page.

Dependencies