endeca_on_demand 0.9.9.5 → 0.9.9.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -73,23 +73,15 @@ Pass your 'host' and 'options' hash to new EndecaOnDemand
73
73
 
74
74
  @endeca = EndecaOnDemand.new(host, options)
75
75
 
76
- All of the following have been exposed as part of the API, most should be pretty self explanatory of what they return:
77
-
76
+ All of the following have been exposed as part of the API, most of them will also have sub api methods available which will become visible with a .inspect on the object:
77
+
78
78
  @endeca.records
79
- @endeca.record_offset
80
- @endeca.records_per_page
81
- @endeca.total_record_count
82
79
  @endeca.breadcrumbs
83
- @endeca.filtercrumbs - Filtercrumbs are pretty much breadcrumbs that are tailored to be used as left nav filterables (per Thanx Medias recommendation)
80
+ @endeca.filtercrumbs (Filtercrumbs are breadcrumbs that have been tailored for use as left nav filterables)
84
81
  @endeca.dimensions
85
82
  @endeca.rules
86
- @endeca.searchs
87
-
88
- NOTE: The following are part of a search result so expect a change where they become part of a search results class rather than naked calls
89
- @endeca.matchedrecordcount
90
- @endeca.matchedmode
91
- @endeca.applied_search_adjustments
92
- @endeca.suggested_search_adjustments
83
+ @endeca.search_reports
84
+ @endeca.keyword_redirect
93
85
  @endeca.selected_dimension_value_ids
94
86
 
95
87
  I also exposed some 'debug'-ish type options to the API so you can see a little of what your request/response looks like if your not getting back the results your expecting
@@ -98,59 +90,19 @@ I also exposed some 'debug'-ish type options to the API so you can see a little
98
90
  @endeca.http
99
91
  @endeca.base
100
92
  @endeca.query
93
+ @endeca.raw_response
101
94
  @endeca.response
95
+ @endeca.error
96
+
97
+ Below is an example of how you could access the response data:
102
98
 
103
- Below are (ruby) examples of how you could access the response data:
104
-
105
- Records:
106
-
107
- @endeca.records.each do |record|
108
- puts "---------- BEGIN RECORD"
109
- puts "RECORD: #{record.inspect}"
110
- puts "---------- END"
111
- end
112
-
113
- Breadcrumbs/Filtercrumbs:
114
-
115
- @endeca.breadcrumbs.each do |crumb|
116
- puts "---------- BEGIN CRUMB"
117
- puts "CRUMB: #{crumb.inspect}"
118
- puts "---------- END"
119
- end
120
-
121
- @endeca.filtercrumbs.each do |crumb|
122
- puts "---------- BEGIN CRUMB"
123
- puts "CRUMB: #{crumb.inspect}"
124
- puts "---------- END"
125
- end
126
-
127
- Dimensions:
128
-
129
- @endeca.dimensions.each do |dimension|
130
- puts "---------- BEGIN DIMENSION"
131
- puts "DIMENSION: #{dimension.inspect}"
132
- puts "DIMENSION VALUES: #{dimension.dimensionvalues}"
133
- puts "DIMENSION VALUES ARRAY: #{dimension.dimension_values}"
134
- puts "---------- END"
135
- end
136
-
137
- Rules:
138
-
139
- @endeca.rules.each do |rule|
140
- puts "---------- BEGIN RULE"
141
- puts "RULE: #{rule.inspect}"
142
- puts "RULE PROPERTIES: #{rule.properties}"
143
- puts "RULE PROPERTIES_ARRAY: #{rule.properties_array}"
144
- puts "RULE RECORDS: #{rule.records}"
145
- puts "---------- END"
146
- end
99
+ - @endeca.records.each do |record|
100
+ puts "----- RECORD: #{record.inspect}"
147
101
 
148
- Each object will have associated instance variables that will allow you directly call any value on that object:
102
+ Each object will then have associated instance variables exposed that will allow you directly call any value on that object:
149
103
 
150
- @endeca.records.each do |record|
151
- record.p_name
152
- etc...
153
- end
104
+ - @endeca.records.each do |record|
105
+ puts "----- RECORD NAME: #{record.p_name}"
154
106
 
155
107
  === F.A.Q
156
108
 
@@ -164,7 +116,7 @@ Each object will have associated instance variables that will allow you directly
164
116
  * Add tests
165
117
  * I don't have all the possible advanced parameters, so for now it only handles the default 'AggregationKey'
166
118
  * Search needs some more testing. Currently its only been setup with a basic search, so I'm not aware of what additional parameters might be coming in, and how I may need to handle them
167
- * Review the classes and create any additional classes that might be useful where only an instance variable currently exists (i.e. search_reports or paging)
119
+ * [complete] Review the classes and create any additional classes that might be useful where only an instance variable currently exists
168
120
 
169
121
  === CONTACT
170
122
 
@@ -43,7 +43,7 @@ class EndecaOnDemand
43
43
 
44
44
  ## DEBUG
45
45
  attr_reader :uri, :http
46
- attr_reader :base, :query, :request, :raw_response, :response, :error
46
+ attr_reader :base, :query, :request, :response, :error
47
47
  ## /DEBUG
48
48
  ### /API
49
49
 
@@ -72,26 +72,21 @@ class EndecaOnDemand
72
72
 
73
73
  begin
74
74
  @request, @raw_response = @http.post(@uri.path, @query.target!, 'Content-type' => 'application/xml')
75
- handle_response(Nokogiri::XML(@raw_response))
75
+
76
+ @response = Nokogiri::XML(@raw_response)
77
+
78
+ build_records
79
+ build_breadcrumbs
80
+ build_dimensions
81
+ build_business_rules
82
+ build_search_reports
83
+ build_selected_dimension_value_ids
84
+ build_keyword_redirect
76
85
  rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => error
77
86
  @error = error
78
87
  end
79
88
  end
80
89
 
81
- ## HANDLE RESPONSE
82
-
83
- def handle_response(response)
84
- @response = response
85
-
86
- build_records
87
- build_breadcrumbs
88
- build_dimensions
89
- build_business_rules
90
- build_search_reports
91
- build_selected_dimension_value_ids
92
- build_keyword_redirect
93
- end
94
-
95
90
  ### XML REQUEST ###
96
91
 
97
92
  ## SET REQUEST HOST
@@ -1,3 +1,3 @@
1
1
  class EndecaOnDemand
2
- VERSION = "0.9.9.5"
2
+ VERSION = "0.9.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: endeca_on_demand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9.5
4
+ version: 0.9.9.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70328031715700 !ruby/object:Gem::Requirement
16
+ requirement: &70334016591400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70328031715700
24
+ version_requirements: *70334016591400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70328031713880 !ruby/object:Gem::Requirement
27
+ requirement: &70334016590220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70328031713880
35
+ version_requirements: *70334016590220
36
36
  description: EndecaOnDemand will take a query-string and construct an XML query and
37
37
  send it to an hosted Endeca On-Demand Cluster. It will then parse the response and
38
38
  expose an API for using the response data.