$test_packager->addMetadata("abstract", $abstract); $test_packager->addMetadata("available", "2009"); $test_packager->addMetadata("bibliographicCitation", "Lewis, S., Hayes, L., Newton-Wade, V., Corfield, A., Davis, R., Donohue, T., Wilson, S., If SWORD is the answer, what is the question? Use of the Simple Web-service Offering Repository Deposit protocol, Program: electronic library and information systems, 2009, Vol 43, Issue 4, pp: 407 - 418, 10.1108/00330330910998057, Emerald Group Publishing Limited"); $test_packager->addMetadata("creator", "Lewis, Stuart"); $test_packager->addMetadata("creator", "Hayes, Leonie"); $test_packager->addMetadata("creator", "Newton-Wade, Vanessa"); $test_packager->addMetadata("creator", "Corfield, Antony"); $test_packager->addMetadata("creator", "Davis, Richard"); $test_packager->addMetadata("creator", "Donohue, Tim"); $test_packager->addMetadata("creator", "Wilson, Scott"); $test_packager->addMetadata("identifier", "10.1108/00330330910998057"); $test_packager->addMetadata("publisher", "Emerald"); $test_packager->addMetadata("title", "If SWORD is the answer, what is the question? Use of the Simple Web service Offering Repository Deposit protocol"); $test_packager->addFile('if-sword-is-the-answer.pdf'); $test_packager->create(); // The filename to save the second package as $test_fileout = 'atom_multipart_package2'; // Create the test package $test_packager = new PackagerAtomMultipart($test_rootin, $test_dirin, $test_rootout, $test_fileout); $test_packager->setTitle("A photo of Stuart Lewis"); $test_packager->setIdentifier("facebook.com/stuartlewis"); $test_packager->addEntryAuthor("Stuart Lewis"); $abstract = "Stuart's profile photo from Facebook"; $test_packager->setSummary($abstract); $test_packager->addMetadata("abstract", $abstract); $test_packager->addMetadata("available", "2009"); $test_packager->addMetadata("creator", "Lewis, Stuart"); $test_packager->addMetadata("identifier", "facebook.com/stuartlewis"); $test_packager->addMetadata("title", "Stuart Lewis"); $test_packager->addFile('stuartlewis.jpg'); $test_packager->create();
// Load the PHP library include_once '../../../../packager_atom_multipart.php'; // Store the values session_start(); $_SESSION['durl'] = $_POST['durl']; // Set the location of this site on file include '../../config.php'; // Construct the package $test_rootin = $_SESSION['location']; $test_dirin = 'files'; $test_rootout = $_SESSION['location'] . '/files'; $test_fileout = 'atom'; // Create the test package $test_packager = new PackagerAtomMultipart($test_rootin, $test_dirin, $test_rootout, $test_fileout); $test_packager->setTitle($_POST['title']); $test_packager->setIdentifier($_POST['identifier']); $test_packager->addEntryAuthor($_POST['author']); $test_packager->setSummary($_POST['abstract']); $test_packager->addMetadata("abstract", $_POST['abstract']); $test_packager->addMetadata("available", $_POST['date']); $test_packager->addMetadata("creator", $_POST['author']); $test_packager->addMetadata("identifier", $_POST['identifier']); $test_packager->addMetadata("title", $_POST['title']); $test_packager->create(); $_SESSION['filename'] = $test_rootout . '/' . $test_fileout; // Is it in progress? if (isset($_POST['inprogress'])) { $_SESSION['inprogress'] = "true"; } else { $_SESSION['inprogress'] = "false"; }