Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt
This guide

...

will help you setup the OAI-PMH provider for

...

Fedora 4 on Tomcat 7. For further details, please refer to the project's documentation on GitHub.

Setting up Tomcat7

Install Tomcat. Use the appropriate package manager (e.g. yum, portage) to install Tomcat (on Xubuntu, for example, setting up Tomcat is accomplished by a simple command:

Code Block
sudo apt-get install tomcat7

Alternatively, visit the Apache Tomcat project documentation for more installation options. Once Tomcat is installed and running, you should see the Tomcat welcome

(Parts of this wiki page were taken from https://github.com/fcrepo4-labs/fcrepo4-oaiprovider)

Assumptions

I'm using a Virtualbox VM, but this should work "as-is" on any linux platform

Xubuntu 14.04-desktop-i386

Java version "1.7.0_65", OpenJDK Runtime Environment (IcedTea 2.5.2)

OpenJDK Client VM (build 24.65-b04, mixed mode, sharing)

CATALINA_HOME is /var/lib/tomcat7

<fcrepo> is fcrepo-webapp-4.0.0-beta-04-SNAPSHOT

 

Setting up Tomcat7

Om Xubuntu, setting up tomcat7 is a simple command: "sudo apt-get install tomcat7" to download and install the webserver and any prerequisites. On other systems, use the build-in package manager (yum, portage) to install tomcat7 or install it manually using the useful instructions on the packages website. By the completion of the installation, you should be able to run tomcat and see the "It Worked!" screen when you visit http://localhost:8080.

 

Setting up Fedora Repository

...

Using Use either the pre-packaged binary . WAR file or building it build Fedora from the source files (using the helpful and informative instructions), the result should be a .source to get a WAR file. Copy the . WAR file to the tomcats Tomcat root directory <CATALINA_HOME>/webapps. Start/restart tomcat Tomcat, and http://localhost:8080/<fcrepo>/rest should display the fedora Fedora repository front page. (I've called it <fcrepo> as its

Info
<fcrepo> is the name of the .

...

war file minus the .war extension and

...

the exact file name can vary on build

...

/release number.

...

Install the fcrepo-oaiprovider library dependencies

FcrepoThe OAI-PMH provider in fcrepo4-oaiprovider relies on JAX-B to operateJAXB, so install them by grabbing the jar filesdownload 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 moving move them to <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib

Building fcrepo-oaiprovider

...

  1.  Obtain and build the fcrepo-oaiprovider source code

...

  1. :

    Code Block
    languagetext
        git clone https://github.com/fcrepo4-labs/fcrepo4-oaiprovider.git

...

  1. 
        cd fcrepo4-oaiprovider

...

  1. 
        mvn package

...

  1.  Move the generated JAR to Tomcat's lib folder:

    Code Block
    languagetext
        cp target/fcrepo4-oaiprovider-4.0.0-beta-

...

  1. 05-SNAPSHOT.jar <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib

 

  1.  Copy the oai.xml file to the fcrepo config directory

...

  1. :

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

 

  1. Edit the fcrepo master.xml file

...

  1. in <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/

...

  1. class/spring/master.xml

...

  1. to paste the following <import> declaration after other <import> declarations:

    Code Block
    languagetext
    <import resource="classpath:/spring/oai.xml"/>

...

  1. You may have to add the following namespace element to fcrepo-kernel-impl/src/main/resources/fedora-node-types.cnd in the fcrepo4 project and rebuild it, or reference your .cnd file in repository.json, if necessary. 

    Code Block
    languagetext

    - Save the file

 

...

  1. <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

...

...

  1. Restart Tomcat. Go to http://localhost:8080/<fcrepo>/rest/oai?verb=Identify. If

...

  1. everything is in order, you should see

...

  1. an XML file outlining the default configuration for the OAI-PMH provider.

Popular Common errors are either the OAI-Provider PMH provider generating either 4xx HTTP error codes or producing the default values (see mentioned 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 status codes indicate an undefined namespace (Step 5 above). If default values appear instead of the properties you populated, this means the properties are not available or defined incorrectly. 

Configuring the OAI-PMH provider

The OAI - Provider relies on 4 four properties being present in the main repository for the IDENTIFY verb. Those The properties and the corresponding default values are:

PropertyDefault
oai:repositoryName "Fedora 4"
oai:description "An example repository description"
oai:version<build version>
oai:

...

adminAddress "admin@example.com"

These properties have to populated manually for now (with the exception of oai:version, which is populated automatically to reflect the build version), using the following sparql-update queriesSPARQL/Update queries of the pattern:

INSERT {<> oai:repositoryName "exciting repository name 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"

 

 

 

 

As an example:

Code Block
languagetext
echo "insert data {<> oai:repositoryName coolrepo } " | curl -X PATCH --upload-file - http://localhost:8080/fcrepo/rest

...