Skip to content

Commit

Permalink
Remove code checking for test prefix
Browse files Browse the repository at this point in the history
Removing the code added in 2018 which checked if a test system was attempting
to mint outside the test DOI prefix.

Its possible it could be reworked by adding another option in which a custom
test prefix is entered - but someone with the need can be the one to do that
work.

Previous commit: fa34723

Closes #48
  • Loading branch information
goetzk committed Sep 25, 2020
1 parent bbf501f commit 86ac3a7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ This config file contains all the configurable settings for the plugin, see comm
$c->{plugins}{"Export::DataCiteXML"}{params}{disable} = 0;
$c->{plugins}{"Event::DataCiteEvent"}{params}{disable} = 0;

# Regex to match pre production servers
# $c->{datacitedoi}{test_host_regex} = 'dev|test|preprod';

# which field to use for the doi
$c->{datacitedoi}{eprintdoifield} = "id_number";

Expand Down
3 changes: 0 additions & 3 deletions cfg/cfg.d/z_datacitedoi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
$c->{plugins}{"Export::DataCiteXML"}{params}{disable} = 0;
$c->{plugins}{"Event::DataCiteEvent"}{params}{disable} = 0;

# Regex to match pre production servers
# $c->{datacitedoi}{test_host_regex} = 'dev|test|preprod';

# which field to use for the doi
$c->{datacitedoi}{eprintdoifield} = "id_number";

Expand Down
19 changes: 0 additions & 19 deletions lib/cfg.d/z_datacite_mapping.pl
Original file line number Diff line number Diff line change
Expand Up @@ -464,25 +464,6 @@

my @problems = ();

# If this host is not production it should probably use a test endpoint.
# To prevent this check change the test_host_regex regex not to match hostname
# or ensure test_host_regex is undefined (as is the default)

my $test_regex = $repository->get_conf("datacitedoi", "test_host_regex");
if (defined $test_regex){
use Sys::Hostname;
my $doi_prefix = $repository->get_conf("datacitedoi", "prefix");

# Does this host match the regex? Is it using the test DOI prefix?
if ((hostname =~ $test_regex) && ("10.5072" != $doi_prefix)) {
push @problems, $repository->html_phrase(
"datacite_validate:doi_prefix_mismatch",
match_regexp=> $xml->create_text_node("$test_regex"),
configured_doi_prefix=> $xml->create_text_node("$doi_prefix"),
);
}
}

#NEED CREATORS
if( !$eprint->is_set( "creators" ) &&
!$eprint->is_set( "corp_creators" ) )
Expand Down
2 changes: 0 additions & 2 deletions lib/lang/en/phrases/coinDOI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@

<epp:phrase id="datacite_validate:need_published_year"><p>There are no suitable values for the mandatory field <strong>datacite:PublicationYear</strong>. Please supply a <epc:pin name="dates">publication date</epc:pin> before coining a DOI.</p></epp:phrase>

<epp:phrase id="datacite_validate:doi_prefix_mismatch"><p>Your server hostname matches the preprod regex <strong><epc:pin name="match_regexp" textonly="yes" /></strong> but is not using the test DOI prefix - current prefix is <strong><epc:pin name="configured_doi_prefix" /></strong>.</p></epp:phrase>

<!-- Would be nice to hotlink the plugin typemap too -->
<epp:phrase id="datacite_validate:need_mapped_type"><p>Your eprint is either <epc:pin name="types">missing its type</epc:pin> or the type has no match in the plugin typemap.</p></epp:phrase>

Expand Down

0 comments on commit 86ac3a7

Please sign in to comment.