simple-oai-pmh/listsets.php

30 lines
865 B
PHP
Raw Normal View History

2013-05-07 22:01:22 +02:00
<?php
/**
* \file
* \brief Response to Verb ListSets
*
2013-05-07 22:01:22 +02:00
* Lists what sets are available to records in the system.
* This variable is filled in config-sets.php
*/
// Here the size of sets is small, no resumptionToken is taken care.
if (is_array($SETS)) {
2013-05-07 22:01:22 +02:00
$outputObj = new ANDS_Response_XML($args);
foreach($SETS as $set) {
$setNode = $outputObj->add2_verbNode("set");
foreach($set as $key => $val) {
if($key=='setDescription') {
$desNode = $outputObj->addChild($setNode,$key);
$des = $outputObj->doc->createDocumentFragment();
$des->appendXML($val);
$desNode->appendChild($des);
} else {
$outputObj->addChild($setNode,$key,$val);
}
}
}
} else {
$errors[] = oai_error('noSetHierarchy');
oai_exit();
}