Skip to content

Instantly share code, notes, and snippets.

View terrywbrady's full-sized avatar

Terry Brady terrywbrady

View GitHub Profile
@terrywbrady
terrywbrady / XmluiThumbnailPermission.xsl
Created December 12, 2016 18:19
Evaluating the access rights for a Thumbnail in DSpace XMLUI
<xsl:template name="gu-thumbnail-link">
<xsl:param name="thumb" select="."/>
<xsl:param name="src"/>
<xsl:variable name="thumbmets" select="$EXTMETS//mets:fileSec/mets:fileGrp[@USE='THUMBNAIL']/mets:file[@GROUPID=$thumb/@GROUPID]"/>
<xsl:variable name="authid" select="$thumbmets/@ADMID"/>
<xsl:variable name="thumbauth" select="$EXTMETS//mets:rightsMD[@ID=$authid]"/>
<xsl:variable name="angrec" select="$thumbauth//metsrights:Context[@in-effect='true'][@CONTEXTCLASS='MANAGED GRP'][metsrights:UserName[text()=$GUCOMM]]"/>
<xsl:variable name="pubrec" select="$thumbauth//metsrights:Context[@in-effect='true'][@CONTEXTCLASS='GENERAL PUBLIC']"/>
<xsl:choose>
function isbnLookup(id) {
var url = "https://www.googleapis.com/books/v1/volumes?country=US&q=isbn:"+id;
var options = {contentType : "application/json"};
var resp = UrlFetchApp.fetch(url, options);
if (resp == null || resp == "") return "N/A";
var respdata = JSON.parse(resp.getContentText());
if (respdata["items"].length == 0) return "Not found";
return respdata["items"][0]["volumeInfo"]["title"];
}
@terrywbrady
terrywbrady / sample.xsl
Created October 3, 2016 23:25
Show Orcid with XMLUI
<!--
display item summary info
$notLast and $sep are used to control the display of multiple authors
-->
<xsl:when test="@element='contributor' and @qualifier='author' and @authority">
<xsl:variable name="a">
<xsl:value-of select="."/>
<xsl:call-template name="ORCID">
<xsl:with-param name="uuid" select='@authority'/>
@terrywbrady
terrywbrady / PdfBitstreamsPerCollection.sql
Created September 16, 2016 21:02
DSpace 5 vs DSpace 6 Queries
//DSpace 5
select
h.handle,
rp.policy_id,
bit.sequence_id,
bitmv.text_value,
bit.internal_id,
brp.policy_id
from handle h
join item i
@terrywbrady
terrywbrady / Screenshot.jpg
Last active July 25, 2016 21:04
Sierra Barcode Report
Screenshot.jpg
@terrywbrady
terrywbrady / Shema.Org_ForXMLUI.md
Last active September 19, 2022 17:25
Schema.org microtags in XMLUI
@terrywbrady
terrywbrady / Field.java
Last active August 29, 2015 14:16
Dump DSpace Metadata Registry As JSON
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.ctask.georgetown;
/**
@terrywbrady
terrywbrady / summon-customize.js
Last active August 29, 2015 14:14
Group Summon Results: Online, GU, Consortium
This sample code has been migrated to https://github.com/Georgetown-University-Libraries/SummonCustomization
@terrywbrady
terrywbrady / SolrLoggerSpecial.java
Created January 21, 2015 20:02
DSpace Special code to run stats-util -s that forces new id/version values
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.statistics;
import au.com.bytecode.opencsv.CSVReader;
@terrywbrady
terrywbrady / ExceptionReprot.java
Last active August 29, 2015 14:11
DSpace Curation Task - Exception Report
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.ctask.georgetown;
import java.io.IOException;