Skip to content

Instantly share code, notes, and snippets.

View LincolnUniLTL's full-sized avatar

Lincoln University Library, Teaching, and Learning LincolnUniLTL

View GitHub Profile
@LincolnUniLTL
LincolnUniLTL / formviewer.js
Created July 28, 2014 20:27
Browser bookmarklet to show hidden forms on a webpage
javascript:(function(){var%20forms=document.getElementsByTagName('form');for(i=0;i<forms.length;i++){forms[i].style.display='block';}})();
@LincolnUniLTL
LincolnUniLTL / login.html
Last active September 15, 2023 12:43
Dual (or more) authentication method login form
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-NZ" lang="en-NZ">
<head>
<title>Electronic resource login</title>
<style type="text/css">
@LincolnUniLTL
LincolnUniLTL / symplectic_xwalks_lincoln_custom.xsl
Created June 11, 2014 23:55
Our Symplectic Elements Repository Tools crosswalk custom templates
<?xml version="1.0" encoding="utf-8"?>
<!-- Lincoln override templates for Elements crosswalk transforms -->
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:crosswalks="info:symplectic/crosswalks"
xmlns:pubs="http://www.symplectic.co.uk/publications/atom-api"
version="1.0"
>
@LincolnUniLTL
LincolnUniLTL / pubitem.pl
Last active October 27, 2017 15:23
Get or set Symplectic Elements publication item metadata using the Elements API
#! /usr/bin/perl
# *********************************************************
# Invoke the Symplectic Elements API with a get or set call
# to a publication item
# (/{cat}/records/{source}/{proprietary-id} API method)
# using either HTTP GET or PUT (set) depending on arguments.
# Usage:
# - get/dump : pubitem.pl $id
# - set/amend: pubitem.pl $id $xmlfile
@LincolnUniLTL
LincolnUniLTL / DHandle.sql
Created April 14, 2014 02:38
DSpace handle returning function
-- PostgresSQL pure SQL function to return handle, given an id
-- assumes handle is uniquely in element "identifier(.uri)", uncomment non-standard uri qualifier to enforce that
CREATE OR REPLACE FUNCTION DHandle(p_id INTEGER) RETURNS text AS $$
SELECT text_value
FROM metadatavalue V, metadatafieldregistry R
WHERE R.metadata_field_id = V.metadata_field_id
AND element ILIKE 'identifier'
-- AND qualifier ILIKE 'uri'
AND item_id=$1;
@LincolnUniLTL
LincolnUniLTL / DMeta.sql
Last active April 18, 2016 14:17
DSpace metadata discovery utilities
-- Function to query metadata values and return table, all parameters optional
/* Example usages:
SELECT DMeta( 4317 ); -- all metadata for Item 4317 as a single column with results in a set
SELECT * FROM DMeta( 4317 ); -- all metadata for Item 4317 with results as a table
SELECT * FROM DMeta(); -- all metadata as a table
SELECT * FROM DMeta( NULL, 'dc.date.issued' ); -- all metadata using qualified element 'dc.date.issued'
SELECT "value" FROM DMeta( 4317, 'dc.subject' ); -- all metadata values for Item 4317 using element 'dc.subject'
SELECT * FROM DMeta( 4317, 'dc.subject', 'corporate' ); -- all metadata records for Item 4317 where 'dc.subject' contains "corporate"
SELECT * FROM DMeta( NULL, NULL, 'corporate' ); -- all metadata records with value containing "corporate"
*/