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
mport org.marc4j.MarcReader; | |
import org.marc4j.MarcStreamReader; | |
import org.marc4j.marc.Record; | |
import org.marc4j.marc.DataField; | |
import org.marc4j.MarcWriter; | |
import org.marc4j.MarcStreamWriter; | |
import org.marc4j.marc.MarcFactory; |
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
# This edits the archivesspace mysql database to pull out indicator_1 vales in the | |
# container table that have "XX.YY" values. | |
# the indicator_1 and indicator_2 values are updated to be indicator_1 = XX and | |
# indicator_2 = YY, with a type_1 = box and type_2 = folder. | |
# all other container values are copied over as is. | |
# Containers with indicator_1 that do not have "." in them are left as-is. | |
# AS ALWAYS!!! MAKE A BACKUP OF YOUR DB BEFORE YOU DO THIS AND THEN CHECK IF THIS | |
# DID WHAT YOU WANTED!!! |
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
class CommonIndexer | |
add_indexer_initialize_hook do |indexer| | |
indexer.add_document_prepare_hook do |doc, record| | |
doc['fullrecord'] = CommonIndexer.extract_string_values(record) | |
%w(finding_aid_subtitle finding_aid_author).each do |field| | |
if record['record'].has_key?(field) | |
doc['fullrecord'] << "#{record['record'][field]} " | |
end |
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
{ | |
"@context": "http://iiif.io/api/presentation/2/context.json", | |
"@id": "http://loris-dev.dlts.org/loris//manifest.json", | |
"@type": "sc:Manifest", | |
"label": "NYU Example", | |
"thumbnail": "http://loris-dev.dlts.org/loris/AD-MC-002_ref1000_n000001_m.tif/full/!200,200/0/default.jpg", | |
"viewingHint": "paged", | |
"metadata": [ | |
{ | |
"Foo": "Bar" |
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
require 'uri' | |
require 'fileutils' | |
require 'iiif/presentation' | |
require 'json' | |
collection = nil | |
@base = "http://loris-dev.dlts.org/loris/" | |
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
# plugins/local/public/plugin_init.rb | |
Rails.application.config.after_initialize do | |
SearchController.class_eval do | |
private | |
def set_search_criteria | |
@criteria = params.select{|k,v| |
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" standalone="yes"?> | |
<collection xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<record> | |
<leader>00000npc a2200000 u 4500</leader> | |
<controlfield tag="008">081112i19002007xx eng d</controlfield> | |
<datafield tag="040" ind2=" " ind1=" "> | |
<subfield code="a">NyNyUA</subfield> | |
<subfield code="b">eng</subfield> | |
<subfield code="c">NyNyUA</subfield> | |
<subfield code="e">dacs</subfield> |
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
<%# This would go into views/welcome/index.html.erb %> | |
<%= setup_context :title => "Home", :suppress_breadcrumb => true %> | |
<div class="row"> | |
<div class="col-md-12"> | |
<%= render_aspace_partial :partial => "shared/flash_messages" %> | |
</div> | |
<div class="col-md-12" style="padding: 30px;"> | |
<h1><%= I18n.t "welcome.heading" %></h1> |
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
require 'net/http' | |
class Net::HTTP | |
singleton_class.send(:alias_method, :start_orig, :start) | |
class << self | |
def start(address, *arg, &block) | |
opt = Hash.try_convert(arg[-1]) ? arg.pop : {} | |
opt[:use_ssl] = ( [ 443, 8443 ].include?(arg.first) ) | |
arg << opt |
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
# to do integration tests with rack-cas, you have to use the FakeCas middleware, which intercepts CAS redirects and | |
# displays a "fake CAS" login form. This form will give a token to anything, but it has to be a user that's in the | |
# DB for the application to log the user in. | |
# To set this up, add | |
# config/environments/test.rb : | |
# config.rack_cas.fake_attributes = { 'admin': { "admin": true, "cas_directory_id": "admin", "name": "admin" } } | |
# test/test_helper.rb: | |
# require 'capybara/rails' |