Procedure: Configure ICE to EPrints

1 About this document

Purpose
This procedure demonstrates how to configure an EPrints 3.X Repository to accept ICE documents.
Audience
This procedure is written for Linux System Administrators or EPrints Administrators with a background in Linux System Administration.
Requirements
ssh access to EPrints server (eprints user and root)
subversion on EPrints server (used to check out code)
References
Intergrated Content Environment (ICE) System
EPrints Institutional Repository Software
Background
This procedure was carried out on an EPrints Repository with LDAP and HTTPS enabled. Not having these features should not affect this procedure in any way. However if you would like to enable LDAP and support for HTTPS see the configuring-eprints-to-use-ldap-and-https documentation.
This version date
02/09/09 02:22:54 PM

2 Getting the code

  1. Log into the EPrints server as the EPrints user

    ssh youruser@youreprints.edu.au
  2. Go to the EPrints users home directory

    cd ~
  3. Check out the code using subversion

    svn co http://ice.usq.edu.au/svn/ice/trunk/src/perl/eprints ice_eprints

3 Configuration

  1. Go into the directory where the code is checked out

    cd ice_eprints
  2. Open ice_ore.pl for editing

    vi ice_ore.pl
    1. Enter the valid username and password of your ICE server, below is an example of the file

    # ICE server username and password
    #
    $c->{"ice_ore_import"}->{username} = "ice_username";
    $c->{"ice_ore_import"}->{password} = "ice_password";

    Note: An ICE server can be set up to use multiple repositories, this ICE to EPrints procedure is currently limited to only accept one ICE username and password. Please ensure that the username and password entered here, is that of the ICE Repository you will be submitting documents from.

  3. Copy ice_ore.pl to $EPRINTS_HOME/archive/$ARCHIVEID/cfg/cfg.d

  4. Copy IceOreResource.pm to $EPRINTS_HOME/perl_lib/EPrints/Plugin/Import

  5. Copy IceOre.pm to $EPRINTS_HOME/perl_lib/EPrints/Plugin/Sword/Import

  6. Open the sword.pl file for editing

    vi $EPRINTS_HOME/archives/$ARCHIVEID/cfg/cfg.d/sword.pl
    1. Add the following ORE format namespace for sword in the file

      $sword->{importers} = {
           ...
           "http://www.openarchives.org/ore/terms/" => "Sword::Import::IceOre",
           "IceORE" => "Sword::Import::IceOre",
         };
  7. Open the SystemSettings.pm file for editing

    vi $EPRINTS_HOME/perl_lib/EPrints/SystemSettings.pm
    1. Add the following lines to the file

       ...
         'executables' => {
           'xsltproc' => '/usr/bin/xsltproc',
           'convert' => '/usr/bin/convert',
           ...
         },
         'invocation' => {
           'xsltproc' => '$(xsltproc) --nomkdir -o $(TARGET) $(STYLESHEET) $(SOURCE)',
           'convert_crop_white' => '$(convert) -crop 0x0 -bordercolor white -border 4x4 $(SOURCE) $(TARGET)',
           ...
         },
         ...

    Note: Check the path to your xsltproc and convert commands if you are concerned that the above default values are incorrect

  8. Open /opt/eprints3/perl_lib/EPrints/Sword/Utils.pm file for editing

    vi /opt/eprints3/perl_lib/EPrints/Sword/Utils.pm
  9. Substitute the value $db with the value $session on line number 193

4 Restart EPrints

  1. Change to the root user

    su -
  2. Restart Apache

    /usr/sbin/apachectl startssl

    Note: If you get an error: Can’t locate HTML/TreeBuilder.pm, please go to Appendix A at the end of this document to resolve that issue and then return to this step.

5 Testing

  1. Create a document in ICE ; If using an existing document skip to step 3

  2. Save the document

  3. Select the document in the ICE web view

    graphics1

  4. Click on the Advanced tab, in the ICE web view and then click on Force render selected

    graphics2

    Note: The above step is not always necessary with new documents, this step was added to ensure that there were no hiccups during this procedure. Older documents however may require this step if the documents were created before the RDF feature was implemented in the ICE code.

  5. Open the document in the ICE web view

  6. Click on the Publish tab and then click on SWORD Deposit

    graphics3

  7. Fill out the URL fields

    http://your_eprints_repository.edu.au/sword-app/servicedocument
  8. Fill out the Authentication (select Basic)

    Note: This will be the username and password of the EPrints repository that you are sending the document to. This username and password can be either a local EPrints user or an LDAP EPrints user. This was made possible by the step in the config above where we replaced the $db variable with $session.

  9. Click Get collections

    graphics4Note: If you get an error regarding EPrints::Sword::ServiceDocument please go to Appendix B at the end of this document to resolve that issue and then return to this step.

  10. When the page refreshes make sure that you set the Collection and Title are correct (it is preferred that you select User Inbox in the collection setting as shown in the screen capture below) then click the Deposit button.

    graphics6

  11. Go to the EPrints repository in your browser

  12. Log in as the user we just entered in the authentication step

  13. Click on Manage deposits

    graphics5

Note: Your item should now appear in your inbox

Appendix A: Can’t locate HTML/TreeBuilder.pm error

  1. Change back to the EPrints user if root and go to their home directory

    cd ~
  2. Download HTML-Tree-3.23.tar.gz

    wget http://search.cpan.org/CPAN/authors/id/P/PE/PETEK/HTML-Tree-3.23.tar.gz
  3. Untar the tar.gz file

    tar -xzf HTML-Tree-3.23.tar.gz
  4. Change to the lib directory

    cd HTML-Tree-3.23/lib
  5. Copy the HTML directory to EPrints perl lib

    cp -r HTML/ /opt/eprints3/perl_lib

Appendix B: Upgrading mod_perl

  • Note: the full error is

failed to resolve handler `EPrints::Sword::ServiceDocument': Bareword "Apache2::Const::DONE" not allowed while "strict subs" in use at /opt/eprints3/perl_lib/EPrints/Sword/ServiceDocument.pm line 63.\nBareword "Apache2::Const::DONE" not allowed while "strict subs" in use at /opt/eprints3/perl_lib/EPrints/Sword/ServiceDocument.pm line 85.\nBareword "Apache2::Const::DONE" not allowed while "strict subs" in use at /opt/eprints3/perl_lib/EPrints/Sword/ServiceDocument.pm line 208.\nCompilation failed in require at (eval 1308) line 3.

This error is caused if the version of mod_perl the operating system is using is too old. To update carry out the following steps.

  1. Open the /etc/yum/repos.d/Centos-Base file for editing

    vi /etc/yum/repos.d/Centos-Base
  2. Change the enable value from 0 to 1 for the “centosplus” repository, below is an example of the file.

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
  3. Change to root user and upgrade mod_perl

    su
    yum upgrade mod_perl
Advertisements

One thought on “Procedure: Configure ICE to EPrints

  1. Pingback: DepoST revisited « Repository News

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s