/** * Responds to the ListMetadataFormats verb. * * Outputs records for all of the items in the database in the specified * metadata format. * * @todo extend for additional metadata formats */ private function listMetadataFormats() { $identifier = $this->_getParam('identifier'); /* Items are not used for lookup, simply checks for an invalid id */ if ($identifier) { $itemId = OaiPmhRepository_OaiIdentifier::oaiIdToItem($identifier); if (!$itemId) { $this->throwError(self::OAI_ERR_ID_DOES_NOT_EXIST); return; } } if (!$this->error) { $listMetadataFormats = $this->document->createElement('ListMetadataFormats'); $this->document->documentElement->appendChild($listMetadataFormats); foreach ($this->metadataFormats as $format) { $formatObject = new $format(null, $this->document); $formatObject->declareMetadataFormat($listMetadataFormats); } } }
/** * Responds to the ListMetadataFormats verb. * * Outputs records for all of the items in the database in the specified * metadata format. * * @todo extend for additional metadata formats */ private function listMetadataFormats() { $identifier = $this->_getParam('identifier'); /* Items are not used for lookup, simply checks for an invalid id */ if ($identifier) { $itemId = OaiPmhRepository_OaiIdentifier::oaiIdToItem($identifier); if (!$itemId) { $this->throwError(self::OAI_ERR_ID_DOES_NOT_EXIST); return; } } if (!$this->error) { $listMetadataFormats = $this->document->createElement('ListMetadataFormats'); $this->document->documentElement->appendChild($listMetadataFormats); foreach ($this->metadataFormats as $prefix => $format) { $elements = array('metadataPrefix' => $prefix, 'schema' => $format['schema'], 'metadataNamespace' => $format['namespace']); $listMetadataFormats->appendNewElementWithChildren('metadataFormat', $elements); } } }