'carte_postale', 'setName'=>'Cartopole de Baud', 'setDescription'=>'Conservatoire regional de la carte postale de Bretagne.') //, //array('setSpec'=>'phdthesis', 'setName'=>'PHD Thesis', 'setDescription'=>'') //, // array('setSpec'=>'math', 'setName'=>'Mathematics') , // array('setSpec'=>'phys', 'setName'=>'Physics') ); // define all supported metadata formats // // myhandler is the name of the file that handles the request for the // specific metadata format. // [record_prefix] describes an optional prefix for the metadata // [record_namespace] describe the namespace for this prefix $METADATAFORMATS = array ( 'oai_dc' => array('metadataPrefix'=>'oai_dc', 'schema'=>'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'metadataNamespace'=>'http://www.openarchives.org/OAI/2.0/oai_dc/', 'myhandler'=>'record_dc.php', 'record_prefix'=>'dc', 'record_namespace' => 'http://purl.org/dc/elements/1.1/' ) //, //array('metadataPrefix'=>'olac', // 'schema'=>'http://www.language-archives.org/OLAC/olac-2.0.xsd', // 'metadataNamespace'=>'http://www.openarchives.org/OLAC/0.2/', // 'handler'=>'record_olac.php' //) ); // // DATABASE SETUP // // change according to your local DB setup. $DB_HOST = 'localhost'; $DB_USER = 'ricos'; $DB_PASSWD = 'brewen4'; $DB_NAME = 'hendad2'; // Data Source Name: This is the universal connection string // if you use something other than mysql edit accordingly. // Example for MySQL $DSN = "mysql://$DB_USER:$DB_PASSWD@$DB_HOST/$DB_NAME"; // Example for Oracle // $DSN = "oci8://$DB_USER:$DB_PASSWD@$DB_NAME"; // the charset you store your metadata in your database // currently only utf-8 and iso8859-1 are supported $charset = "iso8859-1"; // if entities such as < > ' " in your metadata has already been escaped // then set this to true (e.g. you store < as < in your DB) $xmlescaped = false; // We store multiple entries for one element in a single row // in the database. SQL['split'] ist the delimiter for these entries. // If you do not do this, do not define $SQL['split'] $SQL['split'] = ';'; // the name of the table where your store your metadata $SQL['table'] = 'oai_records'; // the name of the column where you store your sequence // (or autoincrement values). $SQL['id_column'] = 'serial'; // the name of the column where you store the unique identifiers // pointing to your item. // this is your internal identifier for the item $SQL['identifier'] = 'url'; // If you want to expand the internal identifier in some way // use this (but not for OAI stuff, see next line) $idPrefix = ''; // this is your external (OAI) identifier for the item // this will be expanded to // oai:$repositoryIdentifier:$idPrefix$SQL['identifier'] // should not be changed $oaiprefix = "oai".$delimiter.$repositoryIdentifier.$delimiter.$idPrefix; // adjust anIdentifier with sample contents an identifier $sampleIdentifier = $oaiprefix.'Cartolis'; // the name of the column where you store your datestamps $SQL['datestamp'] = 'datestamp'; // the name of the column where you store information whether // a record has been deleted. Leave it as it is if you do not use // this feature. $SQL['deleted'] = 'deleted'; // to be able to quickly retrieve the sets to which one item belongs, // the setnames are stored for each item // the name of the column where you store sets $SQL['set'] = 'oai_set'; // Here are a couple of queries which might need to be adjusted to // your needs. Normally, if you have correctly named the columns above, // this does not need to be done. // this function should generate a query which will return // all records // the useless condition id_column = id_column is just there to ease // further extensions to the query, please leave it as it is. function selectallQuery ($id = '') { global $SQL; $query = 'SELECT * FROM '.$SQL['table'].' WHERE '; if ($id == '') { $query .= $SQL['id_column'].' = '.$SQL['id_column']; } else { $query .= $SQL['identifier']." ='$id'"; } return $query; } // this function will return identifier and datestamp for all records function idQuery ($id = '') { global $SQL; if ($SQL['set'] != '') { $query = 'select '.$SQL['identifier'].','.$SQL['datestamp'].','.$SQL['set'].' FROM '.$SQL['table'].' WHERE '; } else { $query = 'select '.$SQL['identifier'].','.$SQL['datestamp'].' FROM '.$SQL['table'].' WHERE '; } if ($id == '') { $query .= $SQL['id_column'].' = '.$SQL['id_column']; } else { $query .= $SQL['identifier']." = '$id'"; } return $query; } // filter for until function untilQuery($until) { global $SQL; return ' and '.$SQL['datestamp']." <= '$until'"; } // filter for from function fromQuery($from) { global $SQL; return ' and '.$SQL['datestamp']." >= '$from'"; } // filter for sets function setQuery($set) { global $SQL; return ' and '.$SQL['set']." LIKE '%$set%'"; } // There is no need to change anything below. // Current Date $datetime = gmstrftime('%Y-%m-%dT%T'); $responseDate = $datetime.'Z'; // do not change $XMLHEADER = ' '."\n"; $xmlheader = $XMLHEADER . ' '.$responseDate."\n"; // the xml schema namespace, do not change this $XMLSCHEMA = 'http://www.w3.org/2001/XMLSchema-instance'; ?>