|
|
|
@ -389,11 +389,12 @@ RDF;
|
|
|
|
|
* Whether or not this operation has produced any changes in the RELS-EXT |
|
|
|
|
*/ |
|
|
|
|
function purge_relationships($relationship, $object, $namespaceURI = RELS_EXT_URI, $literal_value = FALSE) { |
|
|
|
|
$relsext = $this->get_datastream_dissemination('RELS-EXT'); |
|
|
|
|
$relsext = trim($this->get_datastream_dissemination('RELS-EXT')); |
|
|
|
|
|
|
|
|
|
$relsextxml = new DomDocument(); |
|
|
|
|
$relsextxml->loadXML($relsext); |
|
|
|
|
$relsextxml = new DOMDocument(); |
|
|
|
|
$modified = FALSE; |
|
|
|
|
|
|
|
|
|
if ($relsext && $relsextxml->loadXML($relsext)) { |
|
|
|
|
$rels = $relsextxml->getElementsByTagNameNS($namespaceURI, $relationship); |
|
|
|
|
if (!empty($rels)) { |
|
|
|
|
// iterate backwards so if we delete something our pointer doesn't get out of sync |
|
|
|
@ -416,7 +417,7 @@ RDF;
|
|
|
|
|
if ($modified) { |
|
|
|
|
$this->modify_datastream($relsextxml->saveXML(), 'RELS-EXT', "Fedora Object-to-Object Relationship Metadata", 'text/xml'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//Return whether or not we've introduced any changes. |
|
|
|
|
return $modified; |
|
|
|
|
} |
|
|
|
@ -433,11 +434,11 @@ RDF;
|
|
|
|
|
$dsid = $f_prefix . $this->pid . '/' . $dsid; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$relsint = $this->get_datastream_dissemination('RELS-INT'); |
|
|
|
|
|
|
|
|
|
$relsxml = new DOMDocument(); |
|
|
|
|
$relsxml->loadXML($relsint); |
|
|
|
|
$relsint = trim($this->get_datastream_dissemination('RELS-INT')); |
|
|
|
|
$modified = FALSE; |
|
|
|
|
if ($relsint && $relsxml->loadXML($relsint)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$descs = $relsxml->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description'); |
|
|
|
|
$description = NULL; |
|
|
|
@ -467,11 +468,11 @@ RDF;
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Save changes. |
|
|
|
|
if ($modified) { |
|
|
|
|
$this->modify_datastream($relsxml->saveXML(), 'RELS-INT', "Fedora Datastream Relationship Metadata", 'text/xml'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Return whether or not we've introduced any changes. |
|
|
|
|
return $modified; |
|
|
|
|