diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 2bb6e3cd..1714c571 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -6,6 +6,7 @@ */ define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#'); +define("ISLANDORA_PAGE_URI", 'info:islandora/islandora-system:def/pageinfo#'); /** * Fedora Item Class @@ -285,6 +286,10 @@ class Fedora_Item { $relationship = "hasModel"; $namespaceURI = FEDORA_MODEL_URI; break; + case "isPageNumber": + $relationship = "isPageNumber"; + $namespaceURI = ISLANDORA_PAGE_URI; + break; } if (substr($object, 0, 12) != 'info:fedora/') { @@ -622,6 +627,35 @@ class Fedora_Item { return $relationships; } + function get_rdf_relationships() { + + $relationships = array(); + try { + $relsext = $this->get_datastream_dissemination('RELS-EXT'); + } catch (exception $e) { + drupal_set_message(t("Error retrieving RELS-EXT of object $pid"), 'error'); + return $relationships; + } + + // Parse the RELS-EXT into an associative array. + $relsextxml = new DOMDocument(); + $relsextxml->loadXML($relsext); + $relsextxml->normalizeDocument(); + $allTags = array(); + $allTags[] = $relsextxml->getElementsByTagNameNS(RELS_EXT_URI, '*'); + $allTags[] = $relsextxml->getElementsByTagNameNS(FEDORA_MODEL_URI, '*'); + $allTags[] = $relsextxml->getElementsByTagNameNS(ISLANDORA_PAGE_URI, '*'); + foreach ($allTags as $tags) { + foreach ($tags as $child) { + $value = preg_replace('/info:fedora\//','',$child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource')); + + $relationships[$child->tagName][] = $value; + } + } + + return $relationships; + } + function get_models() { $relationships = array(); try { diff --git a/fedora_repository.solutionpacks.inc b/fedora_repository.solutionpacks.inc index e9b0c144..5bb5a117 100644 --- a/fedora_repository.solutionpacks.inc +++ b/fedora_repository.solutionpacks.inc @@ -140,19 +140,16 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul ); if (!$needs_install && !$needs_update) { $form['install_status']['#value'] = theme_image('misc/watchdog-ok.png') . t('All required objects are installed and up-to-date.'); + $submit_button_text = t("Force Reinstallation of Fedora Objects"); + } else { $form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); + $submit_button_text = t("Install Fedora Objects"); + } $form['submit'] = array( - '#value' => t('Install'), - '#disabled' => !$needs_install && !$needs_update, - '#type' => 'submit', - '#name' => $solution_pack_module, - ); - $form['forcesubmit'] = array( - '#value' => t('Force Reinstall'), - //'#disabled' => !$needs_install && !$needs_update, + '#value' => $submit_button_text, '#type' => 'submit', '#name' => $solution_pack_module, );