Browse Source

Merge branch '6.x' of github.com:Islandora/islandora into 6.x

pull/91/head
Ben Woodhead 13 years ago
parent
commit
fc4d9b4b78
  1. 3
      ObjectHelper.inc
  2. 2
      api/fedora_item.inc
  3. 16
      fedora_repository.module

3
ObjectHelper.inc

@ -122,8 +122,7 @@ class ObjectHelper {
$dsID = variable_get('fedora_default_display_dsid', 'TN'); $dsID = variable_get('fedora_default_display_dsid', 'TN');
$mimeType = 'image/jpeg'; $mimeType = 'image/jpeg';
} }
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/objects/' . $pid . '/datastreams/' . $dsID . '/content';
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora') . '/get/' . $pid . '/' . $dsID;
if ($version) { if ($version) {
$url .= '/' . $version; //drupal_urlencode($version); $url .= '/' . $version; //drupal_urlencode($version);
} }

2
api/fedora_item.inc

@ -59,7 +59,7 @@ class Fedora_Item {
self::$connection_helper = new ConnectionHelper(); self::$connection_helper = new ConnectionHelper();
} }
$raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => "")); $raw_objprofile = $this->soap_call('getObjectProfile', array('pid' => $this->pid, 'asOfDateTime' => ""), TRUE);
if (!empty($raw_objprofile)) { if (!empty($raw_objprofile)) {
$this->objectProfile = $raw_objprofile->objectProfile; $this->objectProfile = $raw_objprofile->objectProfile;

16
fedora_repository.module

@ -617,7 +617,7 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) {
* @param type $collectionName * @param type $collectionName
* @return type * @return type
*/ */
function fedora_repository_replace_stream($pid, $dsId, $dsLabel, $collectionName = NULL) { function fedora_repository_replace_stream($pid, $dsId, $dsLabel = '', $collectionName = NULL) {
if ($pid == NULL || $dsId == NULL) { if ($pid == NULL || $dsId == NULL) {
drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error'); drupal_set_message(t('You must specify an pid and dsId to replace.'), 'error');
return ''; return '';
@ -707,8 +707,20 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
$dformat = $mimetype->getType($file->filepath); $dformat = $mimetype->getType($file->filepath);
$item = new Fedora_Item($pid); $item = new Fedora_Item($pid);
$info = $item->get_datastream_info($dsid);
$item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat); if($info->datastream->controlGroup == 'M') {
$item->modify_datastream_by_reference($streamUrl, $dsid, $dsLabel, $dformat);
} elseif ($info->datastream->controlGroup == 'X') {
if($dformat == 'text/xml') {
$item->modify_datastream_by_value(file_get_contents($file->filepath), $dsid, $dsLabel, $dformat);
}
else {
drupal_set_message('File must be of mimetype text/xml in order to replace inline XML datastream.', 'error');
}
} else {
drupal_set_message('Cannot replace Redirect or Managed Datastream.', 'error');
}
$form_state['redirect'] = 'fedora/repository/' . $pid; $form_state['redirect'] = 'fedora/repository/' . $pid;
} }

Loading…
Cancel
Save