cul_hydra 1.0.7 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/generic_resource.rb +8 -11
- data/fixtures/spec/CUL_MODS/mods-date-created-range.xml +2 -2
- data/lib/cul_hydra/solrizer/mods_fieldable.rb +31 -26
- data/lib/cul_hydra/version.rb +1 -1
- data/lib/tasks/cul_hydra_dev.rake +1 -1
- metadata +7 -11
- data/config/fedora.yml +0 -17
- data/config/solr.yml +0 -8
- data/config/subs.yml +0 -17
- data/lib/cul_hydra/version.rb~ +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3844f4364d4f0488fcce5399fbbbef4f49e49a
|
4
|
+
data.tar.gz: 140f4053fb595b0ac8711f6cf917264c6e158568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7cf3163f61825251ed71f15e55d0b1315c9367e8501bd2a6ed596e3b19f49956d9e8c8cbe27366fd8c6679f6c43cc3ad7e9021de99089d1c78855f14ac438f0
|
7
|
+
data.tar.gz: 24194475e9a29a3d8c3445fbf9a7babfcd9b970af7a16105d2056748cc90f1d05b64eb41c0d69b732ffc537a04c52222d981005a3090b07f07e73fcdf1c5e551
|
@@ -36,16 +36,6 @@ class GenericResource < ::ActiveFedora::Base
|
|
36
36
|
"FILE ASSET"
|
37
37
|
end
|
38
38
|
|
39
|
-
def thumbnail_info
|
40
|
-
thumb = relsint.relationships(datastreams['content'],:foaf_thumb).first
|
41
|
-
if thumb
|
42
|
-
t_dsid = thumb.object.to_s.split('/')[-1]
|
43
|
-
return {:url=>"#{ActiveFedora.fedora_config[:url]}/objects/#{pid}/datastreams/#{t_dsid}/content",:mime=>datastreams[t_dsid].mimeType}
|
44
|
-
else
|
45
|
-
return {:url=>image_url("cul_hydra/crystal/file.png"),:mime=>'image/png'}
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
39
|
def to_solr(solr_doc = Hash.new, opts={})
|
50
40
|
solr_doc = super
|
51
41
|
|
@@ -139,7 +129,14 @@ class GenericResource < ::ActiveFedora::Base
|
|
139
129
|
end
|
140
130
|
|
141
131
|
def zooming?
|
142
|
-
|
132
|
+
content = datastreams['content']
|
133
|
+
return false unless content
|
134
|
+
zr = rels_int.relationships(content, :foaf_zooming)
|
135
|
+
if (zr && zr.first)
|
136
|
+
return !zr.first.blank?
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
143
140
|
end
|
144
141
|
|
145
142
|
def with_ds_resource(ds_id, fedora_content_filesystem_mounted=false, &block)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?xml version='1.0' encoding='UTF-8'?>
|
2
2
|
<mods xmlns='http://www.loc.gov/mods/v3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd' version='3.4'>
|
3
3
|
<originInfo>
|
4
|
-
<dateCreated encoding='
|
5
|
-
<dateCreated encoding='
|
4
|
+
<dateCreated encoding='iso8601' keyDate='yes' point='start'>1801</dateCreated>
|
5
|
+
<dateCreated encoding='iso8601' point='end'>1802</dateCreated>
|
6
6
|
</originInfo>
|
7
7
|
</mods>
|
@@ -4,6 +4,7 @@ module Cul::Hydra::Solrizer
|
|
4
4
|
include Solrizer::DefaultDescriptors::Normal
|
5
5
|
|
6
6
|
MODS_NS = {'mods'=>'http://www.loc.gov/mods/v3'}
|
7
|
+
ORIGIN_INFO_DATES = ["dateCreated", "dateIssued", "dateOther"]
|
7
8
|
|
8
9
|
module ClassMethods
|
9
10
|
def value_mapper(maps=nil)
|
@@ -28,16 +29,19 @@ module Cul::Hydra::Solrizer
|
|
28
29
|
n_t.gsub!(/\s+/, ' ')
|
29
30
|
# pull off paired punctuation, and any leading punctuation
|
30
31
|
if strip_punctuation
|
32
|
+
# strip brackets
|
31
33
|
n_t = n_t.sub(/^\((.*)\)$/, "\\1")
|
32
34
|
n_t = n_t.sub(/^\{(.*)\}$/, "\\1")
|
33
35
|
n_t = n_t.sub(/^\[(.*)\]$/, "\\1")
|
36
|
+
n_t = n_t.sub(/^<(.*)>$/, "\\1")
|
37
|
+
# strip quotes
|
34
38
|
n_t = n_t.sub(/^"(.*)"$/, "\\1")
|
35
39
|
n_t = n_t.sub(/^'(.*)'$/, "\\1")
|
36
|
-
|
37
|
-
#n_t = n_t.sub(/^\p{Ps}(.*)\p{Pe}/u, "\\1")
|
40
|
+
is_negative_number = n_t =~ /^-\d+$/
|
38
41
|
n_t = n_t.sub(/^[[:punct:]]+/, '')
|
39
42
|
# this may have 'created' leading/trailing space, so strip
|
40
43
|
n_t.strip!
|
44
|
+
n_t = '-' + n_t if is_negative_number
|
41
45
|
end
|
42
46
|
n_t
|
43
47
|
end
|
@@ -193,18 +197,34 @@ module Cul::Hydra::Solrizer
|
|
193
197
|
|
194
198
|
def textual_dates(node=mods)
|
195
199
|
dates = []
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
dates << ModsFieldable.normalize(n.text, true)
|
201
|
-
end
|
202
|
-
node.xpath("./mods:originInfo/mods:dateOther[not(@keyDate) and not(@point) and not(@w3cdtf)]", MODS_NS).collect do |n|
|
203
|
-
dates << ModsFieldable.normalize(n.text, true)
|
200
|
+
ORIGIN_INFO_DATES.each do |element|
|
201
|
+
node.xpath("./mods:originInfo/mods:#{element}[not(@keyDate) and not(@point) and not(@encoding)]", MODS_NS).collect do |n|
|
202
|
+
dates << ModsFieldable.normalize(n.text, true)
|
203
|
+
end
|
204
204
|
end
|
205
205
|
return dates
|
206
206
|
end
|
207
207
|
|
208
|
+
def key_date_range(node=mods)
|
209
|
+
dates = []
|
210
|
+
encodings = ['w3cdtf','iso8601']
|
211
|
+
ORIGIN_INFO_DATES.each do |element|
|
212
|
+
encodings.each do |encoding|
|
213
|
+
xpath = "./mods:originInfo/mods:#{element}[(@keyDate) and (@encoding = '#{encoding}')]"
|
214
|
+
node.xpath(xpath, MODS_NS).collect do |n|
|
215
|
+
range = [ModsFieldable.normalize(n.text, true)]
|
216
|
+
if n['point'] != 'end'
|
217
|
+
n.xpath("../mods:#{element}[(@encoding = '#{encoding}' and @point = 'end')]", MODS_NS).each do |ep|
|
218
|
+
range << ModsFieldable.normalize(ep.text, true)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
dates << range
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
return dates.first || dates
|
226
|
+
end
|
227
|
+
|
208
228
|
def date_range_to_textual_date(start_year, end_year)
|
209
229
|
start_year = start_year.to_i.to_s # Remove zero-padding if present
|
210
230
|
end_year = end_year.to_i.to_s # Remove zero-padding if present
|
@@ -386,24 +406,9 @@ module Cul::Hydra::Solrizer
|
|
386
406
|
end
|
387
407
|
|
388
408
|
# Create convenient start and end date values based on one of the many possible originInfo/dateX elements.
|
389
|
-
|
390
|
-
possible_end_date_fields = ['origin_info_date_issued_end_ssm', 'origin_info_date_created_end_ssm', 'origin_info_date_other_end_ssm']
|
391
|
-
start_date = nil
|
392
|
-
end_date = nil
|
409
|
+
start_date, end_date = key_date_range
|
393
410
|
start_year = nil
|
394
411
|
end_year = nil
|
395
|
-
possible_start_date_fields.each{|key|
|
396
|
-
if solr_doc.has_key?(key)
|
397
|
-
start_date = solr_doc[key][0]
|
398
|
-
break
|
399
|
-
end
|
400
|
-
}
|
401
|
-
possible_end_date_fields.each{|key|
|
402
|
-
if solr_doc.has_key?(key)
|
403
|
-
end_date = solr_doc[key][0]
|
404
|
-
break
|
405
|
-
end
|
406
|
-
}
|
407
412
|
|
408
413
|
if start_date.present?
|
409
414
|
|
data/lib/cul_hydra/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../") unless defined?(APP_ROOT)
|
2
2
|
|
3
3
|
require 'jettywrapper'
|
4
|
-
JETTY_ZIP_BASENAME = 'fedora-3.
|
4
|
+
JETTY_ZIP_BASENAME = 'fedora-3.8.1-with-risearch'
|
5
5
|
Jettywrapper.url = "https://github.com/cul/hydra-jetty/archive/#{JETTY_ZIP_BASENAME}.zip"
|
6
6
|
|
7
7
|
namespace :cul_hydra do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -99,16 +99,16 @@ dependencies:
|
|
99
99
|
name: active_fedora_relsint
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '0'
|
104
|
+
version: '0.4'
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
111
|
+
version: '0.4'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: cul_image_props
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,14 +352,11 @@ files:
|
|
352
352
|
- app/models/static_audio_aggregator.rb
|
353
353
|
- app/models/static_image_aggregator.rb
|
354
354
|
- bin/rails
|
355
|
-
- config/fedora.yml
|
356
355
|
- config/jetty.yml
|
357
356
|
- config/locales/ldpd_hydra.en.yml
|
358
357
|
- config/predicate_mappings.yml
|
359
|
-
- config/solr.yml
|
360
358
|
- config/solr_mappings.yml
|
361
359
|
- config/solr_value_maps.yml
|
362
|
-
- config/subs.yml
|
363
360
|
- fixtures/cmodels/ldpd_ADLMetadata.xml
|
364
361
|
- fixtures/cmodels/ldpd_AESMetadata.xml
|
365
362
|
- fixtures/cmodels/ldpd_BagAggregator.xml
|
@@ -484,7 +481,6 @@ files:
|
|
484
481
|
- lib/cul_hydra/solrizer/value_mapper.rb
|
485
482
|
- lib/cul_hydra/solrizer_patch.rb
|
486
483
|
- lib/cul_hydra/version.rb
|
487
|
-
- lib/cul_hydra/version.rb~
|
488
484
|
- lib/tasks/cmodel.rake
|
489
485
|
- lib/tasks/cul_hydra_dev.rake
|
490
486
|
- lib/tasks/index.rake
|
@@ -511,7 +507,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
511
507
|
version: '0'
|
512
508
|
requirements: []
|
513
509
|
rubyforge_project:
|
514
|
-
rubygems_version: 2.4.
|
510
|
+
rubygems_version: 2.4.6
|
515
511
|
signing_key:
|
516
512
|
specification_version: 4
|
517
513
|
summary: ActiveFedora, OM, and Solrizer implementations for CUL repository apps
|
data/config/fedora.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
:user: fedoraAdmin
|
3
|
-
:password: fedoraAdmin
|
4
|
-
:url: http://localhost:8983/fedora-test
|
5
|
-
:time_zone: "America/New_York"
|
6
|
-
|
7
|
-
test:
|
8
|
-
:user: fedoraAdmin
|
9
|
-
:password: fedoraAdmin
|
10
|
-
:url: http://localhost:8983/fedora-test
|
11
|
-
:time_zone: "America/New_York"
|
12
|
-
|
13
|
-
production:
|
14
|
-
:user: fedoraAdmin
|
15
|
-
:password: f+BULUS*^
|
16
|
-
:url: http://alcott.cul.columbia.edu:8080/fedora
|
17
|
-
:time_zone: "America/New_York"
|
data/config/solr.yml
DELETED
data/config/subs.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
3
|
-
fedora_server: "http://sayers.cul.columbia.edu:8080"
|
4
|
-
php_server: "http://bach.cul.columbia.edu/dev"
|
5
|
-
test:
|
6
|
-
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
7
|
-
fedora_server: "http://sayers.cul.columbia.edu:8080"
|
8
|
-
php_server: "http://bach.cul.columbia.edu/dev"
|
9
|
-
production:
|
10
|
-
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
11
|
-
fedora_server: "http://alcott.cul.columbia.edu:8080"
|
12
|
-
php_server: "http://bach.cul.columbia.edu"
|
13
|
-
|
14
|
-
hyacinth_prod:
|
15
|
-
djatoka_server: "http://iris.cul.columbia.edu:8080"
|
16
|
-
fedora_server: "http://alcott.cul.columbia.edu:8080"
|
17
|
-
php_server: "http://bach.cul.columbia.edu"
|