diff --git a/cfg/cfg.d/z_orcid_support_advance.pl b/cfg/cfg.d/z_orcid_support_advance.pl index f0a01c6..e506281 100644 --- a/cfg/cfg.d/z_orcid_support_advance.pl +++ b/cfg/cfg.d/z_orcid_support_advance.pl @@ -6,9 +6,11 @@ $c->{orcid_support_advance}->{client_id} = "XXXX"; $c->{orcid_support_advance}->{client_secret} = "YYYY"; -$c->{orcid_support_advance}->{orcid_apiv2} = "https://api.sandbox.orcid.org/v2.0/"; -$c->{orcid_support_advance}->{orcid_org_auth_uri} = "https://sandbox.orcid.org/oauth/authorize"; -$c->{orcid_support_advance}->{orcid_org_exch_uri} = "https://api.sandbox.orcid.org/oauth/token"; +# Use sandbox.orcid.org for testing or orcid.org for production +$c->{orcid_support_advance}->{orcid_domain} = "sandbox.orcid.org"; +$c->{orcid_support_advance}->{orcid_apiv2} = "https://api." . $c->{orcid_support_advance}->{orcid_domain} . "/v2.0/"; +$c->{orcid_support_advance}->{orcid_org_auth_uri} = "https://" . $c->{orcid_support_advance}->{orcid_domain} . "/oauth/authorize"; +$c->{orcid_support_advance}->{orcid_org_exch_uri} = "https://" . $c->{orcid_support_advance}->{orcid_domain} . "/oauth/token"; $c->{orcid_support_advance}->{redirect_uri} = $c->{"perl_url"} . "/orcid/authenticate"; # Decide if the pre-commit trigger should keep (0) or delete (1) non authenticated orcid ids, diff --git a/cfg/cfg.d/z_orcid_support_advance_rdf_triples.pl b/cfg/cfg.d/z_orcid_support_advance_rdf_triples.pl index e1a35cc..880d347 100644 --- a/cfg/cfg.d/z_orcid_support_advance_rdf_triples.pl +++ b/cfg/cfg.d/z_orcid_support_advance_rdf_triples.pl @@ -93,7 +93,7 @@ my $e_given = $all_people->{$person_uri}->{name}->{given} || ""; my $e_family = $all_people->{$person_uri}->{name}->{family} || ""; my $e_orcid = ""; - $e_orcid = "http://orcid.org/" . $all_people->{$person_uri}->{orcid} if defined $all_people->{$person_uri}->{orcid}; + $e_orcid = "http://" . $c->{orcid_support_advance}->{orcid_domain} . "/" . $all_people->{$person_uri}->{orcid} if defined $all_people->{$person_uri}->{orcid}; $o{"graph"}->add( secondary_resource => $person_uri, diff --git a/lib/plugins/EPrints/Plugin/Screen/ExportToOrcid.pm b/lib/plugins/EPrints/Plugin/Screen/ExportToOrcid.pm index 4fe7897..2e58868 100644 --- a/lib/plugins/EPrints/Plugin/Screen/ExportToOrcid.pm +++ b/lib/plugins/EPrints/Plugin/Screen/ExportToOrcid.pm @@ -156,7 +156,7 @@ sub action_export{ # Identify response code by parsing XML with ORCID namespace my $dom = XML::LibXML->load_xml( string => $result->content() ); my $xpc = XML::LibXML::XPathContext->new($dom); - $xpc->registerNs('orcid_error', 'http://www.orcid.org/ns/error'); + $xpc->registerNs('orcid_error', 'http://www.' . $repo->config( "orcid_support_advance", "orcid_domain" ) . '/ns/error'); my($error_nodes) = $xpc->findnodes('//orcid_error:error'); #get orcid error code @@ -824,9 +824,9 @@ sub eprint_to_orcid_work if( defined( $contributor->{"orcid"} )) { my $orcid_details = { - "uri" => "http://orcid.org/" . $contributor->{"orcid"}, + "uri" => "http://" . $repo->config( "orcid_support_advance", "orcid_domain" ) . "/" . $contributor->{"orcid"}, "path" => $contributor->{"orcid"}, - "host" => "orcid.org", + "host" => $repo->config( "orcid_support_advance", "orcid_domain" ), }; $orcid_contributor->{"contributor-orcid"} = $orcid_details; }