Browse Source

Trigger datastream alter on object ingest.

pull/369/head
Adam Vessey 12 years ago
parent
commit
7ad6efc7a0
  1. 21
      includes/tuque_wrapper.inc

21
includes/tuque_wrapper.inc

@ -82,13 +82,26 @@ class IslandoraFedoraRepository extends FedoraRepository {
* @see FedoraRepository::ingestObject() * @see FedoraRepository::ingestObject()
*/ */
public function ingestObject(NewFedoraObject &$object) { public function ingestObject(NewFedoraObject &$object) {
$context = array( try {
foreach ($object as $dsid => $datastream) {
$datastream_context = array(
'action' => 'ingest', 'action' => 'ingest',
'block' => FALSE, 'block' => FALSE,
); );
islandora_alter_object($object, $context); islandora_alter_datastream($object, $datastream, $datastream_context);
try { if ($datastream_context['block']) {
if ($context['block']) { throw new Exception(t('Object ingest blocked due to ingest of @dsid being blocked.', array(
'@dsid' => $dsid,
)));
}
}
$object_context = array(
'action' => 'ingest',
'block' => FALSE,
);
islandora_alter_object($object, $object_context);
if ($object_context['block']) {
throw new Exception('Ingest Object was blocked.'); throw new Exception('Ingest Object was blocked.');
} }
$ret = parent::ingestObject($object); $ret = parent::ingestObject($object);

Loading…
Cancel
Save