diff --git a/dlf/common/class.tx_dlf_document.php b/dlf/common/class.tx_dlf_document.php index 7606d7ca6..889e61d6d 100644 --- a/dlf/common/class.tx_dlf_document.php +++ b/dlf/common/class.tx_dlf_document.php @@ -88,6 +88,10 @@ final class tx_dlf_document { * @access protected */ protected $formats = array ( + 'OAI' => array ( + 'rootElement' => 'OAI-PMH', + 'namespaceURI' => 'http://www.openarchives.org/OAI/2.0/', + ), 'METS' => array ( 'rootElement' => 'mets', 'namespaceURI' => 'http://www.loc.gov/METS/', @@ -853,7 +857,7 @@ public function getMetadata($id, $cPid = 0) { } // Set default value if applicable. - if (empty($metadata[$resArray['index_name']][0]) && $resArray['default_value']) { + if (empty($metadata[$resArray['index_name']][0])) { $metadata[$resArray['index_name']] = array ($resArray['default_value']); @@ -945,7 +949,7 @@ public function getPhysicalPage($logicalPage) { return 1; } - + /** * This determines a title for the given document * @@ -1029,7 +1033,7 @@ public function getTitledata($cPid = 0) { // Set record identifier for METS file if not present. if (is_array($titledata) && array_key_exists('record_id', $titledata)) { - if (!in_array($this->recordId, $titledata['record_id'])) { + if (!empty($this->recordId) && !in_array($this->recordId, $titledata['record_id'])) { array_unshift($titledata['record_id'], $this->recordId); @@ -2418,7 +2422,7 @@ protected function __construct($uid, $pid) { $location = (string) $uid; // Try to load METS file. - if ($this->load($location)) { + if (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($location) && $this->load($location)) { // Initialize core METS object. $this->init(); diff --git a/dlf/hooks/class.tx_dlf_hacks.php b/dlf/hooks/class.tx_dlf_hacks.php index e5bf09df0..4fb8609de 100644 --- a/dlf/hooks/class.tx_dlf_hacks.php +++ b/dlf/hooks/class.tx_dlf_hacks.php @@ -38,7 +38,7 @@ public function construct_postProcessRecordId(SimpleXMLElement &$xml, &$record_i $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); // Get all logical structure nodes with metadata, but without associated METS-Pointers. - if (($divs = $xml->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID and not(./mets:mptr)]'))) { + if (($divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID and not(./mets:mptr)]'))) { $smLinks = $xml->xpath('//mets:structLink/mets:smLink'); diff --git a/dlf/modules/indexing/index.php b/dlf/modules/indexing/index.php index 8c35dbf4f..cac7f4484 100644 --- a/dlf/modules/indexing/index.php +++ b/dlf/modules/indexing/index.php @@ -215,7 +215,8 @@ public function main() { case 'indexFile': - if (!empty($this->data['id']) && isset($this->data['core'])) { + if (!empty($this->data['id']) && isset($this->data['core']) + && \TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($this->data['id'])) { // Save document to database and index. $doc =& tx_dlf_document::getInstance($this->data['id'], $this->id, TRUE); @@ -338,12 +339,6 @@ public function main() { break; - case 'reindexDoc': - - $this->markerArray['CONTENT'] .= $this->getDocList(); - - break; - case 'reindexDocs': $this->markerArray['CONTENT'] .= $this->getCollList();