How to set up the Fedora OAI Provider Service
To expose the DOMS objects to the Summa Storage layer you need to have the OAI Provider Service running on top of your Fedora installation. The OAI Provider installation files and source code can be found in the DOMS SVN repository under the test/lib folder.
Important: It is extremely important that the OAI Provider Service version number matches your Fedora version number. Keep this in mind if Fedora is ever upgraded (Fedora version as of writing is 2.2.1 and matching OAI Provider version is 1.1).
New: Easy OAI Provider Webservice Setup and Deploy Script
Set up the DOMS test installation. Do not ingest any objects.
Execute oaiprovidersetup.sh in the test/bin folder with the doms test installation folder just created as argument. It will prompt for the root password to the MySQL installation, create a proai database with the name proai, edit the proai properties and deploy the oai harvester in the test folder.
And check Identify.xml: http://localhost:7900/oaiprovider/?verb=Identify.
- You are done :).
And then you can check http://localhost:7900/oaiprovider/?verb=ListRecords&metadataPrefix=indexRepresentation.
Old: Manual OAI Provider Webservice Setup and Deploy
If you want to install the OAI Provider manually, the following should still work.
The TestSetup page suggests installing the DOMS test installation in a ~/mydoms directory. Replace <<MYDOMS>> with your DOMS test installation directory in the following. And replace <<PROJECTS/DOMS>> with your DOMS project directory.
cd ~/<<MYDOMS>>/server unzip ~/<<PROJECTS/DOMS>>/test/lib/oaiprovider-1.1.zip unzip ~/<<PROJECTS/DOMS>>/test/lib/oaiprovider-1.1-src.zip
Set up a mysql user for the oaiprovider service and a database named "proai" (alternatively use phpMyAdmin if you want a gui tool):
mysql -u root -p CREATE DATABASE proai; GRANT ALL PRIVILEGES on *.* to 'proai'@'%' identified by 'proai' WITH GRANT OPTION; GRANT ALL PRIVILEGES on *.* to 'proai'@'localhost' identified by 'proai' WITH GRANT OPTION; GRANT ALL PRIVILEGES on *.* to 'proai' identified by 'proai' WITH GRANT OPTION; exit;
or if you already have a proai database and user, you should clear the proai cache to start over:
mysqldump -uproai -pproai --add-drop-table --no-data proai|grep ^DROP|mysql -uproai -pproai proai
Now deploy the oaiprovider webservice into the running tomcat of Fedora. Note that in a production environment it is probably better to deploy the oaiprovider service in another separate tomcat.
cp ~/<<MYDOMS>>/server/oaiprovider-1.1/oaiprovider.war ~/<<MYDOMS>>/tomcat/webapps
Now edit the file ~/<<MYDOMS>>/tomcat/webapps/oaiprovider/WEB-INF/classes/proai.properties to make sure the following is set correctly (replace <<USERNAME>> with your username). Change the first six items; add the last three.
proai.validateUpdates = false
proai.cacheBaseDir = /home/<<USERNAME>>/<<MYDOMS>>/proai/cache
proai.sessionBaseDir = /home/<<USERNAME>>/<<MYDOMS>>/proai/sessions
driver.fedora.baseURL = http://localhost:7900/fedora/
driver.fedora.identify = http://localhost:7900/fedora/get/doms:DOMS_Base_Collection/Identify.xml
- driver.fedora.md.formats = indexRepresentation
driver.fedora.md.format.indexRepresentation.loc = http://example.org/testFormat.xsd
driver.fedora.md.format.indexRepresentation.uri = http://example.org/testFormat/
- driver.fedora.md.format.indexRepresentation.dissType = info:fedora/*/doms:indexRepresentation/getIndexRepresentation
To configure proper logging edit the file ~/<<MYDOMS>>/tomcat/webapps/oaiprovider/WEB-INF/classes/log4j.xml accordingly:
Set the "File" param of each appender to /home/<<USERNAME>>/<<MYDOMS>>/proai/log/proai.log
- The priority value of the root appender should be INFO or DEBUG (instead of WARN)
Log4j will not log anything unless the parent dir of the log file exists, therefore:
mkdir -p ~/<<MYDOMS>>/proai/log
Make sure that the resource index is turned on. This should have been done by domssetup.sh. In ~/<<MYDOMS>>/server/config/fedora.fcfg in <module role="fedora.server.resourceIndex.ResourceIndex" class="fedora.server.resourceIndex.ResourceIndexModule"> the level should be 2:
<param name="level" value="2">
To make sure the new settings are used correctly restart the DOMS test installation