This guide should help you setup the OAI-PMH provider for fcrepo using tomcat7 as the platform.
(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/fcrepo
Using either the pre-packaged binary .WAR file or building it from the source files (using the helpful and informative instructions), the result should be a .WAR file. Copy the .WAR file to the tomcats root directory <CATALINA_HOME>/webapps. Start/restart tomcat and http://localhost:8080/<fcrepo>/rest should display the fedora repository front page. (I've called it <fcrepo> as its the name of the .WAR file minus the .war extension and it can vary on build number/release.)
Install the fcrepo-oaiprovider library dependencies
Fcrepo-oaiprovider relies on JAX-B to operate, so install them by grabbing the jar files:
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 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
2) Move the binary to the fcrepo libraries
cp target/fcrepo-oaiprovider-4.0.0-beta-04-SNAPSHOT.jar <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib
3) Copy the oai.xml file to the fcrepo config directory
cp fcrepo-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 at the end of the file
- Save the file
5) Restart tomcat, wait a while. 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.
TO-DO - Configuring the OAI-PMH provider