activesalesforce 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,44 @@
1
+ =begin
2
+ ActiveSalesforce
3
+ Copyright 2006 Doug Chasman
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ =end
17
+
18
+ require 'rubygems'
19
+ require_gem 'rails', ">= 1.0.0"
20
+
21
+ require 'pp'
22
+
23
+
24
+ module ActiveSalesforce
25
+
26
+ class SessionIDAuthenticationFilter
27
+
28
+ def self.filter(controller)
29
+ # Look to see if a SID was passed in the URL
30
+ params = controller.params
31
+ sid = params[:sid]
32
+ if sid
33
+ api_server_url = params[:api_server_url]
34
+ api_server_url = 'http://na1-api.salesforce.com/services/Soap/u/7.0' unless api_server_url
35
+
36
+ puts "asf_sid_authenticate(:sid => '#{sid}', :url => '#{api_server_url}')"
37
+ Contact.establish_connection(:adapter => 'activesalesforce', :sid => sid, :url => api_server_url) if sid
38
+ end
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: activesalesforce
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.4
7
- date: 2006-02-26 00:00:00 -05:00
6
+ version: 0.3.6
7
+ date: 2006-02-27 00:00:00 -05:00
8
8
  summary: ActiveSalesforce (ASF) is a Rails connection adapter that provides direct access to Salesforce.com hosted data and metadata via the ActiveRecord model layer. Objects, fields, and relationships are all auto surfaced as active record attributes and rels.
9
9
  require_paths:
10
10
  - lib
@@ -35,6 +35,7 @@ files:
35
35
  - lib/mock_binding.rb
36
36
  - lib/rforce.rb
37
37
  - lib/asf_adapter.rb
38
+ - lib/sid_authentication_filter.rb
38
39
  - lib/relationship_definition.rb
39
40
  - test/unit
40
41
  - test/unit/recorded_test_case.rb
@@ -45,7 +46,6 @@ files:
45
46
  - test/unit/recorded_results
46
47
  - test/unit/test.html
47
48
  - test/unit/profiler_results_live.txt
48
- - test/unit/asf_scaffold_generator_test.rb
49
49
  - test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact.recording
50
50
  - test/unit/recorded_results/AsfUnitTestsBasicTest.test_batch_insert.recording
51
51
  - test/unit/recorded_results/AsfUnitTestsBasicTest.test_read_all_content_columns.recording
@@ -97,5 +97,5 @@ dependencies:
97
97
  requirements:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- version: 0.0.2
100
+ version: 0.0.7
101
101
  version:
@@ -1,108 +0,0 @@
1
- =begin
2
- ActiveSalesforce
3
- Copyright 2006 Doug Chasman
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- =end
17
-
18
- require 'rubygems'
19
-
20
- #require_gem 'activesalesforce', '>= 0.2.6'
21
- require 'activesalesforce'
22
-
23
- require 'recorded_test_case'
24
- require 'pp'
25
-
26
-
27
- class Contact < ActiveRecord::Base
28
- end
29
-
30
- class Department < ActiveRecord::Base
31
- end
32
-
33
-
34
- module Asf
35
- module UnitTests
36
-
37
- class AsfScaffoldGeneratorTest < Test::Unit::TestCase
38
- include RecordedTestCase
39
-
40
- attr_reader :contact
41
-
42
- def initialize(test_method_name)
43
- super(test_method_name)
44
-
45
- #force_recording :test_describe_layout
46
- end
47
-
48
- def setup
49
- puts "\nStarting test '#{self.class.name.gsub('::', '')}.#{method_name}'"
50
-
51
- super
52
- end
53
-
54
- def teardown
55
- super
56
- end
57
-
58
-
59
- def test_describe_layout
60
- entity_def = Contact.connection.get_entity_def("Contact")
61
-
62
- layouts = entity_def.layouts
63
-
64
- puts "<table>"
65
- layouts[:layouts][:detailLayoutSections].each do |section|
66
- rows = section[:layoutRows]
67
- rows = [ rows ] unless rows.is_a? Array
68
-
69
- rows.each do | row |
70
- puts " <tr>"
71
-
72
- items = row[:layoutItems]
73
- items = [ items ] unless items.is_a? Array
74
-
75
- items.each do | item |
76
- puts " <td>#{item[:label]}</td>"
77
-
78
- components = item[:layoutComponents]
79
-
80
- components = [ components ] unless components.is_a? Array
81
-
82
- puts " <td>"
83
- components.each do |component|
84
- next if component.nil?
85
-
86
- if component[:type] == "Field"
87
- field = component[:value]
88
- column = entity_def.api_name_to_column[field]
89
-
90
- puts "@contact.#{column.name} "
91
- end
92
- end
93
- puts " </td>"
94
-
95
- end
96
-
97
- puts " </tr>"
98
- end
99
-
100
- end
101
-
102
- puts "</table>"
103
- end
104
-
105
- end
106
-
107
- end
108
- end