endeca_xml 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,8 +6,8 @@ endeca_xml provides an interface between your web application and the thanxmedia
6
6
 
7
7
  * Builds an XML query, formatted to thanxmedia specifications, via form filed hidden inputs which specify all the desired settings
8
8
  * Parses the settings parameters and sends a completed XML query to thanxmedia API
9
- * Handles the response XML and exposes methods to retrieve response data
10
-
9
+ * Handles the response XML and exposes methods to retrieve response data
10
+
11
11
  == Install
12
12
 
13
13
  === Rails
@@ -17,20 +17,21 @@ Add this line to your Gemfile:
17
17
  gem 'endeca_xml'
18
18
 
19
19
  Then bundle install:
20
-
20
+
21
21
  bundle install
22
-
22
+
23
23
  ---
24
-
24
+
25
25
  === Non Rails
26
26
 
27
27
  gem install endeca_xml
28
-
28
+
29
29
  == Usage
30
30
 
31
31
  A lot more work has been done since the previous version. endeca_xml now constructs an XML query to send to thanxmedia via a form submission. An example of how the form is formatted is below:
32
32
 
33
33
  <form method="post" action="/endeca">
34
+ <input type="hidden" name="endeca[host]" value="{'host' => ''}">
34
35
  <input type="hidden" name="endeca[base]" value="{'RecordsSet' => true, 'Dimensions' => true, 'BusinessRulesResult' => true, 'AppliedFilters' => true}" />
35
36
  <input type="hidden" name="endeca[nav]" value="{'type' => 'category [or] dimension', 'ids' => [1, 2, 3, 4]}" />
36
37
  <input type="hidden" name="endeca[search]" value="{'search-key' => 'key', 'search-term' => 'term'}" />
@@ -41,9 +42,9 @@ A lot more work has been done since the previous version. endeca_xml now constru
41
42
  <input type="hidden" name="endeca[filters]" value="{'Between' => {'lower-bound' => 1, 'upper-bound' => 2, 'attribute-name' => 'test', 'lat-long' => 123.4, 'distance' => '100'}, 'LessThan' => {}, 'LessThanOrEqual' => {}, 'GreaterThan' => {}, 'GreaterThanOrEqual' => {}, 'GeocodeLessThan' => {}, 'GeocodeGreaterThan' => {}, 'GeocodeBetween' => {}}" />
42
43
  <input type="submit" />
43
44
  </form>
44
-
45
+
45
46
  This example is a complete example. It is not necessary to include anything that you don't intend to use (ie. blank or empty hash's/values). If you don't need an option, don't include the input field, and if you don't need a value within an option don't include it.
46
-
47
+
47
48
  == TODO
48
49
 
49
50
  * (complete) Pass all parameters into the initializer and have EndecaXml deconstruct the url and reconstruct it as XML rather than having the developer use each method individually.
data/lib/endeca_xml.rb CHANGED
@@ -7,7 +7,7 @@ require 'uri'
7
7
  # each input name corresponds to a function that is called when building the XML. It is important that the names stay the same (for now)!
8
8
  #
9
9
  # <form action="/endeca" method="post">
10
- # <input type="hidden" name="endeca[host]" value="{'host' => 'http://eodhc.endecaondemand.net:35828/ws/main'}">
10
+ # <input type="hidden" name="endeca[host]" value="{'host' => ''}">
11
11
  # <input type="hidden" name="endeca[base]" value="{'RecordsSet' => true, 'Dimensions' => true, 'BusinessRulesResult' => true, 'AppliedFilters' => true}" />
12
12
  # <input type="hidden" name="endeca[nav]" value="{'type' => 'category [or] dimension', 'ids' => [1, 2, 3, 4]}" />
13
13
  # <input type="hidden" name="endeca[search]" value="{'search-key' => 'key', 'search-term' => 'term'}" />
@@ -47,7 +47,7 @@ class EndecaXml
47
47
  options.each do |key, value|
48
48
  @uri = URI.parse(value)
49
49
  end
50
- @http = Net::HTTP.new(uri.host, uri.port)
50
+ @http = Net::HTTP.new(@uri.host, @uri.port)
51
51
  end
52
52
 
53
53
  def base(options)
@@ -1,3 +1,3 @@
1
1
  class EndecaXml
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: endeca_xml
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.3
5
+ version: 0.5.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - sdomino