This is a server that respond to OAI-PMH protocol specification made to work with lodel CMS. It uses a core OAI-PMH librairie and this middleware to fetch data from lodel database.
Clone OAI-PHP server to a directory listed in your php import path. Use the lodel branch.
cd /usr/share/php/
git clone https://github.com/edinum/oai_pmh.git
cd oai_pmh
git checkout lodel
Clone this repository inside your lodel installation, and configure it.
cd /var/www/lodel/
git clone https://github.com/edinum/oai_pmh_lodel.git oai
cd oai
cp config.php.txt config.php
nano config.php
Create the needed database, launch setup.php script and fill your database. You must use the same database prefix as your lodel installation.
mysql
> CREATE DATABASE `lodel_oai-pmh`;
> GRANT ALL PRIVILEGES ON `lodel_oai-pmh` . * TO 'lodel'@'localhost';
php tools/setup.php
php tools/update_db.php
Add options to your lodel sites to configure them to export their documents. You should have extra.oai_id (name of the set) and extra.doi_prefixe configured. You can use lodel-options-extra script to create those options for you.
Add a cronjob to update your database every hour
12 * * * * php /var/www/lodel/oai/tools/update_db.php
Your OAI-PHP server will be available at http://your-lodel-instance/oai/?verb=ListSets
This tool connects to your lodel installation and database using its lodelconfig.php configuration.
It uses it's own database (lodel_oai-pmh) to save Sets (lodel sites) and Records (documents).
Update of the database is done by update_db.php script that should run in the background using crontab. It takes care of newly published sites or documents and take care of deletion (deleted status is not implemented in OAI-PMH).
Thanks to Université Jean Moulin Lyon 3 (especially Jean-Luc de Ochandiano) who paid for developing this tool.
Thanks to Daniel Neis Araujo for his OAI-PMH librairie.
Thanks to Thomas Brouard for his so cool specification for this work.