From 8c0ce49cff71b45fed83eb6b3e85e260d2231062 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 26 Nov 2012 18:43:54 -0400 Subject: [PATCH 1/2] Bit more. --- islandora.api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/islandora.api.php b/islandora.api.php index 9f1e1e5c..337814fa 100644 --- a/islandora.api.php +++ b/islandora.api.php @@ -235,6 +235,10 @@ function hook_islandora_undeletable_datastreams(array $models) {} * - form_id: The form building function to call to get the form structure * for this step. * - args: An array of arguments to pass to the form building function. + * And may optionally include both: + * - module: A module from which we want to load an include. + * - file: A file to include (relative to the module's path, including the + * file's extension). */ function hook_islandora_ingest_steps(array $configuration) { return array( From cda9f25ae7e2ad4cd5344218b5eec38bfa842152 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 28 Nov 2012 13:57:12 -0400 Subject: [PATCH 2/2] Break out acquisition of datastream info. --- includes/globals.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/globals.inc b/includes/globals.inc index e85a71bc..3cece340 100644 --- a/includes/globals.inc +++ b/includes/globals.inc @@ -321,8 +321,23 @@ function islandora_get_missing_datastreams_requirements(FedoraObject $object) { * object. */ function islandora_get_datastreams_requirements(FedoraObject $object) { + return islandora_get_datastreams_requirements_from_models($object->models); +} + +/** + * Get the list of which datastreams are valid in the given set of models. + * + * @param array $models + * An array of content models PIDs from which to parse the DS-COMPOSITE-MODEL + * stream. + * + * @return array + * An associative array of associative arrays, merged from calls to + * islandora_get_datastreams_requirements_from_content_model(). + */ +function islandora_get_datastreams_requirements_from_models(array $models) { $dsids = array(); - foreach ($object->models as $model) { + foreach ($models as $model) { $model = islandora_get_object_by_id($model); $dsids += islandora_get_datastreams_requirements_from_content_model($model); }