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:
* *
@ -27,18 +27,18 @@
* The key is the name of a metadata format. * The key is the name of a metadata format.
* The exact number of items within each format associated array depends on the nature of a metadata format. * The exact number of items within each format associated array depends on the nature of a metadata format.
* Most definitions are done here but handlers themselves are defined in separated files because only the names of PHP script are listed here. * Most definitions are done here but handlers themselves are defined in separated files because only the names of PHP script are listed here.
* - metadataPrefix * - metadataPrefix
* - schema * - schema
* - metadataNamespace * - metadataNamespace
* - myhandler * - myhandler
* - other optional items: record_prefix, record_namespace and etc. * - other optional items: record_prefix, record_namespace and etc.
* *
* - <b>$SQL</b>: Settings for database and queries from database * - <b>$SQL</b>: Settings for database and queries from database
* *
* - <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,35 +75,38 @@ $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']);
// You can use a static URI as well. // You can use a static URI as well.
// $baseURL = "http://my.server.org/oai/oai2.php"; // $baseURL = "http://my.server.org/oai/oai2.php";
$identifyResponse["baseURL"] = MY_URI; $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.
// It MUST NOT reveal a deleted status. // It MUST NOT reveal a deleted status.
// persistent: The repository persistently keeps track about deletions // persistent: The repository persistently keeps track about deletions
// with no time limit. It MUST consistently reveal the status // with no time limit. It MUST consistently reveal the status
// of a deleted record over time. // of a deleted record over time.
// transient: The repository does not guarantee that a list of deletions is // transient: The repository does not guarantee that a list of deletions is
// maintained. It MAY reveal a deleted status for records. // maintained. It MAY reveal a deleted status for records.
// //
// If your database keeps track of deleted records change accordingly. // If your database keeps track of deleted records change accordingly.
// Currently if $record['deleted'] is set to 'true', $status_deleted is set. // Currently if $record['deleted'] is set to 'true', $status_deleted is set.
@ -116,25 +119,21 @@ $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
if (strcmp($identifyResponse["granularity"],'YYYY-MM-DDThh:mm:ssZ')==0) { 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;
// MUST (only one) // MUST (only one)
@ -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
@ -158,8 +157,7 @@ define('REG_OBJ_GROUP','Something agreed on');
$show_identifier = false; $show_identifier = false;
// MUST (only one) // MUST (only one)
// 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)
@ -182,21 +180,23 @@ $expirationdatetime = gmstrftime('%Y-%m-%dT%TZ', time()+TOKEN_VALID);
define('TOKEN_PREFIX','/tmp/ANDS_DBPD-'); define('TOKEN_PREFIX','/tmp/ANDS_DBPD-');
// define all supported sets in your repository // define all supported sets in your repository
$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 /*,
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" array('setSpec'=>'phdthesis', 'setName'=>'PHD Thesis', 'setDescription'=>'<oai_dc:dc
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/"
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
<dc:description>This set contains metadata describing electronic music recordings made during the 1950ies</dc:description> http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
</oai_dc:dc>') //, <dc:description>This set contains metadata describing electronic music recordings made during the 1950ies</dc:description>
// array('setSpec'=>'math', 'setName'=>'Mathematics') , </oai_dc:dc>') //,
// array('setSpec'=>'phys', 'setName'=>'Physics') // array('setSpec'=>'math', 'setName'=>'Mathematics') ,
*/); // 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
// //
@ -205,20 +205,20 @@ $SETS = array (
// [record_prefix] describes an optional prefix for the metadata // [record_prefix] describes an optional prefix for the metadata
// [record_namespace] describe the namespace for this prefix // [record_namespace] describe the namespace for this prefix
$METADATAFORMATS = array ( $METADATAFORMATS = array (
'rif' => array('metadataPrefix'=>'rif', 'rif' => array('metadataPrefix'=>'rif',
'schema'=>'http://services.ands.org.au/sandbox/orca/schemata/registryObjects.xsd', 'schema'=>'http://services.ands.org.au/sandbox/orca/schemata/registryObjects.xsd',
'metadataNamespace'=>'http://ands.org.au/standards/rif-cs/registryObjects/', 'metadataNamespace'=>'http://ands.org.au/standards/rif-cs/registryObjects/',
'myhandler'=>'record_rif.php' 'myhandler'=>'record_rif.php'
), ),
'oai_dc' => array('metadataPrefix'=>'oai_dc', 'oai_dc' => array('metadataPrefix'=>'oai_dc',
'schema'=>'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'schema'=>'http://www.openarchives.org/OAI/2.0/oai_dc.xsd',
'metadataNamespace'=>'http://www.openarchives.org/OAI/2.0/oai_dc/', 'metadataNamespace'=>'http://www.openarchives.org/OAI/2.0/oai_dc/',
'myhandler'=>'record_dc.php', 'myhandler'=>'record_dc.php',
'record_prefix'=>'dc', 'record_prefix'=>'dc',
'record_namespace' => 'http://purl.org/dc/elements/1.1/' 'record_namespace' => 'http://purl.org/dc/elements/1.1/'
) )
); );
if (!is_array($METADATAFORMATS)) { exit("Configuration of METADATAFORMAT has been wrongly set. Correct your ".__FILE__);} if (!is_array($METADATAFORMATS)) { exit("Configuration of METADATAFORMAT has been wrongly set. Correct your ".__FILE__);}
@ -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';
?>