Browse Source

Merge pull request #82 from ajstanley/6.x

6.x
pull/83/head
Ben Woodhead 13 years ago
parent
commit
97b51d1919
  1. 34
      api/fedora_item.inc
  2. 13
      fedora_repository.solutionpacks.inc

34
api/fedora_item.inc

@ -6,6 +6,7 @@
*/ */
define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#'); define('RELS_EXT_URI', 'info:fedora/fedora-system:def/relations-external#');
define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#'); define("FEDORA_MODEL_URI", 'info:fedora/fedora-system:def/model#');
define("ISLANDORA_PAGE_URI", 'info:islandora/islandora-system:def/pageinfo#');
/** /**
* Fedora Item Class * Fedora Item Class
@ -285,6 +286,10 @@ class Fedora_Item {
$relationship = "hasModel"; $relationship = "hasModel";
$namespaceURI = FEDORA_MODEL_URI; $namespaceURI = FEDORA_MODEL_URI;
break; break;
case "isPageNumber":
$relationship = "isPageNumber";
$namespaceURI = ISLANDORA_PAGE_URI;
break;
} }
if (substr($object, 0, 12) != 'info:fedora/') { if (substr($object, 0, 12) != 'info:fedora/') {
@ -622,6 +627,35 @@ class Fedora_Item {
return $relationships; 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() { function get_models() {
$relationships = array(); $relationships = array();
try { try {

13
fedora_repository.solutionpacks.inc

@ -140,19 +140,16 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
); );
if (!$needs_install && !$needs_update) { 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.'); $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 { else {
$form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.'); $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( $form['submit'] = array(
'#value' => t('Install'), '#value' => $submit_button_text,
'#disabled' => !$needs_install && !$needs_update,
'#type' => 'submit',
'#name' => $solution_pack_module,
);
$form['forcesubmit'] = array(
'#value' => t('Force Reinstall'),
//'#disabled' => !$needs_install && !$needs_update,
'#type' => 'submit', '#type' => 'submit',
'#name' => $solution_pack_module, '#name' => $solution_pack_module,
); );

Loading…
Cancel
Save