first test datacite schema
This commit is contained in:
parent
d0ed3e9105
commit
3c50618c8a
|
@ -7,7 +7,8 @@ use App\Models\Dataset;
|
|||
use Illuminate\Support\Facades\Log;
|
||||
use App\Exceptions\OaiModelException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use App\Models\OaiModelError;
|
||||
use App\Models\Oai\OaiModelError;
|
||||
use App\Models\Oai\ResumptionToken;
|
||||
|
||||
class RequestController extends Controller
|
||||
{
|
||||
|
@ -18,6 +19,7 @@ class RequestController extends Controller
|
|||
* @var array
|
||||
*/
|
||||
private $deliveringDocumentStates = array('published', 'deleted'); // maybe deleted documents too
|
||||
private $xMetaDissRestriction = array('doctoralthesis', 'habilitation');
|
||||
const SET_SPEC_PATTERN = '[A-Za-z0-9\-_\.!~\*\'\(\)]+';
|
||||
|
||||
|
||||
|
@ -102,7 +104,7 @@ class RequestController extends Controller
|
|||
private function __handleRequest(array $oaiRequest)
|
||||
{
|
||||
// Setup stylesheet
|
||||
$this->loadStyleSheet('oai-pmh.xslt');
|
||||
$this->loadStyleSheet('datasetxml2oai-pmh.xslt');
|
||||
|
||||
// Set response time
|
||||
$this->_proc->setParameter('', 'responseDate', date("Y-m-d\TH:i:s\Z"));
|
||||
|
@ -143,18 +145,18 @@ class RequestController extends Controller
|
|||
private function handleIdentify()
|
||||
{
|
||||
$email = "repository@geologie.ac.at";
|
||||
$repositoryName = "Data Research Repository";
|
||||
$repositoryName = "RDR - Data Research Repository";
|
||||
$repIdentifier = "rdr.gba.ac.at";
|
||||
//$sampleIdentifier = $this->_configuration->getSampleIdentifier();
|
||||
$sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier();
|
||||
$earliestDateFromDb = Dataset::earliestPublicationDate();
|
||||
|
||||
// set parameters for oai-pmh.xslt
|
||||
$this->_proc->setParameter('', 'email', $email);
|
||||
$this->_proc->setParameter('', 'repositoryName', $repositoryName);
|
||||
$this->_proc->setParameter('', 'repIdentifier', $repIdentifier);
|
||||
//$this->_proc->setParameter('', 'sampleIdentifier', $sampleIdentifier);
|
||||
$this->_proc->setParameter('', 'sampleIdentifier', $sampleIdentifier);
|
||||
$this->_proc->setParameter('', 'earliestDatestamp', $earliestDateFromDb);
|
||||
$this->_xml->appendChild($this->_xml->createElement('Documents'));
|
||||
$this->_xml->appendChild($this->_xml->createElement('Datasets'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,13 +188,11 @@ class RequestController extends Controller
|
|||
if (is_null($dataset)
|
||||
//or (false === in_array($dataset->getServerState(), $this->_deliveringDocumentStates))
|
||||
or (false === $dataset->whereIn('server_state', $this->deliveringDocumentStates))
|
||||
|
||||
|
||||
or (false === $dataset->hasEmbargoPassed())) {
|
||||
throw new OaiModelException('Document is not available for OAI export!', OaiModelError::NORECORDSMATCH);
|
||||
}
|
||||
|
||||
$this->_xml->appendChild($this->_xml->createElement('Documents'));
|
||||
$this->_xml->appendChild($this->_xml->createElement('Datasets'));
|
||||
$this->createXmlRecord($dataset);
|
||||
}
|
||||
|
||||
|
@ -208,15 +208,6 @@ class RequestController extends Controller
|
|||
|
||||
$dataId = null;
|
||||
switch ($identifierParts[0]) {
|
||||
// case 'urn':
|
||||
// //$finder = new Opus_DocumentFinder();
|
||||
// $finder = Dataset::query();
|
||||
// // $finder->setIdentifierTypeValue('urn', $oaiIdentifier);
|
||||
// // $finder->setServerStateInList($this->_deliveringDocumentStates);
|
||||
// $finder->whereIn('server_state', $this->deliveringDocumentStates);
|
||||
// $docIds = $finder->ids();
|
||||
// $docId = $docIds[0];
|
||||
// break;
|
||||
case 'oai':
|
||||
if (isset($identifierParts[2])) {
|
||||
$dataId = $identifierParts[2];
|
||||
|
@ -251,7 +242,7 @@ class RequestController extends Controller
|
|||
*/
|
||||
private function handleListMetadataFormats()
|
||||
{
|
||||
$this->_xml->appendChild($this->_xml->createElement('Documents'));
|
||||
$this->_xml->appendChild($this->_xml->createElement('Datasets'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +265,7 @@ class RequestController extends Controller
|
|||
*/
|
||||
private function handleListIdentifiers(array &$oaiRequest)
|
||||
{
|
||||
$maxIdentifier = 20;//$this->_configuration->getMaxListIdentifiers();
|
||||
$maxIdentifier = 5;//$this->_configuration->getMaxListIdentifiers();
|
||||
$this->handlingOfLists($oaiRequest, $maxIdentifier);
|
||||
}
|
||||
|
||||
|
@ -288,7 +279,7 @@ class RequestController extends Controller
|
|||
{
|
||||
$repIdentifier = "rdr.gba.ac.at";
|
||||
$this->_proc->setParameter('', 'repIdentifier', $repIdentifier);
|
||||
$this->_xml->appendChild($this->_xml->createElement('Documents'));
|
||||
$this->_xml->appendChild($this->_xml->createElement('Datasets'));
|
||||
|
||||
//$oaiSets = new Oai_Model_Sets();
|
||||
$sets = array(
|
||||
|
@ -336,9 +327,12 @@ class RequestController extends Controller
|
|||
if (true === empty($maxRecords)) {
|
||||
$maxRecords = 100;
|
||||
}
|
||||
|
||||
$repIdentifier = "rdr.gba.ac.at";
|
||||
$tokenTempPath = storage_path('app/resumption'); //$this->_configuration->getResumptionTokenPath();
|
||||
|
||||
$this->_proc->setParameter('', 'repIdentifier', $repIdentifier);
|
||||
$this->_xml->appendChild($this->_xml->createElement('Documents'));
|
||||
$this->_xml->appendChild($this->_xml->createElement('Datasets'));
|
||||
|
||||
// do some initialisation
|
||||
$cursor = 0;
|
||||
|
@ -352,21 +346,27 @@ class RequestController extends Controller
|
|||
}
|
||||
$this->_proc->setParameter('', 'oai_metadataPrefix', $metadataPrefix);
|
||||
|
||||
// no resumptionToken is given
|
||||
$finder = Dataset::query();
|
||||
// add server state restrictions
|
||||
$finder->whereIn('server_state', $this->deliveringDocumentStates);
|
||||
if (array_key_exists('set', $oaiRequest)) {
|
||||
$setarray = explode(':', $oaiRequest['set']);
|
||||
if ($setarray[0] == 'doc-type') {
|
||||
if (count($setarray) === 2 and !empty($setarray[1])) {
|
||||
$finder->where('type', $setarray[1]);
|
||||
// parameter resumptionToken is given
|
||||
if (false === empty($oaiRequest['resumptionToken'])) {
|
||||
$tokenWorker = new ResumptionToken();
|
||||
$resParam = $oaiRequest['resumptionToken'];
|
||||
} else {
|
||||
// no resumptionToken is given
|
||||
$finder = Dataset::query();
|
||||
// add server state restrictions
|
||||
$finder->whereIn('server_state', $this->deliveringDocumentStates);
|
||||
if (array_key_exists('set', $oaiRequest)) {
|
||||
$setarray = explode(':', $oaiRequest['set']);
|
||||
if ($setarray[0] == 'data-type') {
|
||||
if (count($setarray) === 2 and !empty($setarray[1])) {
|
||||
$finder->where('type', $setarray[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$totalIds = $finder->count();
|
||||
$reldocIds = $finder->pluck('id')->toArray();
|
||||
}
|
||||
|
||||
$totalIds = $finder->count();
|
||||
$reldocIds = $finder->pluck('id')->toArray();
|
||||
|
||||
// handling of document ids
|
||||
$restIds = $reldocIds;
|
||||
|
@ -401,7 +401,7 @@ class RequestController extends Controller
|
|||
//$node->appendChild($child);
|
||||
|
||||
//$type = $dataset->type;
|
||||
$this->addSpecInformation($node, 'doc-type:' . $dataset->type);
|
||||
$this->addSpecInformation($node, 'data-type:' . $dataset->type);
|
||||
//$this->addSpecInformation($node, 'bibliography:' . 'false');
|
||||
|
||||
$this->_xml->documentElement->appendChild($node);
|
||||
|
@ -472,7 +472,7 @@ class RequestController extends Controller
|
|||
continue;
|
||||
}
|
||||
|
||||
$setSpec = 'doc-type:' . $doctype;
|
||||
$setSpec = 'data-type:' . $doctype;
|
||||
// $count = $row['count'];
|
||||
$sets[$setSpec] = "Set for document type '$doctype'";
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Oai;
|
||||
|
||||
class OaiModelError
|
||||
{
|
152
app/Models/Oai/ResumptionToken.php
Normal file
152
app/Models/Oai/ResumptionToken.php
Normal file
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models\Oai;
|
||||
|
||||
/**
|
||||
* Contains content and structure of a resumption token
|
||||
*/
|
||||
class ResumptionToken
|
||||
{
|
||||
|
||||
/**
|
||||
* Holds dataset ids
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $datasetIds = array();
|
||||
|
||||
/**
|
||||
* Holds metadata prefix information
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $metadataPrefix = null;
|
||||
|
||||
/**
|
||||
* Holds resumption id (only if token is stored)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $resumptionId = null;
|
||||
|
||||
/**
|
||||
* Holds start postion
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $startPostition = 0;
|
||||
|
||||
/**
|
||||
* Holds total amount of document ids
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $totalIds = 0;
|
||||
|
||||
/**
|
||||
* Returns current holded document ids.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDocumentIds()
|
||||
{
|
||||
return $this->_documentIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns metadata prefix information.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMetadataPrefix()
|
||||
{
|
||||
return $this->_metadataPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return setted resumption id after successful storing of resumption token.
|
||||
*
|
||||
* @return string Returns resumption id
|
||||
*/
|
||||
public function getResumptionId()
|
||||
{
|
||||
return $this->_resumptionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns start position.
|
||||
*
|
||||
* @return in
|
||||
*/
|
||||
public function getStartPosition()
|
||||
{
|
||||
return $this->_startPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns total number of document ids for this request
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalIds()
|
||||
{
|
||||
return $this->_totalIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set document ids for this token.
|
||||
*
|
||||
* @param $idsToStore Set of document ids to store.
|
||||
* @return void
|
||||
*/
|
||||
public function setDocumentIds($idsToStore)
|
||||
{
|
||||
if (false === is_array($idsToStore)) {
|
||||
$idsToStore = array($idsToStore);
|
||||
}
|
||||
|
||||
$this->_documentIds = $idsToStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set metadata prefix information.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @return void
|
||||
*/
|
||||
public function setMetadataPrefix($prefix)
|
||||
{
|
||||
$this->_metadataPrefix = $prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set resumption id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setResumptionId($resumptionId)
|
||||
{
|
||||
$this->_resumptionId = $resumptionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set postion where to start on next request.
|
||||
*
|
||||
* @param $startPostion Positon where to start on next request
|
||||
* @return void
|
||||
*/
|
||||
public function setStartPosition($startPosition)
|
||||
{
|
||||
$this->_startPosition = (int) $startPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set count of document ids for this request.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTotalIds($totalIds)
|
||||
{
|
||||
$this->_totalIds = (int) $totalIds;
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ class Person extends Model
|
|||
'email',
|
||||
'identifier_orcid',
|
||||
'status',
|
||||
'name_type'
|
||||
];
|
||||
protected $table = 'persons';
|
||||
public $timestamps = false;
|
||||
|
|
100
composer.lock
generated
100
composer.lock
generated
|
@ -1815,17 +1815,85 @@
|
|||
"time": "2018-11-26T12:48:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v4.1.8",
|
||||
"name": "symfony/contracts",
|
||||
"version": "v1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "9e4dc57949853315561f0cd5eb84d0707465502a"
|
||||
"url": "https://github.com/symfony/contracts.git",
|
||||
"reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/9e4dc57949853315561f0cd5eb84d0707465502a",
|
||||
"reference": "9e4dc57949853315561f0cd5eb84d0707465502a",
|
||||
"url": "https://api.github.com/repos/symfony/contracts/zipball/3edf0ab943d1985a356721952cba36ff31bd6e5f",
|
||||
"reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/cache": "^1.0",
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/cache": "When using the Cache contracts",
|
||||
"psr/container": "When using the Service contracts",
|
||||
"symfony/cache-contracts-implementation": "",
|
||||
"symfony/service-contracts-implementation": "",
|
||||
"symfony/translation-contracts-implementation": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Contracts\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"**/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A set of abstractions extracted out of the Symfony components",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"abstractions",
|
||||
"contracts",
|
||||
"decoupling",
|
||||
"interfaces",
|
||||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"time": "2018-11-24T09:35:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v4.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "aa9fa526ba1b2ec087ffdfb32753803d999fcfcd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/aa9fa526ba1b2ec087ffdfb32753803d999fcfcd",
|
||||
"reference": "aa9fa526ba1b2ec087ffdfb32753803d999fcfcd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1834,7 +1902,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -1865,7 +1933,7 @@
|
|||
],
|
||||
"description": "Symfony CssSelector Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-11T19:51:29+00:00"
|
||||
"time": "2018-11-11T19:52:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
|
@ -2482,20 +2550,21 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v4.1.8",
|
||||
"version": "v4.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "615e3cf75d00a7d6788316d9631957991ba9c26a"
|
||||
"reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/615e3cf75d00a7d6788316d9631957991ba9c26a",
|
||||
"reference": "615e3cf75d00a7d6788316d9631957991ba9c26a",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/ff9a878c9b8f8bcd4d9138e2d32f508c942773d9",
|
||||
"reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/contracts": "^1.0",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
|
@ -2503,6 +2572,9 @@
|
|||
"symfony/dependency-injection": "<3.4",
|
||||
"symfony/yaml": "<3.4"
|
||||
},
|
||||
"provide": {
|
||||
"symfony/translation-contracts-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~3.4|~4.0",
|
||||
|
@ -2520,7 +2592,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -2547,7 +2619,7 @@
|
|||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-26T10:26:29+00:00"
|
||||
"time": "2018-11-27T07:20:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<xsl:template match="/">
|
||||
<!-- stylesheet for browser -->
|
||||
<xsl:processing-instruction name="xml-stylesheet">
|
||||
<xsl:text>type="text/xsl" href="xsl/oai2.xslt"</xsl:text>
|
||||
<xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text>
|
||||
</xsl:processing-instruction>
|
||||
|
||||
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openarchives.org/OAI/2.0/"
|
||||
|
@ -57,17 +57,13 @@
|
|||
<xsl:value-of select="$oai_verb" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<xsl:if test="$oai_metadataPrefix != ''">
|
||||
<xsl:attribute name="metadataPrefix">
|
||||
<xsl:value-of select="$oai_metadataPrefix" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:value-of select="$baseURL" />
|
||||
</request>
|
||||
|
||||
<xsl:if test="$oai_error_code!=''">
|
||||
<error>
|
||||
<xsl:attribute name="code">
|
||||
|
@ -80,22 +76,22 @@
|
|||
<!--create the rest of oai response depending on oai_verb -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$oai_verb='GetRecord'">
|
||||
<xsl:apply-templates select="Documents" mode="GetRecord" />
|
||||
<xsl:apply-templates select="Datasets" mode="GetRecord" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_verb='Identify'">
|
||||
<xsl:apply-templates select="Documents" mode="Identify" />
|
||||
<xsl:apply-templates select="Datasets" mode="Identify" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_verb='ListIdentifiers'">
|
||||
<xsl:apply-templates select="Documents" mode="ListIdentifiers" />
|
||||
<xsl:apply-templates select="Datasets" mode="ListIdentifiers" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_verb='ListMetadataFormats'">
|
||||
<xsl:apply-templates select="Documents" mode="ListMetadataFormats" />
|
||||
<xsl:apply-templates select="Datasets" mode="ListMetadataFormats" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_verb='ListRecords'">
|
||||
<xsl:apply-templates select="Documents" mode="ListRecords" />
|
||||
<xsl:apply-templates select="Datasets" mode="ListRecords" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_verb='ListSets'">
|
||||
<xsl:apply-templates select="Documents" mode="ListSets" />
|
||||
<xsl:apply-templates select="Datasets" mode="ListSets" />
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</OAI-PMH>
|
||||
|
@ -103,7 +99,7 @@
|
|||
|
||||
|
||||
<!-- template for Identiy -->
|
||||
<xsl:template match="Documents" mode="Identify">
|
||||
<xsl:template match="Datasets" mode="Identify">
|
||||
<Identify>
|
||||
<repositoryName>
|
||||
<xsl:value-of select="$repositoryName"/>
|
||||
|
@ -148,7 +144,7 @@
|
|||
|
||||
|
||||
<!-- template for ListMetadataFormats -->
|
||||
<xsl:template match="Documents" mode="ListMetadataFormats">
|
||||
<xsl:template match="Datasets" mode="ListMetadataFormats">
|
||||
<ListMetadataFormats>
|
||||
<metadataFormat>
|
||||
<metadataPrefix>
|
||||
|
@ -161,22 +157,36 @@
|
|||
<xsl:text>http://www.openarchives.org/OAI/2.0/oai_dc/</xsl:text>
|
||||
</metadataNamespace>
|
||||
</metadataFormat>
|
||||
|
||||
<metadataFormat>
|
||||
<metadataPrefix>
|
||||
<xsl:text>oai_datacite</xsl:text>
|
||||
</metadataPrefix>
|
||||
<schema>
|
||||
http://schema.datacite.org/meta/kernel-4.1/metadata.xsd
|
||||
</schema>
|
||||
<metadataNamespace>
|
||||
http://datacite.org/schema/kernel-4
|
||||
</metadataNamespace>
|
||||
</metadataFormat>
|
||||
|
||||
</ListMetadataFormats>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Documents" mode="ListSets">
|
||||
<xsl:template match="Datasets" mode="ListSets">
|
||||
<ListSets>
|
||||
<xsl:apply-templates select="Rdr_Sets" />
|
||||
</ListSets>
|
||||
</xsl:template>
|
||||
<xsl:template match="Rdr_Sets">
|
||||
<set>
|
||||
<setSpec><xsl:value-of select="@Type"/></setSpec>
|
||||
<setName><xsl:value-of select="@TypeName"/></setName>
|
||||
</set>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Documents" mode="ListIdentifiers">
|
||||
<xsl:template match="Rdr_Sets">
|
||||
<set>
|
||||
<setSpec><xsl:value-of select="@Type"/></setSpec>
|
||||
<setName><xsl:value-of select="@TypeName"/></setName>
|
||||
</set>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Datasets" mode="ListIdentifiers">
|
||||
<xsl:if test="count(Rdr_Dataset) > 0">
|
||||
<ListIdentifiers>
|
||||
<xsl:apply-templates select="Rdr_Dataset" />
|
||||
|
@ -198,27 +208,27 @@
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Documents" mode="ListRecords">
|
||||
<xsl:template match="Datasets" mode="ListRecords">
|
||||
<xsl:if test="count(Rdr_Dataset) > 0">
|
||||
<ListRecords>
|
||||
<xsl:apply-templates select="Rdr_Dataset" />
|
||||
<!--<xsl:if test="$totalIds > 0">
|
||||
<resumptionToken>
|
||||
<xsl:attribute name="expirationDate"><xsl:value-of select="$dateDelete"/></xsl:attribute>
|
||||
<xsl:attribute name="completeListSize"><xsl:value-of select="$totalIds"/></xsl:attribute>
|
||||
<xsl:attribute name="cursor"><xsl:value-of select="$cursor"/></xsl:attribute>
|
||||
<xsl:value-of select="$res"/>
|
||||
</resumptionToken>
|
||||
</xsl:if>-->
|
||||
<xsl:if test="$totalIds > 0">
|
||||
<resumptionToken>
|
||||
<xsl:attribute name="expirationDate"><xsl:value-of select="$dateDelete"/></xsl:attribute>
|
||||
<xsl:attribute name="completeListSize"><xsl:value-of select="$totalIds"/></xsl:attribute>
|
||||
<xsl:attribute name="cursor"><xsl:value-of select="$cursor"/></xsl:attribute>
|
||||
<xsl:value-of select="$res"/>
|
||||
</resumptionToken>
|
||||
</xsl:if>
|
||||
</ListRecords>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Documents" mode="GetRecord">
|
||||
<GetRecord>
|
||||
<xsl:apply-templates select="Rdr_Dataset" />
|
||||
</GetRecord>
|
||||
</xsl:template>
|
||||
<xsl:template match="Datasets" mode="GetRecord">
|
||||
<GetRecord>
|
||||
<xsl:apply-templates select="Rdr_Dataset" />
|
||||
</GetRecord>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Rdr_Dataset">
|
||||
<xsl:choose>
|
||||
|
@ -275,6 +285,9 @@
|
|||
<xsl:when test="$oai_metadataPrefix='oai_dc'">
|
||||
<xsl:apply-templates select="." mode="oai_dc" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$oai_metadataPrefix='oai_datacite'">
|
||||
<xsl:apply-templates select="." mode="oai_datacite" />
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</metadata>
|
||||
|
||||
|
@ -282,14 +295,65 @@
|
|||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="SetSpec">
|
||||
<setSpec>
|
||||
<xsl:value-of select="@Value"/>
|
||||
</setSpec>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="Rdr_Dataset" mode="oai_datacite">
|
||||
<resource xmlns="http://datacite.org/schema/kernel-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
|
||||
<!-- <isReferenceQuality>true</isReferenceQuality>
|
||||
<schemaVersion>4.1</schemaVersion>
|
||||
<datacentreSymbol>RDR.GBA</datacentreSymbol> -->
|
||||
<identifier>
|
||||
<xsl:text>oai:</xsl:text>
|
||||
<xsl:value-of select="$repIdentifier" />
|
||||
<xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="@Id" />
|
||||
</identifier>
|
||||
<!--<datacite:creator>-->
|
||||
<creators>
|
||||
<xsl:apply-templates select="PersonAuthor" mode="oai_datacite" />
|
||||
</creators>
|
||||
<publicationYear><xsl:value-of select="@PublishedYear" /></publicationYear>
|
||||
</resource>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="PersonAuthor" mode="oai_datacite">
|
||||
<creator>
|
||||
<creatorName>
|
||||
<xsl:if test="@NameType != ''" >
|
||||
<xsl:attribute name="nameType">
|
||||
<xsl:value-of select="@NameType" />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@LastName" />
|
||||
<xsl:if test="@FirstName != ''" >
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@FirstName" />
|
||||
<xsl:if test="@AcademicTitle != ''" >
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="@AcademicTitle" />
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:if>
|
||||
</creatorName>
|
||||
|
||||
<givenName><xsl:value-of select="@FirstName" /></givenName>
|
||||
<familyName><xsl:value-of select="@LastName" /></familyName>
|
||||
<xsl:if test="@IdentifierOrcid != ''" >
|
||||
<nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID" ><xsl:value-of select="@IdentifierOrcid" /></nameIdentifier>
|
||||
</xsl:if>
|
||||
<!--
|
||||
<nameType><xsl:value-of select="@NameType" /></nameType>
|
||||
</xsl:if> -->
|
||||
<affiliation>GBA</affiliation>
|
||||
</creator>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="Rdr_Dataset" mode="oai_dc">
|
||||
<oai_dc:dc xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
|
||||
<!-- dc:title -->
|
||||
|
@ -389,12 +453,13 @@
|
|||
</dc:date>
|
||||
</xsl:template>
|
||||
|
||||
<!-- für ListRecords -->
|
||||
<xsl:template match="@Type" mode="oai_dc">
|
||||
<dc:type>
|
||||
<xsl:value-of select="." />
|
||||
</dc:type>
|
||||
<dc:type>
|
||||
<xsl:text>doc-type:</xsl:text>
|
||||
<xsl:text>data-type:</xsl:text>
|
||||
<xsl:value-of select="." />
|
||||
</dc:type>
|
||||
</xsl:template>
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
http://ws.pangaea.de/oai/oai2.xsl
|
||||
|
||||
XSL Transform to convert OAI 2.0 responses into XHTML
|
||||
|
||||
|
@ -55,13 +56,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
|
||||
|
||||
<xsl:template name="style">
|
||||
html, button, input, select, textarea, .pure-g [class *= "pure-u"] {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
td.value {
|
||||
vertical-align: top;
|
||||
padding-left: 1em;
|
||||
padding: 3px;
|
||||
}
|
||||
td.key {
|
||||
background-color: #e0e0ff;
|
||||
background-color: #3abac4;
|
||||
padding: 3px;
|
||||
text-align: right;
|
||||
border: 1px solid #c0c0c0;
|
||||
|
@ -109,16 +113,17 @@ h3 {
|
|||
background-color: #a0a0df;
|
||||
}
|
||||
.oaiRecord, .oaiRecordTitle {
|
||||
background-color: #f0f0ff;
|
||||
background-color: #eee;
|
||||
border-style: solid;
|
||||
border-color: #d0d0d0;
|
||||
}
|
||||
h2.oaiRecordTitle {
|
||||
background-color: #e0e0ff;
|
||||
background-color: #51565c;
|
||||
color: #fff;
|
||||
font-size: medium;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-width: 2px 2px 0px 2px;
|
||||
border-width: 0px 0px 0px 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
.oaiRecord {
|
||||
|
@ -456,12 +461,21 @@ p.intro {
|
|||
<xsl:template match="oai:metadataFormat">
|
||||
<h2>Metadata Format</h2>
|
||||
<table class="values">
|
||||
<tr><td class="key">metadataPrefix</td>
|
||||
<td class="value"><xsl:value-of select="oai:metadataPrefix"/></td></tr>
|
||||
<tr><td class="key">metadataNamespace</td>
|
||||
<td class="value"><xsl:value-of select="oai:metadataNamespace"/></td></tr>
|
||||
<tr><td class="key">schema</td>
|
||||
<td class="value"><a href="{oai:schema}"><xsl:value-of select="oai:schema"/></a></td></tr>
|
||||
<tr>
|
||||
<td class="key">metadataPrefix</td>
|
||||
<!-- <td class="value"><xsl:value-of select="oai:metadataPrefix"/></td> -->
|
||||
<td class="value">
|
||||
<a class="link" href="?verb=ListRecords&metadataPrefix={oai:metadataPrefix}"><xsl:value-of select="oai:metadataPrefix"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key">metadataNamespace</td>
|
||||
<td class="value"><xsl:value-of select="oai:metadataNamespace"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key">schema</td>
|
||||
<td class="value"><a href="{oai:schema}"><xsl:value-of select="oai:schema"/></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
|
@ -37,6 +37,14 @@
|
|||
<small id="orcidHelp" class="pure-form-message-inline">orcid is optional.</small>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
{!! Form::label('name_type', 'Name Type') !!}
|
||||
<div class="select form-control">
|
||||
{!! Form::select('name_type', ['personal' => 'personal', 'organizational' => 'organizational'], null, ['id' => 'name_type', 'placeholder' => '-- no name type --']) !!}
|
||||
</div>
|
||||
<small id="nameTypeHelp" class="pure-form-message-inline">name type is optional</small>
|
||||
</div>
|
||||
|
||||
<h5><b>Status of person</b></h5>
|
||||
<div class="pure-control-group checkboxlist">
|
||||
<label for="status" class="pure-checkbox">
|
||||
|
|
Loading…
Reference in New Issue
Block a user