mdex_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mdex_client.gemspec
4
+ gemspec
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require "rspec/core/rake_task"
4
+
5
+ # RSpec 2.0
6
+ RSpec::Core::RakeTask.new(:spec) do |spec|
7
+ spec.pattern = 'spec/**/*_spec.rb'
8
+ spec.rspec_opts = ['--backtrace']
9
+ end
@@ -0,0 +1 @@
1
+ require 'mdex_client/client'
@@ -0,0 +1,77 @@
1
+ module MDEXClient
2
+ module ActiveRecord
3
+ module Searchable
4
+ extend ActiveSupport::Concern
5
+
6
+ module ClassMethods
7
+ def mdex_field_mapping=(mapping)
8
+ @@mdex_field_mapping = mapping
9
+ end
10
+
11
+ def mdex_field_mapping
12
+ @@mdex_field_mapping ||= { "id" => "id" }
13
+ end
14
+
15
+ def mdex_additional_record_attributes=(attributes)
16
+ @@mdex_additional_record_attributes = Set.new(attributes)
17
+ end
18
+
19
+ def mdex_additional_record_attributes
20
+ @@mdex_additional_record_attributes ||= Set.new
21
+ end
22
+
23
+ def mdex_client=(client)
24
+ @@mdex_client = client
25
+ end
26
+
27
+ def mdex_client
28
+ @@mdex_client
29
+ end
30
+
31
+ def mdex_included_record_attributes
32
+ mdex_additional_record_attributes | mdex_field_mapping.keys
33
+ end
34
+
35
+ def new_from_record(record)
36
+ obj = new
37
+ obj.mdex_attributes = record.attributes
38
+ obj
39
+ end
40
+
41
+ def mdex_navigation_query(params={})
42
+ query = MDEXClient::MData::NavigationQuery.new(params)
43
+ query.included_record_attributes = mdex_included_record_attributes
44
+ query.expose_all_refinements = true
45
+
46
+ return query
47
+ end
48
+
49
+ def mdex_find(params={})
50
+ query = mdex_navigation_query(params)
51
+ result = mdex_client.navigation_query(query)
52
+ shim_objects = result.records.collect { |record| new_from_record(record) }
53
+
54
+ return query, result, shim_objects
55
+ end
56
+ end
57
+
58
+ module InstanceMethods
59
+ def mdex_attributes=(attributes)
60
+ mapping = self.class.mdex_field_mapping
61
+ unmapped_attributes = self.class.mdex_additional_record_attributes
62
+
63
+ attributes.each do |key, value|
64
+ next if unmapped_attributes.include? key
65
+
66
+ unless mapping[key]
67
+ logger.warn "No MDEX field mapping for #{key} in #{self.class.name}, skipping"
68
+ next
69
+ end
70
+
71
+ send("#{mapping[key]}=", value)
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,91 @@
1
+ require 'mdex_client/mdata/navigation_result'
2
+ require 'mdex_client/mdata/navigation_query'
3
+
4
+ module MDEXClient
5
+ class Client
6
+ attr_reader :soap_client
7
+ attr_accessor :login, :password
8
+
9
+ NAMESPACES = {
10
+ "env" => "http://schemas.xmlsoap.org/soap/envelope/",
11
+ "mdata" => "http://www.endeca.com/MDEX/data/IR600"
12
+ }
13
+
14
+ def self.namespace_declarations
15
+ NAMESPACES.inject({}) do |memo, (name, uri)|
16
+ memo["xmlns:#{name}"] = uri
17
+ memo
18
+ end
19
+ end
20
+
21
+ def initialize(&block)
22
+ @soap_client = Savon::Client.new do
23
+ process 1, &block if block
24
+ end
25
+ end
26
+
27
+ def xquery(xquery)
28
+ response = @soap_client.request("Request") do
29
+ soap.xml do |xml|
30
+ xml.env(:Envelope, MDEXClient::Client.namespace_declarations) do
31
+ xml.env :Header
32
+ xml.env(:Body) do
33
+ xml.mdata :Request, xquery
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ response_xml = Nokogiri::XML::Document.parse(response.to_xml)
40
+ response_xml.xpath("/env:Envelope/env:Body/mdata:Response", NAMESPACES)
41
+ end
42
+
43
+ def dimension_value_id_from_path(path)
44
+ quoted_path = path.collect do |item|
45
+ "\"#{item}\""
46
+ end
47
+
48
+ response = xquery("mdex:dimension-value-id-from-path((#{quoted_path.join(",")}))")
49
+ result = response.xpath("mdata:UntypedResult/mdata:Result", NAMESPACES)
50
+ result && result.text.to_i
51
+ end
52
+
53
+ def navigation_query(params=nil)
54
+ query = case params
55
+ when MData::NavigationQuery
56
+ params
57
+ else
58
+ MData::NavigationQuery.new(params)
59
+ end
60
+
61
+ xml = Builder::XmlMarkup.new
62
+ xml.mdata :Query do
63
+ query.write_xml!(xml)
64
+ end
65
+
66
+ response = xquery("mdex:navigation-query(#{xml.target!})")
67
+ MData::NavigationResult.new(response.xpath("mdata:TypedResult/mdata:NavigationResults", NAMESPACES))
68
+ end
69
+
70
+ def query_each(params)
71
+ query = case params
72
+ when MData::NavigationQuery
73
+ params.dup
74
+ else
75
+ MData::NavigationQuery.new(params)
76
+ end
77
+
78
+ query.record_offset ||= 0
79
+
80
+ while true
81
+ result = navigation_query(query)
82
+ result.records.each do |record|
83
+ yield record
84
+ end
85
+
86
+ break if result.records_per_page + result.offset > result.total_record_count
87
+ query.record_offset += result.records_per_page
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1 @@
1
+ require 'mdex_client/fake_mdex/fake_mdex'
@@ -0,0 +1,23 @@
1
+ require 'webmock'
2
+
3
+ class FakeMDEX
4
+ extend WebMock::API
5
+
6
+ WSDL_FILE = File.expand_path("#{__FILE__}/../mdex.wsdl")
7
+ NAVIGATION_RESULT_FILE = File.expand_path("#{__FILE__}/../mdex_response.xml")
8
+
9
+ def self.setup_stubs!
10
+ stub_request(:post, %r{^https://(.*:.*@)?mdex.gively.com/ws/mdex}).
11
+ to_return(:body => File.new(NAVIGATION_RESULT_FILE), :status => 200)
12
+
13
+ stub_request(:get, %r{^https://(.*:.*@)?mdex.gively.com/ws/mdex}).
14
+ to_return(:body => File.new(WSDL_FILE), :status => 200)
15
+ end
16
+
17
+ def self.navigation_result
18
+ xml = Nokogiri::XML.parse(File.new(NAVIGATION_RESULT_FILE))
19
+ result = xml.xpath("/env:Envelope/env:Body/mdata:Response/mdata:TypedResult/mdata:NavigationResults",
20
+ MDEXClient::Client::NAMESPACES)
21
+ MDEXClient::MData::NavigationResult.new(result)
22
+ end
23
+ end
@@ -0,0 +1,787 @@
1
+ <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.endeca.com/MDEX/data/IR600" name="MDEX" targetNamespace="http://www.endeca.com/MDEX/data/IR600">
2
+
3
+ <types>
4
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.endeca.com/MDEX/data/IR600">
5
+
6
+ <simpleType name="DimensionValueId">
7
+ <restriction base="string">
8
+ <pattern value="[0-9]+"/>
9
+ </restriction>
10
+ </simpleType>
11
+
12
+ <complexType name="DimensionValueList">
13
+ <sequence>
14
+ <element name="DimensionValue" type="tns:DimensionValue" minOccurs="1" maxOccurs="unbounded"/>
15
+ </sequence>
16
+ </complexType>
17
+
18
+ <complexType name="Attribute">
19
+ <simpleContent>
20
+ <extension base="string">
21
+ <attribute name="Key" type="string" use="required"/>
22
+ </extension>
23
+ </simpleContent>
24
+ </complexType>
25
+
26
+ <complexType name="Property">
27
+ <simpleContent>
28
+ <extension base="tns:Attribute"/>
29
+ </simpleContent>
30
+ </complexType>
31
+
32
+
33
+ <complexType name="PropertyList">
34
+ <sequence>
35
+ <element name="Property" type="tns:Property" minOccurs="1" maxOccurs="unbounded"/>
36
+ </sequence>
37
+ </complexType>
38
+
39
+ <simpleType name="MultiSelect">
40
+ <restriction base="string">
41
+ <enumeration value="And"/>
42
+ <enumeration value="Or"/>
43
+ <enumeration value="None"/>
44
+ </restriction>
45
+ </simpleType>
46
+
47
+ <complexType name="DimensionValue">
48
+ <sequence>
49
+ <element name="DimensionValues" type="tns:DimensionValueList" minOccurs="0" maxOccurs="1"/>
50
+ <element name="Properties" type="tns:PropertyList" minOccurs="0" maxOccurs="1"/>
51
+ </sequence>
52
+ <attribute name="Name" type="string" use="required"/>
53
+ <attribute name="Id" type="tns:DimensionValueId" use="required"/>
54
+ <attribute name="IsLeaf" type="boolean" use="required"/>
55
+ <attribute name="IsNavigable" type="boolean" use="required"/>
56
+ <attribute name="StaticRecordCount" type="unsignedLong" use="optional"/>
57
+ </complexType>
58
+
59
+ <complexType name="Dimension">
60
+ <sequence>
61
+ <element name="DimensionValue" type="tns:DimensionValue"/>
62
+ </sequence>
63
+ <attribute name="Name" type="string" use="required"/>
64
+ <attribute name="Id" type="tns:DimensionValueId" use="required"/>
65
+ <attribute name="MultiSelect" type="tns:MultiSelect" use="required"/>
66
+ <attribute name="GroupName" type="string" use="optional"/>
67
+ </complexType>
68
+
69
+ <complexType name="DimensionList">
70
+ <sequence>
71
+ <element name="Dimension" type="tns:Dimension" minOccurs="0" maxOccurs="unbounded"/>
72
+ </sequence>
73
+ </complexType>
74
+
75
+ <complexType name="RefinementConfig">
76
+ <attribute name="DimensionValueId" type="tns:DimensionValueId" use="required"/>
77
+ <attribute name="Expose" type="boolean" default="true"/>
78
+ <attribute name="LimitDimensionValues" type="boolean"/>
79
+ <attribute name="OrderByRecordCount" type="boolean"/>
80
+ <attribute name="MaximumDimensionValueCount" type="unsignedLong"/>
81
+ </complexType>
82
+
83
+ <complexType name="RefinementConfigList">
84
+ <sequence>
85
+ <element name="RefinementConfig" type="tns:RefinementConfig" minOccurs="0" maxOccurs="unbounded"/>
86
+ </sequence>
87
+ <attribute name="ExposeAllRefinements" type="boolean" use="optional"/>
88
+ </complexType>
89
+
90
+ <complexType name="DimensionValueState">
91
+ <attribute name="Name" type="string" use="required"/>
92
+ <attribute name="Id" type="tns:DimensionValueId" use="required"/>
93
+ </complexType>
94
+
95
+ <complexType name="DimensionValueStateList">
96
+ <sequence>
97
+ <element name="DimensionValueReference" type="tns:DimensionValueState" minOccurs="0" maxOccurs="unbounded"/>
98
+ </sequence>
99
+ </complexType>
100
+
101
+ <complexType name="RefinementList">
102
+ <complexContent>
103
+ <extension base="tns:DimensionValueStateList">
104
+ <attribute name="ParentName" type="string" use="required"/>
105
+ <attribute name="ParentId" type="tns:DimensionValueId" use="required"/>
106
+ <attribute name="HasMore" type="boolean" use="required"/>
107
+ <attribute name="IsRefinable" type="boolean" use="required"/>
108
+ </extension>
109
+ </complexContent>
110
+ </complexType>
111
+
112
+ <complexType name="DimensionState">
113
+ <sequence>
114
+ <element name="Refinements" type="tns:RefinementList" minOccurs="1" maxOccurs="unbounded"/>
115
+ <element name="SelectedDimensionValues" type="tns:DimensionValueStateList" minOccurs="0" maxOccurs="1"/>
116
+ <element name="ImplicitDimensionValues" type="tns:DimensionValueStateList" minOccurs="0" maxOccurs="1"/>
117
+ </sequence>
118
+ <attribute name="DimensionName" type="string" use="required"/>
119
+ <attribute name="DimensionId" type="tns:DimensionValueId" use="required"/>
120
+ </complexType>
121
+
122
+ <complexType name="DimensionStateList">
123
+ <sequence>
124
+ <element name="DimensionState" type="tns:DimensionState" minOccurs="1" maxOccurs="unbounded"/>
125
+ </sequence>
126
+ </complexType>
127
+
128
+ <complexType name="NavigationStatesResult">
129
+ <sequence>
130
+ <element name="RefinementConfigs" type="tns:RefinementConfigList" minOccurs="0" maxOccurs="1"/>
131
+ <element name="DimensionStates" type="tns:DimensionStateList" minOccurs="0" maxOccurs="1"/>
132
+ </sequence>
133
+ </complexType>
134
+
135
+ <complexType name="Geocode">
136
+ <attribute name="Latitude" type="double" use="required"/>
137
+ <attribute name="Longitude" type="double" use="required"/>
138
+ </complexType>
139
+
140
+ <simpleType name="SortDirection">
141
+ <restriction base="string">
142
+ <enumeration value="Ascending"/>
143
+ <enumeration value="Descending"/>
144
+ </restriction>
145
+ </simpleType>
146
+
147
+ <complexType name="Sort">
148
+ <sequence>
149
+ <element name="ReferenceGeocode" type="tns:Geocode" minOccurs="0" maxOccurs="1"/>
150
+ </sequence>
151
+ <attribute name="Key" type="string" use="required"/>
152
+ <attribute name="Direction" type="tns:SortDirection" use="optional"/>
153
+ </complexType>
154
+
155
+ <simpleType name="SearchMode">
156
+ <restriction base="string">
157
+ <enumeration value="All"/>
158
+ <enumeration value="AllAny"/>
159
+ <enumeration value="AllPartial"/>
160
+ <enumeration value="Any"/>
161
+ <enumeration value="Boolean"/>
162
+ <enumeration value="Partial"/>
163
+ <enumeration value="PartialMax"/>
164
+ <enumeration value="Unknown"/>
165
+ </restriction>
166
+ </simpleType>
167
+
168
+ <complexType name="RelevanceRanking">
169
+ <simpleContent>
170
+ <extension base="string">
171
+ <attribute name="Key" type="string" use="required"/>
172
+ <attribute name="Strategy" type="string" use="required"/>
173
+ <attribute name="Mode" type="tns:SearchMode"/>
174
+ </extension>
175
+ </simpleContent>
176
+ </complexType>
177
+
178
+ <complexType name="SortList">
179
+ <sequence>
180
+ <choice>
181
+ <element name="Sort" type="tns:Sort" minOccurs="0" maxOccurs="unbounded"/>
182
+ <element name="RelevanceRanking" type="tns:RelevanceRanking"/>
183
+ </choice>
184
+ </sequence>
185
+ </complexType>
186
+
187
+ <complexType name="IncludedRecordAttributeList">
188
+ <sequence>
189
+ <element name="IncludedRecordAttribute" type="string" minOccurs="0" maxOccurs="unbounded"/>
190
+ </sequence>
191
+ </complexType>
192
+
193
+ <simpleType name="RecordsPerAggregateRecord">
194
+ <restriction base="string">
195
+ <enumeration value="All"/>
196
+ <enumeration value="None"/>
197
+ <enumeration value="One"/>
198
+ </restriction>
199
+ </simpleType>
200
+
201
+ <complexType name="AggregationKey">
202
+ <simpleContent>
203
+ <extension base="string">
204
+ <attribute name="RecordsPerAggregateRecord" type="tns:RecordsPerAggregateRecord"/>
205
+ </extension>
206
+ </simpleContent>
207
+ </complexType>
208
+
209
+ <complexType name="AttributeDimensionValue">
210
+ <simpleContent>
211
+ <extension base="tns:Attribute">
212
+ <attribute name="DimensionId" type="tns:DimensionValueId" use="required"/>
213
+ <attribute name="Id" type="tns:DimensionValueId" use="required"/>
214
+ </extension>
215
+ </simpleContent>
216
+ </complexType>
217
+
218
+ <complexType name="AttributeList">
219
+ <choice minOccurs="1" maxOccurs="unbounded">
220
+ <element name="AssignedDimensionValue" type="tns:AttributeDimensionValue"/>
221
+ <element name="Property" type="tns:Property"/>
222
+ </choice>
223
+ </complexType>
224
+
225
+ <complexType name="SnippetList">
226
+ <sequence>
227
+ <element name="Snippet" type="tns:Property" minOccurs="1" maxOccurs="unbounded"/>
228
+ </sequence>
229
+ </complexType>
230
+
231
+ <complexType name="Record">
232
+ <sequence>
233
+ <element name="Attributes" type="tns:AttributeList" minOccurs="0" maxOccurs="1"/>
234
+ <element name="Snippets" type="tns:SnippetList" minOccurs="0" maxOccurs="1"/>
235
+ </sequence>
236
+ <attribute name="Id" type="string" use="required"/>
237
+ </complexType>
238
+
239
+ <complexType name="AggregateRecord">
240
+ <complexContent>
241
+ <extension base="tns:Record">
242
+ <sequence>
243
+ <element name="DerivedProperties" type="tns:PropertyList" minOccurs="0" maxOccurs="1"/>
244
+ <element name="ConstituentRecords" type="tns:RecordList" minOccurs="0" maxOccurs="1"/>
245
+ </sequence>
246
+ <attribute name="RecordsInAggregate" type="unsignedLong" use="required"/>
247
+ </extension>
248
+ </complexContent>
249
+ </complexType>
250
+
251
+ <complexType name="RecordList">
252
+ <sequence>
253
+ <choice>
254
+ <element name="Record" type="tns:Record" minOccurs="1" maxOccurs="unbounded"/>
255
+ <element name="AggregateRecord" type="tns:AggregateRecord" minOccurs="1" maxOccurs="unbounded"/>
256
+ </choice>
257
+ </sequence>
258
+ </complexType>
259
+
260
+ <complexType name="RecordsResult">
261
+ <sequence>
262
+ <element name="Sorts" type="tns:SortList" minOccurs="0" maxOccurs="1"/>
263
+ <element name="IncludedRecordAttributes" type="tns:IncludedRecordAttributeList" minOccurs="0" maxOccurs="1"/>
264
+ <element name="AggregationKey" type="tns:AggregationKey" minOccurs="0" maxOccurs="1"/>
265
+ <element name="Records" type="tns:RecordList" minOccurs="0" maxOccurs="1"/>
266
+ </sequence>
267
+ <attribute name="Offset" type="unsignedLong" use="required"/>
268
+ <attribute name="RecordsPerPage" type="unsignedLong" use="required"/>
269
+ <attribute name="TotalRecordCount" type="unsignedLong" use="required"/>
270
+ <attribute name="TotalAggregateRecordCount" type="unsignedLong" use="optional"/>
271
+ </complexType>
272
+
273
+ <complexType name="RangeFilter">
274
+ <attribute name="AttributeName" type="string" use="required"/>
275
+ </complexType>
276
+
277
+ <complexType name="LessThanFilter">
278
+ <complexContent>
279
+ <extension base="tns:RangeFilter">
280
+ <sequence>
281
+ <element name="GeocodeReference" type="tns:Geocode" minOccurs="0" maxOccurs="1"/>
282
+ </sequence>
283
+ <attribute name="UpperBound" type="double"/>
284
+ </extension>
285
+ </complexContent>
286
+ </complexType>
287
+
288
+ <complexType name="LessThanOrEqualFilter">
289
+ <complexContent>
290
+ <extension base="tns:RangeFilter">
291
+ <attribute name="UpperBound" type="double"/>
292
+ </extension>
293
+ </complexContent>
294
+ </complexType>
295
+
296
+ <complexType name="GreaterThanFilter">
297
+ <complexContent>
298
+ <extension base="tns:RangeFilter">
299
+ <sequence>
300
+ <element name="GeocodeReference" type="tns:Geocode" minOccurs="0" maxOccurs="1"/>
301
+ </sequence>
302
+ <attribute name="LowerBound" type="double"/>
303
+ </extension>
304
+ </complexContent>
305
+ </complexType>
306
+
307
+ <complexType name="GreaterThanOrEqualFilter">
308
+ <complexContent>
309
+ <extension base="tns:RangeFilter">
310
+ <attribute name="LowerBound" type="double"/>
311
+ </extension>
312
+ </complexContent>
313
+ </complexType>
314
+
315
+ <complexType name="BetweenFilter">
316
+ <complexContent>
317
+ <extension base="tns:RangeFilter">
318
+ <sequence>
319
+ <element name="GeocodeReference" type="tns:Geocode" minOccurs="0" maxOccurs="1"/>
320
+ </sequence>
321
+ <attribute name="LowerBound" type="double"/>
322
+ <attribute name="UpperBound" type="double"/>
323
+ </extension>
324
+ </complexContent>
325
+ </complexType>
326
+
327
+ <complexType name="RangeFilterList">
328
+ <sequence>
329
+ <choice minOccurs="1" maxOccurs="unbounded">
330
+ <element name="LessThanFilter" type="tns:LessThanFilter"/>
331
+ <element name="LessThanOrEqualFilter" type="tns:LessThanOrEqualFilter"/>
332
+ <element name="GreaterThanFilter" type="tns:GreaterThanFilter"/>
333
+ <element name="GreaterThanOrEqualFilter" type="tns:GreaterThanOrEqualFilter"/>
334
+ <element name="BetweenFilter" type="tns:BetweenFilter"/>
335
+ </choice>
336
+ </sequence>
337
+ </complexType>
338
+
339
+ <complexType name="Search">
340
+ <simpleContent>
341
+ <extension base="string">
342
+ <attribute name="Key" type="string" use="required"/>
343
+ <attribute name="RelevanceRankingStrategy" type="string"/>
344
+ <attribute name="Mode" type="tns:SearchMode"/>
345
+ <attribute name="SnippetLength" type="unsignedLong" use="optional"/>
346
+ <attribute name="EnableSnippeting" type="boolean" use="optional"/>
347
+ </extension>
348
+ </simpleContent>
349
+ </complexType>
350
+
351
+ <complexType name="DimensionSearch">
352
+ <simpleContent>
353
+ <extension base="string">
354
+ <attribute name="RelevanceRankingStrategy" type="string"/>
355
+ <attribute name="Mode" type="tns:SearchMode"/>
356
+ </extension>
357
+ </simpleContent>
358
+ </complexType>
359
+
360
+ <complexType name="CompoundDimensionSearch">
361
+ <simpleContent>
362
+ <extension base="string">
363
+ <attribute name="Mode" type="tns:SearchMode"/>
364
+ </extension>
365
+ </simpleContent>
366
+ </complexType>
367
+
368
+ <simpleType name="AdjustmentType">
369
+ <restriction base="string">
370
+ <enumeration value="Phrasing"/>
371
+ <enumeration value="SpellingCorrection"/>
372
+ <enumeration value="WordBreak"/>
373
+ </restriction>
374
+ </simpleType>
375
+
376
+ <complexType name="SearchAdjustment">
377
+ <sequence>
378
+ <element name="AdjustmentType" type="tns:AdjustmentType" minOccurs="1" maxOccurs="unbounded"/>
379
+ </sequence>
380
+ <attribute name="Terms" type="string" use="required"/>
381
+ <attribute name="RecordCountIfApplied" type="unsignedLong" use="required"/>
382
+ </complexType>
383
+
384
+ <complexType name="SearchAdjustmentList">
385
+ <sequence>
386
+ <element name="SearchAdjustment" type="tns:SearchAdjustment" minOccurs="1" maxOccurs="unbounded"/>
387
+ </sequence>
388
+ </complexType>
389
+
390
+ <complexType name="WordInterpretationList">
391
+ <sequence>
392
+ <element name="WordInterpretation" type="tns:Property" minOccurs="1" maxOccurs="unbounded"/>
393
+ </sequence>
394
+ </complexType>
395
+
396
+ <complexType name="SearchReport">
397
+ <sequence>
398
+ <element name="ErrorMessage" type="string" minOccurs="0" maxOccurs="1"/>
399
+ <choice>
400
+ <sequence>
401
+ <element name="Search" type="tns:Search"/>
402
+ <element name="MatchedRecordCount" type="unsignedLong"/>
403
+ </sequence>
404
+ <sequence>
405
+ <element name="DimensionSearch" type="tns:DimensionSearch"/>
406
+ <element name="MatchedDimensionValueCount" type="unsignedLong"/>
407
+ </sequence>
408
+ <sequence>
409
+ <element name="CompoundDimensionSearch" type="tns:CompoundDimensionSearch"/>
410
+ <element name="MatchedCompoundDimensionValueCount" type="unsignedLong"/>
411
+ </sequence>
412
+ </choice>
413
+ <element name="MatchedMode" type="tns:SearchMode"/>
414
+ <element name="MatchedTermsCount" type="unsignedLong"/>
415
+ <element name="AppliedSearchAdjustments" type="tns:SearchAdjustmentList" minOccurs="0" maxOccurs="1"/>
416
+ <element name="SuggestedSearchAdjustments" type="tns:SearchAdjustmentList" minOccurs="0" maxOccurs="1"/>
417
+ <element name="TruncatedTerms" type="string" minOccurs="0" maxOccurs="1"/>
418
+ <element name="WordInterpretations" type="tns:WordInterpretationList" minOccurs="0" maxOccurs="1"/>
419
+ </sequence>
420
+ </complexType>
421
+
422
+ <complexType name="SearchReportList">
423
+ <sequence>
424
+ <element name="SearchReport" type="tns:SearchReport" minOccurs="1" maxOccurs="unbounded"/>
425
+ </sequence>
426
+ </complexType>
427
+
428
+ <complexType name="DimensionValueIdList">
429
+ <sequence>
430
+ <element name="DimensionValueId" type="tns:DimensionValueId" minOccurs="0" maxOccurs="unbounded"/>
431
+ </sequence>
432
+ </complexType>
433
+
434
+ <complexType name="NavigationAppliedFilters">
435
+ <sequence>
436
+ <element name="EqlExpression" type="string" minOccurs="0" maxOccurs="1"/>
437
+ <element name="RangeFilters" type="tns:RangeFilterList" minOccurs="0" maxOccurs="1"/>
438
+ <element name="RecordFilter" type="string" minOccurs="0" maxOccurs="1"/>
439
+ <element name="SearchReports" type="tns:SearchReportList" minOccurs="0" maxOccurs="1"/>
440
+ <element name="SelectedDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0" maxOccurs="1"/>
441
+ <element name="LanguageId" type="string" minOccurs="0" maxOccurs="1"/>
442
+ </sequence>
443
+ </complexType>
444
+
445
+ <complexType name="BusinessRule">
446
+ <sequence>
447
+ <element name="SelectedDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0" maxOccurs="1"/>
448
+ <element name="Properties" type="tns:PropertyList" minOccurs="0" maxOccurs="1"/>
449
+ <element name="Records" type="tns:RecordList" minOccurs="0" maxOccurs="1"/>
450
+ </sequence>
451
+ <attribute name="Id" type="string" use="required"/>
452
+ <attribute name="NavigationStateRecordCount" type="unsignedLong" use="required"/>
453
+ <attribute name="SortAttribute" type="string" use="optional"/>
454
+ <attribute name="Style" type="string" use="required"/>
455
+ <attribute name="Title" type="string" use="required"/>
456
+ <attribute name="Zone" type="string" use="required"/>
457
+ <attribute name="SortDirection" type="tns:SortDirection" use="optional"/>
458
+ </complexType>
459
+
460
+ <complexType name="BusinessRuleList">
461
+ <sequence>
462
+ <element name="BusinessRule" type="tns:BusinessRule" minOccurs="1" maxOccurs="unbounded"/>
463
+ </sequence>
464
+ </complexType>
465
+
466
+ <complexType name="BusinessRulesResult">
467
+ <sequence>
468
+ <element name="BusinessRulesFilter" type="string" minOccurs="0"/>
469
+ <element name="BusinessRulesPreviewTime" type="dateTime" minOccurs="0"/>
470
+ <element name="BusinessRules" type="tns:BusinessRuleList" minOccurs="0" maxOccurs="1"/>
471
+ </sequence>
472
+ </complexType>
473
+
474
+ <complexType name="KeywordRedirectList">
475
+ <sequence>
476
+ <element name="KeywordRedirect" type="string" minOccurs="0" maxOccurs="unbounded"/>
477
+ </sequence>
478
+ </complexType>
479
+
480
+ <complexType name="AnalyticsStatementResult">
481
+ <sequence>
482
+ <element name="Record" type="tns:Record" minOccurs="0" maxOccurs="unbounded"/>
483
+ </sequence>
484
+ <attribute name="Name" type="string" use="required"/>
485
+ <attribute name="TotalRecordCount" type="unsignedLong" use="required"/>
486
+ </complexType>
487
+
488
+ <complexType name="AnalyticsResult">
489
+ <sequence>
490
+ <element name="AnalyticsStatementResult" type="tns:AnalyticsStatementResult" minOccurs="0" maxOccurs="unbounded"/>
491
+ </sequence>
492
+ </complexType>
493
+
494
+ <complexType name="NavigationResult">
495
+ <sequence>
496
+ <element name="Dimensions" type="tns:DimensionList"/>
497
+ <element name="NavigationStatesResult" type="tns:NavigationStatesResult"/>
498
+ <element name="RecordsResult" type="tns:RecordsResult"/>
499
+ <element name="AppliedFilters" type="tns:NavigationAppliedFilters"/>
500
+ <element name="BusinessRulesResult" type="tns:BusinessRulesResult"/>
501
+ <element name="KeywordRedirects" type="tns:KeywordRedirectList"/>
502
+ <element name="AnalyticsResult" type="tns:AnalyticsResult"/>
503
+ </sequence>
504
+ </complexType>
505
+
506
+ <complexType name="DimensionSearchAppliedFilters">
507
+ <sequence>
508
+ <element name="EqlExpression" type="string" minOccurs="0"/>
509
+ <element name="RangeFilters" type="tns:RangeFilterList" minOccurs="0"/>
510
+ <element name="RecordFilter" type="string" minOccurs="0"/>
511
+ <element name="SearchReport" type="tns:SearchReport"/>
512
+ <element name="SearchWithinDimensionValueId" type="tns:DimensionValueId" minOccurs="0"/>
513
+ <element name="SelectedDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0"/>
514
+ <element name="LanguageId" type="string" minOccurs="0" maxOccurs="1"/>
515
+ </sequence>
516
+ </complexType>
517
+
518
+ <complexType name="ResultDimension">
519
+ <sequence>
520
+ <element name="MatchingDimensionValue" type="tns:AttributeDimensionValue" minOccurs="1" maxOccurs="unbounded"/>
521
+ </sequence>
522
+ <attribute name="Name" type="string" use="required"/>
523
+ <attribute name="Id" type="tns:DimensionValueId" use="required"/>
524
+ </complexType>
525
+
526
+ <complexType name="ResultDimensionList">
527
+ <sequence>
528
+ <element name="MatchingDimension" type="tns:ResultDimension" minOccurs="1" maxOccurs="unbounded"/>
529
+ </sequence>
530
+ </complexType>
531
+
532
+ <complexType name="MatchingDimensionsResult">
533
+ <sequence>
534
+ <element name="DimensionValuesPerDimension" type="unsignedLong" minOccurs="0"/>
535
+ <element name="MatchingDimensions" type="tns:ResultDimensionList" minOccurs="0" maxOccurs="1"/>
536
+ </sequence>
537
+ <attribute name="HasMore" type="boolean" use="required"/>
538
+ </complexType>
539
+
540
+ <complexType name="DimensionSearchResult">
541
+ <sequence>
542
+ <element name="Dimensions" type="tns:DimensionList"/>
543
+ <element name="MatchingDimensionsResult" type="tns:MatchingDimensionsResult"/>
544
+ <element name="AppliedFilters" type="tns:DimensionSearchAppliedFilters"/>
545
+ </sequence>
546
+ </complexType>
547
+
548
+ <complexType name="MatchingDimensionValueList">
549
+ <sequence>
550
+ <element name="MatchingDimensionValue" type="tns:AttributeDimensionValue" minOccurs="0" maxOccurs="unbounded"/>
551
+ </sequence>
552
+ </complexType>
553
+
554
+ <complexType name="CompoundDimensionValueList">
555
+ <sequence>
556
+ <element name="MatchingCompoundDimensionValue" type="tns:MatchingDimensionValueList" minOccurs="0" maxOccurs="unbounded"/>
557
+ </sequence>
558
+ </complexType>
559
+
560
+ <complexType name="MatchingCompoundDimensionsResult">
561
+ <sequence>
562
+ <element name="DimensionValuesPerDimension" type="unsignedLong" minOccurs="0"/>
563
+ <element name="MatchingCompoundDimensionValues" type="tns:CompoundDimensionValueList"/>
564
+ </sequence>
565
+ <attribute name="HasMore" type="boolean" use="required"/>
566
+ </complexType>
567
+
568
+ <complexType name="CompoundDimensionSearchAppliedFilters">
569
+ <sequence>
570
+ <element name="EqlExpression" type="string" minOccurs="0"/>
571
+ <element name="RangeFilters" type="tns:RangeFilterList" minOccurs="0"/>
572
+ <element name="RecordFilter" type="string" minOccurs="0"/>
573
+ <element name="SearchReport" type="tns:SearchReport" minOccurs="0"/>
574
+ <element name="SearchWithinDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0"/>
575
+ <element name="SelectedDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0"/>
576
+ <element name="LanguageId" type="string" minOccurs="0" maxOccurs="1"/>
577
+ </sequence>
578
+ </complexType>
579
+
580
+ <complexType name="CompoundDimensionSearchResult">
581
+ <sequence>
582
+ <element name="Dimensions" type="tns:DimensionList"/>
583
+ <element name="MatchingCompoundDimensionsResult" type="tns:MatchingCompoundDimensionsResult"/>
584
+ <element name="AppliedFilters" type="tns:CompoundDimensionSearchAppliedFilters"/>
585
+ </sequence>
586
+ </complexType>
587
+
588
+ <complexType name="SearchKey">
589
+ <simpleContent>
590
+ <extension base="string">
591
+ <attribute name="IsSearchInterface" type="boolean" use="required"/>
592
+ </extension>
593
+ </simpleContent>
594
+ </complexType>
595
+
596
+ <complexType name="SearchKeyList">
597
+ <sequence>
598
+ <element name="SearchKey" type="tns:SearchKey" minOccurs="0" maxOccurs="unbounded"/>
599
+ </sequence>
600
+ </complexType>
601
+
602
+ <complexType name="SortKeyList">
603
+ <sequence>
604
+ <element name="SortKey" type="string" minOccurs="0" maxOccurs="unbounded"/>
605
+ </sequence>
606
+ </complexType>
607
+
608
+ <complexType name="AggregationKeyList">
609
+ <sequence>
610
+ <element name="AggregationKey" type="string" minOccurs="0" maxOccurs="unbounded"/>
611
+ </sequence>
612
+ </complexType>
613
+
614
+ <complexType name="AttributeMetadata">
615
+ <sequence>
616
+ <element name="Properties" type="tns:PropertyList" minOccurs="0" maxOccurs="1"/>
617
+ </sequence>
618
+ <attribute name="Name" type="string" use="required"/>
619
+ </complexType>
620
+
621
+ <complexType name="AttributeMetadataList">
622
+ <sequence>
623
+ <element name="AttributeMetadata" type="tns:AttributeMetadata" minOccurs="0" maxOccurs="unbounded"/>
624
+ </sequence>
625
+ </complexType>
626
+
627
+ <complexType name="MetadataResult">
628
+ <sequence>
629
+ <element name="SearchKeys" type="tns:SearchKeyList"/>
630
+ <element name="SortKeys" type="tns:SortKeyList"/>
631
+ <element name="AggregationKeys" type="tns:AggregationKeyList"/>
632
+ <element name="AttributeMetadataList" type="tns:AttributeMetadataList"/>
633
+ </sequence>
634
+ </complexType>
635
+
636
+ <complexType name="RecordDetailsAppliedFilters">
637
+ <sequence>
638
+ <element name="RecordFilter" type="string" minOccurs="0"/>
639
+ </sequence>
640
+ </complexType>
641
+
642
+ <complexType name="RecordDetailsResult">
643
+ <sequence>
644
+ <element name="Dimensions" type="tns:DimensionList"/>
645
+ <element name="Record" type="tns:Record"/>
646
+ <element name="AppliedFilters" type="tns:RecordDetailsAppliedFilters"/>
647
+ </sequence>
648
+ </complexType>
649
+
650
+ <complexType name="AggregateRecordDetailsAppliedFilters">
651
+ <sequence>
652
+ <element name="SelectedDimensionValueIds" type="tns:DimensionValueIdList" minOccurs="0"/>
653
+ <element name="EqlExpression" type="string" minOccurs="0"/>
654
+ <element name="RecordFilter" type="string" minOccurs="0"/>
655
+ <element name="RangeFilters" type="tns:RangeFilterList" minOccurs="0"/>
656
+ </sequence>
657
+ </complexType>
658
+
659
+ <complexType name="AggregateRecordDetailsResult">
660
+ <sequence>
661
+ <element name="Dimensions" type="tns:DimensionList"/>
662
+ <element name="AggregateRecord" type="tns:AggregateRecord"/>
663
+ <element name="AppliedFilters" type="tns:AggregateRecordDetailsAppliedFilters"/>
664
+ </sequence>
665
+ <attribute name="AggregationKey" type="string" use="required"/>
666
+ </complexType>
667
+
668
+ <element name="Request">
669
+ <simpleType>
670
+ <restriction base="string"/>
671
+ </simpleType>
672
+ </element>
673
+
674
+ <complexType name="UntypedResult">
675
+ <sequence>
676
+ <any processContents="lax"/>
677
+ </sequence>
678
+ </complexType>
679
+
680
+ <complexType name="TypedResult">
681
+ <sequence>
682
+ <choice>
683
+ <element name="NavigationResults" type="tns:NavigationResult"/>
684
+ <element name="DimensionSearchResults" type="tns:DimensionSearchResult"/>
685
+ <element name="CompoundDimensionSearchResults" type="tns:CompoundDimensionSearchResult"/>
686
+ <element name="MetadataResults" type="tns:MetadataResult"/>
687
+ <element name="RecordDetailsResults" type="tns:RecordDetailsResult"/>
688
+ <element name="AggregateRecordDetailsResults" type="tns:AggregateRecordDetailsResult"/>
689
+ </choice>
690
+ </sequence>
691
+ </complexType>
692
+
693
+ <element name="Response">
694
+ <complexType>
695
+ <sequence>
696
+ <choice minOccurs="0" maxOccurs="unbounded">
697
+ <element name="UntypedResult" type="tns:UntypedResult"/>
698
+ <element name="TypedResult" type="tns:TypedResult"/>
699
+ </choice>
700
+ </sequence>
701
+ </complexType>
702
+ </element>
703
+
704
+ <complexType name="Location">
705
+ <attribute name="line" type="string" use="required"/>
706
+ <attribute name="column" type="string" use="required"/>
707
+ </complexType>
708
+
709
+ <complexType name="Span">
710
+ <sequence>
711
+ <element name="Start" type="tns:Location"/>
712
+ <element name="End" type="tns:Location"/>
713
+ </sequence>
714
+ <attribute name="uri" type="string" use="required"/>
715
+ </complexType>
716
+
717
+ <complexType name="StackTrace">
718
+ <sequence>
719
+ <element name="Span" type="tns:Span" maxOccurs="unbounded"/>
720
+ </sequence>
721
+ </complexType>
722
+
723
+ <complexType name="ErrorSequence">
724
+ <sequence>
725
+ <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
726
+ </sequence>
727
+ </complexType>
728
+
729
+ <element name="Fault">
730
+ <complexType>
731
+ <sequence>
732
+ <element name="ErrorCode" type="string"/>
733
+ <element name="ErrorDetail" type="string"/>
734
+ <element name="ErrorSequence" type="tns:ErrorSequence"/>
735
+ <element name="StackTrace" type="tns:StackTrace"/>
736
+ </sequence>
737
+ </complexType>
738
+ </element>
739
+
740
+ </schema>
741
+ </types>
742
+
743
+ <message name="MDEXRequest">
744
+ <part name="request" element="tns:Request"/>
745
+ </message>
746
+
747
+ <message name="MDEXResponse">
748
+ <part name="response" element="tns:Response"/>
749
+ </message>
750
+
751
+ <message name="MDEXFault">
752
+ <part name="fault" element="tns:Fault"/>
753
+ </message>
754
+
755
+ <portType name="MDEXPort">
756
+ <operation name="query">
757
+ <input name="request" message="tns:MDEXRequest"/>
758
+ <output name="response" message="tns:MDEXResponse"/>
759
+ <fault name="fault" message="tns:MDEXFault"/>
760
+ </operation>
761
+ </portType>
762
+
763
+ <binding name="MDEXSoapBinding" type="tns:MDEXPort">
764
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
765
+ <operation name="query">
766
+ <soap:operation soapAction=""/>
767
+ <input name="request">
768
+ <soap:body use="literal"/>
769
+ </input>
770
+ <output name="response">
771
+ <soap:body use="literal"/>
772
+ </output>
773
+ <fault name="fault">
774
+ <soap:fault use="literal" name="fault"/>
775
+ </fault>
776
+ </operation>
777
+ </binding>
778
+
779
+ <service name="MDEX">
780
+ <documentation>MDEX Evaluation Service</documentation>
781
+
782
+ <!-- connect the port to the "MDEXSoapBinding" above -->
783
+ <port name="MDEXPort" binding="tns:MDEXSoapBinding">
784
+
785
+ </port>
786
+ </service>
787
+ </definitions>