Browse Source

Comment out debug lines.

pull/95/head
Adam Vessey 13 years ago
parent
commit
972e97d498
  1. 12
      api/fedora_item.inc
  2. 23
      fedora_repository.module
  3. 2
      formClass.inc

12
api/fedora_item.inc

@ -212,7 +212,7 @@ class Fedora_Item {
* @param type $namespaceURI * @param type $namespaceURI
*/ */
function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) { function add_relationship($relationship, $object, $namespaceURI = RELS_EXT_URI) {
dd($this, 'The Fedora_Item'); //dd($this, 'The Fedora_Item');
$ds_list = $this->get_datastreams_list_as_array(); $ds_list = $this->get_datastreams_list_as_array();
$f_prefix = 'info:fedora/'; $f_prefix = 'info:fedora/';
if (!array_key_exists('RELS-EXT', $ds_list)) { if (!array_key_exists('RELS-EXT', $ds_list)) {
@ -222,14 +222,14 @@ class Fedora_Item {
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
RDF; RDF;
dd($rdf_string, 'RELS-EXT RDF being added'); //dd($rdf_string, 'RELS-EXT RDF being added');
$this->add_datastream_from_string($rdf_string, 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'application/rdf+xml', 'X'); $this->add_datastream_from_string($rdf_string, 'RELS-EXT', 'Fedora object-to-object relationship metadata', 'application/rdf+xml', 'X');
dd('Added'); //dd('Added');
} }
dd('Getting RELS-EXT'); //dd('Getting RELS-EXT');
$relsext = $this->get_datastream_dissemination('RELS-EXT'); $relsext = $this->get_datastream_dissemination('RELS-EXT');
dd('Got RELS-EXT'); //dd('Got RELS-EXT');
if (substr($object, 0, strlen($f_prefix)) !== $f_prefix) { if (substr($object, 0, strlen($f_prefix)) !== $f_prefix) {
$object = $f_prefix . $object; $object = $f_prefix . $object;
@ -835,7 +835,7 @@ RDF;
'logMessage' => 'Fedora Object Ingested' 'logMessage' => 'Fedora Object Ingested'
); );
$object = self::soap_call('ingest', $params); $object = self::soap_call('ingest', $params);
dd($object, 'Soap return'); //dd($object, 'Soap return');
return new Fedora_Item($object->objectPID); return new Fedora_Item($object->objectPID);
} }

23
fedora_repository.module

@ -812,7 +812,8 @@ function fedora_repository_edit_qdc_form_validate($form, &$form_state) {
function fedora_repository_edit_qdc_form_submit($form, &$form_state) { function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
if ($form_state['storage']['xml']) { if ($form_state['storage']['xml']) {
module_load_include('inc', 'islandora_content_model_forms', 'EditObjectMetadataForm'); 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 { else {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); 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. // 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); $item = new Fedora_Item($pid);
if ($item->exists()) { if ($item->exists()) {
dd(' Found'); //dd(' Found');
$item->purge(t('Remove during re-install batch job')); $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) $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'] : ''; $label = !empty($object['label']) ? $object['label'] : '';
if (!isset($new_item)) { if (!isset($new_item)) {
dd(' Not found, creating'); //dd(' Not found, creating');
$new_item = Fedora_Item::ingest_new_item($pid, 'A', $label); $new_item = Fedora_Item::ingest_new_item($pid, 'A', $label);
dd(' Created'); //dd(' Created');
} }
elseif (!empty($label)) { elseif (!empty($label)) {
$new_item->modify_object($label); $new_item->modify_object($label);
@ -2203,17 +2204,17 @@ function fedora_repository_batch_reingest_object($object, &$context) {
if (isset($new_item)) { if (isset($new_item)) {
if (!empty($object['cmodel'])) { if (!empty($object['cmodel'])) {
dd(' relating to cmodel'); //dd(' relating to cmodel');
$new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI); $new_item->add_relationship('hasModel', $object['cmodel'], FEDORA_MODEL_URI);
dd(' related to cmodel'); //dd(' related to cmodel');
} }
if (!empty($object['parent'])) { if (!empty($object['parent'])) {
dd(' adding parent'); //dd(' adding parent');
$new_item->add_relationship('isMemberOfCollection', $object['parent']); $new_item->add_relationship('isMemberOfCollection', $object['parent']);
dd(' parent added'); //dd(' parent added');
} }
foreach ((array)$datastreams as $ds) { foreach ((array)$datastreams as $ds) {
dd("trying to add ds: {$ds['dsid']}"); //dd("trying to add ds: {$ds['dsid']}");
if ($ds['dsid'] == 'DC') { if ($ds['dsid'] == 'DC') {
$new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml'); $new_item->modify_datastream_by_value(file_get_contents($ds['datastream_file']), $ds['dsid'], $ds['label'], 'text/xml');
} }

2
formClass.inc

@ -601,7 +601,7 @@ class formClass {
$form = new IngestObjectMetadataForm(); $form = new IngestObjectMetadataForm();
return $form->create($collection_pid, $collection_label, $form_state); return $form->create($collection_pid, $collection_label, $form_state);
} catch (Exception $e) { } catch (Exception $e) {
dd('An error occured; reverting to QDC form...'); //dd('An error occured; reverting to QDC form...');
$form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form. $form_state['storage']['xml'] = FALSE; // An error occured revert back to the QDC Form.
} }
} }

Loading…
Cancel
Save