ecircle 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .idea
2
2
  pkg
3
- runner.rb
3
+ async_runner.rb
4
+ sync_runner.rb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ecircle (0.0.4)
4
+ ecircle (0.0.5)
5
5
  activesupport
6
6
  i18n
7
7
  rake
@@ -49,7 +49,7 @@ module Ecircle
49
49
  @response = client.request :logon do
50
50
  soap.body = {
51
51
  :user => Ecircle.configuration.user,
52
- :realm => Ecircle.configuration.realm,
52
+ :realm => Ecircle.configuration.sync_realm,
53
53
  :passwd => Ecircle.configuration.password
54
54
  }
55
55
  end
@@ -4,7 +4,7 @@ module Ecircle
4
4
  ENDPOINT = 'http://webservices.ecircle-ag.com/rpc'
5
5
  NAMESPACE = "http://webservices.ecircleag.com/rpcns"
6
6
 
7
- attr_accessor :user, :password, :realm, :wsdl, :endpoint, :namespace
7
+ attr_accessor :user, :password, :sync_realm, :async_realm, :wsdl, :endpoint, :namespace
8
8
 
9
9
  def initialize
10
10
  @wsdl = WSDL
@@ -2,59 +2,67 @@ module Ecircle
2
2
  module JobPackage
3
3
  TARGET_CONTENT_ENCODING = 'ISO-8859-1'
4
4
 
5
- def self.send_asynch_message_to_group(options)
6
- xml = xml_for_asynch_calls(options)
5
+ def self.send_async_message_to_group(options)
6
+ client = Savon::Client.new do
7
+ wsdl.endpoint = 'http://webservices.ecircle-ag.com/ws'
8
+ wsdl.namespace = "http://webservices.ecircleag.com/ws"
9
+ end
10
+
11
+ response = client.request :control, 'xmlns' => "http://webservices.ecircle-ag.com/ecm", 'request-id' => options[:request_id], 'group-id' => options[:group_id] do
12
+ soap.header = { :authenticate => { :realm => Ecircle.configuration.async_realm,
13
+ :email => Ecircle.configuration.user,
14
+ :password => Ecircle.configuration.password },
15
+ :attributes! => { :authenticate => { "xmlns" => "http://webservices.ecircle-ag.com/ws" } } }
16
+ soap.body = soap_body(options)
17
+ end
7
18
  end
8
19
 
9
- def self.xml_for_asynch_calls(options)
20
+ def self.soap_body(options)
10
21
  xml = Builder::XmlMarkup.new(:indent => 2)
11
- xml.instruct!
12
- xml.control :xmlns => 'http://webservices.ecircle-ag.com/ecm', 'request-id' => options[:request_id], 'group-id' => options[:group_id] do
13
- xml.message 'message-id' => 'new', 'delete' => 'false' do
14
- xml.tag! 'sendout-preferences' do
15
- xml.tag! 'object-handling', 'html-images' => 'untouched'
16
- xml.tag! 'email-channel', 'preferred-format' => 'email-html-multipart'
17
- end
18
- xml.tag! 'send-date' do
19
- xml.date Helper.date_format(options[:send_out_date])
22
+ xml.message 'message-id' => 'new', 'delete' => 'false' do
23
+ xml.tag! 'sendout-preferences' do
24
+ xml.tag! 'object-handling', 'html-images' => 'untouched'
25
+ xml.tag! 'email-channel', 'preferred-format' => 'email-html-multipart'
26
+ end
27
+ xml.tag! 'send-date' do
28
+ xml.date Helper.date_format(options[:send_out_date])
29
+ end
30
+ xml.tag! 'send-report-address' do
31
+ xml.tag! 'email-address' do
32
+ xml.email options[:report_email]
33
+ xml.name "Send report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
20
34
  end
21
- xml.tag! 'send-report-address' do
35
+ end
36
+ xml.tag! 'status-report', 'report-id' => 'new', 'delete' => 'false', 'user-tracking-details' => 'false', 'link-tracking-details' => 'false', 'bouncing-details' => 'false' do
37
+ xml.tag! 'report-address' do
22
38
  xml.tag! 'email-address' do
