Skip to content

Commit

Permalink
Reverted unlinking .passed file; updated README for DataCite module.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Oct 25, 2017
1 parent 9335390 commit c70a5ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 14 additions & 2 deletions modules/islandora_doi_datacite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ someothernamespace:1
someothernamespace:2
```

The script provides two commands, `islandora_doi_datacite_assign_dois_preflight` and `islandora_doi_datacite_assign_dois`.
The script provides two commands, `islandora_doi_datacite_assign_dois_preflight` and `islandora_doi_datacite_assign_dois`. Configuration options set in the admin GUI as described above are used by the drush commands.

You should run the preflight command on your list of PIDs before running the assign command. Configuration options set in the admin GUI as described above are used by the drush commands. The preflight command checks each object identified in the PID file to confirm that its DC datastream contains the values required by the DataCite metadata schema, specifically, for a dc.title, dc.creator, dc.publisher. It also checks the dc.date field for a YYYY year. Running the file produces two output files, named after the PID file with `.passed` and `.errors` appended. The 'passed' file contains PIDs of objects that had all the required values, and the 'errors' file contains a log of the missing elements in each object. For example:
You should run the preflight command on your list of PIDs before running the assign command. That command checks each object identified in the PID file to confirm that its DC datastream contains the values required by the DataCite metadata schema, specifically, for a dc.title, dc.creator, dc.publisher. It also checks the dc.date field for a YYYY year. Running the file produces two output files, named after the PID file with `.passed` and `.errors` appended. The 'passed' file contains PIDs of objects that had all the required values, and the 'errors' file contains a log of the missing elements in each object. For example:

```
drush -u 1 islandora_doi_datacite_assign_dois_preflight --pid_file=/tmp/dois.pids
Expand All @@ -63,6 +63,18 @@ The `islandora_doi_datacite_assign_dois` command assigns DOIs to each object lis
drush -u 1 islandora_doi_datacite_assign_dois --pid_file=/tmp/dois.pids --resource_type=Text
```

Given a PID file `/tmp/dois.pids` that contains two PIDs `doitest:2` and `doitest:3`, running this command will assign the DOIs and produce output like this:

```
You are about to mint new DOIs. Have you run the preflight check? (y/n): y
DOI 10.5072/doitest:2 assigned to object doitest:2 [ok]
DOI 10.5072/doitest:3 assigned to object doitest:3 [ok]
DOI 10.5072/doitest:2 successfully minted for object doitest:2 [status]
DOI 10.5072/doitest:2 successfully saved in doitest:2's MODS datastream. [status]
DOI 10.5072/doitest:3 successfully minted for object doitest:3 [status]
DOI 10.5072/doitest:3 successfully saved in doitest:3's MODS datastream. [status]
```

## Maintainer

* [Mark Jordan](https://github.com/mjordan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ function drush_islandora_doi_datacite_assign_dois_preflight() {
$errors = islandora_doi_datacite_check_required_values($dc_values);
$error_file_path = $input_file_path . '.errors';
$passed_file_path = $input_file_path . '.passed';
if (file_exists($passed_file_path)) {
unlink($passed_file_path);
}
if (count($errors)) {
drush_log(dt("!pid does not meet DataCite's metadata requirements", array('!pid' => $pid)), 'warning');
foreach ($errors as $error) {
Expand Down

0 comments on commit c70a5ca

Please sign in to comment.