This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = <<<EOQ | |
SELECT ?pid | |
FROM <#ri> | |
WHERE { | |
?pid <fedora-rels-ext:isMemberOfCollection> <info:fedora/enter-collection-pid-here>; | |
} | |
EOQ; | |
$connection = islandora_get_tuque_connection(); | |
$results = $connection->repository->ri->sparqlQuery($query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:dcterms="http://purl.org/dc/terms/" | |
xmlns:dwr="http://rs.tdwg.org/dwc/xsd/simpledarwincore/" | |
xmlns:java="http://xml.apache.org/xalan/java" xmlns:dwc="http://rs.tdwg.org/dwc/terms/" | |
exclude-result-prefixes="dwc foxml java dwr dcterms"> | |
<!-- HashSet to track single-valued fields. --> | |
<xsl:variable name="dwc_single_valued_hashset" select="java:java.util.HashSet.new()"/> | |
<xsl:template match="foxml:datastream[@ID='DWC']/foxml:datastreamVersion[last()]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function renderText($results) { | |
module_load_include('inc', 'islandora', 'includes/utilities'); | |
$facet_field = $this->facet_field; | |
$islandora_solr_query = self::$islandoraSolrQuery; | |
$soft_limit = self::$soft_limit; | |
$buckets = array(); | |
foreach ($results as $key => $values) { | |
$bucket = $values['bucket']; | |
if (variable_get('islandora_solr_facet_replace_pid', FALSE) && islandora_is_valid_pid($bucket)) { | |
if ($object = islandora_object_load($bucket)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:if test="not(concat($prefix, local-name()) = $this_prefix)"> | |
<xsl:if test="not(normalize-space($textValue)='')"> | |
<field> | |
<xsl:attribute name="name"> | |
<xsl:value-of select="concat($prefix, local-name(), '_mdt')"/> | |
</xsl:attribute> | |
<xsl:value-of select="$textValue"/> | |
</field> | |
</xsl:if> | |
<xsl:if test="not(normalize-space($rawTextValue)='')"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function <theme name>_preprocess_islandora_solr(&$vars) { | |
foreach($vars['results'] as &$doc) { | |
if(isset($doc['some key that only nodes have'])) { | |
$doc['thumbnail'] = 'static or node image'; | |
$doc['object_url'] = 'url for node'; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function islandora_default_preprocess_page(&$vars) { | |
$front = (isset($vars['is_front']) ? $vars['is_front'] : FALSE); | |
$type = (isset($vars['node']->type) ? $vars['node']->type : NULL); | |
if(!$front) { | |
switch ($type) { | |
case 'collection': | |
case 'exhibit': | |
case 'formats': | |
case 'partners': | |
case 'places': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function yourthemename_preprocess_islandora_video(&$variables) { | |
$viewer_dsid = 'MP4'; | |
$object = $variables['object']; | |
$video_params = array( | |
'pid' => $object->id, | |
); | |
if (isset($object[$viewer_dsid]) && islandora_datastream_access(FEDORA_VIEW_OBJECTS, $object[$viewer_dsid])) { | |
$video_url = url("islandora/object/{$object->id}/datastream/$viewer_dsid/view"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$results_sorted = array(); | |
foreach ($results as $key => $row) { | |
$results_sorted[$key] = $row['bucket']; | |
} | |
$results_sorted = array_map('strtolower', $results_sorted); | |
array_multisort($results_sorted, SORT_ASC, $results); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess(). | |
*/ | |
function your_theme_preprocess_islandora_basic_image(&$variables) { | |
mods_metadata($variables); | |
} | |
/* | |
* Use a MODS to HTML xslt for the metadata fieldset | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avessey@vassardev:~/temp$ git clone git://github.com/Islandora/islandora_gsearch_extensions.git | |
Cloning into 'islandora_gsearch_extensions'... | |
remote: Counting objects: 6, done. | |
remote: Compressing objects: 100% (3/3), done. | |
remote: Total 6 (delta 0), reused 6 (delta 0) | |
Receiving objects: 100% (6/6), done. | |
avessey@vassardev:~/temp$ cd islandora_gsearch_extensions/ | |
avessey@vassardev:~/temp/islandora_gsearch_extensions$ javac -cp "/usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/lib/*:/usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes" ca/upei/roblib/DataStreamForXSLT.java | |
Note: ca/upei/roblib/DataStreamForXSLT.java uses unchecked or unsafe operations. | |
Note: Recompile with -Xlint:unchecked for details. |
NewerOlder