|
|
|
@ -82,13 +82,26 @@ class IslandoraFedoraRepository extends FedoraRepository {
|
|
|
|
|
* @see FedoraRepository::ingestObject() |
|
|
|
|
*/ |
|
|
|
|
public function ingestObject(NewFedoraObject &$object) { |
|
|
|
|
$context = array( |
|
|
|
|
try { |
|
|
|
|
foreach ($object as $dsid => $datastream) { |
|
|
|
|
$datastream_context = array( |
|
|
|
|
'action' => 'ingest', |
|
|
|
|
'block' => FALSE, |
|
|
|
|
); |
|
|
|
|
islandora_alter_object($object, $context); |
|
|
|
|
try { |
|
|
|
|
if ($context['block']) { |
|
|
|
|
islandora_alter_datastream($object, $datastream, $datastream_context); |
|
|
|
|
if ($datastream_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.'); |
|
|
|
|
} |
|
|
|
|
$ret = parent::ingestObject($object); |
|
|
|
|