|
|
|
@ -812,7 +812,8 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) {
|
|
|
|
|
function fedora_repository_edit_qdc_form_submit($form, &$form_state) { |
|
|
|
|
if ($form_state['storage']['xml']) { |
|
|
|
|
module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); |
|
|
|
|
EditObjectMetadataForm::submit($form, $form_state); |
|
|
|
|
$xml_form = new EditObjectMetadataForm(); |
|
|
|
|
$xml_form->submit($form, $form_state); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); |
|
|
|
@ -2160,12 +2161,12 @@ function fedora_repository_batch_reingest_object($object, &$context) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Does the object exist? If so, purge it. |
|
|
|
|
dd("About to test existence of PID: $pid"); |
|
|
|
|
//dd("About to test existence of PID: $pid"); |
|
|
|
|
$item = new Fedora_Item($pid); |
|
|
|
|
if ($item->exists()) { |
|
|
|
|
dd(' Found'); |
|
|
|
|
//dd(' Found'); |
|
|
|
|
$item->purge(t('Remove during re-install batch job')); |
|
|
|
|
dd(' Purged'); |
|
|
|
|
//dd(' Purged'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$new_item = NULL; //Need to have this a couple places... (After trying from FOXML and later for individual DSs) |
|
|
|
@ -2193,9 +2194,9 @@ function fedora_repository_batch_reingest_object($object, &$context) {
|
|
|
|
|
|
|
|
|
|
$label = !empty($object['label']) ? $object['label'] : ''; |
|
|
|
|
if (!isset($new_item)) { |
|
|
|
|
dd(' Not found, creating'); |
|
|
|
|
//dd(' Not found, creating'); |
|
|
|
|
$new_item = Fedora_Item::ingest_new_item($pid, 'A', $label); |
|
|
|
|
dd(' Created'); |
|
|
|
|
//dd(' Created'); |
|
|
|
|
} |
|
|
|
|
elseif (!empty($label)) { |
|
|
|
|
$new_item->modify_object($label); |
|
|
|
@ -2203,17 +2204,17 @@ function fedora_repository_batch_reingest_object($object, &$context) {
|
|
|
|
|
|
|
|
|
|
if (isset($new_item)) { |
|
|
|
|
if (!empty($object['cmodel'])) { |
|
|
|
|
dd(' relating to cmodel'); |
|
|
|
|
//dd(' relating to cmodel'); |
|
|
|
|
$new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); |
|
|
|
|
dd(' related to cmodel'); |
|
|
|
|
//dd(' related to cmodel'); |
|
|
|
|
} |
|
|
|
|
if (!empty($object['parent'])) { |
|
|
|
|
dd(' adding parent'); |
|
|
|
|
//dd(' adding parent'); |
|
|
|
|
$new_item->add_relationship('isMemberOfCollection', $object['parent']); |
|
|
|
|
dd(' parent added'); |
|
|
|
|
//dd(' parent added'); |
|
|
|
|
} |
|
|
|
|
foreach ((array)$datastreams as $ds) { |
|
|
|
|
dd("trying to add ds: {$ds['dsid']}"); |
|
|
|
|
//dd("trying to add ds: {$ds['dsid']}"); |
|
|
|
|
if ($ds['dsid'] == 'DC') { |
|
|
|
|
$new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); |
|
|
|
|
} |
|
|
|
|