23
39
  xml.email options[:report_email]
24
- xml.name "Send report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
40
+ xml.name "Status report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
25
41
  end
26
42
  end
27
- xml.tag! 'status-report', 'report-id' => 'new', 'delete' => 'false', 'user-tracking-details' => 'false', 'link-tracking-details' => 'false', 'bouncing-details' => 'false' do
28
- xml.tag! 'report-address' do
29
- xml.tag! 'email-address' do
30
- xml.email options[:report_email]
31
- xml.name "Status report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
32
- end
33
- end
34
- xml.tag! 'send-date' do
35
- xml.date Helper.date_format(options[:send_date_for_report])
36
- end
37
- end
38
- xml.content 'target-content-encoding' => TARGET_CONTENT_ENCODING do
39
- xml.subject options[:subject], 'target-encoding' => TARGET_CONTENT_ENCODING
40
- xml.text options[:text], 'target-content-encoding' => TARGET_CONTENT_ENCODING
41
- xml.html options[:html], 'target-content-encoding' => TARGET_CONTENT_ENCODING
43
+ xml.tag! 'send-date' do
44
+ xml.date Helper.date_format(options[:send_date_for_report])
42
45
  end
43
46
  end
44
- xml.tag! 'success-report-address' do
45
- xml.tag! 'email-address' do
46
- xml.email options[:report_email]
47
- xml.name "Success report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
48
- end
47
+ xml.content 'target-content-encoding' => TARGET_CONTENT_ENCODING do
48
+ xml.subject options[:subject], 'target-encoding' => TARGET_CONTENT_ENCODING
49
+ xml.text options[:text], 'target-content-encoding' => TARGET_CONTENT_ENCODING
50
+ xml.html options[:html], 'target-content-encoding' => TARGET_CONTENT_ENCODING
49
51
  end
50
- xml.tag! 'failure-report-address' do
51
- xml.tag! 'email-address' do
52
- xml.email options[:report_email]
53
- xml.name "Failure report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
54
- end
52
+ end
53
+ xml.tag! 'success-report-address' do
54
+ xml.tag! 'email-address' do
55
+ xml.email options[:report_email]
56
+ xml.name "Success report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
57
+ end
58
+ end
59
+ xml.tag! 'failure-report-address' do
60
+ xml.tag! 'email-address' do
61
+ xml.email options[:report_email]
62
+ xml.name "Failure report for newsletter for location #{options[:location_name]} sent out on #{options[:send_out_date]}"
55
63
  end
56
64
  end
57
65
  xml.target!
58
66
  end
59
67
  end
60
- end
68
+ end
@@ -1,3 +1,3 @@
1
1
  module Ecircle
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecircle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &78217310 !ruby/object:Gem::Requirement
16
+ requirement: &81915150 !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: :runtime
23
23
  prerelease: false
24
- version_requirements: *78217310
24
+ version_requirements: *81915150
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: i18n
27
- requirement: &78216730 !ruby/object:Gem::Requirement
27
+ requirement: &81914550 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *78216730
35
+ version_requirements: *81914550
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &78216260 !ruby/object:Gem::Requirement
38
+ requirement: &81914140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *78216260
46
+ version_requirements: *81914140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: savon
49
- requirement: &78215740 !ruby/object:Gem::Requirement
49
+ requirement: &81913720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.9.7
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *78215740
57
+ version_requirements: *81913720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &78215320 !ruby/object:Gem::Requirement
60
+ requirement: &81879230 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 2.6.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *78215320
68
+ version_requirements: *81879230
69
69
  description: The ecircle gem aims to be a full-fledged client for all ecircle services.
70
70
  email:
71
71
  - timo.roessner@googlemail.com
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: -247901923
105
+ hash: -975259857
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: -247901923
114
+ hash: -975259857
115
115
  requirements: []
116
116
  rubyforge_project: ecircle
117
117
  rubygems_version: 1.8.6