Skip to content

Instantly share code, notes, and snippets.

View jordandukart's full-sized avatar

Jordan Dukart jordandukart

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mods="http://www.loc.gov/mods/v3" exclude-result-prefixes="xs mods"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This xsl transform the University of Limerick I7 MODS xml to align with
the MODS profile supported by the base I7-to-I8 migrate configuration. -->
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
[
{
"provider_name": "23HQ",
"provider_url": "http:\/\/www.23hq.com",
"endpoints": [
{
"schemes": [
"http:\/\/www.23hq.com\/*\/photo\/*"
],
"url": "http:\/\/www.23hq.com\/23\/oembed"
@jordandukart
jordandukart / test.md
Last active January 4, 2018 16:08
README.md

XML Based CONTENTdm Migration

Introduction

Provides a framework for migrating content out of CONTENTdm and into Islandora given XML data mapped from an export from CONTENTdm.

This module extends the Islandora Batch framework and works in much the same way. The ingest is a two-step process:

@jordandukart
jordandukart / test.php
Created November 15, 2017 13:53
Example derivative
<?php
/**
* Implements hook_islandora_derivative().
*/
function test_islandora_derivative(AbstractObject $object) {
return array(
'source_dsid' => 'TEST',
'destination_dsid' => 'TEST',
'function' => 'test_test_derivative',
@jordandukart
jordandukart / filters.php
Created October 19, 2017 19:17
FQ filtering
<?php
$fqs_to_remove = array();
$compound_fq = variable_get('islandora_compound_object_solr_fq', '-RELS_EXT_isConstituentOf_uri_mt:*');
$fqs_to_remove[] = $compound_fq;
$query_params = drupal_get_query_parameters();
if (isset($query_params['cp'])) {
// XXX: Compound children aren't indexed with ancestor information so if
// a collection search is present in the URL remove the ancestors FQ when
// retrieving the first child.
diff --git a/islandora_solr_views_query.inc b/islandora_solr_views_query.inc
index 0500be4..cfcaf1e 100644
--- a/islandora_solr_views_query.inc
+++ b/islandora_solr_views_query.inc
@@ -130,9 +130,10 @@ class islandora_solr_views_query extends views_plugin_query {
if (isset($this->orderby)) {
module_load_include('inc', 'islandora_solr', 'includes/utilities');
// Populate sorting parameters.
- foreach ($this->orderby as $field => $order) {
- $params['sort'][] = islandora_solr_lesser_escape($field) . ' ' . $order;
mysql> SELECT * FROM jenkins_rb_documents LIMIT 1;
+--------+-----------+----------+------+------------+--------+------------+----------+---------------+--------------+-------------+--------+--------+-----+-----------+
| doc_id | doc_pages | doc_name | fid | microfiche | box_id | doc_volume | doc_part | trial_opinion | for_download | doc_type_id | src_id | nid | vid | timestamp |
+--------+-----------+----------+------+------------+--------+------------+----------+---------------+--------------+-------------+--------+--------+-----+-----------+
| 1 | NULL | | NULL | 1 | NULL | | NULL | 0 | 1 | 2 | 4 | 593728 | 0 | 0 |
+--------+-----------+----------+------+------------+--------+------------+----------+---------------+--------------+-------------+--------+--------+-----+-----------+
1 row in set (0.00 sec)
mysql> SELECT * FROM jenkins_rb_dockets LIMIT 1;
+-----+--------+--------+------------+-------------+
@jordandukart
jordandukart / gist:2a003fec492cb7df4513
Created January 28, 2016 20:58
XML form orphaning
/**
* Adds a tabs form element via AJAX.
*
* @param FormElement $element
* The element to add.
* @param array $form
* The Drupal form.
* @param array $form_state
* The Drupal form state.
*/
diff --git a/includes/workbench.inc b/includes/workbench.inc
index d8b0990..68a84d4 100644
--- a/includes/workbench.inc
+++ b/includes/workbench.inc
@@ -46,7 +46,6 @@ function emicdora_workbench_form($form, &$form_state) {
$form['add_critical_edition'] = array(
'#type' => 'submit',
'#value' => t('Add Critical Edition'),
- '#submit' => array('emicdora_workbench_add_critical_edition_redirect'),
'#access' => user_access(ISLANDORA_INGEST),
@jordandukart
jordandukart / gist:8923040
Created February 10, 2014 19:58
Islandora Groups DS Modify
<?php
/**
* Implements hook_islandora_datastream_ingested().
**/
function foo_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) {
if ($datastream->id == 'TECHMD') {
// Do things like changing the content of the DC datastream to blah.
if (isset($object['DC'])) {
$object['DC']->content = 'blah';
$object['DC']->label = 'My awesomely edited Dublin Core';