Esempio n. 1
0
 /**
  * Menampilkan detil record metadata dalam bentuk XML
  *
  * @param   mixed   $recordID: ID atau Identifier OAI dari record
  * @param   string  $metadataPrefix:  Prefix dari skema metadata yang diinginkan
  * @param   boolean $headerOnly: tampilkan hanya header dari record XML OAI
  *
  */
 protected function outputRecordXML($recordID, $metadataPrefix = 'oai_dc')
 {
     global $sysconf;
     // berikut adalah entitas yang dilarang oleh XML, tambahkan dalam array apabila diperlukan
     $xmlForbiddenSymbols = array('Â', 'Ã', '¶', '¸', '©', '­', '£', '±', '®', '§', '·', '¡');
     // ambil detail record
     if ($metadataPrefix == 'oai_dc') {
         $detail = new detail($this->db, $recordID, 'dc');
         $rec_detail = $detail->DublinCoreOutput();
     }
     // mulai output XML
     ob_start();
     echo '<record>' . "<header><identifier>" . $sysconf['OAI']['identifierPrefix'] . $recordID . "</identifier></header>";
     echo "<metadata>";
     if ($metadataPrefix == 'oai_dc') {
         echo '<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
     }
     echo $rec_detail;
     if ($metadataPrefix == 'oai_dc') {
         echo '</oai_dc:dc>';
     }
     echo "</metadata>\n";
     echo "</record>\n";
     $recordXML = ob_get_clean();
     return $recordXML;
 }
Esempio n. 2
0
 /**
  * Menampilkan detil record metadata dalam bentuk XML
  *
  * @param   mixed   $recordID: ID atau Identifier OAI dari record
  * @param   string  $metadataPrefix:  Prefix dari skema metadata yang diinginkan
  * @param   boolean $headerOnly: tampilkan hanya header dari record XML OAI
  *
  */
 protected function outputRecordXML($recordID, $metadataPrefix = 'oai_dc')
 {
     global $sysconf;
     // ambil detail record
     if ($metadataPrefix == 'oai_dc') {
         $detail = new detail($this->db, $recordID, 'dc');
         $rec_detail = $detail->DublinCoreOutput();
     }
     // mulai output XML
     ob_start();
     echo "<record><header><identifier>" . $sysconf['OAI']['identifierPrefix'] . $recordID . "</identifier></header>";
     echo "<metadata>";
     if ($metadataPrefix == 'oai_dc') {
         echo '<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
     }
     echo $rec_detail;
     if ($metadataPrefix == 'oai_dc') {
         echo '</oai_dc:dc>';
     }
     echo "</metadata>\n";
     echo "</record>\n";
     $recordXML = ob_get_clean();
     return $recordXML;
 }