Browse Source

letting batch derivitives run during batches

pull/489/head
willtp87 11 years ago
parent
commit
27e2f5f978
  1. 22
      includes/derivatives.inc
  2. 10
      islandora.module

22
includes/derivatives.inc

@ -4,6 +4,28 @@
* Defines functions used when constructing derivatives.
*/
/**
* Decides which derivative function to call and runs it.
*
* @param AbstractObject $object
* The object to run the derivative function for.
* @param string $dsid
* The DSID to run the derivative function for.
*/
function islandora_run_derivatives (AbstractObject $object, $dsid) {
if (empty(batch_get())) {
$logging_results = islandora_do_derivatives($object, array(
'source_dsid' => $dsid,
));
islandora_derivative_logging($logging_results);
}
else {
islandora_do_batch_derivatives($object, array(
'source_dsid' => $dsid,
));
}
}
/**
* Kicks off derivative functions based upon hooks and conditions.
*

10
islandora.module

@ -1695,10 +1695,7 @@ function islandora_islandora_basic_collection_get_query_filters() {
*/
function islandora_islandora_object_ingested(AbstractObject $object) {
module_load_include('inc', 'islandora', 'includes/derivatives');
$logging_results = islandora_do_derivatives($object, array(
'source_dsid' => NULL,
));
islandora_derivative_logging($logging_results);
islandora_run_derivatives($object, NULL);
}
/**
@ -1709,10 +1706,7 @@ function islandora_islandora_object_ingested(AbstractObject $object) {
*/
function islandora_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) {
module_load_include('inc', 'islandora', 'includes/derivatives');
$logging_results = islandora_do_derivatives($object, array(
'source_dsid' => $datastream->id,
));
islandora_derivative_logging($logging_results);
islandora_run_derivatives($object, $datastream->id);
}
/**

Loading…
Cancel
Save