E assim eh validado pelo dspace

This commit is contained in:
Usuario Moodle 2013-05-07 15:44:21 -03:00
parent b3bd6f267a
commit a89f4b7fa1
3 changed files with 88 additions and 93 deletions

View File

@ -23,10 +23,6 @@ foreach($identifyResponse as $key => $val) {
$outputObj->add2_verbNode($key, $val); $outputObj->add2_verbNode($key, $val);
} }
foreach($adminEmail as $val) {
$outputObj->add2_verbNode("adminEmail", $val);
}
if(isset($compression)) { if(isset($compression)) {
foreach($compression as $val) { foreach($compression as $val) {
$outputObj->add2_verbNode("compression", $val); $outputObj->add2_verbNode("compression", $val);

View File

@ -70,7 +70,7 @@ require_once('oaidp-config.php');
// Create a PDO object // Create a PDO object
try { try {
$db = new PDO($DSN); $db = new PDO($DSN, $DB_USER, $DB_PASSWD);
} catch (PDOException $e) { } catch (PDOException $e) {
exit('Connection failed: ' . $e->getMessage()); exit('Connection failed: ' . $e->getMessage());
} }

View File

@ -10,7 +10,7 @@
* *
* The response may may be compressed for better performace: * The response may may be compressed for better performace:
* - Compression : a compression encoding supported by the repository. The recommended values are those defined for the Content-Encoding header in Section 14.11 of RFC 2616 describing HTTP 1.1. A compression element should not be included for the identity encoding, which is implied. * - Compression : a compression encoding supported by the repository. The recommended values are those defined for the Content-Encoding header in Section 14.11 of RFC 2616 describing HTTP 1.1. A compression element should not be included for the identity encoding, which is implied.
* *
* *
* Some other used variables: * Some other used variables:
* *
@ -38,7 +38,7 @@
* - <b>$DSN</b>: DSN for connecting your database. Reference PDO for details. * - <b>$DSN</b>: DSN for connecting your database. Reference PDO for details.
* *
* The rest of settings will not normally need to be adjusted. Read source code for details. * The rest of settings will not normally need to be adjusted. Read source code for details.
*/ */
/** /**
* Whether to show error message for dubug. * Whether to show error message for dubug.
@ -75,11 +75,11 @@ $identifyResponse = array();
// MUST (only one) // MUST (only one)
// please adjust // please adjust
$identifyResponse["repositoryName"] = 'Your organisation'; $identifyResponse["repositoryName"] = 'Moodle Dev2';
// For ANDS to harvest of RIF-CS, originatingSource is plantaccelerator.org.au // For ANDS to harvest of RIF-CS, originatingSource is plantaccelerator.org.au
// $dataSource = "plantaccelerator.org.au"; // $dataSource = "plantaccelerator.org.au";
define('DATASOURCE','domain.of.your.organisation'); define('DATASOURCE','dev2.moodle.ufsc.br');
// do not change // do not change
define('MY_URI','http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']); define('MY_URI','http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
@ -90,11 +90,14 @@ $identifyResponse["baseURL"] = MY_URI;
// do not change // do not change
$identifyResponse["protocolVersion"] = '2.0'; $identifyResponse["protocolVersion"] = '2.0';
// must exist before earliestDatestamp
$identifyResponse['adminEmail'] = 'danielneis@gmail.com';
// MUST (only one) // MUST (only one)
// the earliest datestamp in your repository, // the earliest datestamp in your repository,
// please adjust // please adjust
// Only date is needed even later it will be formatted according to the granularity. // Only date is needed even later it will be formatted according to the granularity.
$identifyResponse["earliestDatestamp"] = '2011-01-01'; $identifyResponse["earliestDatestamp"] = '2013-01-01T12:00:00Z';
// How your repository handles deletions // How your repository handles deletions
// no: The repository does not maintain status about deletions. // no: The repository does not maintain status about deletions.
@ -116,7 +119,7 @@ $deletedRecord = $identifyResponse["deletedRecord"]; // a shorthand for checking
//granularity is days //granularity is days
//$granularity = 'YYYY-MM-DD'; //$granularity = 'YYYY-MM-DD';
// granularity is seconds // granularity is seconds
$identifyResponse["granularity"] = 'YYYY-MM-DDThh:mm:ssZ'; $identifyResponse["granularity"] = 'YYYY-MM-DD';
// this is appended if your granularity is seconds. // this is appended if your granularity is seconds.
// do not change // do not change
@ -124,16 +127,12 @@ if (strcmp($identifyResponse["granularity"],'YYYY-MM-DDThh:mm:ssZ')==0) {
$identifyResponse["earliestDatestamp"] = $identifyResponse["earliestDatestamp"].'T00:00:00Z'; $identifyResponse["earliestDatestamp"] = $identifyResponse["earliestDatestamp"].'T00:00:00Z';
} }
// MUST (multiple)
// please adjust
$adminEmail = array('some.one@contact.com');
/** Compression methods supported. Optional (multiple). Default: null. /** Compression methods supported. Optional (multiple). Default: null.
* *
* Currently only gzip is supported (you need output buffering turned on, * Currently only gzip is supported (you need output buffering turned on,
* and php compiled with libgz). * and php compiled with libgz).
* The client MUST send "Accept-Encoding: gzip" to actually receive * The client MUST send "Accept-Encoding: gzip" to actually receive
*/ */
// $compression = array('gzip'); // $compression = array('gzip');
$compression = null; $compression = null;
@ -143,7 +142,7 @@ $compression = null;
// see: http://www.openarchives.org/OAI/2.0/guidelines-oai-identifier.htm // see: http://www.openarchives.org/OAI/2.0/guidelines-oai-identifier.htm
// Basically use domainname // Basically use domainname
// please adjust // please adjust
$repositoryIdentifier = 'url.organisation.'; $repositoryIdentifier = 'dev2.moodle.ufsc.br.';
// For RIF-CS, especially with ANDS, each registryObject much has a group for the ownership of data. // For RIF-CS, especially with ANDS, each registryObject much has a group for the ownership of data.
// For detail please see ANDS guide on its web site. Each data provider should have only one REG_OBJ_GROUP // For detail please see ANDS guide on its web site. Each data provider should have only one REG_OBJ_GROUP
@ -160,7 +159,6 @@ $show_identifier = false;
// should not be changed. Only useful when NODE description is included in the response to Identifier // should not be changed. Only useful when NODE description is included in the response to Identifier
$delimiter = ':'; $delimiter = ':';
/** Maximum mumber of the records to deliver /** Maximum mumber of the records to deliver
* (verb is ListRecords) * (verb is ListRecords)
* If there are more records to deliver * If there are more records to deliver
@ -185,7 +183,8 @@ define('TOKEN_PREFIX','/tmp/ANDS_DBPD-');
$SETS = array ( $SETS = array (
array('setSpec'=>'class:activity', 'setName'=>'Activities'), array('setSpec'=>'class:activity', 'setName'=>'Activities'),
array('setSpec'=>'class:collection', 'setName'=>'Collections'), array('setSpec'=>'class:collection', 'setName'=>'Collections'),
array('setSpec'=>'class:party', 'setName'=>'Parties')/*, array('setSpec'=>'class:party', 'setName'=>'Parties')
/*,
array('setSpec'=>'phdthesis', 'setName'=>'PHD Thesis', 'setDescription'=>'<oai_dc:dc array('setSpec'=>'phdthesis', 'setName'=>'PHD Thesis', 'setDescription'=>'<oai_dc:dc
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
@ -196,7 +195,8 @@ $SETS = array (
</oai_dc:dc>') //, </oai_dc:dc>') //,
// array('setSpec'=>'math', 'setName'=>'Mathematics') , // array('setSpec'=>'math', 'setName'=>'Mathematics') ,
// array('setSpec'=>'phys', 'setName'=>'Physics') // array('setSpec'=>'phys', 'setName'=>'Physics')
*/); */
);
// define all supported metadata formats, has to be an array // define all supported metadata formats, has to be an array
// //
@ -230,10 +230,10 @@ define('XMLSCHEMA', 'http://www.w3.org/2001/XMLSchema-instance');
// //
// change according to your local DB setup. // change according to your local DB setup.
$DB_HOST = '127.0.0.1'; $DB_HOST = '';
$DB_USER = 'your-name'; $DB_USER = '';
$DB_PASSWD = 'your-pwd'; $DB_PASSWD = '';
$DB_NAME = 'your-db'; $DB_NAME = '';
// Data Source Name: This is the universal connection string // Data Source Name: This is the universal connection string
// if you use something other than mysql edit accordingly. // if you use something other than mysql edit accordingly.
@ -242,7 +242,7 @@ $DB_NAME = 'your-db';
// Example for Oracle // Example for Oracle
// $DSN = "oci8://$DB_USER:$DB_PASSWD@$DB_NAME"; // $DSN = "oci8://$DB_USER:$DB_PASSWD@$DB_NAME";
$DSN = "pgsql:host=$DB_HOST;port=5432;dbname=$DB_NAME;user=$DB_USER;password=$DB_PASSWD"; $DSN = "mysql:host={$DB_HOST};dbname={$DB_NAME};port=3306;";
// the charset you store your metadata in your database // the charset you store your metadata in your database
// currently only utf-8 and iso8859-1 are supported // currently only utf-8 and iso8859-1 are supported
@ -295,4 +295,3 @@ $SQL['deleted'] = 'deleted';
// the setnames are stored for each item // the setnames are stored for each item
// the name of the column where you store sets // the name of the column where you store sets
$SQL['set'] = 'oai_set'; $SQL['set'] = 'oai_set';
?>