diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 408b2604..698e5d42 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -178,7 +178,10 @@ class ObjectHelper { if ($curl_stat !== FALSE) { $info = curl_getinfo($ch); - + // Fixes an IE issue (ISLANDORA-311) + // http://support.microsoft.com/kb/316431 + drupal_set_header("Cache-Control: private", TRUE); + //Set what headers we can... if ($mimeType = $info['content_type']) { drupal_set_header("Content-Type: $mimeType"); diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 6935d448..20a48cc0 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -158,7 +158,7 @@ class Fedora_Item { // Fedora has some problems getting files from HTTPS connections sometimes, so if we are getting a file // from the local drupal, we try to pass a HTTP url instead of a HTTPS one. - if(stripos($datastream_url, 'https://') !== FALSE && stripos($datastream_url, $base_url) !== FALSE) { + if (stripos($datastream_url, 'https://') !== FALSE && stripos($datastream_url, $base_url) !== FALSE) { $datastream_url = str_ireplace('https://', 'http://', $datastream_url); } @@ -397,15 +397,15 @@ RDF; $rels = $relsextxml->getElementsByTagNameNS($namespaceURI, $relationship); if (!empty($rels)) { // iterate backwards so if we delete something our pointer doesn't get out of sync - for ($i = $rels->length; $i>0; $i--) { - $rel = $rels->item($i-1); + for ($i = $rels->length; $i > 0; $i--) { + $rel = $rels->item($i - 1); // foreach ($rels as $rel) { // moving forward like this caused iteration errors when something was deleted - if ( //If either no object is specified, or the object matches (in either the literal or URI case), remove this node from it's parent, and mark as changed. - empty($object) || - (($literal_value == RELS_TYPE_URI) && $rel->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource') == $object) || - (($literal_value == RELS_TYPE_PLAIN_LITERAL) && $rel->textContent == $object) || - (($literal_value == RELS_TYPE_STRING) && $rel->getAttribute('rdf:datatype') == 'http://www.w3.org/2001/XMLSchema#string' && $rel->textContent == $object) || - (($literal_value == RELS_TYPE_INT) && $rel->getAttribute('rdf:datatype') == 'http://www.w3.org/2001/XMLSchema#int' && intval($rel->textContent) == $object)) { + if (//If either no object is specified, or the object matches (in either the literal or URI case), remove this node from it's parent, and mark as changed. + empty($object) || + (($literal_value == RELS_TYPE_URI) && $rel->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource') == $object) || + (($literal_value == RELS_TYPE_PLAIN_LITERAL) && $rel->textContent == $object) || + (($literal_value == RELS_TYPE_STRING) && $rel->getAttribute('rdf:datatype') == 'http://www.w3.org/2001/XMLSchema#string' && $rel->textContent == $object) || + (($literal_value == RELS_TYPE_INT) && $rel->getAttribute('rdf:datatype') == 'http://www.w3.org/2001/XMLSchema#int' && intval($rel->textContent) == $object)) { $rel->parentNode->removeChild($rel); $modified = TRUE; } @@ -857,8 +857,26 @@ RDF; return $relationships; } - function get_rdf_relationships() { + /** + * Retrieves RELS-EXT values from item + * + * @param array $namespaces + * @return array + */ + function get_rdf_relationships($namespaces = null) { + if ($namespaces == NULL) { + $namespaces = array( + RELS_EXT_URI, + FEDORA_MODEL_URI, + ISLANDORA_PAGE_URI, + ISLANDORA_RELS_EXT_URI, + ISLANDORA_RELS_INT_URI, + ); + } + if (!is_array($namespaces)) { + $namespaces = array($namespaces); + } $relationships = array(); try { $relsext = $this->get_datastream_dissemination('RELS-EXT'); @@ -872,13 +890,16 @@ RDF; $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 ($namespaces as $namespace) { + $allTags[] = $relsextxml->getElementsByTagNameNS($namespace, '*'); + } + 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')); - + $value = preg_replace('/info:fedora\//', '', $child->getAttributeNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'resource')); + if (!$value) { + $value = $child->textContent; + } $relationships[$child->tagName][] = $value; } } @@ -1085,9 +1106,9 @@ RDF; $params = array( 'pid' => $this->pid, - 'ownerId' => (($ownerId !== NULL)? //Default to the current owner if none is provided. - $ownerId: - $this->objectProfile->objOwnerId), + 'ownerId' => (($ownerId !== NULL) ? //Default to the current owner if none is provided. + $ownerId : + $this->objectProfile->objOwnerId), 'state' => $state, 'label' => $label, 'logMessage' => $logMessage @@ -1121,32 +1142,32 @@ RDF; $components = explode('/', $parsed_url['path']); $components = array_map('rawurlencode', $components); $fixed_url = url( - t( - '!scheme://!user:!pass@!host:!port/!path', - array( - '!scheme' => $parsed_url['scheme'], - '!user' => rawurlencode($parsed_url['user']), - '!pass' => rawurlencode($parsed_url['pass']), - '!host' => $parsed_url['host'], - '!port' => $parsed_url['port'], - '!path' => implode('/', $components), - ) - ), - array( - 'query' => $parsed_url['query'], - 'fragment' => $parsed_url['fragment'], - ) + t( + '!scheme://!user:!pass@!host:!port/!path', + array( + '!scheme' => $parsed_url['scheme'], + '!user' => rawurlencode($parsed_url['user']), + '!pass' => rawurlencode($parsed_url['pass']), + '!host' => $parsed_url['host'], + '!port' => $parsed_url['port'], + '!path' => implode('/', $components), + ) + ), + array( + 'query' => $parsed_url['query'], + 'fragment' => $parsed_url['fragment'], + ) ); $result = drupal_http_request($fixed_url); - if ((int)($result->code / 100) === 2) { + if ((int) ($result->code / 100) === 2) { $content = $result->data; } else { watchdog('fedora_repository', 'Failed making HTTP request to @URL. Info: @info', array( '@URL' => $fixed_url, '@info' => print_r($result, TRUE), - ), 'warning'); + ), 'warning'); } } @@ -1253,7 +1274,7 @@ RDF; // Fedora has some problems getting files from HTTPS connections sometimes, so if we are getting a file // from the local drupal, we try to pass a HTTP url instead of a HTTPS one. - if(stripos($external_url, 'https://') !== FALSE && stripos($external_url, $base_url) !== FALSE) { + if (stripos($external_url, 'https://') !== FALSE && stripos($external_url, $base_url) !== FALSE) { $external_url = str_ireplace('https://', 'http://', $external_url); } @@ -1333,10 +1354,10 @@ RDF; self::$connection_helper = new ConnectionHelper(); } $url = ( - in_array($function, self::$SoapManagedFunctions)? - variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M') : - variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl') - ); + in_array($function, self::$SoapManagedFunctions) ? + variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/wsdl?api=API-M') : + variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl') + ); try { $soap_client = self::$connection_helper->getSoapClient($url); if (isset($soap_client)) { diff --git a/plugins/fedora_imageapi.info b/plugins/fedora_imageapi.info index cbd6b2ae..8f2ea90b 100644 --- a/plugins/fedora_imageapi.info +++ b/plugins/fedora_imageapi.info @@ -3,5 +3,7 @@ description = Adds image manipulation support through a REST interface package = Islandora Dependencies dependencies[] = fedora_repository dependencies[] = imageapi + version = 6.x-dev + core = 6.x diff --git a/plugins/qt_viewer.inc b/plugins/qt_viewer.inc index 74f34a3e..d02b7a6d 100644 --- a/plugins/qt_viewer.inc +++ b/plugins/qt_viewer.inc @@ -151,7 +151,7 @@ class ShowQtStreamsInFieldSets { 'poster' => array( '#type' => 'markup', '#value' => theme('image', "fedora/repository/{$this->pid}/{$pframe->ID}/poster.jpg", '', '', NULL, FALSE) - ) + ), 'play' => array( '#type' => 'markup', '#prefix' => '
', @@ -167,7 +167,7 @@ class ShowQtStreamsInFieldSets { '#value' => l(t('Download Media File'), "fedora/repository/{$this->pid}/OBJ/MOV.mov", array('attributes' => array('class' => 'download'))), ); } - $src = url("fedora/repository/{$this->pid}/{$media->ID}/MOV.mov"; + $src = url("fedora/repository/{$this->pid}/{$media->ID}/MOV.mov"); $qtparams = "'autostart', '" . ($pframe !== FALSE ? 'TRUE' : 'FALSE') . "', "; $init = <<