-
-
Save mcantelon/429307d59b2839fda74bdeeb464fef93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Run this file using AtoM's tools:run task, for example: | |
// | |
// $ php symfony tools:run ead_cache_filepaths.php | |
$slug = readline('Slug to determine EAD filepaths for? '); | |
// Attempt to get slug | |
$criteria = new Criteria; | |
$criteria->add(QubitSlug::SLUG, $slug); | |
$slugObject = QubitSlug::getOne($criteria); | |
if ($slugObject === null) | |
{ | |
print "Slug not found.\n"; | |
} | |
else | |
{ | |
// Attempt to get corresponding information object | |
$io = QubitInformationObject::getById($slugObject->objectId); | |
if ($io === null) | |
{ | |
print "Information object corresponding to slug not found.\n"; | |
} | |
else | |
{ | |
// Display EAD cache paths | |
$representation = new QubitInformationObjectXmlCacheResource($io); | |
print "\nMain XML file: ". $representation->getFilePath('ead') ."\n"; | |
print 'XML file for embedding into OAI-PMH*: '. $representation->getFilePath('ead', true) ."\n\n"; | |
print "*For OAI-PMH version, the first two lines (XML declaration and the doctype) should be removed.\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment