Esempio n. 1
0
  <request>' . $sysconf['OAI']['Identify']['baseURL'] . '</request>
  <error code="badVerb">OAI Repository disabled</error>
  </OAI-PMH>';
    exit;
}
// required library
require LIB . 'oai-pmh.inc.php';
require LIB . 'detail.inc.php';
$config['oai_pmh_verbs'] = array('GetRecord', 'Identify', 'ListMetadataFormats', 'ListIdentifiers', 'ListRecords', 'ListSets');
// cek apakah ada request OAI-PMH pada REQUEST HTTP GET atau POST
if (isset($_GET['verb']) || isset($_POST['verb'])) {
    $oai_verb = isset($_GET['verb']) ? trim($_GET['verb']) : trim($_POST['verb']);
    if (in_array($oai_verb, $config['oai_pmh_verbs'])) {
        // MULAI PROSES OAI-PMH REQUEST
        // buat instance object OAI-PMH
        $oai_respon_handlers = new OAI_Web_Service($dbs);
        // mulai output XML
        header('Content-type: text/xml');
        echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">' . "\n" . '<responseDate>' . $date_respons . '</responseDate>' . "\n";
        switch ($oai_verb) {
            case 'ListSets':
                echo $oai_respon_handlers->ListSets();
                break;
            case 'ListIdentifiers':
                $metadataPrefix = isset($_GET['metadataPrefix']) ? $dbs->escape_string(trim($_GET['metadataPrefix'])) : 'oai_dc';
                echo $oai_respon_handlers->ListIdentifiers($metadataPrefix);
                break;
            case 'ListMetadataFormats':
                echo $oai_respon_handlers->ListMetadataFormats();
                break;
            case 'ListRecords':