00001 <?php
00002
00016
00017
00018
00019 class OAIMetadataFormat_RFC1807 extends OAIMetadataFormat {
00020
00024 function toXML(&$record) {
00025 $response = "<rfc1807\n" .
00026 "\txmlns=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\"\n" .
00027 "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" .
00028 "\txsi:schemaLocation=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\n" .
00029 "\thttp://www.openarchives.org/OAI/1.1/rfc1807.xsd\">\n" .
00030 "\t<bib-version>v2</bib-version>\n" .
00031 $this->formatElement('id', $record->url) .
00032 $this->formatElement('entry', $record->datestamp) .
00033 $this->formatElement('organization', $this->getLocalizedData($record->publishers, $record->primaryLocale)) .
00034 $this->formatElement('organization', $this->getLocalizedData($record->sources, $record->primaryLocale)) .
00035 $this->formatElement('title', $this->getLocalizedData($record->titles, $record->primaryLocale)) .
00036 $this->formatElement('type', $this->getLocalizedData($record->types, $record->primaryLocale)) .
00037 $this->formatElement('type', $record->relation) .
00038 $this->formatElement('author', $record->creator) .
00039 $this->formatElement('date', $record->date) .
00040 $this->formatElement('copyright', $record->rights) .
00041 $this->formatElement('other_access', 'url:' . $record->url) .
00042 $this->formatElement('keyword', $this->getLocalizedData($record->subjects, $record->primaryLocale)) .
00043 $this->formatElement('period', $record->coverage) .
00044 $this->formatElement('monitoring', $this->getLocalizedData($record->contributors, $record->primaryLocale)) .
00045 $this->formatElement('language', $record->language) .
00046 $this->formatElement('abstract', $this->getLocalizedData($record->descriptions, $record->primaryLocale)) .
00047 "</rfc1807>\n";
00048
00049 return $response;
00050 }
00051
00057 function formatElement($name, $value) {
00058 if (!is_array($value)) {
00059 $value = array($value);
00060 }
00061
00062 $response = '';
00063 foreach ($value as $v) {
00064 $response .= "\t<$name>" . $this->oai->prepOutput($v) . "</$name>\n";
00065 }
00066 return $response;
00067 }
00068
00069 }
00070
00071 ?>