Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7b7533a
Fix 2 files appear missing from epmi, checksum for z_datacitedoi.pl o…
drtjmb Dec 19, 2014
af8e62b
Fix })}) mashup in z_datacite_core.pl, new epmi
drtjmb Dec 19, 2014
e37c779
Finally fixed the typo in How it works
Dec 19, 2014
adbcb28
code moved to datacitedoi.pl
cziaarm Jan 15, 2015
af246e6
new config options
cziaarm Jan 15, 2015
dae3b09
improved event handling
cziaarm Jan 15, 2015
10c2a39
Event::Datacite::coin_doi for consisstency
cziaarm Jan 15, 2015
43dfb29
pharses for action button and related msgs
cziaarm Jan 15, 2015
7723caf
Action button plugin
cziaarm Jan 15, 2015
53af6d8
updated readme to reflect new features
cziaarm Jan 15, 2015
67d9326
Screen not Sreen!!
cziaarm Jan 16, 2015
8c6c49a
Fixed schemqLocation in config
cziaarm Jan 16, 2015
4db3b82
epmi relates to latest code
cziaarm Jan 16, 2015
1683cd6
Updating plugin code to resolve server error issue
Aug 12, 2016
2daef87
updating plugin, to use 4.0 metadata schema
BorysFeldman Aug 31, 2016
3d1bef3
changes to the plugin for the repo link
BorysFeldman Sep 1, 2016
6b80290
Updating DataCiteEvent.pm to use Crypt::SSLeay module
Sep 2, 2016
ee2d788
Update z_datacitedoi.pl
cziaarm Sep 7, 2016
aceb640
Update z_datacitedoi.pl
BorysFeldman Sep 7, 2016
50233b4
updates to the datacite plugin
BorysFeldman Sep 13, 2016
5178819
Fixing bug when <subjects> tag is created
Nov 3, 2016
cfb51f5
Fixing minor typo
Nov 3, 2016
a3354c4
Adding resourceType and resourceTypeGeneral attributes to DataCiteXML…
Nov 4, 2016
4939f22
Updating rendering of resourceType and subjects elements
Nov 7, 2016
32cc4b0
Fixing minor typos in XML element names
Nov 15, 2016
cc5493d
Fixing rendering of geoLocations XML elements
Nov 16, 2016
402886d
Commenting out creation of contributors element due to requirements o…
Dec 16, 2016
203e85a
Fixed hash ref bug, this closes #6
Nov 29, 2016
4fed4d0
bug fix for creators and orcid, though more to be done, and tidied l…
Mar 6, 2017
a40fe61
Added configurable var for lang tags, use EPrints::XML::to_string, Cl…
Mar 6, 2017
ec11dca
be more explicit about utf8
Mar 6, 2017
d1741dc
updates to the dataciteXML
Apr 26, 2017
3ac5bf6
tab tidying and datacite_custom_repo_link
Jul 11, 2017
be7a6c2
remove the relatedIdentifier for now
Jul 13, 2017
336a27c
reworked Export plugin so that *any* EPrint field can be mapped if a …
Aug 21, 2017
7aab5a0
rationalisation of field render code
Sep 19, 2017
c5454f7
rationalisation of field render code
Sep 19, 2017
4808185
remove uneeded file
Sep 19, 2017
2cb2ba8
removing uneeded file
Sep 19, 2017
d5659f9
updating Datacitexml file
Sep 19, 2017
659a674
Merge pull request #15 from eprintsug/new_release
cziaarm Sep 19, 2017
5a2ab4d
updated epmi
Sep 20, 2017
17ae4a3
updating license
Sep 27, 2017
7f48f88
Merge branch 'master' of https://github.com/eprintsug/DataCiteDoi int…
Sep 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 60 additions & 20 deletions DataCiteDoi.epmi
Original file line number Diff line number Diff line change
@@ -1,42 +1,78 @@
<?xml version='1.0' encoding='utf-8'?>
<epm xmlns='http://eprints.org/ep2/data/2.0' id='http://eprints/id/epm/DataCiteDoi'>
<epm xmlns='http://eprints.org/ep2/data/2.0' id='http://pok.pok.com/id/epm/DataCiteDoi'>
<epmid>DataCiteDoi</epmid>
<uri>http://eprints/id/epm/DataCiteDoi</uri>
<uri>http://clean.ep.devorkin:8082/id/epm/DataCiteDoi</uri>
<documents>
<document>
<files>
<file>
<filename>epm/DataCiteDoi/cfg/cfg.d/z_datacitedoi.pl</filename>
<datasetid>document</datasetid>
<filename>lang/en/phrases/coinDOI.xml</filename>
<mime_type>application/xml</mime_type>
<hash>ea8da6c0e471cea13c5b573d115cbbe8</hash>
<hash_type>MD5</hash_type>
<filesize>641</filesize>
</file>
<file>
<datasetid>document</datasetid>
<filename>static/images/epm/datacitedoi.png</filename>
<mime_type>image/png</mime_type>
<hash>14e9e2be0a73f452533488634aaea66e</hash>
<hash_type>MD5</hash_type>
<filesize>101504</filesize>
</file>
<file>
<datasetid>document</datasetid>
<filename>plugins/EPrints/Plugin/Event/DataCiteEvent.pm</filename>
<mime_type>text/plain</mime_type>
<hash>fcb3176e88cf0bccb6c8e000bd1ac0da</hash>
<hash>3fe07ce4a3a6e765b647b16118cc23f2</hash>
<hash_type>MD5</hash_type>
<filesize>1070</filesize>
<filesize>5213</filesize>
</file>
<file>
<datasetid>document</datasetid>
<filename>plugins/EPrints/Plugin/Export/DataCiteXML.pm</filename>
<mime_type>application/x-symlink</mime_type>
<hash>84f4180876ff95bdde9f78a6a4c300e6</hash>
<mime_type>text/plain</mime_type>
<hash>696d1ecb13af35cdf6cba01198219b30</hash>
<hash_type>MD5</hash_type>
<filesize>3898</filesize>
<filesize>2806</filesize>
</file>
<file>
<filename>static/images/epm/datacitedoi.png</filename>
<mime_type>application/x-symlink</mime_type>
<hash>14e9e2be0a73f452533488634aaea66e</hash>
<datasetid>document</datasetid>
<filename>plugins/EPrints/Plugin/Screen/EPrint/Staff/CoinDOI.pm</filename>
<mime_type>text/plain</mime_type>
<hash>0ceae1dd50779c660b2e2a6bb4e4ff27</hash>
<hash_type>MD5</hash_type>
<filesize>101504</filesize>
<filesize>2237</filesize>
</file>
<file>
<datasetid>document</datasetid>
<filename>cfg.d/z_datacite_mapping.pl</filename>
<mime_type>text/plain</mime_type>
<hash>4f2807b6c4cd8fba51cada676ebf9278</hash>
<hash_type>MD5</hash_type>
<filesize>8691</filesize>
</file>
<file>
<datasetid>document</datasetid>
<filename>epm/DataCiteDoi/cfg/cfg.d/z_datacitedoi.pl</filename>
<mime_type>text/plain</mime_type>
<hash>670a102e25b0b7636091ccf15d200847</hash>
<hash_type>MD5</hash_type>
<filesize>5046</filesize>
</file>
</files>
<mime_type>application/x-symlink</mime_type>
<format>other</format>
<main>static/images/epm/datacitedoi.png</main>
<mime_type>text/plain</mime_type>
<format>text</format>
<main>epm/DataCiteDoi/cfg/cfg.d/z_datacitedoi.pl</main>
<content>install</content>
</document>
<document>
<files>
<file>
<datasetid>document</datasetid>
<filename>static/images/epm/datacitedoi.png</filename>
<mime_type>application/x-symlink</mime_type>
<mime_type>image/png</mime_type>
<hash>14e9e2be0a73f452533488634aaea66e</hash>
<hash_type>MD5</hash_type>
<filesize>101504</filesize>
Expand All @@ -47,15 +83,19 @@
<content>coverimage</content>
</document>
</documents>
<version>0.9.0</version>
<version>2.0.0</version>
<creators>
<item>
<name>
<family>Milsted</family>
<given>Andrew</given>
<family>McNicholl</family>
<given>Rory</given>
</name>
<id>repositories@ulcc.ac.uk</id>
</item>
</creators>
<title>Data Cite DOI Registration</title>
<datestamp>2017-09-20 15:27:51</datestamp>
<title>DataCiteDoi - DataCite DOIs for EPrints</title>
<description>A plugin integrate into the workflow the process of to minting and registering DataCite DOIs</description>
<home_page>https://github.com/eprintsug/DataCiteDoi</home_page>
<icon>images/epm/datacitedoi.png</icon>
</epm>
92 changes: 69 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Installation
Install the plugin from the bazaar and edit the following config files.

```
z_datacite_core.pl
z_datacitedoi.pl
```

Expand Down Expand Up @@ -52,9 +51,14 @@ $c->{datacitedoi}{pass} = "PASS";
# prints, distributes, releases, issues, or produces the
# resource. This property will be used to formulate the
# citation, so consider the prominence of the role.
# eg World Data Center for Climate (WDCC);
# eg World Data Center for Climate (WDCC);
$c->{datacitedoi}{publisher} = "Eprints Repo";

# Namespace and location for datacite XML schema
# feel free to update, though no guarantees it'll be accepted if you do
$c->{datacitedoi}{xmlns} = "http://datacite.org/schema/kernel-2.2";
$c->{datacitedoi}{schemaLocation} = $c->{datacitedoi}{xmlns}." ".$c->{datacitedoi}{xmlns}."/metadata.xsd";

# need to map eprint type (article, dataset etc) to ResourceType
# Controled list http://schema.datacite.org/meta/kernel-2.2/doc/DataCite-MetadataKernel_v2.2.pdf
# where v is the ResourceType and a is the resourceTypeGeneral
Expand All @@ -74,42 +78,84 @@ $c->{datacitedoi}{typemap}{other} = {v=>'Misc',a=>'Collection'};
$c->{datacitedoi}{typemap}{dataset} = {v=>'Dataset',a=>'Dataset'};
$c->{datacitedoi}{typemap}{audio} = {v=>'Audio',a=>'Sound'};
$c->{datacitedoi}{typemap}{video} = {v=>'Video',a=>'Film'};
```

z_datacite_core.pl
###########################
#### DOI syntax config ####
###########################

Adds the minting plugin, by default it the plugin will run when ever the status (draft,review,deposit,delete) changes.
The plugin will then run asynchronously after the change using the eprints queue so the datacite registration wont affect the users view.
# Set config of DOI delimiters
# Feel free to change, but they must conform to DOI syntax
# If not set will default to prefix/repoid/id the example below gives prefix/repoid.id
$c->{datacitedoi}{delimiters} = ["/","."];

```perl
# Adds the minting plugin to the EP_TRIGGER_STATUS_CHANGE
$c->add_dataset_trigger( "eprint", EP_TRIGGER_STATUS_CHANGE , sub {
# If set, plugin will attempt to register what is found in the EP DOI field ($c->{datacitedoi}{eprintdoifield})
# Will only work if what is found adheres to DOI syntax rules (obvioulsy)
$c->{datacitedoi}{allow_custom_doi} = 0;

#Datacite recommend digits of length 8-10 set this param to pad the id to required length
$c->{datacitedoi}{zero_padding} = 8;

##########################################
### Override which URL gets registered ###
##########################################

#Only useful for testing from "wrong" domain (eg an unregistered test server) should be undef for normal operation
$c->{datacitedoi}{override_url} = undef;

##########################
##### When to coin ? #####
##########################

#If auto_coin is set DOIs will be minted on Status change (provided all else is well)
$c->{datacitedoi}{auto_coin} = 0;
#If action_coin is set then a button will be displayed under action tab (for staff) to mint DOIs on an adhoc basis
$c->{datacitedoi}{action_coin} = 1;

# NB setting auto_coin renders action coin redundant as only published items can be registered

####### Formerly in cfg.d/datacite_core.pl #########

# Including datacite_core.pl below as we can make some useful decisions based on the above config.

## Adds the minting plugin to the EP_TRIGGER_STATUS_CHANGE
if($c->{datacitedoi}{auto_coin}){
$c->add_dataset_trigger( "eprint", EP_TRIGGER_STATUS_CHANGE , sub {
my ( %params ) = @_;

my $repository = %params->{repository};

return undef if (!defined $repository);

if (defined %params->{dataobj}) {
my $dataobj = %params->{dataobj};
my $eprint_id = $dataobj->id;


if (defined %params->{dataobj}) {
my $dataobj = %params->{dataobj};
my $eprint_id = $dataobj->id;
$repository->dataset( "event_queue" )->create_dataobj({
pluginid => "Event::DataCiteEvent",
action => "datacite_doi",
params => [$dataobj->internal_uri],
});
});
}
pluginid => "Event::DataCiteEvent",
action => "datacite_doi",
params => [$dataobj->internal_uri],
});
}

});
});
}

