celsius-primo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/celsius-primo.gemspec +1 -1
- data/lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/process_match_queries.rb +15 -17
- data/lib/celsius/primo/soap_api/searcher/search_brief/search_request_transformation/process_range_queries.rb +16 -16
- data/lib/celsius/primo/version.rb +1 -1
- data/spec/assets/adapter/search/complex_search_request.yml +85 -0
- data/spec/assets/adapter/search/search_result_for_complex_request.yml +172 -0
- data/spec/cassettes/Celsius_Primo_Adapter/_search/returns_a_normalized_search_result.yml +188 -0
- data/spec/celsius-primo/adapter_spec.rb +39 -1
- data/spec/spec_helper.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4277500e7234aac3afa225684ede09aaf77e99fc
|
4
|
+
data.tar.gz: d7d6546d49383c0f645b65e23ffb2d092af3c6c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9eac504685fced5f04eab16a437d283d1931285627a761e4cfeab099c7b95cab6124dbb2c30dc49286af9ad2ce7d565c113e80cbc18af1da0f877905e8ea34
|
7
|
+
data.tar.gz: 4d795059e87617ccec01c34e4b962e42546c744be9bc9ab4a042f9740d7040535876a58fe710d803ba794f2db589c0167409c691136dad060331b8250c0b7158
|
data/celsius-primo.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "celsius", ">= 0.4.
|
19
|
+
spec.add_dependency "celsius", ">= 0.4.3"
|
20
20
|
spec.add_dependency "httpi", ">= 2.1.0", "< 3.0.0"
|
21
21
|
spec.add_dependency "ox", ">= 2.1.0"
|
22
22
|
|
@@ -6,24 +6,22 @@ class Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchRequestTransformatio
|
|
6
6
|
|
7
7
|
def call
|
8
8
|
if match_queries = Celsius::Hash.deep_find_key(source, :match)
|
9
|
-
|
10
|
-
raise "unimplemented!"
|
11
|
-
end
|
12
|
-
end
|
9
|
+
query_terms_node = transformation.inner_search_request.locate("PrimoSearchRequest/QueryTerms").first
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
match_queries.each do |match_query|
|
12
|
+
index_field = index_field_mapping(match_query.keys.first)
|
13
|
+
value = match_query.values.first
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
15
|
+
query_terms_node << Ox.parse(
|
16
|
+
<<-xml
|
17
|
+
<QueryTerm>
|
18
|
+
<IndexField>#{index_field}</IndexField>
|
19
|
+
<PrecisionOperator>exact</PrecisionOperator>
|
20
|
+
<Value>#{value}</Value>
|
21
|
+
</QueryTerm>
|
22
|
+
xml
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
27
26
|
end
|
28
|
-
=end
|
29
27
|
end
|
@@ -6,23 +6,23 @@ class Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchRequestTransformatio
|
|
6
6
|
|
7
7
|
def call
|
8
8
|
if range_queries = Celsius::Hash.deep_find_key(source, :range)
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
9
|
+
query_terms_node = transformation.inner_search_request.locate("PrimoSearchRequest/QueryTerms").first
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
range_queries.each do |range_query|
|
12
|
+
lower_bound = Celsius::Hash.smart_fetch(range_query.values.first, :gte)
|
13
|
+
upper_bound = Celsius::Hash.smart_fetch(range_query.values.first, :lte)
|
14
|
+
index_field = index_field_mapping(range_query.keys.first)
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
query_terms_node << Ox.parse(
|
17
|
+
<<-xml
|
18
|
+
<QueryTerm>
|
19
|
+
<IndexField>#{index_field}</IndexField>
|
20
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
21
|
+
<Value>[#{lower_bound} TO #{upper_bound}]</Value>
|
22
|
+
</QueryTerm>
|
23
|
+
xml
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
26
27
|
end
|
27
|
-
=end
|
28
28
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
---
|
2
|
+
facets:
|
3
|
+
facet_tlevel:
|
4
|
+
terms:
|
5
|
+
field: facet_tlevel
|
6
|
+
shard_size: 75
|
7
|
+
facet_creator:
|
8
|
+
terms:
|
9
|
+
field: facet_creator
|
10
|
+
shard_size: 75
|
11
|
+
facet_local31:
|
12
|
+
terms:
|
13
|
+
field: facet_local31
|
14
|
+
shard_size: 75
|
15
|
+
facet_topic:
|
16
|
+
terms:
|
17
|
+
field: facet_topic
|
18
|
+
shard_size: 75
|
19
|
+
facet_creationdate:
|
20
|
+
terms:
|
21
|
+
field: facet_creationdate
|
22
|
+
shard_size: 75
|
23
|
+
facet_domain:
|
24
|
+
terms:
|
25
|
+
field: facet_domain
|
26
|
+
shard_size: 75
|
27
|
+
facet_lang:
|
28
|
+
terms:
|
29
|
+
field: facet_lang
|
30
|
+
shard_size: 75
|
31
|
+
facet_local15:
|
32
|
+
terms:
|
33
|
+
field: facet_local15
|
34
|
+
shard_size: 75
|
35
|
+
facet_local32:
|
36
|
+
terms:
|
37
|
+
field: facet_local32
|
38
|
+
shard_size: 75
|
39
|
+
facet_local33:
|
40
|
+
terms:
|
41
|
+
field: facet_local33
|
42
|
+
shard_size: 75
|
43
|
+
from: 0
|
44
|
+
query:
|
45
|
+
bool:
|
46
|
+
must:
|
47
|
+
- query_string:
|
48
|
+
default_operator: AND
|
49
|
+
fields:
|
50
|
+
- _all
|
51
|
+
query: linux
|
52
|
+
- query_string:
|
53
|
+
default_operator: AND
|
54
|
+
fields:
|
55
|
+
- creator
|
56
|
+
query: gehrke
|
57
|
+
- query_string:
|
58
|
+
default_operator: AND
|
59
|
+
fields:
|
60
|
+
- title
|
61
|
+
query: linux
|
62
|
+
- query_string:
|
63
|
+
default_operator: AND
|
64
|
+
fields:
|
65
|
+
- subject
|
66
|
+
query: linux
|
67
|
+
- query_string:
|
68
|
+
default_operator: AND
|
69
|
+
fields:
|
70
|
+
- created
|
71
|
+
query: 2002
|
72
|
+
- query_string:
|
73
|
+
default_operator: AND
|
74
|
+
fields:
|
75
|
+
- identifier
|
76
|
+
query: TWR11793
|
77
|
+
- range:
|
78
|
+
facet_creationdate:
|
79
|
+
gte: 2002
|
80
|
+
lte: 2002
|
81
|
+
- match:
|
82
|
+
facet_creator: Gehrke, Frank
|
83
|
+
size: 20
|
84
|
+
sort:
|
85
|
+
- created
|
@@ -0,0 +1,172 @@
|
|
1
|
+
---
|
2
|
+
took:
|
3
|
+
hits:
|
4
|
+
hits:
|
5
|
+
- _type: record
|
6
|
+
_source:
|
7
|
+
control:
|
8
|
+
sourcerecordid: 000857752
|
9
|
+
sourceid: PAD_ALEPH
|
10
|
+
recordid: PAD_ALEPH000857752
|
11
|
+
originalsourceid: PAD01
|
12
|
+
ilsapiid: PAD01000857752
|
13
|
+
sourcesystem: Aleph
|
14
|
+
display:
|
15
|
+
type: print
|
16
|
+
title: 'Linux - das Buch : [SuSE Linux 8.x]'
|
17
|
+
creator:
|
18
|
+
- Klappheck, Günter
|
19
|
+
- Glinsky, Peter
|
20
|
+
- Gehrke, Frank
|
21
|
+
edition: 1. Aufl.
|
22
|
+
publisher: 'Düsseldorf : Sybex'
|
23
|
+
creationdate: '2002'
|
24
|
+
format: '767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)'
|
25
|
+
subject: SuSE LINUX 8.x
|
26
|
+
description: 'CD-ROM u.d.T.: Linux'
|
27
|
+
language: ger
|
28
|
+
lds01: '{"ht_number":null,"label":"Das Buch - viel Wissen","volume_count":null,"label_additions":null}'
|
29
|
+
lds02: 'Linux - das Buch : [SuSE Linux 8.x]'
|
30
|
+
lds10: TWR11793
|
31
|
+
search:
|
32
|
+
creatorcontrib:
|
33
|
+
- Klappheck, Günter
|
34
|
+
- Glinsky, Peter
|
35
|
+
- Gehrke, Frank
|
36
|
+
- Klappheck, Günther
|
37
|
+
title:
|
38
|
+
- 'Linux - das Buch : [SuSE Linux 8.x]'
|
39
|
+
- Linux
|
40
|
+
- "<<Das>> Buch - viel Wissen"
|
41
|
+
description: 'CD-ROM u.d.T.: Linux'
|
42
|
+
subject: SuSE LINUX 8.x
|
43
|
+
general: TWR
|
44
|
+
sourceid: PAD_ALEPH
|
45
|
+
recordid: PAD_ALEPH000857752
|
46
|
+
isbn:
|
47
|
+
- 3-8155-0186-5
|
48
|
+
- '9783815501863'
|
49
|
+
- '3815501865'
|
50
|
+
rsrctype: print
|
51
|
+
format: '767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)'
|
52
|
+
creationdate: '2002'
|
53
|
+
searchscope: PAD_ALEPH
|
54
|
+
scope: PAD_ALEPH
|
55
|
+
lsr02: 'false'
|
56
|
+
lsr03: 'false'
|
57
|
+
lsr04: 'true'
|
58
|
+
lsr05: HT013404430
|
59
|
+
lsr09: '20030107'
|
60
|
+
lsr10: TWR11793
|
61
|
+
lsr15: TWR
|
62
|
+
lsr31: monograph
|
63
|
+
lsr32: other
|
64
|
+
lsr33: print
|
65
|
+
lsr34: 'Düsseldorf : Sybex'
|
66
|
+
sort:
|
67
|
+
title: 'Linux - das Buch : [SuSE Linux 8.x]'
|
68
|
+
creationdate: '2002'
|
69
|
+
author: Klappheck, Günter
|
70
|
+
lso01: '20030107'
|
71
|
+
lso03: TWR
|
72
|
+
lso48: PAD01000857752
|
73
|
+
facets:
|
74
|
+
language: ger
|
75
|
+
creationdate: '2002'
|
76
|
+
topic: SuSE LINUX 8.x
|
77
|
+
toplevel: printmedia
|
78
|
+
rsrctype:
|
79
|
+
- other
|
80
|
+
- books
|
81
|
+
creatorcontrib:
|
82
|
+
- Klappheck, Günter
|
83
|
+
- Glinsky, Peter
|
84
|
+
- Gehrke, Frank
|
85
|
+
format: '767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)'
|
86
|
+
lfc15: TWR
|
87
|
+
lfc31: monograph
|
88
|
+
lfc32: other
|
89
|
+
lfc33: print
|
90
|
+
frbrgroupid: '282155386'
|
91
|
+
frbrtype: '6'
|
92
|
+
delivery:
|
93
|
+
delcategory: physical_item
|
94
|
+
addata:
|
95
|
+
lad01: '{"author_statement":["Günter Klappheck ; Peter Glinsky ; Frank Gehrke"],"person_creator_display":["Klappheck,
|
96
|
+
Günter","Glinsky, Peter","Gehrke, Frank"]}'
|
97
|
+
_id: PAD_ALEPH000857752
|
98
|
+
creator:
|
99
|
+
- Klappheck, Günter
|
100
|
+
- Glinsky, Peter
|
101
|
+
- Gehrke, Frank
|
102
|
+
created: '2002'
|
103
|
+
description: 'CD-ROM u.d.T.: Linux'
|
104
|
+
edition: 1. Aufl.
|
105
|
+
format: '767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)'
|
106
|
+
identifier:
|
107
|
+
- PAD01000857752
|
108
|
+
- PAD_ALEPH000857752
|
109
|
+
isbn:
|
110
|
+
- 3-8155-0186-5
|
111
|
+
- '9783815501863'
|
112
|
+
- '3815501865'
|
113
|
+
issn:
|
114
|
+
language: ger
|
115
|
+
title: 'Linux - das Buch : [SuSE Linux 8.x]'
|
116
|
+
publisher: Sybex
|
117
|
+
subject: SuSE LINUX 8.x
|
118
|
+
placeOfPublication: Düsseldorf
|
119
|
+
total: 1
|
120
|
+
facets:
|
121
|
+
facet_tlevel:
|
122
|
+
_type: terms
|
123
|
+
terms:
|
124
|
+
- term: printmedia
|
125
|
+
count: 1
|
126
|
+
facet_creator:
|
127
|
+
_type: terms
|
128
|
+
terms:
|
129
|
+
- term: Klappheck, Günter
|
130
|
+
count: 1
|
131
|
+
- term: Gehrke, Frank
|
132
|
+
count: 1
|
133
|
+
- term: Glinsky, Peter
|
134
|
+
count: 1
|
135
|
+
facet_local31:
|
136
|
+
_type: terms
|
137
|
+
terms:
|
138
|
+
- term: monograph
|
139
|
+
count: 1
|
140
|
+
facet_topic:
|
141
|
+
_type: terms
|
142
|
+
terms:
|
143
|
+
- term: SuSE LINUX 8.x
|
144
|
+
count: 1
|
145
|
+
facet_creationdate:
|
146
|
+
_type: terms
|
147
|
+
terms:
|
148
|
+
- term: '2002'
|
149
|
+
count: 1
|
150
|
+
facet_domain:
|
151
|
+
_type: terms
|
152
|
+
terms: []
|
153
|
+
facet_lang:
|
154
|
+
_type: terms
|
155
|
+
terms:
|
156
|
+
- term: ger
|
157
|
+
count: 1
|
158
|
+
facet_local15:
|
159
|
+
_type: terms
|
160
|
+
terms:
|
161
|
+
- term: TWR
|
162
|
+
count: 1
|
163
|
+
facet_local32:
|
164
|
+
_type: terms
|
165
|
+
terms:
|
166
|
+
- term: other
|
167
|
+
count: 1
|
168
|
+
facet_local33:
|
169
|
+
_type: terms
|
170
|
+
terms:
|
171
|
+
- term: print
|
172
|
+
count: 1
|
@@ -3105,4 +3105,192 @@ http_interactions:
|
|
3105
3105
|
\n</addata>\n</record></PrimoNMBib><sear:LINKS><sear:thumbnail/><sear:linktotoc>errorPage</sear:linktotoc></sear:LINKS></sear:DOC></sear:DOCSET></sear:RESULT><sear:searchToken>0</sear:searchToken></sear:JAGROOT></sear:SEGMENTS></searchBriefReturn></ns1:searchBriefResponse></soapenv:Body></soapenv:Envelope>"
|
3106
3106
|
http_version:
|
3107
3107
|
recorded_at: Thu, 22 Jan 2015 11:49:54 GMT
|
3108
|
+
- request:
|
3109
|
+
method: post
|
3110
|
+
uri: http://primo.kobv.de/primo_library/libweb/webservices/services/searcher
|
3111
|
+
body:
|
3112
|
+
encoding: UTF-8
|
3113
|
+
string: |
|
3114
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
3115
|
+
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="http://primo.kobv.de/PrimoWebServices/services/searcher" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://xml.apache.org/xml-soap">
|
3116
|
+
<env:Body>
|
3117
|
+
<impl:searchBrief>
|
3118
|
+
<searchRequestStr>
|
3119
|
+
<![CDATA[
|
3120
|
+
<searchRequest xmlns="http://www.exlibris.com/primo/xsd/wsRequest" xmlns:uic="http://www.exlibris.com/primo/xsd/primoview/uicomponents">
|
3121
|
+
<PrimoSearchRequest xmlns="http://www.exlibris.com/primo/xsd/search/request">
|
3122
|
+
<QueryTerms>
|
3123
|
+
<BoolOpeator>AND</BoolOpeator>
|
3124
|
+
<QueryTerm>
|
3125
|
+
<IndexField>facet_creator</IndexField>
|
3126
|
+
<PrecisionOperator>exact</PrecisionOperator>
|
3127
|
+
<Value>Gehrke, Frank</Value>
|
3128
|
+
</QueryTerm>
|
3129
|
+
<QueryTerm>
|
3130
|
+
<IndexField>any</IndexField>
|
3131
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3132
|
+
<Value>linux</Value>
|
3133
|
+
</QueryTerm>
|
3134
|
+
<QueryTerm>
|
3135
|
+
<IndexField>creator</IndexField>
|
3136
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3137
|
+
<Value>gehrke</Value>
|
3138
|
+
</QueryTerm>
|
3139
|
+
<QueryTerm>
|
3140
|
+
<IndexField>title</IndexField>
|
3141
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3142
|
+
<Value>linux</Value>
|
3143
|
+
</QueryTerm>
|
3144
|
+
<QueryTerm>
|
3145
|
+
<IndexField>sub</IndexField>
|
3146
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3147
|
+
<Value>linux</Value>
|
3148
|
+
</QueryTerm>
|
3149
|
+
<QueryTerm>
|
3150
|
+
<IndexField>cdate</IndexField>
|
3151
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3152
|
+
<Value>2002</Value>
|
3153
|
+
</QueryTerm>
|
3154
|
+
<QueryTerm>
|
3155
|
+
<IndexField>any</IndexField>
|
3156
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3157
|
+
<Value>TWR11793</Value>
|
3158
|
+
</QueryTerm>
|
3159
|
+
<QueryTerm>
|
3160
|
+
<IndexField>facet_creationdate</IndexField>
|
3161
|
+
<PrecisionOperator>contains</PrecisionOperator>
|
3162
|
+
<Value>[2002 TO 2002]</Value>
|
3163
|
+
</QueryTerm>
|
3164
|
+
</QueryTerms>
|
3165
|
+
<StartIndex>1</StartIndex>
|
3166
|
+
<BulkSize>20</BulkSize>
|
3167
|
+
<DidUMeanEnabled>false</DidUMeanEnabled>
|
3168
|
+
<HighlightingEnabled>false</HighlightingEnabled>
|
3169
|
+
<Languages>
|
3170
|
+
<Language>ger</Language>
|
3171
|
+
<Language>eng</Language>
|
3172
|
+
</Languages>
|
3173
|
+
<SortByList>
|
3174
|
+
<SortField>scdate</SortField>
|
3175
|
+
</SortByList>
|
3176
|
+
<Locations>
|
3177
|
+
<uic:Location type="local" value="scope:(PAD_ALEPH)"/>
|
3178
|
+
</Locations>
|
3179
|
+
</PrimoSearchRequest>
|
3180
|
+
<onCampus>false</onCampus>
|
3181
|
+
<institution>PAD</institution>
|
3182
|
+
</searchRequest>
|
3183
|
+
]]>
|
3184
|
+
</searchRequestStr>
|
3185
|
+
</impl:searchBrief>
|
3186
|
+
</env:Body>
|
3187
|
+
</env:Envelope>
|
3188
|
+
headers:
|
3189
|
+
Content-Type:
|
3190
|
+
- application/xml
|
3191
|
+
Soapaction:
|
3192
|
+
- searchBrief
|
3193
|
+
Accept-Encoding:
|
3194
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
3195
|
+
Accept:
|
3196
|
+
- "*/*"
|
3197
|
+
User-Agent:
|
3198
|
+
- Ruby
|
3199
|
+
response:
|
3200
|
+
status:
|
3201
|
+
code: 200
|
3202
|
+
message: OK
|
3203
|
+
headers:
|
3204
|
+
Server:
|
3205
|
+
- Apache-Coyote/1.1
|
3206
|
+
Set-Cookie:
|
3207
|
+
- JSESSIONID=05E2A0832CC90D99365B6D7690844DA1; Path=/primo_library/libweb/;
|
3208
|
+
HttpOnly
|
3209
|
+
Vary:
|
3210
|
+
- Accept-Encoding
|
3211
|
+
Content-Type:
|
3212
|
+
- text/xml;charset=utf-8
|
3213
|
+
Transfer-Encoding:
|
3214
|
+
- chunked
|
3215
|
+
Date:
|
3216
|
+
- Thu, 22 Jan 2015 15:37:07 GMT
|
3217
|
+
body:
|
3218
|
+
encoding: UTF-8
|
3219
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
|
3220
|
+
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soapenv:Body><ns1:searchBriefResponse
|
3221
|
+
soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"http://primo.kobv.de/PrimoWebServices/services/searcher\"><searchBriefReturn
|
3222
|
+
xsi:type=\"soapenc:string\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><sear:SEGMENTS
|
3223
|
+
xmlns:sear="http://www.exlibrisgroup.com/xsd/jaguar/search"><sear:JAGROOT><sear:RESULT><sear:QUERYTRANSFORMS/><sear:FACETLIST
|
3224
|
+
ACCURATE_COUNTERS="true"><sear:FACET NAME="creator"
|
3225
|
+
COUNT="3"><sear:FACET_VALUES KEY="Klappheck, Günter"
|
3226
|
+
VALUE="1"/><sear:FACET_VALUES KEY="Gehrke, Frank"
|
3227
|
+
VALUE="1"/><sear:FACET_VALUES KEY="Glinsky, Peter"
|
3228
|
+
VALUE="1"/></sear:FACET><sear:FACET NAME="lang"
|
3229
|
+
COUNT="1"><sear:FACET_VALUES KEY="ger" VALUE="1"/></sear:FACET><sear:FACET
|
3230
|
+
NAME="rtype" COUNT="2"><sear:FACET_VALUES KEY="books"
|
3231
|
+
VALUE="1"/><sear:FACET_VALUES KEY="other" VALUE="1"/></sear:FACET><sear:FACET
|
3232
|
+
NAME="topic" COUNT="1"><sear:FACET_VALUES KEY="SuSE
|
3233
|
+
LINUX 8.x" VALUE="1"/></sear:FACET><sear:FACET
|
3234
|
+
NAME="tlevel" COUNT="1"><sear:FACET_VALUES KEY="printmedia"
|
3235
|
+
VALUE="1"/></sear:FACET><sear:FACET NAME="creationdate"
|
3236
|
+
COUNT="1"><sear:FACET_VALUES KEY="2002" VALUE="1"/></sear:FACET><sear:FACET
|
3237
|
+
NAME="fmt" COUNT="1"><sear:FACET_VALUES KEY="767
|
3238
|
+
S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)" VALUE="1"/></sear:FACET><sear:FACET
|
3239
|
+
NAME="local15" COUNT="1"><sear:FACET_VALUES KEY="TWR"
|
3240
|
+
VALUE="1"/></sear:FACET><sear:FACET NAME="local31"
|
3241
|
+
COUNT="1"><sear:FACET_VALUES KEY="monograph" VALUE="1"/></sear:FACET><sear:FACET
|
3242
|
+
NAME="local32" COUNT="1"><sear:FACET_VALUES KEY="other"
|
3243
|
+
VALUE="1"/></sear:FACET><sear:FACET NAME="local33"
|
3244
|
+
COUNT="1"><sear:FACET_VALUES KEY="print" VALUE="1"/></sear:FACET></sear:FACETLIST><sear:DOCSET
|
3245
|
+
HIT_TIME="234" TOTALHITS="1" FIRSTHIT="1" LASTHIT="1"
|
3246
|
+
TOTAL_TIME="302" IS_LOCAL="true"><sear:DOC ID="15234584"
|
3247
|
+
RANK="0.43341723" NO="1" SEARCH_ENGINE="Local Search
|
3248
|
+
Engine" SEARCH_ENGINE_TYPE="Local Search Engine"><PrimoNMBib
|
3249
|
+
xmlns="http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib">\n<record>\n<control>\n<sourcerecordid>000857752</sourcerecordid>
|
3250
|
+
\n<sourceid>PAD_ALEPH</sourceid> \n<recordid>PAD_ALEPH000857752</recordid>
|
3251
|
+
\n<originalsourceid>PAD01</originalsourceid> \n<ilsapiid>PAD01000857752</ilsapiid>
|
3252
|
+
\n<sourcesystem>Aleph</sourcesystem> \n</control>\n<display>\n<type>print</type>
|
3253
|
+
\n<title>Linux - das Buch : [SuSE Linux 8.x]</title> \n<creator>Klappheck,
|
3254
|
+
Günter</creator> \n<creator>Glinsky, Peter</creator>
|
3255
|
+
\n<creator>Gehrke, Frank</creator> \n<edition>1. Aufl.</edition>
|
3256
|
+
\n<publisher>Düsseldorf : Sybex</publisher> \n<creationdate>2002</creationdate>
|
3257
|
+
\n<format>767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)</format> \n<subject>SuSE
|
3258
|
+
LINUX 8.x</subject> \n<description>CD-ROM u.d.T.: Linux</description>
|
3259
|
+
\n<language>ger</language> \n<lds01>{"ht_number":null,"label":"Das
|
3260
|
+
Buch - viel Wissen","volume_count":null,"label_additions":null}</lds01>
|
3261
|
+
\n<lds02>Linux - das Buch : [SuSE Linux 8.x]</lds02> \n<lds10>TWR11793</lds10>
|
3262
|
+
\n</display>\n<search>\n<creatorcontrib>Klappheck, Günter</creatorcontrib>
|
3263
|
+
\n<creatorcontrib>Glinsky, Peter</creatorcontrib> \n<creatorcontrib>Gehrke,
|
3264
|
+
Frank</creatorcontrib> \n<creatorcontrib>Klappheck, Günther</creatorcontrib>
|
3265
|
+
\n<title>Linux - das Buch : [SuSE Linux 8.x]</title> \n<title>Linux</title>
|
3266
|
+
\n<title>&lt;&lt;Das>> Buch - viel Wissen</title>
|
3267
|
+
\n<description>CD-ROM u.d.T.: Linux</description> \n<subject>SuSE
|
3268
|
+
LINUX 8.x</subject> \n<general>TWR</general> \n<sourceid>PAD_ALEPH</sourceid>
|
3269
|
+
\n<recordid>PAD_ALEPH000857752</recordid> \n<isbn>3-8155-0186-5</isbn>
|
3270
|
+
\n<isbn>9783815501863</isbn> \n<isbn>3815501865</isbn>
|
3271
|
+
\n<rsrctype>print</rsrctype> \n<format>767 S. : Ill. ; 25
|
3272
|
+
cm + 1 CD-ROM (12 cm)</format> \n<creationdate>2002</creationdate>
|
3273
|
+
\n<searchscope>PAD_ALEPH</searchscope> \n<scope>PAD_ALEPH</scope>
|
3274
|
+
\n<lsr02>false</lsr02> \n<lsr03>false</lsr03> \n<lsr04>true</lsr04>
|
3275
|
+
\n<lsr05>HT013404430</lsr05> \n<lsr09>20030107</lsr09>
|
3276
|
+
\n<lsr10>TWR11793</lsr10> \n<lsr15>TWR</lsr15> \n<lsr31>monograph</lsr31>
|
3277
|
+
\n<lsr32>other</lsr32> \n<lsr33>print</lsr33> \n<lsr34>Düsseldorf
|
3278
|
+
: Sybex</lsr34> \n</search>\n<sort>\n<title>Linux
|
3279
|
+
- das Buch : [SuSE Linux 8.x]</title> \n<creationdate>2002</creationdate>
|
3280
|
+
\n<author>Klappheck, Günter</author> \n<lso01>20030107</lso01>
|
3281
|
+
\n<lso03>TWR</lso03> \n<lso48>PAD01000857752</lso48>
|
3282
|
+
\n</sort>\n<facets>\n<language>ger</language> \n<creationdate>2002</creationdate>
|
3283
|
+
\n<topic>SuSE LINUX 8.x</topic> \n<toplevel>printmedia</toplevel>
|
3284
|
+
\n<rsrctype>other</rsrctype> \n<rsrctype>books</rsrctype>
|
3285
|
+
\n<creatorcontrib>Klappheck, Günter</creatorcontrib> \n<creatorcontrib>Glinsky,
|
3286
|
+
Peter</creatorcontrib> \n<creatorcontrib>Gehrke, Frank</creatorcontrib>
|
3287
|
+
\n<format>767 S. : Ill. ; 25 cm + 1 CD-ROM (12 cm)</format> \n<lfc15>TWR</lfc15>
|
3288
|
+
\n<lfc31>monograph</lfc31> \n<lfc32>other</lfc32>
|
3289
|
+
\n<lfc33>print</lfc33> \n<frbrgroupid>282155386</frbrgroupid><frbrtype>6</frbrtype></facets>\n<delivery>\n<delcategory>physical_item</delcategory>
|
3290
|
+
\n</delivery>\n<addata>\n<lad01>{"author_statement":["Günter
|
3291
|
+
Klappheck ; Peter Glinsky ; Frank Gehrke"],"person_creator_display":["Klappheck,
|
3292
|
+
Günter","Glinsky, Peter","Gehrke, Frank"]}</lad01>
|
3293
|
+
\n</addata>\n</record></PrimoNMBib><sear:LINKS><sear:thumbnail/></sear:LINKS></sear:DOC></sear:DOCSET></sear:RESULT><sear:searchToken>0</sear:searchToken></sear:JAGROOT></sear:SEGMENTS></searchBriefReturn></ns1:searchBriefResponse></soapenv:Body></soapenv:Envelope>"
|
3294
|
+
http_version:
|
3295
|
+
recorded_at: Thu, 22 Jan 2015 15:37:08 GMT
|
3108
3296
|
recorded_with: VCR 2.9.3
|
@@ -34,11 +34,49 @@ describe Celsius::Primo::Adapter do
|
|
34
34
|
describe "#search" do
|
35
35
|
asset_dir = "adapter/search"
|
36
36
|
|
37
|
+
context "if given search request is not a hash" do
|
38
|
+
it "raises an error" do
|
39
|
+
expect { adapter.search(:no_array) }.to raise_error(ArgumentError, /hash/)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
context "if languages is neither set on the adapter nor given" do
|
45
|
+
let(:adapter) do
|
46
|
+
described_class.new(adapter_options.tap { |options| options.delete(:languages) })
|
47
|
+
end
|
48
|
+
|
49
|
+
it "raises an error" do
|
50
|
+
expect { adapter.search({}) }.to raise_error(ArgumentError, /languages/)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "if locations is neither set on the adapter nor given" do
|
55
|
+
let(:adapter) do
|
56
|
+
described_class.new(adapter_options.tap { |options| options.delete(:locations) })
|
57
|
+
end
|
58
|
+
|
59
|
+
it "raises an error" do
|
60
|
+
expect { adapter.search({}) }.to raise_error(ArgumentError, /locations/)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "if institution is neither set on the adapter nor given" do
|
65
|
+
let(:adapter) do
|
66
|
+
described_class.new(adapter_options.tap { |options| options.delete(:institution) })
|
67
|
+
end
|
68
|
+
|
69
|
+
it "raises an error" do
|
70
|
+
expect { adapter.search({}) }.to raise_error(ArgumentError, /institution/)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
37
74
|
it "returns a normalized search result", :vcr do
|
38
75
|
[
|
39
76
|
["#{asset_dir}/search_request.yml", "#{asset_dir}/search_result.yml"],
|
40
77
|
["#{asset_dir}/search_request_with_empty_result.yml", "#{asset_dir}/empty_search_result.yml"],
|
41
|
-
["#{asset_dir}/search_request_for_multiple_publishers.yml", "#{asset_dir}/search_result_with_multiple_publishers.yml"]
|
78
|
+
["#{asset_dir}/search_request_for_multiple_publishers.yml", "#{asset_dir}/search_result_with_multiple_publishers.yml"],
|
79
|
+
["#{asset_dir}/complex_search_request.yml", "#{asset_dir}/search_result_for_complex_request.yml"],
|
42
80
|
]
|
43
81
|
.each do |search_request_yaml_filename, search_response_yaml_filename|
|
44
82
|
search_request = YAML.load(read_asset(search_request_yaml_filename))
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celsius-primo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Sievers
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httpi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,11 +212,13 @@ files:
|
|
212
212
|
- lib/celsius/primo/version.rb
|
213
213
|
- spec/assets/adapter/mget/mget_request.yml
|
214
214
|
- spec/assets/adapter/mget/mget_result.yml
|
215
|
+
- spec/assets/adapter/search/complex_search_request.yml
|
215
216
|
- spec/assets/adapter/search/empty_search_result.yml
|
216
217
|
- spec/assets/adapter/search/search_request.yml
|
217
218
|
- spec/assets/adapter/search/search_request_for_multiple_publishers.yml
|
218
219
|
- spec/assets/adapter/search/search_request_with_empty_result.yml
|
219
220
|
- spec/assets/adapter/search/search_result.yml
|
221
|
+
- spec/assets/adapter/search/search_result_for_complex_request.yml
|
220
222
|
- spec/assets/adapter/search/search_result_with_multiple_publishers.yml
|
221
223
|
- spec/cassettes/Celsius_Primo_Adapter/_mget/returns_a_normalzed_mget_result.yml
|
222
224
|
- spec/cassettes/Celsius_Primo_Adapter/_search/returns_a_normalized_search_result.yml
|
@@ -250,11 +252,13 @@ summary: Generic primo celsius adapter
|
|
250
252
|
test_files:
|
251
253
|
- spec/assets/adapter/mget/mget_request.yml
|
252
254
|
- spec/assets/adapter/mget/mget_result.yml
|
255
|
+
- spec/assets/adapter/search/complex_search_request.yml
|
253
256
|
- spec/assets/adapter/search/empty_search_result.yml
|
254
257
|
- spec/assets/adapter/search/search_request.yml
|
255
258
|
- spec/assets/adapter/search/search_request_for_multiple_publishers.yml
|
256
259
|
- spec/assets/adapter/search/search_request_with_empty_result.yml
|
257
260
|
- spec/assets/adapter/search/search_result.yml
|
261
|
+
- spec/assets/adapter/search/search_result_for_complex_request.yml
|
258
262
|
- spec/assets/adapter/search/search_result_with_multiple_publishers.yml
|
259
263
|
- spec/cassettes/Celsius_Primo_Adapter/_mget/returns_a_normalzed_mget_result.yml
|
260
264
|
- spec/cassettes/Celsius_Primo_Adapter/_search/returns_a_normalized_search_result.yml
|