Skip to content

Instantly share code, notes, and snippets.

@jesusbagpuss
Created October 13, 2016 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesusbagpuss/1f553a6ef5540c2de57bceefff81fdf2 to your computer and use it in GitHub Desktop.
Save jesusbagpuss/1f553a6ef5540c2de57bceefff81fdf2 to your computer and use it in GitHub Desktop.
Add data to OAI-PMH export
# THIS IS UNTESTED
# try it on a test server first!
#
# Save file to: ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugin/Export/LocalDC.pm
# then run:
# > bin/epadmin test ARCHIVEID
# if there are no errors, add the file below and run it again.
# if there are still no errors, restart apache and test the OAI-PMH interface.
package EPrints::Plugin::Export::LocalDC;
@ISA = ( 'EPrints::Plugin::Export::DC' );
use strict;
sub convert_dataobj
{
my( $plugin, $eprint ) = @_;
my @dcdata = $plugin->SUPER::convert_dataobj( $eprint );
# add isbn
push @dcdata, $plugin->simple_value( $eprint, isbn => "identifier" );
# add doi/id_number (field usage may vary!)
push @dcdata, $plugin->simple_value( $eprint, id_number => "identifier" );
push @dcdata, $plugin->simple_value( $eprint, doi => "identifier" );
return \@dcdata
}
1;
# THIS IS UNTESTED
# try it on a test server first!
#
# Save file to: ~/archives/ARCHIVEID/cfg/cfg.d/z_plugins_oai.pl
#
# Alias the new plugin to the old one:
$c->{plugin_alias_map}->{"Export::DC"} = "Export::LocalDC";
$c->{plugin_alias_map}->{"Export::LocalDC"} = undef;
@orazionelson
Copy link

Hello, finally I tried but it doesn't work.
I had to change the main DC.pm file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment