rhoconnect-adapters 1.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/CHANGELOG +4 -0
- data/Gemfile +18 -0
- data/README.md +239 -0
- data/Rakefile +31 -0
- data/bin/rhoconnect-adapters +35 -0
- data/generators/crm/templates/application/application.rb +34 -0
- data/generators/crm/templates/source/source_adapter.rb +10 -0
- data/generators/crm/templates/source/source_spec.rb +25 -0
- data/generators/crm/templates/spec/spec_helper.rb +64 -0
- data/generators/crm/vendor/ms_dynamics/adapter.rb +301 -0
- data/generators/crm/vendor/ms_dynamics/application.rb +56 -0
- data/generators/crm/vendor/ms_dynamics/lib/crm_metadata_service.rb +43 -0
- data/generators/crm/vendor/ms_dynamics/lib/crm_service.rb +141 -0
- data/generators/crm/vendor/ms_dynamics/lib/discovery_service.rb +51 -0
- data/generators/crm/vendor/ms_dynamics/lib/wlid_service.rb +159 -0
- data/generators/crm/vendor/ms_dynamics/ms_dynamics.rb +45 -0
- data/generators/crm/vendor/ms_dynamics/settings/Account.yml +46 -0
- data/generators/crm/vendor/ms_dynamics/settings/Contact.yml +40 -0
- data/generators/crm/vendor/ms_dynamics/settings/GenericObject.yml +18 -0
- data/generators/crm/vendor/ms_dynamics/settings/Lead.yml +53 -0
- data/generators/crm/vendor/ms_dynamics/settings/Opportunity.yml +41 -0
- data/generators/crm/vendor/ms_dynamics/settings/settings.yml +9 -0
- data/generators/crm/vendor/ms_dynamics/spec/application_spec.rb +23 -0
- data/generators/crm/vendor/ms_dynamics/spec/sources/account_spec.rb +49 -0
- data/generators/crm/vendor/ms_dynamics/spec/sources/contact_spec.rb +49 -0
- data/generators/crm/vendor/ms_dynamics/spec/sources/lead_spec.rb +49 -0
- data/generators/crm/vendor/ms_dynamics/spec/sources/opportunity_spec.rb +62 -0
- data/generators/crm/vendor/ms_dynamics/spec/spec_helper.rb +78 -0
- data/generators/crm/vendor/ms_dynamics/spec_data/Account.yml +6 -0
- data/generators/crm/vendor/ms_dynamics/spec_data/Contact.yml +7 -0
- data/generators/crm/vendor/ms_dynamics/spec_data/GenericObject.yml +3 -0
- data/generators/crm/vendor/ms_dynamics/spec_data/Lead.yml +12 -0
- data/generators/crm/vendor/ms_dynamics/spec_data/Opportunity.yml +6 -0
- data/generators/crm/vendor/ms_dynamics/templates.rb +57 -0
- data/generators/crm/vendor/oracle_on_demand/adapter.rb +421 -0
- data/generators/crm/vendor/oracle_on_demand/application.rb +64 -0
- data/generators/crm/vendor/oracle_on_demand/settings/Account.yml +91 -0
- data/generators/crm/vendor/oracle_on_demand/settings/Contact.yml +54 -0
- data/generators/crm/vendor/oracle_on_demand/settings/GenericObject.yml +21 -0
- data/generators/crm/vendor/oracle_on_demand/settings/Lead.yml +72 -0
- data/generators/crm/vendor/oracle_on_demand/settings/Opportunity.yml +69 -0
- data/generators/crm/vendor/oracle_on_demand/settings/settings.yml +8 -0
- data/generators/crm/vendor/oracle_on_demand/spec/application_spec.rb +14 -0
- data/generators/crm/vendor/oracle_on_demand/spec/sources/account_spec.rb +50 -0
- data/generators/crm/vendor/oracle_on_demand/spec/sources/contact_spec.rb +50 -0
- data/generators/crm/vendor/oracle_on_demand/spec/sources/lead_spec.rb +51 -0
- data/generators/crm/vendor/oracle_on_demand/spec/sources/opportunity_spec.rb +51 -0
- data/generators/crm/vendor/oracle_on_demand/spec_data/Account.yml +8 -0
- data/generators/crm/vendor/oracle_on_demand/spec_data/Contact.yml +8 -0
- data/generators/crm/vendor/oracle_on_demand/spec_data/GenericObject.yml +4 -0
- data/generators/crm/vendor/oracle_on_demand/spec_data/Lead.yml +14 -0
- data/generators/crm/vendor/oracle_on_demand/spec_data/Opportunity.yml +6 -0
- data/generators/crm/vendor/oracle_on_demand/templates.rb +52 -0
- data/generators/crm/vendor/salesforce/adapter.rb +315 -0
- data/generators/crm/vendor/salesforce/application.rb +80 -0
- data/generators/crm/vendor/salesforce/settings/Account.yml +53 -0
- data/generators/crm/vendor/salesforce/settings/Contact.yml +61 -0
- data/generators/crm/vendor/salesforce/settings/GenericObject.yml +13 -0
- data/generators/crm/vendor/salesforce/settings/Lead.yml +73 -0
- data/generators/crm/vendor/salesforce/settings/Opportunity.yml +48 -0
- data/generators/crm/vendor/salesforce/settings/settings.yml +6 -0
- data/generators/crm/vendor/salesforce/spec/application_spec.rb +14 -0
- data/generators/crm/vendor/salesforce/spec/sources/account_spec.rb +50 -0
- data/generators/crm/vendor/salesforce/spec/sources/contact_spec.rb +50 -0
- data/generators/crm/vendor/salesforce/spec/sources/lead_spec.rb +51 -0
- data/generators/crm/vendor/salesforce/spec/sources/opportunity_spec.rb +51 -0
- data/generators/crm/vendor/salesforce/spec_data/Account.yml +14 -0
- data/generators/crm/vendor/salesforce/spec_data/Contact.yml +8 -0
- data/generators/crm/vendor/salesforce/spec_data/GenericObject.yml +3 -0
- data/generators/crm/vendor/salesforce/spec_data/Lead.yml +10 -0
- data/generators/crm/vendor/salesforce/spec_data/Opportunity.yml +10 -0
- data/generators/crm/vendor/salesforce/templates.rb +45 -0
- data/generators/crm/vendor/sugar/adapter.rb +291 -0
- data/generators/crm/vendor/sugar/application.rb +50 -0
- data/generators/crm/vendor/sugar/settings/Account.yml +49 -0
- data/generators/crm/vendor/sugar/settings/Contact.yml +62 -0
- data/generators/crm/vendor/sugar/settings/GenericObject.yml +12 -0
- data/generators/crm/vendor/sugar/settings/Lead.yml +76 -0
- data/generators/crm/vendor/sugar/settings/Opportunity.yml +49 -0
- data/generators/crm/vendor/sugar/settings/settings.yml +9 -0
- data/generators/crm/vendor/sugar/spec/application_spec.rb +25 -0
- data/generators/crm/vendor/sugar/spec/sources/account_spec.rb +53 -0
- data/generators/crm/vendor/sugar/spec/sources/contact_spec.rb +53 -0
- data/generators/crm/vendor/sugar/spec/sources/lead_spec.rb +54 -0
- data/generators/crm/vendor/sugar/spec/sources/opportunity_spec.rb +54 -0
- data/generators/crm/vendor/sugar/spec_data/Account.yml +13 -0
- data/generators/crm/vendor/sugar/spec_data/Contact.yml +8 -0
- data/generators/crm/vendor/sugar/spec_data/GenericObject.yml +3 -0
- data/generators/crm/vendor/sugar/spec_data/Lead.yml +16 -0
- data/generators/crm/vendor/sugar/spec_data/Opportunity.yml +10 -0
- data/generators/crm/vendor/sugar/sugar.rb +33 -0
- data/generators/crm/vendor/sugar/templates.rb +58 -0
- data/generators/rhoconnect-adapters.rb +217 -0
- data/lib/rhoconnect-adapters/crm/crm.rb +31 -0
- data/lib/rhoconnect-adapters/soap_service.rb +70 -0
- data/lib/rhoconnect-adapters/version.rb +3 -0
- data/lib/rhoconnect-adapters.rb +2 -0
- data/rhoconnect-adapters.gemspec +36 -0
- data/spec/apps/ms_dynamics_spec.rb +19 -0
- data/spec/apps/oracle_on_demand_spec.rb +20 -0
- data/spec/apps/salesforce_spec.rb +18 -0
- data/spec/apps/sugar_spec.rb +18 -0
- data/spec/generator/generator_spec.rb +113 -0
- data/spec/spec_helper.rb +57 -0
- metadata +288 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Query_Fields:
|
|
2
|
+
# This is just a sample list of fields
|
|
3
|
+
# that are used in QueryPage
|
|
4
|
+
Id:
|
|
5
|
+
Label: Id
|
|
6
|
+
Type: id
|
|
7
|
+
AccountName:
|
|
8
|
+
Label: Name
|
|
9
|
+
Type: textinput
|
|
10
|
+
AccountType:
|
|
11
|
+
Label: Type
|
|
12
|
+
Type: Picklist
|
|
13
|
+
Priority:
|
|
14
|
+
Label: Priority
|
|
15
|
+
Type: Picklist
|
|
16
|
+
Status:
|
|
17
|
+
Label: Status
|
|
18
|
+
Type: Picklist
|
|
19
|
+
Description:
|
|
20
|
+
Label: Description
|
|
21
|
+
Type: textarea
|
|
22
|
+
MainPhone:
|
|
23
|
+
Label: Main Phone
|
|
24
|
+
Type: textinput
|
|
25
|
+
WebSite:
|
|
26
|
+
Label: Web Site
|
|
27
|
+
Type: textinput
|
|
28
|
+
NumberEmployees:
|
|
29
|
+
Label: Number Of Employees
|
|
30
|
+
Type: textinput
|
|
31
|
+
AnnualRevenues:
|
|
32
|
+
Label: Annual Revenues
|
|
33
|
+
Type: textinput
|
|
34
|
+
Industry:
|
|
35
|
+
Label: Industry
|
|
36
|
+
Type: Picklist
|
|
37
|
+
Region:
|
|
38
|
+
Label: Region
|
|
39
|
+
Type: Picklist
|
|
40
|
+
CallFrequency:
|
|
41
|
+
Label: Call Frequency
|
|
42
|
+
Type: Picklist
|
|
43
|
+
InfluenceType:
|
|
44
|
+
Label: Influence Type
|
|
45
|
+
Type: Picklist
|
|
46
|
+
Route:
|
|
47
|
+
Label: Route
|
|
48
|
+
Type: Picklist
|
|
49
|
+
|
|
50
|
+
NonQuery_MappingWS_Fields:
|
|
51
|
+
# these are the fields that are returned by Mapping WebService
|
|
52
|
+
# but can not be used in QueryPage
|
|
53
|
+
PartnerOrgStatus:
|
|
54
|
+
ModifiedbyEmailAddress:
|
|
55
|
+
CreatedbyEmailAddress:
|
|
56
|
+
AccountId:
|
|
57
|
+
OwnerPartnerName:
|
|
58
|
+
OwnerPartnerChannelManagerAlias:
|
|
59
|
+
PrincipalPartnerName:
|
|
60
|
+
PrincipalPartnerChannelManagerAlias:
|
|
61
|
+
OriginatingPartnerName:
|
|
62
|
+
OriginatingPartnerChannelManagerAlias:
|
|
63
|
+
StaticPicklist:
|
|
64
|
+
# these are fields that are Picklists
|
|
65
|
+
# but Oracle returns an error,
|
|
66
|
+
# so we define it manually here
|
|
67
|
+
Industry:
|
|
68
|
+
- Automotive
|
|
69
|
+
- Consumer Goods
|
|
70
|
+
- Energy
|
|
71
|
+
- Financial Services
|
|
72
|
+
- High Technology
|
|
73
|
+
- Insurance
|
|
74
|
+
- Manufacturing
|
|
75
|
+
- Media & Entertainment
|
|
76
|
+
- Medical
|
|
77
|
+
- Metals & Mining
|
|
78
|
+
- Non-profit
|
|
79
|
+
- Other
|
|
80
|
+
- Pharmaceuticals
|
|
81
|
+
- Public Sector
|
|
82
|
+
- Real Estate
|
|
83
|
+
- Retail
|
|
84
|
+
- Services
|
|
85
|
+
- Telecommunication
|
|
86
|
+
- Travel & Transportation
|
|
87
|
+
ObjectFields:
|
|
88
|
+
# these are reference fields to the other objects
|
|
89
|
+
|
|
90
|
+
TitleFields:
|
|
91
|
+
- AccountName
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Query_Fields:
|
|
2
|
+
# This is just a sample list of fields
|
|
3
|
+
# that are used in QueryPage
|
|
4
|
+
Id:
|
|
5
|
+
Label: Id
|
|
6
|
+
Type: id
|
|
7
|
+
MrMrs:
|
|
8
|
+
Label: Salutation
|
|
9
|
+
Type: Picklist
|
|
10
|
+
ContactFirstName:
|
|
11
|
+
Label: First Name
|
|
12
|
+
Type: textinput
|
|
13
|
+
ContactLastName:
|
|
14
|
+
Label: Last Name
|
|
15
|
+
Type: textinput
|
|
16
|
+
ContactType:
|
|
17
|
+
Label: Type
|
|
18
|
+
Type: Picklist
|
|
19
|
+
ContactEmail:
|
|
20
|
+
Label: Email
|
|
21
|
+
Type: textinput
|
|
22
|
+
WorkPhone:
|
|
23
|
+
Label: Work Phone
|
|
24
|
+
Type: textinput
|
|
25
|
+
CellularPhone:
|
|
26
|
+
Label: Cell Phone
|
|
27
|
+
Type: textinput
|
|
28
|
+
Age:
|
|
29
|
+
Label: Age
|
|
30
|
+
Type: textinput
|
|
31
|
+
Description:
|
|
32
|
+
Label: Description
|
|
33
|
+
Type: textarea
|
|
34
|
+
AccountName:
|
|
35
|
+
Label: Account Name
|
|
36
|
+
Type: object
|
|
37
|
+
Object: Account
|
|
38
|
+
|
|
39
|
+
NonQuery_MappingWS_Fields:
|
|
40
|
+
# these are the fields that are returned by Mapping WebService
|
|
41
|
+
# but can not be used in QueryPage
|
|
42
|
+
ContactId:
|
|
43
|
+
ModifiedbyEmailAddress:
|
|
44
|
+
CreatedbyEmailAddress:
|
|
45
|
+
OccamTerritory:
|
|
46
|
+
StaticPicklist:
|
|
47
|
+
# these are fields that are Picklists
|
|
48
|
+
# but Oracle returns an error
|
|
49
|
+
ObjectFields:
|
|
50
|
+
AccountName:
|
|
51
|
+
|
|
52
|
+
TitleFields:
|
|
53
|
+
- ContactLastName
|
|
54
|
+
- ContactFirstName
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Query_Fields:
|
|
2
|
+
# This is just a sample list of fields
|
|
3
|
+
# that are used in QueryPage
|
|
4
|
+
Id:
|
|
5
|
+
Label: Id
|
|
6
|
+
Type: id
|
|
7
|
+
|
|
8
|
+
NonQuery_MappingWS_Fields:
|
|
9
|
+
# these are the fields that are returned by Mapping WebService
|
|
10
|
+
# but can not be used in QueryPage
|
|
11
|
+
|
|
12
|
+
StaticPicklist:
|
|
13
|
+
# these are fields that are Picklists
|
|
14
|
+
# but Oracle returns an error,
|
|
15
|
+
# so we define it manually here
|
|
16
|
+
|
|
17
|
+
ObjectFields:
|
|
18
|
+
# these are reference fields to the other objects
|
|
19
|
+
|
|
20
|
+
TitleFields:
|
|
21
|
+
- Id
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Query_Fields:
|
|
2
|
+
# This is just a sample list of fields
|
|
3
|
+
# that are used in QueryPage
|
|
4
|
+
Id:
|
|
5
|
+
Label: Id
|
|
6
|
+
Type: id
|
|
7
|
+
MrMrs:
|
|
8
|
+
Label: Salutation
|
|
9
|
+
Type: Picklist
|
|
10
|
+
LeadFirstName:
|
|
11
|
+
Label: First Name
|
|
12
|
+
Type: textinput
|
|
13
|
+
LeadLastName:
|
|
14
|
+
Label: Last Name
|
|
15
|
+
Type: textinput
|
|
16
|
+
AccountName:
|
|
17
|
+
Label: Account Name
|
|
18
|
+
Type: object
|
|
19
|
+
Object: Account
|
|
20
|
+
CellularPhone:
|
|
21
|
+
Label: Cell Phone
|
|
22
|
+
Type: textinput
|
|
23
|
+
LeadEmail:
|
|
24
|
+
Label: Email
|
|
25
|
+
Type: textinput
|
|
26
|
+
Company:
|
|
27
|
+
Label: Company
|
|
28
|
+
Type: textinput
|
|
29
|
+
JobTitle:
|
|
30
|
+
Label: Job Title
|
|
31
|
+
Type: textinput
|
|
32
|
+
PotentialRevenue:
|
|
33
|
+
Label: Potential Revenue
|
|
34
|
+
Type: textinput
|
|
35
|
+
EstimatedCloseDate:
|
|
36
|
+
Label: Estimated Close Date
|
|
37
|
+
Type: textinput
|
|
38
|
+
Country:
|
|
39
|
+
Label: Country
|
|
40
|
+
Type: Picklist
|
|
41
|
+
Province:
|
|
42
|
+
Label: State/Province
|
|
43
|
+
Type: textinput
|
|
44
|
+
City:
|
|
45
|
+
Label: City
|
|
46
|
+
Type: textinput
|
|
47
|
+
StreetAddress:
|
|
48
|
+
Label: Street Address
|
|
49
|
+
Type: textinput
|
|
50
|
+
NonQuery_MappingWS_Fields:
|
|
51
|
+
# these are the fields that are returned by Mapping WebService
|
|
52
|
+
# but can not be used in QueryPage
|
|
53
|
+
ChannelAccountManager:
|
|
54
|
+
ObjectiveObjectiveName:
|
|
55
|
+
ModifiedbyEmailAddress:
|
|
56
|
+
CreatedbyEmailAddress:
|
|
57
|
+
LastUpdated:
|
|
58
|
+
LeadId:
|
|
59
|
+
PrincipalPartnerName:
|
|
60
|
+
PrincipalPartnerChannelManagerAlias:
|
|
61
|
+
OriginatingPartnerName:
|
|
62
|
+
OriginatingPartnerChannelManagerAlias:
|
|
63
|
+
StaticPicklist:
|
|
64
|
+
# these are fields that are Picklists
|
|
65
|
+
# but Oracle returns an error
|
|
66
|
+
ObjectFields:
|
|
67
|
+
# these are reference fields to the other objects
|
|
68
|
+
AccountName:
|
|
69
|
+
|
|
70
|
+
TitleFields:
|
|
71
|
+
- LeadLastName
|
|
72
|
+
- LeadFirstName
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Query_Fields:
|
|
2
|
+
# This is just a sample list of fields
|
|
3
|
+
# that are used in QueryPage
|
|
4
|
+
Id:
|
|
5
|
+
Label: Id
|
|
6
|
+
Type: id
|
|
7
|
+
OpportunityName:
|
|
8
|
+
Label: Name
|
|
9
|
+
Type: textinput
|
|
10
|
+
OpportunityType:
|
|
11
|
+
Label: Type
|
|
12
|
+
Type: Picklist
|
|
13
|
+
ExpectedRevenue:
|
|
14
|
+
Label: Expected Revenue
|
|
15
|
+
Type: textinput
|
|
16
|
+
Probability:
|
|
17
|
+
Label: Probability
|
|
18
|
+
Type: textinput
|
|
19
|
+
SalesStage:
|
|
20
|
+
Label: Sales Stage
|
|
21
|
+
Type: Picklist
|
|
22
|
+
Priority:
|
|
23
|
+
Label: Priority
|
|
24
|
+
Type: Picklist
|
|
25
|
+
LeadSource:
|
|
26
|
+
Label: Lead Source
|
|
27
|
+
Type: Picklist
|
|
28
|
+
NextStep:
|
|
29
|
+
Label: Next Step
|
|
30
|
+
Type: textarea
|
|
31
|
+
AccountName:
|
|
32
|
+
Label: Account Name
|
|
33
|
+
Type: object
|
|
34
|
+
Object: Account
|
|
35
|
+
NonQuery_MappingWS_Fields:
|
|
36
|
+
# these are the fields that are returned by Mapping WebService
|
|
37
|
+
# but can not be used in QueryPage
|
|
38
|
+
OpportunityId:
|
|
39
|
+
ChannelAccountManager:
|
|
40
|
+
ApprovedDRPartnerId:
|
|
41
|
+
ApprovedDRExpiresDate:
|
|
42
|
+
ApprovedDRId:
|
|
43
|
+
ModifiedByEmailAddress:
|
|
44
|
+
CreatedByEmailAddress:
|
|
45
|
+
ProgramProgramName:
|
|
46
|
+
PrincipalPartnerName:
|
|
47
|
+
ApproverAlias:
|
|
48
|
+
PrincipalPartnerName:
|
|
49
|
+
PrincipalPartnerChannelManagerAlias:
|
|
50
|
+
OriginatingPartnerName:
|
|
51
|
+
OriginatingPartnerChannelManagerAlias:
|
|
52
|
+
StaticPicklist:
|
|
53
|
+
# these are fields that are Picklists
|
|
54
|
+
# but Oracle returns an error,
|
|
55
|
+
# so we define it manually here
|
|
56
|
+
SalesStage:
|
|
57
|
+
- Qualified Lead
|
|
58
|
+
- Closed/Won
|
|
59
|
+
- Closed/Lost
|
|
60
|
+
- Short List
|
|
61
|
+
- Selected
|
|
62
|
+
- Negotiation
|
|
63
|
+
- Building Vision
|
|
64
|
+
ObjectFields:
|
|
65
|
+
# these are reference fields to the other objects
|
|
66
|
+
AccountName:
|
|
67
|
+
|
|
68
|
+
TitleFields:
|
|
69
|
+
- OpportunityName
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
:test:
|
|
2
|
+
:oraclecrm_service_url: https://secure-ausomxkwa.crmondemand.com/Services/Integration
|
|
3
|
+
:production:
|
|
4
|
+
:oraclecrm_service_url: https://secure-ausomxkwa.crmondemand.com/Services/Integration
|
|
5
|
+
:development:
|
|
6
|
+
:oraclecrm_service_url: https://secure-ausomxkwa.crmondemand.com/Services/Integration
|
|
7
|
+
|
|
8
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__),'spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Application" do
|
|
4
|
+
it_should_behave_like "SpecHelper" do
|
|
5
|
+
it "should authenticate" do
|
|
6
|
+
Application.authenticate(@test_user,@test_password,nil).should be_true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should not authenticate with wrong credentials" do
|
|
10
|
+
Application.should_receive(:warn).once.with(/wrong_user: #<RuntimeError: LOGIN/)
|
|
11
|
+
Application.authenticate('wrong_user','wrong_password',nil).should be_false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Account" do
|
|
4
|
+
it_should_behave_like "SpecHelper" do
|
|
5
|
+
before(:each) do
|
|
6
|
+
sample_data_file = File.join(File.dirname(__FILE__),'..','..','vendor','oracle_on_demand','spec_data','Account.yml')
|
|
7
|
+
@sample_data = YAML.load_file(sample_data_file)['Account'] if sample_data_file and File.exist?(sample_data_file)
|
|
8
|
+
setup_test_for Account,@test_user
|
|
9
|
+
Application.authenticate(@test_user, @test_password,"")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
before(:each) do
|
|
13
|
+
@ss.adapter.login
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
after(:each) do
|
|
17
|
+
@ss.adapter.logoff
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should process Account query" do
|
|
21
|
+
result = test_query
|
|
22
|
+
puts result.length.inspect
|
|
23
|
+
query_errors.should == {}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "should process Account create" do
|
|
27
|
+
create_hash = @sample_data
|
|
28
|
+
result = test_create(create_hash)
|
|
29
|
+
puts result.inspect
|
|
30
|
+
create_hash['Id'] = result
|
|
31
|
+
TestHelpers.created_records = { result => create_hash }
|
|
32
|
+
create_errors.should == {}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "should process Account update" do
|
|
36
|
+
TestHelpers.created_records.each do |key,value|
|
|
37
|
+
value["AccountName"] = "Sample Update #{key.to_s}"
|
|
38
|
+
end
|
|
39
|
+
result = test_update(TestHelpers.created_records)
|
|
40
|
+
puts result.inspect
|
|
41
|
+
update_errors.should == {}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "should process Account delete" do
|
|
45
|
+
result = test_delete(TestHelpers.created_records)
|
|
46
|
+
puts result.inspect
|
|
47
|
+
delete_errors.should == {}
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Contact" do
|
|
4
|
+
it_should_behave_like "SpecHelper" do
|
|
5
|
+
before(:each) do
|
|
6
|
+
sample_data_file = File.join(File.dirname(__FILE__),'..','..','vendor','oracle_on_demand','spec_data','Contact.yml')
|
|
7
|
+
@sample_data = YAML.load_file(sample_data_file)['Contact'] if sample_data_file and File.exist?(sample_data_file)
|
|
8
|
+
setup_test_for Contact,@test_user
|
|
9
|
+
Application.authenticate(@test_user, @test_password,"")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
before(:each) do
|
|
13
|
+
@ss.adapter.login
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
after(:each) do
|
|
17
|
+
@ss.adapter.logoff
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should process Contact query" do
|
|
21
|
+
result = test_query
|
|
22
|
+
puts result.length.inspect
|
|
23
|
+
query_errors.should == {}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "should process Contact create" do
|
|
27
|
+
create_hash = @sample_data
|
|
28
|
+
result = test_create(create_hash)
|
|
29
|
+
puts result.inspect
|
|
30
|
+
create_hash['Id'] = result
|
|
31
|
+
TestHelpers.created_records = { result => create_hash }
|
|
32
|
+
create_errors.should == {}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it "should process Contact update" do
|
|
36
|
+
TestHelpers.created_records.each do |key,value|
|
|
37
|
+
value["ContactFirstName"] = "Changed Name #{key.to_s}"
|
|
38
|
+
end
|
|
39
|
+
result = test_update(TestHelpers.created_records)
|
|
40
|
+
puts result.inspect
|
|
41
|
+
update_errors.should == {}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "should process Contact delete" do
|
|
45
|
+
result = test_delete(TestHelpers.created_records)
|
|
46
|
+
puts result.inspect
|
|
47
|
+
delete_errors.should == {}
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Lead" do
|
|
4
|
+
it_should_behave_like "SpecHelper" do
|
|
5
|
+
|
|
6
|
+
before(:each) do
|
|
7
|
+
sample_data_file = File.join(File.dirname(__FILE__),'..','..','vendor','oracle_on_demand','spec_data','Lead.yml')
|
|
8
|
+
@sample_data = YAML.load_file(sample_data_file)['Lead'] if sample_data_file and File.exist?(sample_data_file)
|
|
9
|
+
setup_test_for Lead,@test_user
|
|
10
|
+
Application.authenticate(@test_user, @test_password,"")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
before(:each) do
|
|
14
|
+
@ss.adapter.login
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after(:each) do
|
|
18
|
+
@ss.adapter.logoff
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should process Lead query" do
|
|
22
|
+
result = test_query
|
|
23
|
+
puts result.length.inspect
|
|
24
|
+
query_errors.should == {}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "should process Lead create" do
|
|
28
|
+
create_hash = @sample_data
|
|
29
|
+
result = test_create(create_hash)
|
|
30
|
+
puts result.inspect
|
|
31
|
+
create_hash['Id'] = result
|
|
32
|
+
TestHelpers.created_records = { result => create_hash }
|
|
33
|
+
create_errors.should == {}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it "should process Lead update" do
|
|
37
|
+
TestHelpers.created_records.each do |key,value|
|
|
38
|
+
value["LeadFirstName"] = "Changed Lead #{key.to_s}"
|
|
39
|
+
end
|
|
40
|
+
result = test_update(TestHelpers.created_records)
|
|
41
|
+
puts result.inspect
|
|
42
|
+
update_errors.should == {}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "should process Lead delete" do
|
|
46
|
+
result = test_delete(TestHelpers.created_records)
|
|
47
|
+
puts result.inspect
|
|
48
|
+
delete_errors.should == {}
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Opportunity" do
|
|
4
|
+
it_should_behave_like "SpecHelper" do
|
|
5
|
+
|
|
6
|
+
before(:each) do
|
|
7
|
+
sample_data_file = File.join(File.dirname(__FILE__),'..','..','vendor','oracle_on_demand','spec_data','Opportunity.yml')
|
|
8
|
+
@sample_data = YAML.load_file(sample_data_file)['Opportunity'] if sample_data_file and File.exist?(sample_data_file)
|
|
9
|
+
setup_test_for Opportunity,@test_user
|
|
10
|
+
Application.authenticate(@test_user, @test_password,"")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
before(:each) do
|
|
14
|
+
@ss.adapter.login
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after(:each) do
|
|
18
|
+
@ss.adapter.logoff
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should process Opportunity query" do
|
|
22
|
+
result = test_query
|
|
23
|
+
puts result.length.inspect
|
|
24
|
+
query_errors.should == {}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "should process Opportunity create" do
|
|
28
|
+
create_hash = @sample_data
|
|
29
|
+
result = test_create(create_hash)
|
|
30
|
+
puts result.inspect
|
|
31
|
+
create_hash["Id"] = result
|
|
32
|
+
TestHelpers.created_records = { result => create_hash }
|
|
33
|
+
create_errors.should == {}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it "should process Opportunity update" do
|
|
37
|
+
TestHelpers.created_records.each do |key,value|
|
|
38
|
+
value["OpportunityName"] = "Changed Opportunity #{key.to_s}"
|
|
39
|
+
end
|
|
40
|
+
result = test_update(TestHelpers.created_records)
|
|
41
|
+
puts result.inspect
|
|
42
|
+
update_errors.should == {}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "should process Opportunity delete" do
|
|
46
|
+
result = test_delete(TestHelpers.created_records)
|
|
47
|
+
puts result.inspect
|
|
48
|
+
delete_errors.should == {}
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Lead:
|
|
2
|
+
MrMrs: Mr.
|
|
3
|
+
LeadFirstName: John
|
|
4
|
+
LeadLastName: Smith
|
|
5
|
+
CellularPhone: (555)111-1111
|
|
6
|
+
Email: john.smith@example.com
|
|
7
|
+
Company: ABC Company
|
|
8
|
+
JobTitle: Sales Assistant
|
|
9
|
+
PotentialRevenue: $40000
|
|
10
|
+
EstimatedCloseDate: 5/15/2011
|
|
11
|
+
Country: USA
|
|
12
|
+
Province: CA
|
|
13
|
+
City: San Francisco
|
|
14
|
+
StreetAddress: 111 Market St.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# these are Oracle-specific Templater::Generator templates
|
|
2
|
+
module RhoconnectAdapters
|
|
3
|
+
module CRM
|
|
4
|
+
module OracleOnDemand
|
|
5
|
+
class << self
|
|
6
|
+
def configure_gemfile
|
|
7
|
+
# put all specific dependencies here
|
|
8
|
+
# in the form of hash {'gem' => 'version'}
|
|
9
|
+
{}
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
RhoconnectAdapters::CRMAppGenerator.add_vendor_templates :template, :settings_yml do |template,name,crm|
|
|
17
|
+
template.source = File.join('..','..','vendor','oracle_on_demand','settings','settings.yml')
|
|
18
|
+
template.destination = File.join("#{name}", 'vendor','oracle_on_demand','settings','settings.yml')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
RhoconnectAdapters::CRMAppGenerator.add_vendor_templates :file, :application_spec do |file,name,crm|
|
|
22
|
+
file.source = File.join('..','..','vendor','oracle_on_demand','spec','application_spec.rb')
|
|
23
|
+
file.destination = File.join("#{name}", 'spec','application_spec.rb')
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
RhoconnectAdapters::CRMSourceGenerator.add_vendor_templates :file, :object_yml do |file,name,crm|
|
|
27
|
+
source_name = name.gsub('-', '_').camel_case
|
|
28
|
+
source_filename = File.join('..','..','vendor','oracle_on_demand','settings',"#{source_name}.yml")
|
|
29
|
+
if File.exists? File.join(CRMSourceGenerator.source_root, source_filename)
|
|
30
|
+
file.source = source_filename
|
|
31
|
+
else
|
|
32
|
+
file.source = File.join('..','..','vendor','oracle_on_demand','settings',"GenericObject.yml")
|
|
33
|
+
end
|
|
34
|
+
file.destination = File.join('vendor','oracle_on_demand','settings', "#{source_name}.yml")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
RhoconnectAdapters::CRMSourceGenerator.add_vendor_templates :template, :spec_data do |template,name,crm|
|
|
38
|
+
source_name = name.gsub('-', '_').camel_case
|
|
39
|
+
source_filename = File.join('..','..','vendor','oracle_on_demand','spec_data',"#{source_name}.yml")
|
|
40
|
+
if File.exists? File.join(CRMSourceGenerator.source_root, source_filename)
|
|
41
|
+
template.source = source_filename
|
|
42
|
+
else
|
|
43
|
+
template.source = File.join('..','..','vendor','oracle_on_demand','spec_data',"GenericObject.yml")
|
|
44
|
+
end
|
|
45
|
+
template.destination = File.join('vendor','oracle_on_demand','spec_data', "#{source_name}.yml")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|