rhoconnect 3.0.0.beta1 → 3.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/CHANGELOG +16 -2
  2. data/Gemfile +14 -5
  3. data/Gemfile.lock +13 -23
  4. data/Rakefile +86 -0
  5. data/bench/bench_runner.rb +5 -4
  6. data/bench/benchapp/Gemfile +17 -8
  7. data/bench/blobapp/Gemfile +13 -14
  8. data/doc/adapters-crm.txt +226 -0
  9. data/doc/adapters-intro.txt +18 -0
  10. data/doc/client.txt +29 -2
  11. data/doc/heroku-addon.txt +54 -0
  12. data/doc/install.txt +1 -2
  13. data/doc/migration.txt +18 -6
  14. data/doc/net-plugin.txt +276 -0
  15. data/doc/plugin-intro.txt +6 -0
  16. data/doc/push.txt +1 -1
  17. data/doc/rails-plugin.txt +116 -0
  18. data/doc/rest-api.txt +2 -2
  19. data/doc/settings.txt +59 -0
  20. data/doc/tutorial.txt +8 -5
  21. data/generators/rhoconnect.rb +30 -0
  22. data/generators/templates/application/Gemfile +16 -7
  23. data/generators/templates/application/gitignore +4 -0
  24. data/install.sh +74 -106
  25. data/installer/deb-scripts/LICENSE +75 -0
  26. data/installer/deb-scripts/install.sh +300 -0
  27. data/installer/deb-scripts/scripts/rho_connect_install_constants.rb +32 -0
  28. data/installer/deb-scripts/scripts/rho_connect_install_installers.rb +103 -0
  29. data/installer/deb-scripts/scripts/rho_connect_install_utilities.rb +110 -0
  30. data/installer/deb-scripts/scripts/rhoinstaller.rb +55 -0
  31. data/installer/deb-scripts/utils/README +67 -0
  32. data/installer/deb-scripts/utils/create_texts.rb +76 -0
  33. data/installer/deb-scripts/utils/redis_init_script +124 -0
  34. data/installer/deb-scripts/utils/redis_log_rotate +8 -0
  35. data/installer/unix-like/install.sh +361 -0
  36. data/installer/unix-like/post-install.sh +8 -0
  37. data/installer/unix-like/pre-install.sh +8 -0
  38. data/installer/unix-like/rho_connect_install_constants.rb +9 -14
  39. data/installer/unix-like/rho_connect_install_debian.rb +7 -5
  40. data/installer/unix-like/rho_connect_install_dnd.rb +6 -6
  41. data/installer/unix-like/rho_connect_install_get_params.rb +1 -1
  42. data/installer/unix-like/rho_connect_install_installers.rb +39 -38
  43. data/installer/unix-like/rho_connect_install_utilities.rb +9 -10
  44. data/installer/unix-like/rho_connect_install_yum.rb +6 -5
  45. data/installer/unix-like/rhoinstaller.rb +8 -3
  46. data/installer/utils/create_texts.rb +313 -85
  47. data/installer/windows/rhosync.nsi +5 -5
  48. data/lib/rhoconnect/api/application/clientcreate.rb +1 -1
  49. data/lib/rhoconnect/api/application/clientregister.rb +1 -1
  50. data/lib/rhoconnect/api/application/clientreset.rb +1 -1
  51. data/lib/rhoconnect/client.rb +0 -1
  52. data/lib/rhoconnect/client_sync.rb +1 -0
  53. data/lib/rhoconnect/console/app/routes/home.rb +1 -1
  54. data/lib/rhoconnect/console/app/routes/user.rb +8 -3
  55. data/lib/rhoconnect/console/app/views/adapter.erb +2 -2
  56. data/lib/rhoconnect/console/app/views/ping.erb +14 -2
  57. data/lib/rhoconnect/console/app/views/users.erb +8 -1
  58. data/lib/rhoconnect/jobs/ping_job.rb +11 -3
  59. data/lib/rhoconnect/model.rb +2 -2
  60. data/lib/rhoconnect/read_state.rb +2 -0
  61. data/lib/rhoconnect/server.rb +4 -3
  62. data/lib/rhoconnect/source.rb +33 -6
  63. data/lib/rhoconnect/source_adapter.rb +5 -9
  64. data/lib/rhoconnect/source_sync.rb +11 -5
  65. data/lib/rhoconnect/store.rb +7 -4
  66. data/lib/rhoconnect/tasks.rb +3 -3
  67. data/lib/rhoconnect/version.rb +1 -1
  68. data/lib/rhoconnect.rb +22 -8
  69. data/rhoconnect.gemspec +4 -22
  70. data/spec/api/application/rhoconnect_api_spec.rb +54 -8
  71. data/spec/api/source/get_source_params_spec.rb +2 -1
  72. data/spec/api/source/list_sources_spec.rb +3 -3
  73. data/spec/app_spec.rb +8 -1
  74. data/spec/apps/rhotestapp/settings/settings.yml +10 -5
  75. data/spec/apps/rhotestapp/sources/other_adapter.rb +7 -0
  76. data/spec/client_sync_spec.rb +5 -8
  77. data/spec/dynamic_adapter_spec.rb +8 -8
  78. data/spec/generator/generator_spec.rb +4 -2
  79. data/spec/jobs/ping_job_spec.rb +53 -0
  80. data/spec/model_spec.rb +2 -2
  81. data/spec/rhosync_spec.rb +1 -1
  82. data/spec/server/server_spec.rb +3 -14
  83. data/spec/source_sync_spec.rb +84 -2
  84. data/spec/support/shared_examples.rb +2 -2
  85. data/tasks/redis.rake +2 -2
  86. metadata +30 -41
  87. data/spec/api/rhosync_api_spec.rb.orig +0 -606
data/CHANGELOG CHANGED
@@ -1,4 +1,12 @@
1
- ## 3.0.0 (not released)
1
+ ## 3.0.0.beta3 (not released)
2
+
3
+
4
+ ## 3.0.0.beta2 (2011-09-14)
5
+ * #17830175 - moved SystemTimer in application's Gemfile so rhoconnect gem isn't specific
6
+ * #13303895 - Generating a new source with 'rhosync source <name>' deletes sections in settings.yml
7
+ * #10313437 - support source settings per environment
8
+
9
+ ## 3.0.0.beta1 (2011-09-01)
2
10
  * #1018 user delete now iterates through user sources and deletes data in redis
3
11
  * #11102931 ping api accepts vibrate string and int
4
12
  * #7197617 test spec helpers support pass through
@@ -10,7 +18,7 @@
10
18
  * #12105115 - removed unnecessary log4r dependency
11
19
  * added bundler to manage gem's dependencies, migrated from rspec1 to rspec2
12
20
  * #5687948 - fixed issue "iPhone push specs failed"
13
- * use redis 2.2.12 by default
21
+ * use redis 2.2.13 by default
14
22
  * added SystemTimer gem dependency (used only on posix systems)
15
23
  * #13616807 - Rake task spec:all fails for enterprise ruby (ree)
16
24
  * #13776713 - Rake -v 0.9.0 breaks rhosync rake tasks
@@ -35,6 +43,12 @@
35
43
  * #14286249 - jruby WAR file deployed , some of the links are broken in console window, should use the relative paths
36
44
  * #14285867 - jruby rhosync:start should have run with dtach
37
45
  * #17526603 - implement clientreset support for specified sources
46
+ * #16628143 - implement 'ping' for multiple users at once in REST API
47
+ * #18003071 - enhancing console to support multi-user ping
48
+ * #10313437 - source settings per environment (also applied to dynamic adapters)
49
+ * #18356697 - store lock is never released (bug fix)
50
+ * #18672811 - edge case produces race condition which leads to corruption of Store data
51
+ * #18508155 - on failed syncs allow the user to retry it up to pre-defined number of times
38
52
 
39
53
  ## 2.1.10 (2011-08-17)
40
54
  * #16001227 - raise exceptions on c2dm errors
data/Gemfile CHANGED
@@ -4,15 +4,24 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  platforms :jruby do
7
- gem 'trinidad'
7
+ gem 'jdbc-sqlite3', ">= 3.7.2"
8
+ gem 'dbi', ">= 0.4.5"
9
+ gem 'dbd-jdbc', ">= 0.1.4"
10
+ gem 'jruby-openssl', ">= 0.7.4"
8
11
  gem 'warbler'
9
12
  end
10
13
 
14
+ gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
15
+
11
16
  group :development do
12
- gem 'rspec', '~> 2.6.0'
13
- gem 'rcov', '>= 0.9.8'
17
+ gem 'fpm', '>= 0.3.8'
14
18
  gem 'ffaker', '~> 1.8.0'
15
- gem 'rack-test', '>= 0.5.3', :require => 'rack/test'
16
19
  gem 'thor', '>= 0.13.6'
17
20
  gem 'webmock', '~> 1.6.4'
18
- end
21
+ end
22
+
23
+ group :test do
24
+ gem 'rspec', '~> 2.6.0'
25
+ gem 'rcov', '>= 0.9.8'
26
+ gem 'rack-test', '>= 0.5.3', :require => 'rack/test'
27
+ end
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (3.0.0.beta1)
5
- SystemTimer (~> 1.2.3)
4
+ rhoconnect (3.0.0.beta3)
6
5
  bundler (~> 1.0)
7
6
  json (~> 1.5.0)
8
7
  rake (= 0.9.2)
@@ -11,36 +10,32 @@ PATH
11
10
  rest-client (~> 1.6.1)
12
11
  rubyzip (~> 0.9.4)
13
12
  sinatra (~> 1.2)
14
- sqlite3 (>= 1.3.3)
15
13
  templater (~> 1.0.0)
16
14
  uuidtools (>= 2.1.1)
17
15
 
18
16
  GEM
19
17
  remote: http://rubygems.org/
20
18
  specs:
21
- SystemTimer (1.2.3)
22
19
  addressable (2.2.6)
23
- crack (0.1.8)
20
+ crack (0.3.1)
24
21
  diff-lcs (1.1.3)
25
22
  extlib (0.9.15)
26
- ffaker (1.8.0)
23
+ ffaker (1.8.1)
24
+ fpm (0.3.9)
25
+ json
27
26
  highline (1.6.2)
28
- jruby-jars (1.6.4)
29
- jruby-rack (1.0.10)
30
27
  json (1.5.4)
31
- json (1.5.4-java)
32
28
  mime-types (1.16)
33
- rack (1.3.2)
29
+ rack (1.3.3)
34
30
  rack-test (0.6.1)
35
31
  rack (>= 1.0)
36
32
  rake (0.9.2)
37
33
  rcov (0.9.10)
38
- rcov (0.9.10-java)
39
34
  redis (2.2.2)
40
35
  redis-namespace (1.0.3)
41
36
  redis (< 3.0.0)
42
37
  resque (1.17.1)
43
- json (>= 1.4.6, < 1.6)
38
+ json (< 1.6, >= 1.4.6)
44
39
  redis-namespace (~> 1.0.2)
45
40
  sinatra (>= 0.9.2)
46
41
  vegas (~> 0.1.2)
@@ -65,33 +60,28 @@ GEM
65
60
  highline (>= 1.4.0)
66
61
  thor (0.14.6)
67
62
  tilt (1.3.3)
68
- trinidad (1.2.3)
69
- jruby-rack (>= 1.0.9)
70
- trinidad_jars (>= 1.0.1)
71
- trinidad_jars (1.0.1)
72
63
  uuidtools (2.1.2)
73
64
  vegas (0.1.8)
74
65
  rack (>= 1.0.0)
75
- warbler (1.3.2)
76
- jruby-jars (>= 1.4.0)
77
- jruby-rack (>= 1.0.0)
78
- rake (>= 0.8.7)
79
- rubyzip (>= 0.9.4)
80
66
  webmock (1.6.4)
81
67
  addressable (> 2.2.5, ~> 2.2)
82
68
  crack (>= 0.1.7)
83
69
 
84
70
  PLATFORMS
85
- java
86
71
  ruby
87
72
 
88
73
  DEPENDENCIES
74
+ dbd-jdbc (>= 0.1.4)
75
+ dbi (>= 0.4.5)
89
76
  ffaker (~> 1.8.0)
77
+ fpm (>= 0.3.8)
78
+ jdbc-sqlite3 (>= 3.7.2)
79
+ jruby-openssl (>= 0.7.4)
90
80
  rack-test (>= 0.5.3)
91
81
  rcov (>= 0.9.8)
92
82
  rhoconnect!
93
83
  rspec (~> 2.6.0)
84
+ sqlite3 (>= 1.3.3)
94
85
  thor (>= 0.13.6)
95
- trinidad
96
86
  warbler
97
87
  webmock (~> 1.6.4)
data/Rakefile CHANGED
@@ -80,3 +80,89 @@ def ask(msg)
80
80
  end
81
81
 
82
82
  Bundler::GemHelper.install_tasks
83
+
84
+ require 'rhoconnect/version'
85
+
86
+ desc "Build archive rhoconnect-#{Rhoconnect::VERSION}.tar.gz into the pkg directory"
87
+ task :archive do
88
+ `mkdir -p pkg`
89
+ `git archive --format=tar --prefix=rhoconnect-#{Rhoconnect::VERSION}/ HEAD | gzip > pkg/rhoconnect-#{Rhoconnect::VERSION}.tar.gz`
90
+ end
91
+
92
+ # Debian and RPM package building tasks
93
+
94
+ version = Rhoconnect::VERSION
95
+
96
+ def create_post_install(version)
97
+ post_install = "#!/bin/sh
98
+ VERSION=#{version}
99
+
100
+ cd /tmp/installdir/rhoconnect-$VERSION
101
+ ./install.sh -v $VERSION
102
+
103
+ echo \"Delete tmp files ...\"
104
+ rm -rf /tmp/installdir
105
+ end #create_Post_install"
106
+
107
+ post_install
108
+ end #create_post_install
109
+
110
+ def build_pkg(dist, arch, deps)
111
+ curr_dir = `pwd`.strip
112
+ workspace = "#{curr_dir}/pkg/workspace"
113
+ version = Rhoconnect::VERSION
114
+ description = '"Rhoconnect production environment"'
115
+ post_install = "#{workspace}/unix-like/post-install.sh"
116
+ prefix = "/tmp/installdir/rhoconnect-#{version}"
117
+ gem_name = "rhoconnect-#{version}.gem"
118
+ post_install = create_post_install version
119
+ post_install_script = "#{workspace}/unix-like/post-install.sh"
120
+
121
+ Dir.mkdir("#{workspace}")
122
+ Dir.mkdir("#{workspace}/unix-like")
123
+ Dir.mkdir("#{workspace}/utils")
124
+
125
+ # Turn post_install string into a bash script file and place it in the workspace.
126
+ post_install_file = File.new("#{post_install_script}", "w")
127
+ post_install_file.write(post_install)
128
+ post_install_file.close
129
+
130
+ # Copy all necessary Files into the workspace
131
+ system("cp ./install.sh #{workspace}")
132
+ system("cp -r ./installer/unix-like/* #{workspace}/unix-like")
133
+ system("cp -r ./installer/utils/* #{workspace}/utils")
134
+ system("cp ./pkg/#{gem_name} #{workspace}")
135
+
136
+ # cd into the pkg dir so that fpm will create the package into the pkg dir.
137
+ Dir.chdir("./pkg")
138
+
139
+ # Construct fpm command
140
+ fpm_cmd = "fpm -s dir -t #{dist} -n rhoconnect -v #{version} -a #{arch} " +
141
+ "-C #{workspace} --post-install #{post_install_script} --prefix #{prefix} " +
142
+ "--description #{description}"
143
+
144
+ # Add the list of dependencies to the fpm call
145
+ deps.each do |dep|
146
+ fpm_cmd << " -d #{dep}"
147
+ end #do
148
+
149
+ # Create the package
150
+ system(fpm_cmd)
151
+
152
+ # Leave no trace...
153
+ system("rm -rf #{workspace}")
154
+ end #build_pkg
155
+
156
+ task "build:deb" => :build do
157
+ deps = ['build-essential', 'zlib1g-dev','libssl-dev', 'libreadline5-dev',
158
+ 'libcurl4-openssl-dev', 'libsqlite3-0']
159
+
160
+ build_pkg "deb", "all", deps
161
+ end #build:deb
162
+
163
+ task "build:rpm" => :build do
164
+ deps = ['gcc-c++', 'zlib-devel', 'openssl-devel', 'readline-devel', 'curl-devel',
165
+ 'pcre-devel']
166
+
167
+ build_pkg "rpm", "noarch", deps
168
+ end #build:rpm
@@ -17,10 +17,11 @@ begin
17
17
  puts `bundle update`
18
18
  puts
19
19
 
20
- puts "Installing rhoconnect ..."
21
- puts `rake install`
22
- puts
23
-
20
+ # Skip the following lines because becnchapp Gemfile uses path to rhoconnect code
21
+ # puts "Installing rhoconnect ..."
22
+ # puts `rake install`
23
+ # puts
24
+
24
25
  Dir.chdir "bench/benchapp" #puts Dir.pwd
25
26
  puts "Checking bench application dependencies ..."
26
27
  puts `bundle update`
@@ -1,17 +1,26 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rhoconnect', '3.0.0'
3
+ gem 'rhoconnect', :path => '../../'
4
4
 
5
- gem 'warbler', "~> 1.3.0", :platforms => :jruby
5
+ # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
6
+ gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
7
+
8
+ platforms :jruby do
9
+ gem 'jdbc-sqlite3', ">= 3.7.2"
10
+ gem 'dbi', ">= 0.4.5"
11
+ gem 'dbd-jdbc', ">= 0.1.4"
12
+ gem 'jruby-openssl', ">= 0.7.4"
13
+ gem 'warbler'
14
+ end
15
+
16
+ gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
17
+
18
+ # For jruby trinidad JRuby web server is used
19
+ gem 'trinidad', :platforms => :jruby
6
20
 
7
21
  group :development do
8
22
  # By default to run application thin web server is used
9
- gem 'thin', :platforms => :ruby
10
-
11
- # For jruby trinidad JRuby web server is used
12
- gem 'trinidad', :platforms => :jruby
13
- # Alternative for jruby
14
- # gem 'jetty-rackup', :platforms => :jruby
23
+ gem 'thin', :platforms => [:ruby, :mswin, :mingw]
15
24
  end
16
25
 
17
26
  group :test do
@@ -1,27 +1,26 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rhoconnect', '>= 3.0.0'
3
+ gem 'rhoconnect', :path => '../../'
4
+
5
+ # Helps with some of the limitations of green threads, not needed in ruby 1.9.x
6
+ gem 'SystemTimer', '~> 1.2.3', :platforms => :ruby_18
4
7
 
5
8
  platforms :jruby do
6
- gem 'jdbc-sqlite3', :require => false
7
- gem 'dbi'
8
- gem 'dbd-jdbc', :require => 'dbd/Jdbc'
9
- gem 'jruby-openssl'
9
+ gem 'jdbc-sqlite3', ">= 3.7.2"
10
+ gem 'dbi', ">= 0.4.5"
11
+ gem 'dbd-jdbc', ">= 0.1.4"
12
+ gem 'jruby-openssl', ">= 0.7.4"
10
13
  gem 'warbler'
11
14
  end
12
15
 
13
- platforms :ruby do
14
- gem 'sqlite3'
15
- end
16
+ gem 'sqlite3', ">= 1.3.3", :platforms => [:ruby, :mswin, :mingw]
17
+
18
+ # For jruby trinidad JRuby web server is used
19
+ gem 'trinidad', :platforms => :jruby
16
20
 
17
21
  group :development do
18
22
  # By default to run application thin web server is used
19
- gem 'thin', '1.2.11', :platforms => :ruby
20
-
21
- # For jruby trinidad JRuby web server is used
22
- gem 'trinidad', :platforms => :jruby
23
- # Alternative for jruby
24
- # gem 'jetty-rackup', :platforms => :jruby
23
+ gem 'thin', :platforms => [:ruby, :mswin, :mingw]
25
24
  end
26
25
 
27
26
  group :test do
@@ -0,0 +1,226 @@
1
+ CRM adapters
2
+ ===
3
+
4
+ With rhoconnect-adapters, you can utilize the pre-built set of [RhoConnect](http://rhomobile.com/products/rhoconnect/) applications
5
+ for popular CRM backends (SalesForce, Oracle CRM On Demand, Sugar CRM, etc.). Also, this library includes support for writing your own [RhoConnect](http://rhomobile.com/products/rhoconnect/)
6
+ CRM applications to extend or customize the default functionality.
7
+
8
+ ### Generating Standard CRM Application
9
+
10
+ To create a standard out-of-the-box rhoconnect CRM application use the following command:
11
+
12
+ $ rhoconnect-adapters crmapp <app_name> <CRM-backend>
13
+
14
+ Here, the \<CRM\-backend\> parameter specifies the CRM backend that your application will use.
15
+ Currently, the following CRM backends are supported:
16
+
17
+ - OracleOnDemand (for [Oracle CRM On Demand](http://crmondemand.oracle.com))
18
+ - MsDynamics (for [Microsoft Dynamics CRM](http://www.microsoft.com/en-us/dynamics/default.aspx))
19
+ - Salesforce (for [Salesforce CRM](http://www.salesforce.com/))
20
+ - Sugar (for [Sugar CRM](http://www.sugarcrm.com/crm/))
21
+
22
+ The generated Rhoconnect CRM application structure will include typical [RhoConnect](http://rhomobile.com/products/rhoconnect/)
23
+ files (for example, application.rb and settings.yml). It will also create a special vendor directory `vendor/\<CRM\-backend\>`
24
+ containing all support files specific for the corresponding CRM backend.
25
+
26
+ By default, the Rhoconnect CRM application will be generated with four standard source adapters corresponding
27
+ to the following CRM objects:
28
+
29
+ - Account
30
+ - Contact
31
+ - Lead
32
+ - Opportunity
33
+
34
+
35
+ ### Generating CRM Application without pre-built source adapters
36
+
37
+ In some cases, it is necessary to generate an application without any standard sources.
38
+ For this purpose, use the `--bare` option to generate just the application's skeleton.
39
+
40
+ rhoconnect-adapters crmapp <app_name> <CRM-backend> --bare
41
+
42
+
43
+ ### Generating CRM source adapters for the Rhoconnect CRM application
44
+
45
+ Once you create your Rhoconnect CRM application, you can generate the desired source adapters
46
+ based on the CRM objects by typing the following command in your application's directory:
47
+
48
+ rhoconnect-adapters crmsource <CRM-object-name> <CRM-backend>
49
+
50
+ Here, \<CRM\-object\-name\> must exactly correspond to the name of the CRM object you're trying to
51
+ build the source adapter for.
52
+
53
+ ## Preparing the Rhoconnect CRM Application
54
+
55
+ ### OracleOnDemand settings
56
+ All OracleOnDemand-specific settings are located in the `vendor/oracle_on_demand/settings` directory.
57
+ In the file `settings.yml` you'll find the entries that you must customize before running the app.
58
+ These are:
59
+
60
+ - **:oraclecrm_service_url:** <oracle_web_services_integration_url> - substitute the default URL with your OracleOnDemand account URL.
61
+
62
+ For every source adapter based on CRM object there is a corresponding *'vendor/oracle_on_demand/settings/\<CRM\-object\-name\>.yml'*
63
+ file containing the descriptions for the OracleOnDemand CRM object.
64
+ Every CRM object file has the following entries:
65
+
66
+ Query_Fields: hash of the objects's fields
67
+ (each field's element has the value
68
+ in a form of the hash with the field's options ,
69
+ containing the following data):
70
+ Label => <val> - display name of the field
71
+ Type => <val> - type of the field data
72
+ (textinput, textarea, Picklist, id, etc.)
73
+
74
+ NonQuery_MappingWS_Fields: object's fields that can not be used
75
+ in OracleCRM Queries
76
+ (however, Oracle returns them in GetMapping API)
77
+
78
+ StaticPickList: Normally, all picklist fields are queried
79
+ for the allowed values using GetPicklistValues API
80
+ However, for certain fields OracleCRM API
81
+ returns the error 'not a valid picklist'
82
+ This entry is a workaround for this error -
83
+ fields's picklist values are statically hard-coded here.
84
+
85
+ ObjectFields: this one specifies a hash of fields
86
+ that are actually references to other objects.
87
+ For example, AccountName field for Contact object
88
+ is really a reference to the corresponding Account object.'
89
+
90
+ TitleFields: this setting specifies an array of fields
91
+ used in constructing the object's title in the 'Show' page
92
+ using the Metadata method. Typically, you will want to put
93
+ `name` fields in here.
94
+
95
+ For the default generated CRM object adapters, this file is pre-filled with information. However, you can customize it by including or excluding
96
+ options. For custom adapters, you need to fill this file with relevant information. List of object's fields, for example, can be obtained
97
+ from the Oracle CRM On Demand documentation and then later used to fill the Query_Fields setting. Alternatively, user can customize the adapter and obtain
98
+ the list of fields using the GetMapping API.
99
+
100
+
101
+ ### MsDynamics settings
102
+ All MsDynamics-specific settings are located in the **'vendor/ms_dynamics/settings'** directory.
103
+ In the file *'settings.yml'* you'll find the entries that are necessary to customize before running the app.
104
+ These are:
105
+
106
+ - **:msdynamics_ticket_url:** <msdynamics_web_services_integration_url> - substitute the default URL with your MsDynamics account URL.
107
+
108
+ For every source adapter based on CRM object there is a corresponding *'vendor/msdynamics/settings/\<CRM\-object\-name\>.yml'*
109
+ file containing the descriptions for the Sugar CRM object.
110
+ Every CRM object file has the following entries:
111
+
112
+ Query_Fields: hash of the objects's fields
113
+ (each field's element has the value
114
+ in a form of the hash with the field's options ,
115
+ containing the following data):
116
+ Label => <val> - display name of the field
117
+ Type => <val> - type of the field data
118
+ (textinput, textarea, Picklist, id, etc.)
119
+
120
+ AttributeTypePicklists: this is a hash of picklist arrays
121
+ for artificially constructed fields
122
+ that are really represent some other field's type
123
+ for example, `customerid` field can be either
124
+ `account` or `contact`. In this case
125
+ field `customertype_attrtype` will represent `customerid` field's type
126
+ and will take values from the `AttributeTypePicklists`
127
+ array for the field `customerid_attrtype`
128
+
129
+ ObjectFields: this one specifies a hash of fields
130
+ that are actually references to other objects.
131
+ For example, `account_name` field for Contact object
132
+ is really a reference to the corresponding Account object.
133
+
134
+ TitleFields: this setting specifies an array of fields
135
+ used in constructing the object's title in the 'Show' page
136
+ using the Metadata method. Typically, you will want to put
137
+ `name` fields in here.
138
+
139
+ For the default generated CRM object adapters, this file is pre-filled with information. However, you can customize it by including or excluding
140
+ options. For custom adapters, you need to fill this file with relevant information. List of object's fields, for example, can be obtained
141
+ from the MsDynamics documentation and then later used to fill the Query_Fields setting. Alternatively, user can customize the adapter and obtain
142
+ the desired list of object's fields using the MsDynamics SOAP API.
143
+
144
+ ### Sugar settings
145
+ All Sugar-specific settings are located in the **'vendor/sugar/settings'** directory.
146
+ In the file *'settings.yml'* you'll find the entries that are necessary to customize before running the app.
147
+ These are:
148
+
149
+ - **:sugarcrm_uri:** <oracle_web_services_integration_url> - substitute the default URL with your OracleOnDemand account URL.
150
+ - **:debug_enabled:** <true/false> - enable debug output of the backend HTTP transactions.
151
+
152
+ For every source adapter based on CRM object there is a corresponding *'vendor/sugar/settings/\<CRM\-object\-name\>.yml'*
153
+ file containing the descriptions for the Sugar CRM object.
154
+ Every CRM object file has the following entries:
155
+
156
+ Query_Fields: hash of the objects's fields
157
+ (each field's element has the value
158
+ in a form of the hash with the field's options ,
159
+ containing the following data):
160
+ Label => <val> - display name of the field
161
+ Type => <val> - type of the field data
162
+ (textinput, textarea, Picklist, id, etc.)
163
+
164
+ ObjectFields: this one specifies a hash of fields
165
+ that are actually references to other objects.
166
+ For example, `account_name` field for Contact object
167
+ is really a reference to the corresponding Account object.
168
+
169
+ TitleFields: this setting specifies an array of fields
170
+ used in constructing the object's title in the 'Show' page
171
+ using the Metadata method. Typically, you will want to put
172
+ `name` fields in here.
173
+
174
+ For the default generated CRM object adapters, this file is pre-filled with information. However, you can customize it by including or excluding
175
+ options. For custom adapters, you need to fill this file with relevant information. List of object's fields, for example, can be obtained
176
+ from the SugarCRM documentation and then later used to fill the Query_Fields setting. Alternatively, user can customize the adapter and obtain
177
+ the desired list of object's fields using the SugarCRM REST API.
178
+
179
+ ### Salesforce settings
180
+ All Salesforce-specific settings are located in the `vendor/salesforce/settings` directory.
181
+ In the file `settings.yml` you'll find the entries that you must customize before running the app.
182
+ These are:
183
+
184
+ - **:salesforce_login_url:** <salesforce_soap_login_url> - Currently, this parameter is pre-defined to
185
+ `https://login.salesforce.com/services/Soap/c/22.0` for simple SOAP web service authentication.
186
+ Rhoconnect-adapters is not using `OAuth2` scheme at this point.
187
+
188
+ For every source adapter based on CRM object there is a corresponding *'vendor/salesforce/settings/\<CRM\-object\-name\>.yml'*
189
+ file containing the descriptions for the OracleOnDemand CRM object.
190
+ Every CRM object file has the following entries:
191
+
192
+ Query_Fields: hash of the objects's fields
193
+ (each field's element has the value
194
+ in a form of the hash with the field's options ,
195
+ containing the following data):
196
+ Label => <val> - display name of the field
197
+ Type => <val> - type of the field data
198
+ (textinput, textarea, Picklist, datetime, id, etc.)
199
+
200
+ ObjectFields: this one specifies a hash of fields
201
+ that are actually references to other objects.
202
+ For example, AccountId field for Contact object
203
+ is really a reference to the corresponding Account object.'
204
+
205
+ TitleFields: this setting specifies an array of fields
206
+ used in constructing the object's title in the 'Show' page
207
+ using the Metadata method. Typically, you will want to put
208
+ `name` fields in here.
209
+
210
+ For the default generated CRM object adapters, this file is pre-filled with sample information. However, you can customize it by including or excluding
211
+ different fields. For custom adapters, you need to fill this file with relevant information. List of object's fields, for example, can be obtained
212
+ from the Salesforce documentation and then later used to fill the Query_Fields setting. Alternatively, user can customize the adapter and obtain
213
+ the list of fields using the `/sobjects/<CRM-object-name>/describe/` API.
214
+
215
+
216
+ ## Running the CRM Application
217
+ Once your Rhoconnect application is customized and ready to run, you can start it like any other Rhoconnect app.
218
+ Type the following command in the CRM application's root directory:
219
+
220
+ rake rhoconnect:start
221
+
222
+
223
+ ## Meta
224
+ Created and maintained by Rhomobile Inc.
225
+
226
+ Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
@@ -0,0 +1,18 @@
1
+ RhoConnect Adapters Introduction
2
+ ===
3
+
4
+ rhoconnect-adapters is a ruby library containing a collection of the out-of-box [RhoConnect](http://rhomobile.com/products/rhoconnect) applications
5
+ for various needs.
6
+
7
+ ## Setup
8
+ Install the 'rhoconnect-adapters' gem by using the following command:
9
+
10
+ $ [sudo] gem install rhoconnect-adapters
11
+
12
+
13
+ ## Usage
14
+ The 'rhoconnect-adapters' command creates pre-built [RhoConnect](http://rhomobile.com/products/rhoconnect/) applications.
15
+ Visit the [RhoConnect](http://rhomobile.com/products/rhoconnect/) website for more information.
16
+
17
+
18
+ <img src='https://s3.amazonaws.com/rhodocs/rhoconnect/rhoconnect-adapters-intro.png' alt='image' height='471' width='800' />
data/doc/client.txt CHANGED
@@ -75,7 +75,14 @@ Rhoconnect Client is a library to add sync data capability to your applications.
75
75
  @property(assign) NSString* name;
76
76
 
77
77
  //possible values: RST_INCREMENTAL, RST_BULK_ONLY
78
- @property int sync_type;
78
+ @property(assign) int sync_type;
79
+
80
+ //possible values: RMT_PROPERTY_BAG (default), RMT_PROPERTY_FIXEDSCHEMA
81
+ @property(assign) int model_type;
82
+
83
+ //associations dictionary: the key is attribute name, the value is associated model name
84
+ //while using associations use object_id attribute as object reference
85
+ @property(assign) NSDictionary* associations;
79
86
 
80
87
  // model constructor
81
88
  - (id) init;
@@ -153,13 +160,33 @@ See [rhoconnect-client\Samples\ObjectiveC\store](http://github.com/rhomobile/rho
153
160
  RhomModel* product = [[RhomModel alloc] init];
154
161
  product.name = @"Product";
155
162
 
163
+ RhomModel* order = [[RhomModel alloc] init];
164
+ order.name = @"Order";
165
+ order.associations = [NSDictionary dictionaryWithObjectsAndKeys: @"Customer", @"customer", @"Product", @"product", nil];
166
+
156
167
  RhoConnectClient* sclient = [[RhoConnectClient alloc] init];
157
- NSArray* models = [NSArray arrayWithObjects:customer, product, nil];
168
+ NSArray* models = [NSArray arrayWithObjects:customer, product, order, nil];
158
169
 
159
170
  [sclient addModels:models];
160
171
 
161
172
  sclient.sync_server = @"http://rhodes-store-server.heroku.com/application";
162
173
 
174
+ #### Initialization of Schema model
175
+
176
+ RhomModel* product = [[RhomModel alloc] init];
177
+ product.name = @"Product_s";
178
+ product.model_type = RMT_PROPERTY_FIXEDSCHEMA;
179
+
180
+ To create schema model tables edit database schema file:
181
+
182
+ * Copy file <rhoconnect-client>/shared/db/res/db/syncdb.schema to your project folder
183
+
184
+ * Edit file syncdb.schema : add create table statment for each schema model. Note that mandatory object column should be in each table:
185
+
186
+ "object" varchar(255) PRIMARY KEY
187
+
188
+ * Open 'Copy bundle resources' build phase in project target and point it to local project db folder
189
+
163
190
  #### Login
164
191
 
165
192
  :::cplusplus