Skip to content
Browse files

Merge pull request #82 from ajstanley/6.x

6.x
  • Loading branch information...
2 parents 6849ee5 + ae06196 commit 97b51d1919fb391e0fbda85ac884a5d4855124d8 @bwoodhead bwoodhead committed Mar 15, 2012
Showing with 39 additions and 8 deletions.
  1. +34 −0 api/fedora_item.inc
  2. +5 −8 fedora_repository.solutionpacks.inc
View
34 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 {
View
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) {
$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,
);

0 comments on commit 97b51d1

Please sign in to comment.
Something went wrong with that request. Please try again.