Fix verbListMetadataFormats
This commit is contained in:
parent
b3b7b813de
commit
528526a4c3
|
@ -110,7 +110,7 @@ class OaiPmhController extends AbstractController
|
|||
'oai_dc' => [
|
||||
'schema' => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd',
|
||||
'namespace' => 'http://www.openarchives.org/OAI/2.0/oai_dc/',
|
||||
'requiredFields' => ['record_id'],
|
||||
'requiredFields' => ['recordId'],
|
||||
],
|
||||
'epicur' => [
|
||||
'schema' => 'http://www.persistent-identifier.de/xepicur/version1.0/xepicur.xsd',
|
||||
|
@ -497,7 +497,7 @@ class OaiPmhController extends AbstractController
|
|||
$resArray = [];
|
||||
// check for the optional "identifier" parameter
|
||||
if (isset($this->parameters['identifier'])) {
|
||||
$resArray = $this->documentRepository->getOaiMetadataFormats($this->settings['pages'], $this->parameters['identifier']);
|
||||
$resArray = $this->documentRepository->findOneByRecordId($this->parameters['identifier']);
|
||||
}
|
||||
|
||||
$resultSet = [];
|
||||
|
@ -505,7 +505,8 @@ class OaiPmhController extends AbstractController
|
|||
if (!empty($resArray)) {
|
||||
// check, if all required fields are available for a given identifier
|
||||
foreach ($details['requiredFields'] as $required) {
|
||||
if (empty($resArray[$required])) {
|
||||
$methodName = 'get' . ucfirst(trim($required));
|
||||
if (empty($resArray->$methodName())) {
|
||||
// Skip metadata formats whose requirements are not met.
|
||||
continue 2;
|
||||
}
|
||||
|
|
|
@ -330,27 +330,6 @@ class DocumentRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
|||
return $resArray;
|
||||
}
|
||||
|
||||
public function getOaiMetadataFormats($pid, $id) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_dlf_documents');
|
||||
|
||||
// Check given identifier.
|
||||
$result = $queryBuilder
|
||||
->select('tx_dlf_documents.*')
|
||||
->from('tx_dlf_documents')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('tx_dlf_documents.pid', intval($pid)),
|
||||
$queryBuilder->expr()->eq('tx_dlf_documents.record_id',
|
||||
$queryBuilder->expr()->literal($id))
|
||||
)
|
||||
->orderBy('tx_dlf_documents.tstamp')
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
||||
$resArray = $result->fetch();
|
||||
return $resArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all documents for the given settings
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue