rhoconnect 4.0.0.beta.24 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG.md +20 -0
  2. data/Gemfile.lock +22 -23
  3. data/README.md +0 -2
  4. data/bench/benchapp/spec/spec_helper.rb +2 -2
  5. data/bench/blobapp/spec/spec_helper.rb +2 -2
  6. data/commands/rhoconnect/start.rb +8 -1
  7. data/doc/bulk-sync.txt +1 -23
  8. data/doc/push-client-setup-ios.txt +3 -3
  9. data/doc/push-client-setup-rps.txt +7 -7
  10. data/doc/push-client-setup.txt +18 -30
  11. data/doc/push-server-setup.txt +0 -14
  12. data/doc/push.txt +3 -5
  13. data/doc/source-adapters.txt +3 -2
  14. data/doc/supported-platforms.txt +6 -6
  15. data/generators/templates/application/spec/spec_helper.rb +2 -2
  16. data/install.sh +7 -2
  17. data/installer/unix-like/rho_connect_install_constants.rb +3 -3
  18. data/installer/utils/nix_install_test.rb +12 -4
  19. data/js-adapters/node.rb +1 -1
  20. data/lib/rhoconnect/bulk_data/bulk_data.rb +0 -5
  21. data/lib/rhoconnect/controller/js_base.rb +1 -0
  22. data/lib/rhoconnect/jobs/bulk_data_job.rb +0 -18
  23. data/lib/rhoconnect/ping/apple.rb +9 -6
  24. data/lib/rhoconnect/ping.rb +0 -2
  25. data/lib/rhoconnect/version.rb +1 -1
  26. data/lib/rhoconnect.rb +1 -14
  27. data/spec/controllers/js_base_spec.rb +20 -0
  28. data/spec/jobs/bulk_data_job_spec.rb +0 -42
  29. data/spec/jobs/ping_job_spec.rb +6 -30
  30. data/spec/rhoconnect_spec.rb +0 -1
  31. data/spec/server/server_spec.rb +4 -11
  32. data/spec/spec_helper.rb +4 -0
  33. data/spec/support/shared_examples.rb +2 -1
  34. metadata +4 -11
  35. data/doc/push-client-setup-bb.txt +0 -81
  36. data/lib/rhoconnect/ping/android.rb +0 -116
  37. data/lib/rhoconnect/ping/blackberry.rb +0 -56
  38. data/spec/ping/android_spec.rb +0 -121
  39. data/spec/ping/blackberry_spec.rb +0 -71
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 4.0.0 (2013-09-05)
2
+ * Final v4.0.0 stable release based on beta.63
3
+
4
+ ## 4.0.0.beta.63 (2013-08-19)
5
+ * B-98911 - Fully removed BlackBerry support
6
+ * D-05224 - Fixed stdout for node process. `console.log()` now works
7
+ * B-105930 - Add support for push_objects and push_deletes in js adapters
8
+ * B-92759 - Completely remove C2DM code
9
+ * Add check for ruby download status in rhoconnect installer
10
+
11
+ ## 4.0.0.beta.46 - 4.0.0.beta.51 (skipped for RMS version parity)
12
+
13
+ ## 4.0.0.beta.45 (2013-07-30)
14
+ * Fixed issue w/ securerandom loading for app-less start command
15
+ * D-05431 - Remove refs. to blackberry clients in push docs
16
+ * Update production stack to ruby-1.9.3-p448, redis-2.6.14, node v0.10.15, and nginx-1.4.2.
17
+ * Don't generate code referencing RHO_ENV. Use RACK_ENV.
18
+
19
+ ## 4.0.0.beta.25 - 4.0.0.beta.44 (skipped for RMS version parity)
20
+
1
21
  ## 4.0.0.beta.24 (2013-06-07)
2
22
  * Add /system/rps_login route to handle application credentials for push server
3
23
  * Update doc for 'rhoconnect-push' config.json advanced options
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rhoconnect (4.0.0.beta.24)
4
+ rhoconnect (4.0.0)
5
5
  bundler (~> 1.0)
6
6
  connection_pool (~> 1.0.0)
7
7
  json (~> 1.7.7)
@@ -19,7 +19,7 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- addressable (2.3.4)
22
+ addressable (2.3.5)
23
23
  arr-pm (0.0.8)
24
24
  cabin (> 0)
25
25
  async-rack (0.5.1)
@@ -28,28 +28,27 @@ GEM
28
28
  builder
29
29
  mime-types
30
30
  xml-simple
31
- backports (3.3.1)
31
+ backports (3.3.3)
32
32
  builder (3.2.2)
33
- cabin (0.6.0)
33
+ cabin (0.6.1)
34
34
  childprocess (0.3.9)
35
35
  ffi (~> 1.0, >= 1.0.11)
36
36
  clamp (0.6.1)
37
37
  coffee-script (2.2.0)
38
38
  coffee-script-source
39
39
  execjs
40
- coffee-script-source (1.6.2)
40
+ coffee-script-source (1.6.3)
41
41
  connection_pool (1.0.0)
42
- crack (0.4.0)
42
+ crack (0.4.1)
43
43
  safe_yaml (~> 0.9.0)
44
44
  daemons (1.1.9)
45
45
  diff-lcs (1.1.3)
46
46
  eventmachine (1.0.3)
47
47
  excon (0.22.1)
48
- execjs (1.4.0)
49
- multi_json (~> 1.0)
48
+ execjs (2.0.1)
50
49
  extlib (0.9.16)
51
50
  ffaker (1.14.0)
52
- ffi (1.8.1)
51
+ ffi (1.9.0)
53
52
  fog (1.11.1)
54
53
  builder
55
54
  excon (~> 0.20)
@@ -61,14 +60,14 @@ GEM
61
60
  nokogiri (~> 1.5.0)
62
61
  ruby-hmac
63
62
  formatador (0.2.4)
64
- fpm (0.4.37)
63
+ fpm (0.4.42)
65
64
  arr-pm (~> 0.0.8)
66
65
  backports (>= 2.6.2)
67
66
  cabin (>= 0.6.0)
68
67
  childprocess
69
68
  clamp (~> 0.6)
70
69
  ftw (~> 0.0.30)
71
- json (~> 1.7.7)
70
+ json (>= 1.7.7)
72
71
  ftw (0.0.34)
73
72
  addressable
74
73
  backports (>= 2.6.2)
@@ -90,13 +89,13 @@ GEM
90
89
  rainbow
91
90
  sprockets (~> 2)
92
91
  json (1.7.7)
93
- mime-types (1.23)
92
+ mime-types (1.25)
94
93
  mono_logger (1.1.0)
95
- multi_json (1.7.6)
96
- net-scp (1.1.1)
94
+ multi_json (1.7.9)
95
+ net-scp (1.1.2)
97
96
  net-ssh (>= 2.6.5)
98
- net-ssh (2.6.7)
99
- nokogiri (1.5.9)
97
+ net-ssh (2.6.8)
98
+ nokogiri (1.5.10)
100
99
  rack (1.5.2)
101
100
  rack-fiber_pool (0.9.3)
102
101
  rack-protection (1.5.0)
@@ -106,7 +105,7 @@ GEM
106
105
  rainbow (1.1.4)
107
106
  rake (10.0.4)
108
107
  redis (3.0.4)
109
- redis-namespace (1.3.0)
108
+ redis-namespace (1.3.1)
110
109
  redis (~> 3.0.0)
111
110
  resque (1.24.1)
112
111
  mono_logger (~> 1.0)
@@ -126,11 +125,11 @@ GEM
126
125
  rspec-mocks (2.10.1)
127
126
  ruby-hmac (0.4.0)
128
127
  rubyzip (0.9.9)
129
- safe_yaml (0.9.3)
130
- selenium-webdriver (2.33.0)
128
+ safe_yaml (0.9.5)
129
+ selenium-webdriver (2.35.1)
131
130
  childprocess (>= 0.2.5)
132
131
  multi_json (~> 1.0)
133
- rubyzip
132
+ rubyzip (< 1.0.0)
134
133
  websocket (~> 1.0.4)
135
134
  simplecov (0.7.1)
136
135
  multi_json (~> 1.0)
@@ -138,8 +137,8 @@ GEM
138
137
  simplecov-html (0.7.1)
139
138
  simplecov-rcov (0.2.3)
140
139
  simplecov (>= 0.4.1)
141
- sinatra (1.4.2)
142
- rack (~> 1.5, >= 1.5.2)
140
+ sinatra (1.4.3)
141
+ rack (~> 1.4)
143
142
  rack-protection (~> 1.4)
144
143
  tilt (~> 1.3, >= 1.3.4)
145
144
  sprockets (2.10.0)
@@ -147,7 +146,7 @@ GEM
147
146
  multi_json (~> 1.0)
148
147
  rack (~> 1.0)
149
148
  tilt (~> 1.1, != 1.3.0)
150
- sqlite3 (1.3.7)
149
+ sqlite3 (1.3.8)
151
150
  templater (1.0.0)
152
151
  diff-lcs (>= 1.1.2)
153
152
  extlib (>= 0.9.5)
data/README.md CHANGED
@@ -10,8 +10,6 @@ You will need to install the following in order to run the RhoConnect specs.
10
10
  * RVM: <https://rvm.io/> or RB-env: <https://github.com/sstephenson/rbenv> with Ruby 1.9.3p194+ installed
11
11
  * Bundler: <http://gembundler.com/>
12
12
  * Redis: <http://redis.io>
13
- * Java JDK 1.6+: <http://www.oracle.com/technetwork/java/javase/downloads/index.html>
14
- * hsqldata.jar: <https://github.com/rhomobile/hsqldata/downloads> - put this in a directory called vendor/
15
13
 
16
14
  Running Tests
17
15
  -------------------------------------------------------------
@@ -1,9 +1,9 @@
1
1
  require 'rubygems'
2
2
 
3
3
  # Set environment to test
4
- ENV['RHO_ENV'] = 'test'
4
+ ENV['RACK_ENV'] = 'test'
5
5
  ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..'))
6
- Bundler.require(:default, ENV['RHO_ENV'].to_sym)
6
+ Bundler.require(:default, ENV['RACK_ENV'].to_sym)
7
7
 
8
8
  # Try to load vendor-ed rhoconnect, otherwise load the gem
9
9
  begin
@@ -1,9 +1,9 @@
1
1
  require 'rubygems'
2
2
 
3
3
  # Set environment to test
4
- ENV['RHO_ENV'] = 'test'
4
+ ENV['RACK_ENV'] = 'test'
5
5
  ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..'))
6
- Bundler.require(:default, ENV['RHO_ENV'].to_sym)
6
+ Bundler.require(:default, ENV['RACK_ENV'].to_sym)
7
7
 
8
8
  # Try to load vendor-ed rhoconnect, otherwise load the gem
9
9
  begin
@@ -44,7 +44,14 @@ Execute.define_task do
44
44
  options = { :syncserver => "http://localhost:#{port}", :redis => redis_url,
45
45
  :push_server => push_server, :api_token => token }
46
46
  options[:licensefile] = licensefile if licensefile
47
- options[:secret] = SecureRandom.hex(64)
47
+ begin
48
+ require 'securerandom'
49
+ options[:secret] = SecureRandom.hex(64)
50
+ rescue LoadError => e
51
+ puts "Secure random generator is missing"
52
+ puts e.inspect
53
+ exit
54
+ end
48
55
  conf_hash = { :development => options, :test => options, :production => options }
49
56
  File.open(File.join(ENV['HOME'], '.rhoconnect.yml'), 'w') { |f| f.write(conf_hash.to_yaml) }
50
57
  end
data/doc/bulk-sync.txt CHANGED
@@ -10,7 +10,7 @@ If and when the Rhodes application issues a request to get bulk data, the RhoCon
10
10
 
