cul_hydra 1.4.10 → 1.4.11
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 +4 -4
- data/app/models/concerns/cul/hydra/models/common.rb +13 -8
- data/lib/cul_hydra/indexer.rb +8 -3
- data/lib/cul_hydra/version.rb +1 -1
- data/lib/cul_hydra/version.rb~ +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2737cd4a45932293c8be61930787704ba71757ba
|
4
|
+
data.tar.gz: 773c934a6cf9ea8905a65c9002297a022d45baa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fae21818bbb7ff322432c45900083e10fa0384cecd283ebdcb42f25b0b03af2d017256419d77e6b879142e8a990137ab63c6004840be2a5d085002bfaf5b22f
|
7
|
+
data.tar.gz: 153483a94ca7d83d0dac238c5b24e25eaefcd30410f9cd00bbc468e9671da9795c3bb755d36e0fa9dba10defe82072c1e7b16fc3bd2aba12ba4946098abef5b2
|
@@ -151,13 +151,18 @@ module Cul::Hydra::Models::Common
|
|
151
151
|
end
|
152
152
|
}
|
153
153
|
solr_doc[:structured_bsi] = 'false' unless solr_doc.has_key? :structured_bsi
|
154
|
-
|
154
|
+
|
155
155
|
representative_child = get_representative_generic_resource
|
156
156
|
solr_doc['representative_generic_resource_pid_ssi'] = representative_child.pid unless representative_child.nil?
|
157
157
|
|
158
|
+
# Index URI form of pid to facilitate solr joins
|
159
|
+
solr_doc['fedora_pid_uri_ssi'] = 'info:fedora/' + self.pid if self.pid.present?
|
160
|
+
#solr_doc['fedora_pid_uri_ssi'] = 'info:fedora/' + solr_doc['id'] if solr_doc['id'].present?
|
161
|
+
#solr_doc['fedora_pid_uri_ssi'] = ''
|
162
|
+
|
158
163
|
solr_doc
|
159
164
|
end
|
160
|
-
|
165
|
+
|
161
166
|
# This method generally shouldn't be called with any parameters (unless we're doing testing)
|
162
167
|
def get_representative_generic_resource(force_use_of_non_pid_identifier=false)
|
163
168
|
return self if self.is_a?(GenericResource)
|
@@ -180,11 +185,11 @@ module Cul::Hydra::Models::Common
|
|
180
185
|
else
|
181
186
|
found_struct_div = false
|
182
187
|
end
|
183
|
-
|
188
|
+
|
184
189
|
if found_struct_div
|
185
190
|
content_ids = ng_div.attr('CONTENTIDS').split(' ') # Get all space-delimited content ids
|
186
191
|
child_obj = nil
|
187
|
-
|
192
|
+
|
188
193
|
# Try to do a PID lookup first
|
189
194
|
unless force_use_of_non_pid_identifier
|
190
195
|
content_ids.each do |content_id|
|
@@ -192,7 +197,7 @@ module Cul::Hydra::Models::Common
|
|
192
197
|
child_obj ||= ActiveFedora::Base.exists?(content_id) ? ActiveFedora::Base.find(content_id) : nil
|
193
198
|
end
|
194
199
|
end
|
195
|
-
|
200
|
+
|
196
201
|
# Then fall back to identifier lookup
|
197
202
|
if child_obj.nil?
|
198
203
|
child_pid = nil
|
@@ -203,12 +208,12 @@ module Cul::Hydra::Models::Common
|
|
203
208
|
child_pid = nil
|
204
209
|
end
|
205
210
|
end
|
206
|
-
|
211
|
+
|
207
212
|
if child_pid
|
208
213
|
child_obj = ActiveFedora::Base.find(child_pid)
|
209
214
|
end
|
210
215
|
end
|
211
|
-
|
216
|
+
|
212
217
|
if child_obj
|
213
218
|
# Recursion! Woo!
|
214
219
|
return child_obj.get_representative_generic_resource(force_use_of_non_pid_identifier)
|
@@ -308,4 +313,4 @@ module Cul::Hydra::Models::Common
|
|
308
313
|
min = (ld.min < 10) ? "0#{ld.min}" : ld.min.to_s
|
309
314
|
return File.join(ds_root,"#{ld.year}/#{month}#{day}/#{hour}/#{min}", ds.dsLocation.sub(':','_'))
|
310
315
|
end
|
311
|
-
end
|
316
|
+
end
|
data/lib/cul_hydra/indexer.rb
CHANGED
@@ -66,7 +66,7 @@ module Cul::Hydra::Indexer
|
|
66
66
|
|
67
67
|
end
|
68
68
|
|
69
|
-
def self.index_pid(pid, skip_generic_resources=false, verbose_output=false)
|
69
|
+
def self.index_pid(pid, skip_generic_resources=false, verbose_output=false, softcommit=true)
|
70
70
|
# We found an object with the desired PID. Let's reindex it
|
71
71
|
begin
|
72
72
|
active_fedora_object = nil
|
@@ -77,7 +77,12 @@ module Cul::Hydra::Indexer
|
|
77
77
|
if skip_generic_resources && active_fedora_object.is_a?(GenericResource)
|
78
78
|
puts 'Object was skipped because GenericResources are being skipped and it is a GenericResource.'
|
79
79
|
else
|
80
|
-
|
80
|
+
if softcommit
|
81
|
+
active_fedora_object.update_index
|
82
|
+
else
|
83
|
+
# Using direct solr query to update document without soft commiting
|
84
|
+
ActiveFedora::SolrService.add(active_fedora_object.to_solr)
|
85
|
+
end
|
81
86
|
puts 'done.' if verbose_output
|
82
87
|
end
|
83
88
|
break
|
@@ -108,4 +113,4 @@ module Cul::Hydra::Indexer
|
|
108
113
|
puts "Encountered problem with #{pid}. Skipping record. Exception class: #{e.class.name}. Message: #{e.message}"
|
109
114
|
end
|
110
115
|
end
|
111
|
-
end
|
116
|
+
end
|
data/lib/cul_hydra/version.rb
CHANGED
data/lib/cul_hydra/version.rb~
CHANGED
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.4.
|
4
|
+
version: 1.4.11
|
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: 2017-03
|
12
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|