...
Obtain and build the fcrepo-oaiprovider source code:
Code Block language text git clone https://github.com/fcrepo4-labs/fcrepo4-oaiprovider.git cd fcrepo4-oaiprovider mvn package
Move the generated JAR to Tomcat's lib folder:
Code Block language text cp target/fcrepo4-oaiprovider-4.0.0-beta-05-SNAPSHOT.jar <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/lib
Copy the oai.xml file to the fcrepo config directory:
Code Block cp fcrepo4-oaiprovider/src/main/resources/spring/oai.xml /<CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/classes/spring/
Edit the fcrepo master.xml file in <CATALINA_HOME>/webapps/<fcrepo>/WEB-INF/class/spring/master.xml to paste the following <import> declaration after other <import> declarations:
Code Block language text <import resource="classpath:/spring/oai.xml"/>
Make sure the OAI namespace is defined as a Compact Node Definition Type. 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 language text <oai = 'http://www.openarchives.org/OAI/2.0/'>
- Restart Tomcat. Go to http://localhost:8080/<fcrepo>/rest/oai?verb=Identify. If everything is in order, you should see some an XML , file outlining the default configuration for the OAI-PMH provider.
Common errors are either the OAI-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 status codes indicate an undefined namespace (Step 5 above), so make sure the OAI compact node definition has been added correctly to the fedora-node-types.cnd file. If default values appear instead of the properties you populated, this means the properties are not available or defined incorrectly.
...