Browse Source

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

pull/155/head
Alan Stanley 12 years ago
parent
commit
93b8a02bfd
  1. 4
      CollectionClass.inc
  2. 16
      api/fedora_item.inc
  3. 4
      api/tuque.inc
  4. 3
      fedora_repository.module
  5. 14
      xsl/sparql_to_html.xsl

4
CollectionClass.inc

@ -54,13 +54,11 @@ class CollectionClass {
}
protected static function getDefaultCollectionQuery($pid) {
return 'select $object $title $content from <#ri>
return 'select $object $title from <#ri>
where ($object <fedora-model:label> $title
and $object <fedora-model:hasModel> $content
and ($object <fedora-rels-ext:isMemberOfCollection> <info:fedora/' . $pid . '>
or $object <fedora-rels-ext:isMemberOf> <info:fedora/' . $pid . '>)
and $object <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>
order by $title';
}

16
api/fedora_item.inc

@ -980,7 +980,9 @@ RDF;
$params = array(
'pid' => $this->pid,
'ownerId' => $ownerId,
'ownerId' => (($ownerId !== NULL)? //Default to the current owner if none is provided.
$ownerId:
$this->objectProfile->objOwnerId),
'state' => $state,
'label' => $label,
'logMessage' => $logMessage
@ -1116,7 +1118,9 @@ RDF;
$created_temp = TRUE;
}
$file_url = file_create_url($file);
$parts = explode(DIRECTORY_SEPARATOR, $file);
$parts = array_map('rawurlencode', $parts);
$file_url = file_create_url(implode(DIRECTORY_SEPARATOR, $parts));
$toReturn = $this->modify_datastream_by_reference($file_url, $dsid, $label, $mime_type, $force, $logMessage);
@ -1140,6 +1144,14 @@ RDF;
* @return type
*/
function modify_datastream_by_reference($external_url, $dsid, $label, $mime_type, $force = FALSE, $logMessage = 'Modified by Islandora API', $quiet=FALSE) {
global $base_url;
// 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) {
$external_url = str_ireplace('https://', 'http://', $external_url);
}
$params = array(
'pid' => $this->pid,
'dsID' => $dsid,

4
api/tuque.inc

@ -2,7 +2,7 @@
$islandora_module_path = drupal_get_path('module', 'fedora_repository');
//do this until we expost these in a module or library
//do this until we export these in a module or library
@include_once 'sites/all/libraries/tuque/Datastream.php';
@include_once 'sites/all/libraries/tuque/FedoraApi.php';
@include_once 'sites/all/libraries/tuque/FedoraApiSerializer.php';
@ -67,7 +67,7 @@ class IslandoraTuque {
}
if (!isset($url)) {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
$url = variable_get('fedora_base_url', 'http://localhost:8080/fedora');
}
if(self::exists()) {

3
fedora_repository.module

@ -797,8 +797,9 @@ function fedora_repository_edit_qdc_form(&$form_state, $pid, $dsId = NULL) {
// There is no custom function, so just load the standard QDC form.
$metaDataForm = new formClass();
//currently we only edit the dc metadata. If you defined a custom form with a custom handler you are sol for now.
return $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state);
$output = $metaDataForm->createMetaDataForm($pid, $dsId, $client, $form_state);
}
return $output;
}

14
xsl/sparql_to_html.xsl

@ -90,8 +90,6 @@
<xsl:template match="s:result">
<xsl:variable name='OBJECTURI' select="s:object/@uri"/>
<xsl:variable name='CONTENTURI' select="s:content/@uri"/>
<xsl:variable name='CONTENTMODEL' select="substring-after($CONTENTURI,'/')"/>
<xsl:variable name='PID' select="substring-after($OBJECTURI,'/')"/>
<xsl:variable name="newTitle" >
<xsl:call-template name="replace-string">
@ -103,17 +101,9 @@
<xsl:variable name="cleanTitle" select="php:functionString('fedora_repository_urlencode_string', $newTitle)"/>
<xsl:variable name="linkUrl">
<xsl:choose>
<xsl:when test="($CONTENTMODEL='islandora:collectionCModel')">
<xsl:value-of select="php:functionString('url', concat('fedora/repository/', $PID, '/-/collection'))"/>
</xsl:when>
<xsl:otherwise>
<!--the below is an example of going straight to a datastream instead of the details page.
<xsl:value-of select="$BASEURL"/>/fedora/repository/<xsl:copy-of select="$PID"/>/OBJ/<xsl:value-of select="s:title"/>-->
<xsl:value-of select="php:functionString('url', concat('fedora/repository/', $PID))"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="s:content"/>
</xsl:variable>
<td valign="top" width="25%">
<a>

Loading…
Cancel
Save