= 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 == 1. [[TestSetup|Set up the DOMS test installation.]] Do '''not''' ingest any objects. 1. 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. 1. Try ingesting the base collection (look at [[InstallIngestPackageTestStep]] and [[IngestObjectsTestStep]] for help). 1. And check Identify.xml: [[http://localhost:7900/oaiprovider/?verb=Identify]]. 1. You are done :). 1. You can also try ingesting the test collection (look at [[InstallIngestPackageTestStep]], [[InstallPreIngestPackageTestStep]], [[IngestObjectsTestStep]], [[DisseminatorInstall]]). 1. 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| TestSetup page]] suggests installing the DOMS test installation in a {{{~/mydoms}}} directory. Replace <> with your DOMS test installation directory in the following. And replace <> with your DOMS project directory. {{{ cd ~/<>/server unzip ~/<>/test/lib/oaiprovider-1.1.zip unzip ~/<>/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 ~/<>/server/oaiprovider-1.1/oaiprovider.war ~/<>/tomcat/webapps }}} Now edit the file ''~/<>/tomcat/webapps/oaiprovider/WEB-INF/classes/proai.properties'' to make sure the following is set correctly (replace <> with your username). Change the first six items; add the last three. * '''proai.validateUpdates = false''' * proai.cacheBaseDir = /home/<>/<>/proai/cache * proai.sessionBaseDir = /home/<>/<>/proai/sessions ## * proai.db.username = proai ## * proai.db.password = proai * driver.fedora.baseURL = http://localhost:7900/fedora/ ## * driver.fedora.user = fedoraAdmin ## * driver.fedora.pass = fedoraAdmin * 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 ''~/<>/tomcat/webapps/oaiprovider/WEB-INF/classes/log4j.xml'' accordingly: * Set the "File" param of each appender to ''/home/<>/<>/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 ~/<>/proai/log }}} Make sure that the resource index is turned on. This should have been done by domssetup.sh. In ~/<>/server/config/fedora.fcfg in the level should be 2: * ##Also check that your Fedora installation is configured to retain (rather than re-generate) PIDs of objects in the "doms" PID namespace on ingest. You ##can check this in your fedora.fcfg file: If one of the values of "retainPIDs" is "doms" or "*" (asterisk), Fedora is configured correctly. Otherwise, ##you should add this value. To make sure the new settings are used correctly restart the DOMS test installation {{{ ~/<>/bin/stop.sh ~/<>/bin/start.sh }}} Try ingesting the base collection and check Identify.xml: [[http://localhost:7900/oaiprovider/?verb=Identify]] (look at [[InstallIngestPackageTestStep]] and [[IngestObjectsTestStep]] for help).