Query functions * to reflect it and even develop your own code. *- Check your oai site through a web browser. e.g. : \code http://localhost/oai/ \endcode *- SELinux needs special treatments for database connection and other permission. * * \section struct_sec Structure The system includes files for individual functionality and utility classes and functions to get it work. - Controller - oai2.php - Individual functionalities: - identify.php: identifies the data provider. Responses to Identify. - listmetadataformats.php: lists supported metadata formats, e.g. dc or rif-cs. Responses to ListMetadataFormats. - listsets.php: lists supported sets, e.g. Activity, Collection or Party. Responses to ListSets. - listrecords.php: lists a group of records without details. Responses to ListRecords. It also serves to ListIdentifiers which only returns identifiers. - getrecord.php: gets an individual record. Responses to GetRecord. - Utility classes - xml_creater.php which includes classess ANDS_XML, ANDS_Error_XML, ANDS_Response_XML - Utility functions - oaidp-util.php - Support to different metadataformats in your own systems. Two examples provided with the package are: record_dc.php and record_rif.php. They are helpers and need information from the real records. They need to be devloped for your particular system. - Configurations - oaidp-config.php * * \author Jianfeng Li * \version 1.1 * \date 2010-2011 */ /** * \file * \brief * Default starting point of OAI Data Provider for a human to check. * * OAI Data Provider is not designed for human to retrieve data but it is possible to use this page to test and check the functionality of current implementation. * This page provides a summary of the OAI-PMH and the implementation. * */ $MY_URI = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; $pos = strrpos($MY_URI, '/'); $MY_URI = substr($MY_URI, 0, $pos). '/oai2.php'; ?> php-oai2 Data Provider

php-oai2 Data Provider

This is an implementation of an OAI-PMH 2.0 Data Provider, written in PHP and has been tested with version 5.3.

This implementation completely complies to OAI-PMH 2.0, including the support of on-the-fly output compression which may significantly reduce the amount of data being transfered.

This package has been inspired by PHP OAI Data Provider developed by Heinrich Stamerjohanns at University of Oldenburg. Some of the functions and algorithms used in this code were transplanted from his implementation.

Database is supported through PDO, so almost any popular SQL-database which has PDO driver can be used without any change in the code.

It uses DOM extension,an extension included in every PHP installation since version 5, for generating XML files. With PHP 5 or above no extra extension is needed.

The repository can be quite easily configured by just editing oai2/oaidp-config.php, most possible values and options are explained. For requirements and instructions to install and configure, please reference the documentation.

Once you have setup your Data Provider, you can the easiliy check the generated answers (it will be XML) of your Data Provider by clicking on the test links below.

For simple visual tests set $SHOW_QUERY_ERROR to TRUE and $CONTENT_TYPE to text/plain, so you can easily read the generated XML responses in your browser.

Remember, GetRecord needs identifier to work. So please change it use your own or you should see a response with error message.

Example Tables
OAI Records (mysql)
OAI Records (pgsql)
Query and check your Data-Provider
Identify
ListMetadataFormats
ListSets
ListIdentifiers
ListRecords
GetRecord

For other tests on your own provider or other providers, please use the Repository Explorer.

Jianfeng Li
The Plant Accelerator
University of Adelaide