11
11
  * Execute the ['login,'query','logoff' methods](/rhoconnect/source-adapters#source-adapter-api) of all source adapter models matching the [requested data partition](/rhoconnect/source-adapters#data-partitioning) to get latest set of objects from the backend service
12
12
 
13
- * Generate appropriate database files for the device - hsqldb for Blackberry and sqlite for the rest of them. RhoConnect will generate sqlite files for iOS, Android, and Windows Mobile clients and hsqldb files for Blackberry (if enabled).
13
+ * Generate appropriate database files for the device. RhoConnect will generate sqlite files for iOS, Android, and Windows Mobile clients (if enabled).
14
14
 
15
15
  * The Rhodes application will poll RhoConnect for the bulk sync job to finish. Once the job is finished, the files are generated and Rhodes will download and install them to the device.
16
16
 
@@ -53,28 +53,6 @@ After application executed bulk sync it will set `bulksync_state` to 1 and next
53
53
  :::ruby
54
54
  Rho::RhoConfig.bulksync_state = '0'
55
55
 
56
- ### Enabling BlackBerry Bulk Sync
57
- If your application will be performing bulk sync for BlackBerry devices, you will need to install the open source Rhomobile HSQLDB tool [hsqldata.jar](http://github.com/rhomobile/hsqldata) in your RhoConnect application.
58
-
59
- 1. Download [hsqldata](http://github.com/rhomobile/hsqldata/zipball/0.0.2).
60
-
61
- 2. Build and install hsqldata.jar into your RhoConnect application:
62
-
63
- :::term
64
- $ cd hsqldata
65
- $ ant
66
- $ mkdir <path-to-rhoconnect-app>/vendor
67
- $ cp bin/hsqldata.jar <path-to-rhoconnect-app>/vendor/
68
-
69
- 3. Next set the `:blackberry_bulk_sync:` flag in settings/settings.yml:
70
-
71
- :::yaml
72
- :development:
73
- :licensefile: settings/license.key
74
- :redis: localhost:6379
75
- :syncserver: http://localhost:9292/application/
76
- :blackberry_bulk_sync: true
77
-
78
56
  ## Data Files
79
57
 
80
58
  By default, bulk sync data files will be stored in the application's root folder, under a 'data' directory. When bulk data is requested by the Rhodes application, RhoConnect will return a link to the file if the `bulk_sync_poll_interval` has not expired. If the file is expired, RhoConnect will return a wait command to Rhodes and enqueue another [resque job](http://github.com/defunkt/resque) to generate new bulk data files. By default, the `bulk_sync_poll_interval` is set to 1 hour (3600) seconds and is configurable in `settings.yml`:
@@ -40,9 +40,9 @@ In case of iOS, regardless of the operation, the user will be presented with the
40
40
 
41
41
  ### Setup Push Certificate
42
42
  The first step to setting up your environment is to create an APNS push certificate. To create the SSL certificate, follow the "Creating the SSL Certificate and Keys" section on the
43
- [developer site](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW4).
43
+ [developer site](https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW1).
44
44
 
45
- Once you have the certificate, you will need to export it to a .pem format using [these instructions](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW6). Make sure to name the output file 'apple_push_cert.pem' file from these instructions, since this is what we configured in our RhoConnect application.
45
+ Once you have the certificate, you will need to export it to a .pem format using [these instructions](https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW6). Make sure to name the output file 'apple_push_cert.pem' file from these instructions, since this is what we configured in our RhoConnect application.
46
46
 
47
47
  Once you have this file, copy it to your RhoConnect application directory under the settings folder:
48
48
 
@@ -53,7 +53,7 @@ Once you have this file, copy it to your RhoConnect application directory under
53
53
  Now your RhoConnect application is ready to send APNS messages.
54
54
 
55
55
  ### Setup Provisioning Profile
56
- Next, you can setup your Apple Push Provisioning Profile using Apple's [developer site instructions](https://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW5). Once you have the profile installed in XCode and on your test device, you are ready to test push.
56
+ Next, you can setup your Apple Push Provisioning Profile using Apple's [developer site instructions](https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW6). Once you have the profile installed in XCode and on your test device, you are ready to test push.
57
57
 
58
58
  ### Setup iOS Device
59
59
  Setting up the device is the same process as [building any normal Rhodes application](build#building-a-rhodes-application-for-iphoneipad). When you start the application, make sure to also open the console window (cmd-shift-R). When the application starts, you should see some output in the console that shows the device token (towards the top):
@@ -177,17 +177,17 @@ To set up your Rhodes client application for RhoConnect Push Service, you config
177
177
 
178
178
  In your client application `rhoconfig.txt` file, set the following options to configure your RhoConnect Push Service.
179
179
 
180
- syncserver = 'http://<hostname>:<port>/application'
181
- rhoconnect_push_server = 'http://<hostname>:<port>'
182
- rhoconnect_push_appname = 'someappname'
180
+ syncserver = 'http://<hostname>:<port>'
181
+ Push.rhoconnect.pushServer = 'http://<hostname>:<port>'
182
+ Push.rhoconnect.pushAppName = 'someappname'
183
183
 
184
184
  Next, your RhoConnect application should be running on a network that is accessible to your device. For example, you might have your RhoConnect application running on a LAN with IP 192.168.1.10, PORT 9292. Then make sure your device is connected to the same LAN.
185
185
 
186
- Here is an example of setting `rhoconfig.txt` for the RhoConnect Push Service. The URLs used for the RhoConnect Push Service (rhoconnect_push_server) and the RhoConnect server are running on the same host.
186
+ Here is an example of setting `rhoconfig.txt` for the RhoConnect Push Service. The URLs used for the RhoConnect Push Service (Push.rhoconnect.pushServer) and the RhoConnect server are running on the same host.
187
187
 
188
- syncserver = 'http://192.168.1.10:9292/application'
189
- rhoconnect_push_server = 'http://192.168.1.10:8675'
190
- rhoconnect_push_appname = 'someappname'
188
+ syncserver = 'http://192.168.1.10:9292'
189
+ Push.rhoconnect.pushServer = 'http://192.168.1.10:8675'
190
+ Push.rhoconnect.pushAppName = 'someappname'
191
191
 
192
192
  ### Configuring build.yml
193
193
 
@@ -5,7 +5,6 @@ This chapter contains the final steps for setting up your Rhodes application for
5
5
 
6
6
  * [Setup for RhoConnect Push Service on client and server](/rhoconnect/push-client-setup-rps).
7
7
  * [Setup for RhoConnect Push on client and server for Rhodes Android Client](/rhoconnect/push-client-setup-android).
8
- * [Setup for RhoConnect Push on client and server for Rhodes Blackberry Client](/rhoconnect/push-client-setup-bb).
9
8
  * [Setup for RhoConnect Push on client and server for Rhodes iOS Client](/rhoconnect/push-client-setup-ios).
10
9
 
11
10
  ## Configuring a Rhodes Application for RhoConnect Push
@@ -18,29 +17,31 @@ If you want your device to vibrate when it receives a push message, enable vibra
18
17
 
19
18
  Set up your application [rhoconfig.txt](/rhodes/configuration#run-time-configuration) syncserver to point to your RhoConnect server:
20
19
 
21
- syncserver = 'http://<rhoconnect_server_url>/application'
20
+ syncserver = 'http://<rhoconnect_server_url>'
22
21
 
23
22
  ## Registering a Push Callback in the Rhodes Application
24
23
 
25
- To handle a push message from a Rhodes application, you must register push callback with the System `set_push_notification` method.
24
+ To handle a push message from a Rhodes application, you must register push callback with the Rho::Push `startNotifications` method.
26
25
 
27
26
  :::ruby
28
27
  class AppApplication < Rho::RhoApplication
29
28
  def initialize
30
29
  super
31
- System.set_push_notification "/app/Push/push_callback", ""
30
+ Rho::Push.startNotifications '/app/Settings/push_callback'
32
31
  end
33
32
  end
34
33
 
35
- Push callback is set up in the form of a local application URL and called as callback whether or not rho_callback=1 is specified in its parameters list.
34
+ Push callback is set up in the form of a local application URL and called when application receives server initiated push messages.
36
35
 
37
- The parameters trigger certain operations in the Rhodes client when the callback returns "rho_push". (When the callback returns an empty string, this automatic handling is not performed.) The operations are to show an alert, vibrate the device, play a sound, and perform a sync.
36
+ The callback push message parameters are presented in the form of a hash. This hash contains parameters and values for the operations to perform. The operations are to show an alert, vibrate the device, play a sound, and perform a sync for a list of sources.
38
37
 
39
38
  To have your Rhodes app automatically perform the operations listed in the push message, you can write the callback as follows.
40
39
 
41
40
  :::ruby
42
41
  def push_callback
43
- "rho_push"
42
+ # Variable @params is a hash of operations to perform
43
+ # Show 'alert' popup window
44
+ Rho::Notification.showPopup({'message' => @params['alert'], 'buttons' =>['OK']})
44
45
  end
45
46
 
46
47
  To get push messages from RhoConnect server, the user must be logged into the RhoConnect server.
@@ -49,7 +50,7 @@ In application.rb:
49
50
 
50
51
  :::ruby
51
52
  if SyncEngine::logged_in > 0
52
- System.set_push_notification("/app/Settings/your_rhoconnect_callback",'')
53
+ Rho::Push.startNotifications '/app/Settings/push_callback'
53
54
  end
54
55
 
55
56
  ## Understanding the Rhodes Push Message Payload
@@ -63,16 +64,16 @@ The hash payload may include the parameters of alert, do_sync, sound, and vibrat
63
64
 
64
65
  To sync all the sources with do_sync, the source name list would be specified as 'all' in the ping call, instead of 'product,customer' as in this example.
65
66
 
66
- The Rhodes push payload allows more than one operation in a single message.
67
-
67
+ The Rhodes push payload allows more than one operation in a single message.
68
+
68
69
  There are no required operations. There are default operations - if operation is not specified, no default operation will be performed.
69
70
 
70
71
  Payload may include following operations which client will perform when it receives the PUSH message:
71
72
 
72
- do_sync - do sync on spec specified sync source; use "all" to sync all sources
73
+ do_sync - do sync on spec specified sync source; use "all" to sync all sources
73
74
  :::ruby
74
75
  # one or more sources, or "all" can be specified
75
- do_sync = "Product,Customer"
76
+ do_sync = "Product,Customer"
76
77
 
77
78
  alert - bring app upfront and show specified message
78
79
  :::ruby
@@ -84,9 +85,9 @@ To enable vibrate in your rhodes application in build.yml:
84
85
 
85
86
  capabilities:
86
87
  - vibrate
87
-
88
+
88
89
  Example of vibrate call:
89
-
90
+
90
91
  vibrate = 2000 #=> duration in milliseconds
91
92
 
92
93
  sound - play specified file if media type supported by the phone. iPhone will ignore media-type parameter.
@@ -99,30 +100,17 @@ Media type should be either specified explicitly or may be recognized from file
99
100
 
100
101
  ## Handling Push Notifications from a non-RhoConnect Application
101
102
 
102
- Rhodes applications can also handle PUSH notifications that didn't come from a RhoConnect application.
103
+ Rhodes applications can also handle PUSH notifications that didn't come from a RhoConnect application.
103
104
 
104
105
  In this example, we will get the device ID so we can register the device with some push server:
105
106
  :::ruby
106
- System.get_property('device_id')
107
+ Rho::Push.getDeviceId url_for(:action => 'registration_callback')
107
108
 
108
109
  Application can set push callback to process any commands from server:
109
110
  :::ruby
110
- System.set_push_notification("/app/Settings/push_notify", '')
111
+ Rho::Push.startNotifications '/app/Settings/push_callback'
111
112
 
112
113
  Callback parameters:
113
114
 
114
115
  * since Rhodes 2.0.4 : contain push message parameters as hash
115
116
  * rhodes < 2.0.4 : message - contain server push message body
116
-
117
- Callback return:
118
-
119
- * empty string - do not run Rhodes push command processing
120
- * "rho_push" - to run rhodes push command processing (for alerts, sounds, etc...)
121
-
122
- Example:
123
- :::ruby
124
- def push_notify
125
- puts 'push_notify: ' + @params.inspect
126
- "rho_push"
127
- end
128
-
@@ -25,20 +25,6 @@ This is for running your application in development mode; for production, you wi
25
25
  :::yaml
26
26
  :iphoneserver: gateway.push.apple.com
27
27
 
28
- ## Setting up RhoConnect Server Push for Blackberry
29
-
30
- To set up your RhoConnect application for pushing to a BlackBerry client, you will need to update `settings/settings.yml` to include the following:
31
-
32
- :::yaml
33
- :development:
34
- :redis: localhost:6379
35
- :mdsserver: 192.168.1.110
36
- :mdsserverport: 8080
37
- :syncserver: http://localhost:9292/application/
38
- :licensefile: settings/license.key
39
-
40
- Replace `:mdsserver:` and `:mdsserverport:` with the hostname/IP and port of your machine (default port is 8080).
41
-
42
28
  ## Setting up RhoConnect Server Push for Android (GCM)
43
29
 
44
30
  To set up your RhoConnect application for Android Google Cloud Messaging (GCM), you need to obtain a GCM API key.
data/doc/push.txt CHANGED
@@ -11,11 +11,9 @@ The following sections show how to use the RhoConnect application to deliver pus
11
11
 
12
12
  You will need to perform one of the following set of instructions on the RhoConnect server and your mobile device for your specific platform.
13
13
 
14
- * [Set up RhoConnect Push Service on client and server](/rhoconnect/push-client-setup-rps).
15
- * [Set up RhoConnect Push on client and server for Rhodes Android Client](/rhoconnect/push-client-setup-android).
16
- * [Set up RhoConnect Push on client and server for Rhodes Blackberry Client](/rhoconnect/push-client-setup-bb).
17
- * [Set up RhoConnect Push on client and server for Rhodes iOS Client](/rhoconnect/push-client-setup-ios).
18
-
14
+ * [Set up RhoConnect Push Service on client and server for Rhodes Android and Windows Mobile/CE Devices](/rhoconnect/push-client-setup-rps).
15
+ * [Set up Google Cloud Messaging on client and server for Rhodes Android Device](/rhoconnect/push-client-setup-android).
16
+ * [Set up Apple Push Notification Service on client and server for Rhodes iOS Device](/rhoconnect/push-client-setup-ios).
19
17
  Then you will need to [perform the final set up on your client](/rhoconnect/push-client-setup).
20
18
 
21
19
  ## Executing a Ping Call
@@ -131,10 +131,11 @@ During generation of the model, the `settings/settings.yml` file will be updated
131
131
  You can use the following methods and techniques inside of your source adapter controller.
132
132
 
133
133
  * [register Rhoconnect::EndPoint](/rhoconnectapi/source-adapter-controller-api-ruby#register Rhoconnect::EndPoint) - adds Controller into the application's URL Map.
134
- * [resgiter Rhoconnect::Handler::Sync](/rhoconnectapi/source-adapter-controller-api-ruby#register Rhoconnect::Handler::Sync) - adds SYNC routes to your Controller.
134
+ * [register Rhoconnect::Handler::Sync](/rhoconnectapi/source-adapter-controller-api-ruby#register Rhoconnect::Handler::Sync) - adds SYNC routes to your Controller.
135
+ * [pre-defined conditions](/rhoconnectapi/source-adapter-controller-api-ruby#pre-defined-conditions) - adds common helpers and conditions to your routes.
135
136
  * [@model](/rhoconnectapi/source-adapter-controller-api-ruby#@model) - Access to the source adapter's model instance.
136
137
  * [params,request,response](/rhoconnectapi/source-adapter-controller-api-ruby#sinatra-context) - Allows to use any standard Sinatra context objects.
137
- * [Sinatra framework](/rhoconnectapi/source-adapter-controller-api-ruby#sinatra-features) - Allows to use any standard Sinatra features.
138
+ * [Sinatra framework](/rhoconnectapi/source-adapter-controller-api-ruby#sinatra-framework) - Allows to use any standard Sinatra features.
138
139
 
139
140
  ### Source Adapter Model API (Ruby)
140
141
 
@@ -16,15 +16,15 @@ RhoConnect gem is available on the following platforms:
16
16
  <tr>
17
17
  <td class='cap'>Linux</td>
18
18
  <td> CentOS / RHEL 5.x & 6.x,<br/>Ubuntu 12.04 </td>
19
- <td> ruby-1.9.3-p392 </td>
19
+ <td> ruby-1.9.3-p448 </td>
20
20
  <td class='tbd'> TBD </td>
21
- <td class='tbd'> jruby-1.7.3 </td>
21
+ <td class='tbd'> jruby-1.7.4 </td>
22
22
  <td>Development &<br/>Production</td>
23
23
  </tr>
24
24
  <tr>
25
25
  <td class='cap'>Mac OS </td>
26
26
  <td> Mac OS X 10.7/10.8 </td>
27
- <td> ruby-1.9.3-p392 </td>
27
+ <td> ruby-1.9.3-p448 </td>
28
28
  <td class='tbd'> TBD </td>
29
29
  <td class='tbd'> jruby-1.7.3 </td>
30
30
  <td> Development </td>
@@ -32,9 +32,9 @@ RhoConnect gem is available on the following platforms:
32
32
  <tr>
33
33
  <td class='cap'>Windows</td>
34
34
  <td> Windows 7 </td>
35
- <td> ruby-1.9.3-p392 </td>
35
+ <td> ruby-1.9.3-p448 </td>
36
36
  <td class='tbd'> TBD </td>
37
- <td class='tbd'> jruby-1.7.3 </td>
37
+ <td class='tbd'> jruby-1.7.4 </td>
38
38
  <td>Development</td>
39
39
  </tr>
40
40
  </table>
@@ -58,7 +58,7 @@ RhoConnect Mac OS X is supported in development environment.
58
58
  The components you should have for this environment are:
59
59
 
60
60
  * Ruby 1.9.3
61
- * Nginx HTTP server (1.3.x)
61
+ * Nginx HTTP server (1.4.x)
62
62
  * Redis data store (2.6.x)
63
63
  * Thin application server
64
64
  * RhoConnect gem with all required dependencies
@@ -1,9 +1,9 @@
1
1
  require 'rubygems'
2
2
 
3
3
  # Set environment to test
4
- ENV['RHO_ENV'] = 'test'
4
+ ENV['RACK_ENV'] = 'test'
5
5
  ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..'))
6
- Bundler.require(:default, ENV['RHO_ENV'].to_sym)
6
+ Bundler.require(:default, ENV['RACK_ENV'].to_sym)
7
7
 
8
8
  # Try to load vendor-ed rhoconnect, otherwise load the gem
9
9
  begin
data/install.sh CHANGED
@@ -192,6 +192,11 @@ installRuby ()
192
192
  echo "Downloading ${rubyURL} ..." | tee -a $log
193
193
  echo "wget -P ${prefix} ${rubyURL}" >> $log
194
194
  wget -P ${prefix} ${rubyURL} -o /dev/null
195
+ if (($?)) ; then
196
+ echo "Failed to download ruby tarball: ${rubyURL}\n" | tee -a $log
197
+ echo "Installation terminated. For troubleshooting see file $log ..." | tee -a $log
198
+ exit 1
199
+ fi
195
200
  echo "tar -xzf ${prefix}/${rubyTar} -C ${prefix}" >> $log
196
201
  tar -xzf ${prefix}/${rubyTar} -C ${prefix} > /dev/null 2>&1
197
202
  fi
@@ -258,10 +263,10 @@ rubyVersion=""
258
263
  rubyBinDir=""
259
264
 
260
265
  # Define ruby and nodejs versions to be installed ...
261
- RUBY_PATCH="p429"
266
+ RUBY_PATCH="p448"
262
267
  RUBY_VERSION="ruby-1.9.3-${RUBY_PATCH}"
263
268
 
264
- NODE_VERSION=v0.10.5
269
+ NODE_VERSION=v0.10.15
265
270
  NODE_URL=http://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz
266
271
  ARCH=$([[ `uname -m` == x86_64 ]] && echo "x64" || echo "x86")
267
272
  NODE_BIN_URL=http://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${ARCH}.tar.gz
@@ -8,10 +8,10 @@ module Constants
8
8
  "libaprutil1-dev",
9
9
  "dtach"]
10
10
 
11
- RUBY = "ruby-1.9.3-p429"
12
- REDIS = "redis-2.6.13"
11
+ RUBY = "ruby-1.9.3-p448"
12
+ REDIS = "redis-2.6.14"
13
13
  SQLITE3 = "sqlite-autoconf-3071502"
14
- NGINX = "nginx-1.4.1"
14
+ NGINX = "nginx-1.4.2"
15
15
  PASSENGER_ROOT = "/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/passenger"
16
16
 
17
17
  SOFTWARE = [ REDIS, SQLITE3, RUBY, NGINX ]
@@ -145,6 +145,7 @@ def start_services(server)
145
145
  sleep 3
146
146
  end
147
147
  raise "Service #{program} failed to start." if status != 0
148
+ sleep 10 if program == 'thin'
148
149
  end
149
150
  puts
150
151
  end
@@ -154,9 +155,16 @@ def check_rhoconnect_status(server)
154
155
  host = server.dns_name
155
156
  puts "Testing rhoconnect server on host #{host}"
156
157
  uri = URI("http://#{host}/console/")
157
- response = Net::HTTP.get_response(uri)
158
- puts "#{response.code} #{response.message}"
159
- resp_code = response.code.to_i
158
+
159
+ resp_code = 200
160
+ 3.times do |i|
161
+ response = Net::HTTP.get_response(uri)
162
+ resp_code = response.code.to_i
163
+ puts "#{i}: #{response.code} #{response.message}"
164
+ break if resp_code < 400
165
+ sleep 10
166
+ end
167
+
160
168
  if resp_code < 400
161
169
  puts "Rhoconnect server up and running!"; puts
162
170
  else
@@ -165,7 +173,7 @@ def check_rhoconnect_status(server)
165
173
  puts "Thin server logs:"
166
174
  puts server.ssh('cat /var/log/thin/thin.0.log')[0].stdout
167
175
  puts server.ssh('cat /var/log/thin/thin.1.log')[0].stdout
168
- raise "Failed to connect to rhoconnect service on #{host}" # unless resp_code == 502
176
+ raise "Failed to connect to rhoconnect service on #{host}"
169
177
  end
170
178
  end
171
179
 
data/js-adapters/node.rb CHANGED
@@ -27,7 +27,7 @@ module Rhoconnect
27
27
  sub_env = { "NODE_PATH" => "#{node_modules}#{File::PATH_SEPARATOR}#{pwd}#{File::PATH_SEPARATOR}#{dir}" }
28
28
  file = File.join(dir,"server.js")
29
29
  args = [sub_env, "node", file, "#{$$}", Rhoconnect.environment.to_s]
30
- @pipe = IO.popen(args)
30
+ @pipe = IO.popen(args, "w")
31
31
  log "Starting Node.js process: #{@pipe.pid}"
32
32
  @pipe
33
33
  rescue Exception=>e
@@ -47,11 +47,6 @@ module Rhoconnect
47
47
 
48
48
  def dbfiles_exist?
49
49
  files = [dbfile,dbfile+'.rzip']
50
- if Rhoconnect.blackberry_bulk_sync
51
- files << dbfile+'.hsqldb.data'
52
- files << dbfile+'.hsqldb.script'
53
- files << dbfile+'.hsqldb.properties'
54
- end
55
50
  files.each do |file|
56
51
  return false unless File.exist?(file)
57
52
  end
@@ -11,6 +11,7 @@ module Rhoconnect
11
11
  Rhoconnect::DefaultServer.helpers Rhoconnect::Controller::JsBaseHelpers
12
12
 
13
13
  helpers Rhoconnect::Controller::JsBaseHelpers
14
+ register Rhoconnect::Handler::PluginCallbacks
14
15
 
15
16
  # source name is available inherently from controller
16
17
  before do