/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = null) { $this->doc->setMimeEncoding('application/xml'); $model = $this->getModel('form'); $model->render(); // @TODO replace with OAI errors. if (!$this->canAccess()) { return false; } $listModel = $model->getListModel(); $this->oaiModel->setListModel($listModel); $this->oaiModel->setRecord($model->getData()); $dom = $this->oaiModel->getRecord(); echo $dom->saveXML(); }
/** * Describes a records copy right info * * @param $row * * @return DOMElement */ private function rowRights($row) { $rights = $this->oaiModel->createElement('rights'); $attributes = array("xmlns" => "http://www.openarchives.org/OAI/2.0/rights/", "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/rights/\n http://www.openarchives.org/OAI/2.0/rights.xsd"); $this->oaiModel->nodeAttributes($rights, $attributes); $rightsReference = $this->oaiModel->createElement('rightsReference'); $this->oaiModel->nodeAttributes($rightsReference, array('ref' => $this->params->get('open_archive_license'))); $rights->appendChild($rightsReference); return $rights; }