cul_hydra 1.4.10 → 1.4.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1fa8daff2d1478b0a54e6f08959a37753b93457
4
- data.tar.gz: e13de4607a5f95cee62150738ade25fa886b299a
3
+ metadata.gz: 2737cd4a45932293c8be61930787704ba71757ba
4
+ data.tar.gz: 773c934a6cf9ea8905a65c9002297a022d45baa6
5
5
  SHA512:
6
- metadata.gz: 83e8060838dc54913834db7c9bd8ea507ee40560bdf9ebb4e7c71198b68d12f56607cce1c4bcc6feac85dd8f95af1f333e57a0bccd2246319dab8ac56b7226eb
7
- data.tar.gz: 015c43166025a1792201efbb5e4ebae748294b5c0ead6f4e2055c081f0889a66ca27bcd84348cb57be686d9b03a0f472070f396e505b1e748117b6dc23676c5c
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
@@ -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
- active_fedora_object.update_index
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
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '1.4.10'
3
+ VERSION = '1.4.11'
4
4
  def self.version
5
5
  VERSION
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Cul
2
2
  module Hydra
3
- VERSION = '1.4.9'
3
+ VERSION = '1.4.10'
4
4
  def self.version
5
5
  VERSION
6
6
  end
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.10
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-27 00:00:00.000000000 Z
12
+ date: 2017-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight