Пример #1
0
<?php

/**
 * METS Export collection view script 
 *
 *Outputs a zip file for collections filled with mets files for each item
 *
 * @copyright Copyright 2014 UCSC Library Digital Initiatives
 * @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPLv3
 */
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/helpers/MetsExporter.php';
$collection = get_current_record('collection');
$collectionID = $collection->id;
//header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="Collection_' . $collection->id . '.mets.xml"');
$metsExporter = new MetsExporter();
if (!isset($collectionID)) {
    die('ERROR: collection ID not set');
}
try {
    echo $metsExporter->exportCollection($collectionID);
} catch (Exception $e) {
    die($e->getMessage());
}
Пример #2
0
<?php

/**
 * METS Export item view script 
 *
 * Output a single METS file for an Omeka item.
 *
 * @copyright Copyright 2014 UCSC Library Digital Initiatives
 * @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPLv3
 */
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/helpers/MetsExporter.php';
$item = get_current_record('item');
$itemID = $item->id;
$metsExporter = new MetsExporter();
if (!isset($itemID)) {
    die('ERROR: item ID not set');
}
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="Item_' . $itemID . '_METS.xml"');
try {
    echo $metsExporter->exportItem($itemID);
} catch (Exception $e) {
    $this->flashMessenger->addMessage($e->getMessage(), 'error');
}