-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sandbox switch compatibility to advance plugin
- Loading branch information
Showing
3 changed files
with
60 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,43 @@ | ||
#Adapted from John Salter's work at: https://wiki.eprints.org/w/ORCID#Exposing_the_ORCID_in_RIOXX | ||
#Adapted from John Salter's work at: https://wiki.eprints.org/w/ORCID#Exposing_the_ORCID_in_RIOXX | ||
$c->{rioxx2_value_author} = sub { | ||
my( $eprint ) = @_; | ||
|
||
|
||
my $session = $eprint->{session}; | ||
my $orcid_domain; | ||
|
||
if( $session->config( 'orcid_support_advance', 'orcid_domain' ) ) { | ||
$orcid_domain = $session->config( 'orcid_support_advance', 'orcid_domain' ); | ||
} else { | ||
$orcid_domain = "orcid.org"; | ||
} | ||
|
||
my @authors; | ||
for( @{ $eprint->value( "creators" ) } ) | ||
{ | ||
{ | ||
my $id = $_->{orcid}; | ||
$id = EPrints::ORCID::Utils::get_normalised_orcid( $id ); | ||
if( $id ) | ||
$id = EPrints::ORCID::Utils::get_normalised_orcid( $id ); | ||
if( $id ) | ||
{ | ||
push @authors, { | ||
author => EPrints::Utils::make_name_string( $_->{name} ), | ||
id => "https://orcid.org/$id" | ||
id => "https://" . $orcid_domain . "/" . $id | ||
}; | ||
} | ||
} | ||
else | ||
{ | ||
push @authors, { | ||
author => EPrints::Utils::make_name_string( $_->{name} ), | ||
}; | ||
} | ||
} | ||
|
||
#NB If your corp_creators has DOIs or ISNIs for the entries, a similar method could be used to include these here. | ||
foreach my $corp ( @{ $eprint->value( "corp_creators" ) } ) | ||
{ | ||
my $entry = {}; | ||
$entry->{name} = $corp; | ||
push @authors, { author => $corp }; | ||
} | ||
|
||
return \@authors; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters