EPrints Document License Types

Today I was adding some files to our EPrints-based repository and was asked to assign a Creative Commons Attribution Non-commercial Share Alike US 3.0 license to them. By default, our repository various had Creative Commons licenses included, but they were neither the United States one, or 3.0 (they were 2.5). I figured this was just a matter of editing the phrases since I didn’t really want to have both the CC-NC-SA 3.0 US and the CC-NC-SA 2.5 licenses in the repository. However, it was a little more difficult then that. EPrints is, I think, a lot more powerful then sometimes it is credited for. Some of the power lies in the various format files.

After some searching on EPrints wiki and Google I couldn’t find out how to do this. This is when I turned to the all powerful grep command to search for phrases in files, and I was able to figure out which files contained the information I needed to change. It turns out there are a few different tasks that must be done and they may not be apparent at first. One of those files the contains information related to license information is a Namedset file. This file tells e-prints the codes to use for licenses. My original on looked like:

eprints@elekhasik:~$ more archives/binghamton/cfg/namedsets/licenses

# types for document licenses
cc_by_nd
cc_by
cc_by_nc
cc_by_nc_nd
cc_by_nc_sa
cc_by_sa
cc_public_domain
cc_gnu_gpl
cc_gnu_lgpl

To add a new document license type, all one needs to do is add a new code. Incidentally, the licenses appear in the E-prints editing pages in the ordered listed here. To make things easier on future depositors, instead of simply changing the cc_by_nc_sa license, I decided to make a new one called cc_binghamton. I did this so that people depositing things will know this is our libraries’ default license.

EPrints by default uses the installation-wide (versus repository based) system.xml file to translate the code to phrases for both the depository screens and public view. The two phrases that need to be read are the
licenses_typename_XXXX and licenses_description_XXXX phrases. However, E-prints comes with a warning saying “DON’T EDIT THESE FILES…. Editing the contents of this directory is not recommended.” Okay then, I’m not touching these then. Instead, anything in the system.xml file can be overridden by placing the phrases in any file located in the eprints3/archives/ARCHIVEID/cfg/lang/en/phrases directory. Not wanting to cross that warning, I did just that. While technically the phrases can be in any file, I decided to create a new file in that directory called zz_licenses.xml. The “zz” part tells me it is of my own creation and, if I recall correctly, the files are read in alphabetical order so, it gets processed at the end. As I mentioned, I added a new license called cc_binghamton. So, I needed to add entries for that. I also decided to update the CC-NC-SA to point to the 3.0 US version so I didn’t have to go back and change any previous submissions. I just followed the phrase format from the system.xml, changing the values. Besides properly adding the phrase ID, there is some file header information required. My resulting file looked like this:

<epp:phrases xmlns=”http://www.w3.org/1999/xhtml”
xmlns:epp=”http://eprints.org/ep3/phrase”
xmlns:epc=”http://eprints.org/ep3/control”>

<epp:phrase id=”licenses_typename_cc_by_nc_sa”>Creative Commons Non-commercial Attribution Share Alike
<epp:phrase id=”licenses_description_cc_by_nc_sa”><a href=”http://creativecommons.org/licenses/by-nc-sa/3.0/us/”>Creative Commons Attribution Non-commercial Share Alike US 3.0
<epp:phrase id=”licenses_typename_cc_binghamton”>Binghamton Library Staff</epp:phrase>
<epp:phrase id=”licenses_description_cc_binghamton”><a href=”http://creativecommons.org/licenses/by-nc-sa/3.0/us/”>Creative Commons Attribution Non-commercial Share Alike US 3.0</a></epp:phrase>
</epp:phrases>

Note that because the description is the same, they will both look the same to the end-user.

Wait, your not done yet! If you added a new license type, you will need to reload your EPrints configuration and restart apache:

eprints@elekhasik:~$ bin/epadmin reload ARCHIVEID
eprints@elekhasik:~$ sudo apache2ctl restart

Also, you will need to at least generate new abstracts (or wait for cron to do it assuming you have it configured). I decided to create new abstracts, static pages, and views just to be safe although I am not sure that they are all required.

eprints@elekhasik:~$ bin/generate_static ARCHIVEID
eprints@elekhasik:~$ bin/generate_views ARCHIVEID
eprints@elekhasik:~$ bin/generate_abstracts ARCHIVEID

That’s it. It is pretty simple once you know how to do it.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment