blacklight_oai_provider 0.0.1pre1 → 0.0.1pre2
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.
- data/VERSION +1 -1
- data/lib/blacklight_oai_provider/solr_document_wrapper.rb +6 -7
- metadata +7 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1pre2
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BlacklightOaiProvider
|
2
2
|
class SolrDocumentWrapper < ::OAI::Provider::Model
|
3
3
|
attr_reader :model, :timestamp_field
|
4
|
-
attr_accessor :options
|
4
|
+
attr_accessor :options
|
5
5
|
def initialize(controller, options = {})
|
6
6
|
@controller = controller
|
7
7
|
|
@@ -10,37 +10,36 @@ module BlacklightOaiProvider
|
|
10
10
|
|
11
11
|
@timestamp_field = @options[:timestamp]
|
12
12
|
@limit = @options[:limit]
|
13
|
-
@extra_controller_params = {}
|
14
13
|
end
|
15
14
|
|
16
15
|
def sets
|
17
16
|
end
|
18
17
|
|
19
18
|
def earliest
|
20
|
-
Time.parse @controller.get_search_results({:sort => @timestamp_field +' asc', :rows => 1}
|
19
|
+
Time.parse @controller.get_search_results(@controller.params, {:sort => @timestamp_field +' asc', :rows => 1}).last.first.get(@timestamp_field)
|
21
20
|
end
|
22
21
|
|
23
22
|
def latest
|
24
|
-
Time.parse @controller.get_search_results({:sort => @timestamp_field +' desc', :rows => 1}
|
23
|
+
Time.parse @controller.get_search_results(@controller.params, {:sort => @timestamp_field +' desc', :rows => 1}).last.first.get(@timestamp_field)
|
25
24
|
end
|
26
25
|
|
27
26
|
def find(selector, options={})
|
28
27
|
return next_set(options[:resumption_token]) if options[:resumption_token]
|
29
28
|
|
30
29
|
if :all == selector
|
31
|
-
response, records = @controller.get_search_results({:sort => @timestamp_field + ' asc', :per_page => @limit}
|
30
|
+
response, records = @controller.get_search_results(@controller.params, {:sort => @timestamp_field + ' asc', :per_page => @limit})
|
32
31
|
|
33
32
|
if @limit && response.total >= @limit
|
34
33
|
return select_partial(OAI::Provider::ResumptionToken.new(options.merge({:last => 0})))
|
35
34
|
end
|
36
35
|
else
|
37
|
-
records = @controller.get_search_results({:phrase_filters => {:id => selector.split('/', 2).last}}
|
36
|
+
records = @controller.get_search_results(@controller.params, {:phrase_filters => {:id => selector.split('/', 2).last}}).last.first
|
38
37
|
end
|
39
38
|
records
|
40
39
|
end
|
41
40
|
|
42
41
|
def select_partial token
|
43
|
-
records = @controller.get_search_results({:sort => @timestamp_field + ' asc', :per_page => @limit, :page => token.last}
|
42
|
+
records = @controller.get_search_results(@controller.params, {:sort => @timestamp_field + ' asc', :per_page => @limit, :page => token.last}).last
|
44
43
|
|
45
44
|
raise ::OAI::ResumptionTokenException.new unless records
|
46
45
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_oai_provider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1pre2
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2153049680 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '3.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2153049680
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: blacklight
|
28
|
-
requirement: &
|
28
|
+
requirement: &2153049140 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2153049140
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: oai
|
39
|
-
requirement: &
|
39
|
+
requirement: &2153048520 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2153048520
|
48
48
|
description:
|
49
49
|
email:
|
50
50
|
- chris_beer@wgbh.org
|