function exportIssues(&$journal, &$issues)
 {
     $this->import('MetsExportDom');
     $doc =& XMLCustomWriter::createDocument('', null);
     $root =& XMLCustomWriter::createElement($doc, 'METS:mets');
     XMLCustomWriter::setAttribute($root, 'xmlns:METS', 'http://www.loc.gov/METS/');
     XMLCustomWriter::setAttribute($root, 'xmlns:xlink', 'http://www.w3.org/TR/xlink');
     XMLCustomWriter::setAttribute($root, 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     XMLCustomWriter::setAttribute($root, 'PROFILE', 'Australian METS Profile 1.0');
     XMLCustomWriter::setAttribute($root, 'TYPE', 'journal');
     XMLCustomWriter::setAttribute($root, 'OBJID', 'J-' . $journal->getJournalId());
     XMLCustomWriter::setAttribute($root, 'xsi:schemaLocation', 'http://www.loc.gov/METS/ http://www.loc.gov/mets/mets.xsd');
     $HeaderNode =& MetsExportDom::createmetsHdr($doc);
     XMLCustomWriter::appendChild($root, $HeaderNode);
     MetsExportDom::generateJournalDmdSecDom($doc, $root, $journal);
     $fileSec =& XMLCustomWriter::createElement($doc, 'METS:fileSec');
     $fileGrpOriginal =& XMLCustomWriter::createElement($doc, 'METS:fileGrp');
     XMLCustomWriter::setAttribute($fileGrpOriginal, 'USE', 'original');
     $fileGrpDerivative =& XMLCustomWriter::createElement($doc, 'METS:fileGrp');
     XMLCustomWriter::setAttribute($fileGrpDerivative, 'USE', 'derivative');
     foreach ($issues as $issue) {
         MetsExportDom::generateIssueDmdSecDom($doc, $root, $issue, $journal);
         MetsExportDom::generateIssueFileSecDom($doc, $fileGrpOriginal, $issue);
         MetsExportDom::generateIssueHtmlGalleyFileSecDom($doc, $fileGrpDerivative, $issue);
     }
     $amdSec =& MetsExportDom::createmetsamdSec($doc, $root, $journal);
     XMLCustomWriter::appendChild($root, $amdSec);
     XMLCustomWriter::appendChild($fileSec, $fileGrpOriginal);
     XMLCustomWriter::appendChild($fileSec, $fileGrpDerivative);
     XMLCustomWriter::appendChild($root, $fileSec);
     MetsExportDom::generateStructMap($doc, $root, $journal, $issues);
     XMLCustomWriter::appendChild($doc, $root);
     header("Content-Type: application/xml");
     header("Cache-Control: private");
     header("Content-Disposition: attachment; filename=\"" . $journal->getPath() . "-mets.xml\"");
     XMLCustomWriter::printXML($doc);
     return true;
 }
Ejemplo n.º 2
0
 function exportSchedConfs(&$conference, &$schedConfIdArray)
 {
     $this->import('MetsExportDom');
     $schedConfDAO =& DAORegistry::getDAO('SchedConfDAO');
     $doc =& XMLCustomWriter::createDocument();
     $root =& XMLCustomWriter::createElement($doc, 'METS:mets');
     XMLCustomWriter::setAttribute($root, 'xmlns:METS', 'http://www.loc.gov/METS/');
     XMLCustomWriter::setAttribute($root, 'xmlns:xlink', 'http://www.w3.org/TR/xlink');
     XMLCustomWriter::setAttribute($root, 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     XMLCustomWriter::setAttribute($root, 'PROFILE', 'Australian METS Profile 1.0');
     XMLCustomWriter::setAttribute($root, 'TYPE', 'conference');
     XMLCustomWriter::setAttribute($root, 'OBJID', 'C-' . $conference->getId());
     XMLCustomWriter::setAttribute($root, 'xsi:schemaLocation', 'http://www.loc.gov/METS/ http://www.loc.gov/mets/mets.xsd');
     $headerNode =& MetsExportDom::createmetsHdr($doc);
     XMLCustomWriter::appendChild($root, $headerNode);
     MetsExportDom::generateConfDmdSecDom($doc, $root, $conference);
     $fileSec =& XMLCustomWriter::createElement($doc, 'METS:fileSec');
     $fileGrp =& XMLCustomWriter::createElement($doc, 'METS:fileGrp');
     XMLCustomWriter::setAttribute($fileGrp, 'USE', 'original');
     $i = 0;
     while ($i < sizeof($schedConfIdArray)) {
         $schedConf =& $schedConfDAO->getSchedConf($schedConfIdArray[$i]);
         MetsExportDom::generateSchedConfDmdSecDom($doc, $root, $conference, $schedConf);
         MetsExportDom::generateSchedConfFileSecDom($doc, $fileGrp, $conference, $schedConf);
         $i++;
     }
     $amdSec =& MetsExportDom::createmetsamdSec($doc, $root, $conference);
     XMLCustomWriter::appendChild($root, $amdSec);
     XMLCustomWriter::appendChild($fileSec, $fileGrp);
     XMLCustomWriter::appendChild($root, $fileSec);
     MetsExportDom::generateConfstructMapWithSchedConfsIdArray($doc, $root, $conference, $schedConfIdArray);
     XMLCustomWriter::appendChild($doc, $root);
     header("Content-Type: application/xml");
     header("Cache-Control: private");
     header("Content-Disposition: attachment; filename=\"" . $conference->getPath() . "-mets.xml\"");
     XMLCustomWriter::printXML($doc);
     return true;
 }
Ejemplo n.º 3
0
 /**
  *  Create METS:metsHdr for export
  */
 function &createmetsHdr($doc)
 {
     $root =& XMLCustomWriter::createElement($doc, 'METS:metsHdr');
     XMLCustomWriter::setAttribute($root, 'CREATEDATE', date('c'));
     XMLCustomWriter::setAttribute($root, 'LASTMODDATE', date('c'));
     $agentNode =& XMLCustomWriter::createElement($doc, 'METS:agent');
     XMLCustomWriter::setAttribute($agentNode, 'ROLE', 'DISSEMINATOR');
     XMLCustomWriter::setAttribute($agentNode, 'TYPE', 'ORGANIZATION');
     $organization = Request::getUserVar('organization');
     if ($organization == '') {
         $siteDao =& DAORegistry::getDAO('SiteDAO');
         $site = $siteDao->getSite();
         $organization = $site->getLocalizedTitle();
     }
     XMLCustomWriter::createChildWithText($doc, $agentNode, 'METS:name', $organization, false);
     XMLCustomWriter::appendChild($root, $agentNode);
     $agentNode2 =& XMLCustomWriter::createElement($doc, 'METS:agent');
     XMLCustomWriter::setAttribute($agentNode2, 'ROLE', 'CREATOR');
     XMLCustomWriter::setAttribute($agentNode2, 'TYPE', 'OTHER');
     XMLCustomWriter::createChildWithText($doc, $agentNode2, 'METS:name', MetsExportDom::getCreatorString(), false);
     XMLCustomWriter::appendChild($root, $agentNode2);
     return $root;
 }