Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

This guide should help you setup the OAI-PMH provider for Fedora 4 using Tomcat 7 as the platform. For further details, please refer to the project's documentation on GitHub.

Setting up Tomcat7

Set up Tomcat. On Xubuntu, for example, setting up Tomcat is a simple command: "sudo apt-get install tomcat7".  On other systems, use the appropriate build-in package manager (yum, portage) to install Tomcat (or visit the Apache Tomcat project documentation for more installation options). After installing and deploying Tomcat, you should be able see the Tomcat welcome screen when you visit http://localhost:8080

Setting up Fedora Repository

Use either the pre-packaged WAR file (.war) from webapp-plus project or build Fedora from source to get a WAR file. Copy the WAR to the Tomcat root directory <CATALINA_HOME>/webapps. Start/restart Tomcat and http://localhost:8080/<fcrepo>/rest should display the Fedora repository front page.

(<fcrepo> is the name of the .war file minus the .war extension and it can vary on build number/release.)

Install the fcrepo-oaiprovider library dependencies

The OAI-PMH provider in fcrepo4-oaiprovider relies on JAXB, so download the following JAR files from:

 http://central.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.jar
 http://central.maven.org/maven2/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.jar

and move them to <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib

Building fcrepo-oaiprovider

  1.  Obtain and build the fcrepo-oaiprovider source code:

 

 

 

    git clone https://github.com/fcrepo4-labs/fcrepo4-oaiprovider.git
    cd fcrepo4-oaiprovider
    mvn package

 

 

  1.  Move the generated JAR to the Tomcat lib folder:
    cp target/fcrepo4-oaiprovider-4.0.0-beta-04-SNAPSHOT.jar <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib

 

#  Copy the oai.xml file to the fcrepo config directory:

    cp fcrepo4-oaiprovider/src/main/resources/spring/oai.xml /<CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/classes/spring/

 

4) Add the import to fcrepo's master.xml file

    - Edit <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/classes/spring/master.xml

    - Add '<import resource="classpath:/spring/oai.xml"/>' after the other <import> declarations

4b) Make sure the OAI namespace is defined as a Compact Node Definition Type. Add:

<oai = 'http://www.openarchives.org/OAI/2.0/'>

to fcrepo-kernel-impl/src/main/resources/fedora-node-types.cnd in the main core and rebuilt, but you may have to find another way to add it. See Here

 

5) Restart Tomcat. Go to http://localhost:8080/<fcrepo>/rest/oai?verb=Identify. If it all worked, you should see XML that defines the default configuration for the OAI-PMH provider.

Common errors are either the OAI-PMH provider generating 4xx HTTP error codes or producing the default values (see below). The 4xx HTTP Error codes are a manifestation that the namespace having not been defined (Step 4b above), so make sure the OAI compact node definition has been added to the fedora-node-types.cnd file or however you have found to add the definition is correct.The default values appearing instead of properties you have defined would mean the properties are not available or defined incorrectly.

 

Configuring the OAI-PMH provider

The OAI-Provider relies on four properties being present in the main repository for the IDENTIFY verb. The properties are:

  • oai:repositoryName
  • oai:description
  • oai:version
  • oai:adminEmail

 

These properties have to populated manually for now, using the following SPARQL/Update queries:

INSERT {<> oai:repositoryName "exciting repository name here"}
INSERT {<> oai:description "exciting description here"}
INSERT {<> oai:adminEmail "your.email@here.org"}

 

(oai:version is populated by the software itself, so it should be the software build version)

 

If one or more of the properties are missing, the OAI provider should use the built-in values:

oai:repositoryName: "Fedora 4"

oai:description: "An example repository description"

oai:version: <whatever the software version is>

oai:adminAddress: "admin@example.com"

 

  • No labels