Browse Source

Added abiltiy to force reinstallation of fedora objects

pull/82/head
Alan Stanley 13 years ago
parent
commit
6f2442e96b
  1. 29
      api/fedora_item.inc
  2. 22
      fedora_repository.solutionpacks.inc

29
api/fedora_item.inc

@ -611,6 +611,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 {

22
fedora_repository.solutionpacks.inc

@ -143,13 +143,21 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
else {
$form['install_status']['#value'] = theme_image('misc/watchdog-warning.png') . t('Some objects must be re-ingested. See Objects list for details.');
}
$form['submit'] = array(
'#value' => t('Install'),
'#disabled' => !$needs_install && !$needs_update,
'#type' => 'submit',
'#name' => $solution_pack_module,
);
if ($need_install || $needs_update) {
$form['submit'] = array(
'#value' => t('Install'),
'#type' => 'submit',
'#name' => $solution_pack_module,
);
}
else {
$form['force_submit'] = array(
'#value' => t('Forced Reinstall'),
'#attributes' => array('title' => ('Installs all fedora objects, reverting any changes made since installation. Use with caution.')),
'#type' => 'submit',
'#name' => $solution_pack_module,
);
}
$form['#submit'] = array(
'fedora_repository_solution_pack_form_submit',
);

Loading…
Cancel
Save