# Activate an action button, the plugin for whcih is at
# /plugins/EPrints/Plugin/Screen/EPrint/Staff/CoinDOI.pm
if($c->{datacitedoi}{action_coin}){
$c->{plugins}{"Screen::EPrint::Staff::CoinDOI"}{params}{disable} = 0;
}

```
Who it works

How it works
-------------

/lib/plugins/EPrints/Plugin/Event/DataCiteEvent.pm
This is added to the queue and actually mints the doi.

lib/plugins/EPrints/Plugin/Sreen/EPrint/Staff/CoinDOI.pm
This adds a button to enable staff to choose when to coin the DOI and request registration

/lib/plugins/EPrints/Plugin/Export/DataCiteXML.pm
This exports the metadata xml required for minting, this can be used independently and through the user interface.

Expand Down
22 changes: 0 additions & 22 deletions cfg/cfg.d/z_datacite_core.pl

This file was deleted.

88 changes: 82 additions & 6 deletions cfg/cfg.d/z_datacitedoi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#which field do use for the doi
$c->{datacitedoi}{eprintdoifield} = "id_number";

#for xml:lang attributes in XML
$c->{datacitedoi}{defaultlangtag} = "en-GB";

#When should you register/update doi info.
$c->{datacitedoi}{eprintstatus} = {inbox=>0,buffer=>1,archive=>1,deletion=>0};

Expand All @@ -16,14 +19,19 @@
$c->{datacitedoi}{user} = "USER";
$c->{datacitedoi}{pass} = "PASS";

# datacite requires a Publisher
# The name of the entity that holds, archives, publishes,
# prints, distributes, releases, issues, or produces the
# resource. This property will be used to formulate the
# datacite requires a Publisher
# The name of the entity that holds, archives, publishes,
# prints, distributes, releases, issues, or produces the
# resource. This property will be used to formulate the
# citation, so consider the prominence of the role.
# eg World Data Center for Climate (WDCC);
# eg World Data Center for Climate (WDCC);
$c->{datacitedoi}{publisher} = "Eprints Repo";

# Namespace and location for datacite XML schema
# feel free to update, though no guarantees it'll be accepted if you do
$c->{datacitedoi}{xmlns} = "http://datacite.org/schema/kernel-4.0";
$c->{datacitedoi}{schemaLocation} = $c->{datacitedoi}{xmlns}." http://schema.datacite.org/meta/kernel-4.0/metadata.xsd";

# need to map eprint type (article, dataset etc) to ResourceType
# Controled list http://schema.datacite.org/meta/kernel-2.2/doc/DataCite-MetadataKernel_v2.2.pdf
# where v is the ResourceType and a is the resourceTypeGeneral
Expand All @@ -42,4 +50,72 @@
$c->{datacitedoi}{typemap}{other} = {v=>'Misc',a=>'Collection'};
$c->{datacitedoi}{typemap}{dataset} = {v=>'Dataset',a=>'Dataset'};
$c->{datacitedoi}{typemap}{audio} = {v=>'Audio',a=>'Sound'};
$c->{datacitedoi}{typemap}{video} = {v=>'Video',a=>'Film'};
$c->{datacitedoi}{typemap}{video} = {v=>'Video',a=>'Film'};

###########################
#### DOI syntax config ####
###########################

# Set config of DOI delimiters
# Feel free to change, but they must conform to DOI syntax
# If not set will default to prefix/repoid/id the example below gives prefix/repoid.id
$c->{datacitedoi}{delimiters} = ["/","."];

# If set, plugin will attempt to register what is found in the EP DOI field ($c->{datacitedoi}{eprintdoifield})
# Will only work if what is found adheres to DOI syntax rules (obvioulsy)
$c->{datacitedoi}{allow_custom_doi} = 0;

#Datacite recommend digits of length 8-10 set this param to pad the id to required length
$c->{datacitedoi}{zero_padding} = 8;

##########################################
### Override which URL gets registered ###
##########################################

#Only useful for testing from "wrong" domain (eg an unregistered test server) should be undef for normal operation
$c->{datacitedoi}{override_url} = undef;

##########################
##### When to coin ? #####
##########################

#If auto_coin is set DOIs will be minted on Status change (provided all else is well)
$c->{datacitedoi}{auto_coin} = 0;
#If action_coin is set then a button will be displayed under action tab (for staff) to mint DOIs on an adhoc basis
$c->{datacitedoi}{action_coin} = 1;

# NB setting auto_coin renders action coin redundant as only published items can be registered

####### Formerly in cfg.d/datacite_core.pl #########

# Including datacite_core.pl below as we can make some useful decisions based on the above config.

## Adds the minting plugin to the EP_TRIGGER_STATUS_CHANGE
if($c->{datacitedoi}{auto_coin}){
$c->add_dataset_trigger( "eprint", EP_TRIGGER_STATUS_CHANGE , sub {
my ( %params ) = @_;

my $repository = $params{repository};

return undef if (!defined $repository);

if (defined $params{dataobj}) {
my $dataobj = $params{dataobj};
my $eprint_id = $dataobj->id;
$repository->dataset( "event_queue" )->create_dataobj({
pluginid => "Event::DataCiteEvent",
action => "datacite_doi",
params => [$dataobj->internal_uri],
});
}

});
}

# Activate an action button, the plugin for whcih is at
# /plugins/EPrints/Plugin/Screen/EPrint/Staff/CoinDOI.pm
if($c->{datacitedoi}{action_coin}){
$c->{plugins}{"Screen::EPrint::Staff::CoinDOI"}{params}{disable} = 0;
}


Loading