|
|
@ -164,6 +164,30 @@ class Fedora_Item { |
|
|
|
return $returnvalue; |
|
|
|
return $returnvalue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Wrapper to add new or modify existing datastream |
|
|
|
|
|
|
|
* @global url $base_url |
|
|
|
|
|
|
|
* @param url $external_url |
|
|
|
|
|
|
|
* @param string $dsid |
|
|
|
|
|
|
|
* @param string $label |
|
|
|
|
|
|
|
* @param string $mime_type |
|
|
|
|
|
|
|
* @param string $controlGroup |
|
|
|
|
|
|
|
* @param boolean $force |
|
|
|
|
|
|
|
* @param string $logMessage |
|
|
|
|
|
|
|
* @param boolean $quiet |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function add_or_modify_by_reference($external_url, $dsid, $label, $mime_type, $controlGroup = 'M', $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) { |
|
|
|
|
|
|
|
global $base_url; |
|
|
|
|
|
|
|
if (array_key_exists($dsid, $this->datastreams)) { |
|
|
|
|
|
|
|
$this->modify_datastream_by_reference($external_url, $dsid, $label, $mime_type, $force, $logMessage, $quiet); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
$file_location = str_replace("$base_url/", '', $external_url); |
|
|
|
|
|
|
|
$this->add_datastream_from_file($file_location, $dsid, $label, $mime_type, $controlGroup = 'M', $logMessage = NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Add a relationship string to this object's RELS-EXT. |
|
|
|
* Add a relationship string to this object's RELS-EXT. |
|
|
|
* does not support rels-int yet. |
|
|
|
* does not support rels-int yet. |
|
|
@ -583,7 +607,6 @@ class Fedora_Item { |
|
|
|
return $relationships; |
|
|
|
return $relationships; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function get_models() { |
|
|
|
function get_models() { |
|
|
|
$relationships = array(); |
|
|
|
$relationships = array(); |
|
|
|
try { |
|
|
|
try { |
|
|
|