Skip to content

Instantly share code, notes, and snippets.

@fiver-watson
Created November 21, 2016 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fiver-watson/c19b384bb27a6b43f6d96a710fa28e43 to your computer and use it in GitHub Desktop.
Save fiver-watson/c19b384bb27a6b43f6d96a710fa28e43 to your computer and use it in GitHub Desktop.
This script, when run in Access to Memory (AtoM - see: https://www.accesstomemory.org) using the tools:run command-line task, will generate a PDF finding aid for each published archival descriptive hierarchy (e.g. fonds, collection, record group, etc) in AtoM. If you want to generate a finding aid for all descriptions regardless of publication s…
<?php
$c = new Criteria;
$c->add(QubitInformationObject::PARENT_ID, 1);
foreach (QubitInformationObject::get($c) as $io)
{
if ($io->getPublicationStatus()->statusId == QubitTerm::PUBLICATION_STATUS_DRAFT_ID)
continue;
print "Generating PDF for ".$io->title."\n";
$params = array(
'objectId' => $io->id,
'description' =>'Generating finding aid for: '.$io->getTitle(array('cultureFallback' => true))
);
$job = QubitJob::runJob('arGenerateFindingAidJob', $params);
sleep(30);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment