dor-services 5.17.2 → 5.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 909b3c0e3cd70327c8c654a683fcff6104e65ccf
|
|
4
|
+
data.tar.gz: 16aec03de432570223cf31f8f70e24ae37323517
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ffec7bd43758242bd733c224e8da84cabd1ef97d5ace802602405cf89d11208d150ea206eb2767f637769bd4ebd780118d0d2301cd690ad0c3c3587543b7d54
|
|
7
|
+
data.tar.gz: 5e8ef10484c3df919d0a2a30d542697c1e0849ec9a8e4b9f68bb015b4bdaddac84e11a9c6ae54d3dbf85ddcd0fd0c7044d3b76f56db9f2d291a7d207be555924
|
|
@@ -8,7 +8,7 @@ module Dor
|
|
|
8
8
|
# Compute the thumbnail for this object following the rules at https://consul.stanford.edu/display/chimera/The+Rules+of+Thumb
|
|
9
9
|
# @return [String] the computed thumb filename, with the druid prefix and a slash in front of it, e.g. oo000oo0001/filenamewith space.jp2
|
|
10
10
|
def thumb
|
|
11
|
-
return
|
|
11
|
+
return unless respond_to?(:contentMetadata) && !contentMetadata.nil?
|
|
12
12
|
cm = contentMetadata.ng_xml
|
|
13
13
|
mime_type_finder = "@mimetype='image/jp2' or @mimeType='image/jp2'" # allow the mimetype attribute to be lower or camelcase when searching to make it more robust
|
|
14
14
|
thumb_image=nil
|
data/lib/dor/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dor-services
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.17.
|
|
4
|
+
version: 5.17.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Klein
|
|
@@ -14,7 +14,7 @@ authors:
|
|
|
14
14
|
autorequire:
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
|
-
date: 2016-11-
|
|
17
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: active-fedora
|
|
@@ -642,7 +642,6 @@ files:
|
|
|
642
642
|
- lib/dor/services/indexing_service.rb
|
|
643
643
|
- lib/dor/services/merge_service.rb
|
|
644
644
|
- lib/dor/services/metadata_handlers/catalog_handler.rb
|
|
645
|
-
- lib/dor/services/metadata_handlers/mdtoolkit_handler.rb
|
|
646
645
|
- lib/dor/services/metadata_service.rb
|
|
647
646
|
- lib/dor/services/registration_service.rb
|
|
648
647
|
- lib/dor/services/reset_workspace_service.rb
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require 'nokogiri'
|
|
2
|
-
require 'rest-client'
|
|
3
|
-
|
|
4
|
-
handler = Class.new do
|
|
5
|
-
def fetch(prefix, identifier)
|
|
6
|
-
query = <<-QUERY
|
|
7
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
8
|
-
<query xmlns="http://exist.sourceforge.net/NS/exist">
|
|
9
|
-
<text>
|
|
10
|
-
collection('orbeon/fr')[contains(base-uri(), "#{identifier}")]
|
|
11
|
-
</text>
|
|
12
|
-
</query>
|
|
13
|
-
QUERY
|
|
14
|
-
client = RestClient::Resource.new(Dor::Config.metadata.exist.url)
|
|
15
|
-
response = client['db'].post(query, :content_type => 'application/xquery')
|
|
16
|
-
doc = Nokogiri::XML(response)
|
|
17
|
-
doc.root.add_namespace_definition('exist', 'http://exist.sourceforge.net/NS/exist')
|
|
18
|
-
result = doc.xpath('/exist:result/*[1]').first
|
|
19
|
-
result.nil? ? nil : result.to_s
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def label(metadata)
|
|
23
|
-
xml = Nokogiri::XML(metadata)
|
|
24
|
-
return '' if xml.root.nil?
|
|
25
|
-
case xml.root.name
|
|
26
|
-
when 'msDesc' then xml.xpath('/msDesc/msIdentifier/collection').text
|
|
27
|
-
when 'mods' then
|
|
28
|
-
xml.root.add_namespace_definition('mods', 'http://www.loc.gov/mods/v3')
|
|
29
|
-
xml.xpath('/mods:mods/mods:titleInfo[1]').xpath('mods:title|mods:nonSort').collect { |n| n.text }.join(' ').strip
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def prefixes
|
|
34
|
-
%w(mdtoolkit druid)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
Dor::MetadataService.register(handler)
|