Browse Source

Added documentation

pull/38/head
Alan Stanley 13 years ago
parent
commit
3b3891ebd7
  1. 42
      BatchIngest.inc
  2. 9
      CollectionManagement.inc
  3. 2
      api/fedora_utils.inc

42
BatchIngest.inc

@ -1,5 +1,13 @@
<?php
/**
* batch creation form submit
* @global type $user
* @param array $form
* @param array $form_state
* @param array $content_models
*/
function batch_creation_form(&$form_state, $collection_pid, $content_models) {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
@ -59,6 +67,11 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) {
return($form);
}
/**
* @param array $form
* @param array $form_state
*/
function batch_creation_form_validate($form, &$form_state) {
$fieldName = 'file-location';
@ -129,10 +142,6 @@ function batch_creation_form_submit($form, &$form_state) {
}
}
/**
* use the content model class to construct a class representing the selected content model
* call execIngestmethods on each mimetype passed in
*/
if (($cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM')) === FALSE) {
drupal_set_message("$content_model not found", "error");
return;
@ -155,6 +164,17 @@ function batch_creation_form_submit($form, &$form_state) {
batch_process();
}
/**
*
* @param <string> $label
* @param <string> $content_model
* @param <array> $object_files
* @param <string> $collection_pid
* @param <string> $namespace
* @param <string> $metadata
*/
function create_batch_objects($label, $content_model, $object_files, $collection_pid, $namespace, $metadata) {
module_load_include('inc', 'fedora_repository', 'ContentModel');
module_load_include('inc', 'fedora_repository', 'MimeClass');
@ -198,6 +218,14 @@ function create_batch_objects($label, $content_model, $object_files, $collection
}
}
/**
* transforms mods to dc
* @param <string> $mods_xml
* @return <string>
*/
function batch_create_dc_from_mods($mods_xml) {
$path = drupal_get_path('module', 'fedora_repository');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
@ -225,7 +253,11 @@ function batch_create_dc_from_mods($mods_xml) {
return $dc_xml;
}
/**
*
* @param <string> $dir
* @return <boolean>
*/
function recursive_directory_delete($dir) {
if (!file_exists($dir))
return true;

9
CollectionManagement.inc

@ -29,7 +29,9 @@ function collection_management_form(&$form_state, $this_collection_pid, $content
$name_mappings = array();
foreach ($content_models as $content_model) {
if ($content_model->pid != "islandora:collectionCModel") {
$cm_options[$content_model->pid] = $content_model->name;
$item = new fedora_item($content_model->pid);
$cm_name = $item->objectProfile->objLabel;
$cm_options[$content_model->pid] = $cm_name;
}
}
@ -285,7 +287,10 @@ function collection_management_form_submit($form, &$form_state) {
batch_process('/fedora/repository');
}
}
/**
* deletes PID if pid is not collection
* @param <type> $pid
*/
function delete_objects_as_batch($pid) {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$name = $user->name;

2
api/fedora_utils.inc

@ -299,7 +299,7 @@ function get_content_models_as_option_array() {
$nameparts = explode(':', $parts[0]);
if (!$restricted || in_array($nameparts[0], $allowed))
if ($item->get_datastream_dissemination('ISLANDORACM')) {
$options[$parts[0]] = $parts[1];
$options[$parts[0]] = $parts[1]. ' ~ ' . $parts[0] ;
}
}
}

Loading…
Cancel
Save