Sha256: 615a1170933e3ccf400f82d57ab828d4ec5a9d331996e2e37f1a1b41205c95dc
Contents?: true
Size: 560 Bytes
Versions: 60
Compression:
Stored size: 560 Bytes
Contents
require 'rest-client' handler = Class.new do def fetch(prefix, identifier) client = RestClient::Resource.new(Dor::Config.metadata.catalog.url) client["?#{prefix.chomp}=#{identifier.chomp}"].get end def label(metadata) mods = Nokogiri::XML(metadata) mods.root.add_namespace_definition('mods', 'http://www.loc.gov/mods/v3') mods.xpath('/mods:mods/mods:titleInfo[1]').xpath('mods:title|mods:nonSort').collect { |n| n.text }.join(' ').strip end def prefixes %w(catkey barcode) end end Dor::MetadataService.register(handler)
Version data entries
60 entries across 60 versions & 1 rubygems