rhoconnect 3.3.6 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/CHANGELOG.md +40 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +27 -25
  4. data/bench/benchapp/Gemfile +7 -27
  5. data/bench/benchapp/config.ru +9 -31
  6. data/bench/blobapp/Gemfile +7 -27
  7. data/bench/blobapp/config.ru +9 -29
  8. data/bench/lib/bench.rb +8 -1
  9. data/bench/lib/bench/test_data.rb +4 -1
  10. data/bench/scripts/blob_cud_script.rb +4 -0
  11. data/bench/scripts/cud_script.rb +7 -1
  12. data/bench/scripts/helpers.rb +1 -1
  13. data/bench/scripts/test_query_script.rb +20 -7
  14. data/bench/spec/bench_spec_helper.rb +3 -1
  15. data/bin/rhoconnect +22 -12
  16. data/commands/{commands/dtach_commands → dtach}/dtach_about.rb +0 -0
  17. data/commands/{commands/dtach_commands → dtach}/dtach_install.rb +0 -0
  18. data/commands/{commands/redis_commands → dtach}/redis_attach.rb +0 -0
  19. data/commands/execute.rb +14 -15
  20. data/commands/generators/update.rb +26 -0
  21. data/commands/{commands/redis_commands → redis}/redis_about.rb +0 -0
  22. data/commands/redis/redis_download.rb +13 -0
  23. data/commands/redis/redis_install.rb +26 -0
  24. data/commands/{commands/redis_commands → redis}/redis_make.rb +0 -0
  25. data/commands/{commands/redis_commands → redis}/redis_restart.rb +3 -2
  26. data/commands/{commands/redis_commands → redis}/redis_start.rb +0 -0
  27. data/commands/{commands/redis_commands → redis}/redis_startbg.rb +0 -0
  28. data/commands/{commands/redis_commands → redis}/redis_stop.rb +3 -2
  29. data/commands/{commands/rhoconnect → rhoconnect}/clean_start.rb +0 -0
  30. data/commands/{commands/rhoconnect → rhoconnect}/config.rb +7 -2
  31. data/commands/{commands/rhoconnect → rhoconnect}/create_user.rb +0 -0
  32. data/commands/{commands/rhoconnect → rhoconnect}/delete_device.rb +0 -0
  33. data/commands/{commands/rhoconnect → rhoconnect}/delete_user.rb +0 -0
  34. data/commands/{commands/rhoconnect → rhoconnect}/flushdb.rb +4 -4
  35. data/commands/{commands/rhoconnect → rhoconnect}/get_token.rb +0 -0
  36. data/commands/{commands/rhoconnect → rhoconnect}/reset.rb +0 -0
  37. data/commands/{commands/rhoconnect → rhoconnect}/reset_refresh.rb +0 -0
  38. data/commands/{commands/rhoconnect → rhoconnect}/restart.rb +0 -0
  39. data/commands/{commands/rhoconnect → rhoconnect}/secret.rb +0 -0
  40. data/commands/{commands/rhoconnect → rhoconnect}/set_admin_password.rb +0 -0
  41. data/commands/{commands/rhoconnect → rhoconnect}/spec.rb +0 -0
  42. data/commands/rhoconnect/start.rb +27 -0
  43. data/commands/{commands/rhoconnect → rhoconnect}/startbg.rb +0 -0
  44. data/commands/{commands/rhoconnect → rhoconnect}/startdebug.rb +2 -2
  45. data/commands/{commands/rhoconnect → rhoconnect}/stop.rb +3 -4
  46. data/commands/{commands/rhoconnect → rhoconnect}/version.rb +0 -0
  47. data/commands/{commands/rhoconnect → rhoconnect}/web.rb +0 -0
  48. data/commands/rhoconnect_attach/attach.rb +10 -0
  49. data/commands/rhoconnect_console/console.rb +16 -0
  50. data/commands/{commands/rhoconnect → rhoconnect_console}/console_helper.rb +0 -0
  51. data/commands/{commands/rhoconnect → rhoconnect_war}/war.rb +0 -0
  52. data/commands/{commands/redis_commands → utilities}/redis_runner.rb +22 -19
  53. data/commands/utilities/utilities.rb +6 -0
  54. data/doc/benchmarks.txt +2 -2
  55. data/doc/bulk-sync.txt +12 -1
  56. data/doc/client-java.txt +3 -3
  57. data/doc/client-objc.txt +1 -1
  58. data/doc/client.txt +5 -5
  59. data/doc/command-line.txt +80 -135
  60. data/doc/deploying.txt +119 -12
  61. data/doc/extending-rhoconnect-server.txt +1 -1
  62. data/doc/heroku-addon.txt +119 -23
  63. data/doc/install.txt +101 -39
  64. data/doc/java-plugin.txt +2 -2
  65. data/doc/licensing.txt +1 -1
  66. data/doc/plugin-intro.txt +3 -1
  67. data/doc/preparing-production.txt +4 -4
  68. data/doc/public/cli.txt +2 -2
  69. data/doc/push-backend-setup.txt +11 -1
  70. data/doc/push-client-setup.txt +72 -2
  71. data/doc/push-server-setup.txt +129 -8
  72. data/doc/rails-plugin.txt +245 -40
  73. data/doc/rest-api.txt +10 -6
  74. data/doc/rhoconnect-calculator.txt +237 -0
  75. data/doc/rhoconnect-redis-stack.txt +35 -0
  76. data/doc/session-and-configuration.txt +24 -0
  77. data/doc/settings.txt +51 -41
  78. data/doc/source-adapters.txt +45 -45
  79. data/doc/stats-middleware.txt +2 -2
  80. data/doc/supported-platforms.txt +6 -6
  81. data/doc/testing.txt +2 -2
  82. data/doc/tutorial.txt +63 -63
  83. data/examples/simple/Gemfile +7 -35
  84. data/examples/simple/config.ru +8 -26
  85. data/examples/simple/sources/product.rb +6 -6
  86. data/generators/rhoconnect.rb +5 -0
  87. data/generators/templates/application/Gemfile +7 -37
  88. data/generators/templates/application/Rakefile +8 -0
  89. data/generators/templates/application/config.ru +12 -31
  90. data/generators/templates/application/rcgemfile +44 -0
  91. data/generators/templates/application/settings/settings.yml +7 -5
  92. data/install.sh +4 -4
  93. data/installer/unix-like/create_texts.rb +7 -2
  94. data/installer/unix-like/rho_connect_install_constants.rb +2 -2
  95. data/installer/unix-like/rho_connect_install_installers.rb +1 -16
  96. data/lib/rhoconnect.rb +51 -38
  97. data/lib/rhoconnect/api/app/query.rb +4 -1
  98. data/lib/rhoconnect/api/app/search.rb +4 -1
  99. data/lib/rhoconnect/api/client/list_client_docs.rb +3 -1
  100. data/lib/rhoconnect/api/user/ping.rb +1 -5
  101. data/lib/rhoconnect/application/init.rb +43 -0
  102. data/lib/rhoconnect/async.rb +11 -6
  103. data/lib/rhoconnect/client_sync.rb +30 -37
  104. data/lib/rhoconnect/document.rb +4 -0
  105. data/lib/rhoconnect/graph_helper.rb +74 -56
  106. data/lib/rhoconnect/middleware/helpers.rb +4 -0
  107. data/lib/rhoconnect/ping.rb +1 -0
  108. data/lib/rhoconnect/ping/gcm.rb +58 -0
  109. data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +7 -1
  110. data/lib/rhoconnect/source.rb +70 -56
  111. data/lib/rhoconnect/source_sync.rb +33 -5
  112. data/lib/rhoconnect/store.rb +358 -110
  113. data/lib/rhoconnect/user.rb +8 -0
  114. data/lib/rhoconnect/utilities.rb +16 -14
  115. data/lib/rhoconnect/version.rb +1 -1
  116. data/lib/rhoconnect/web-console/models/client.js +1 -1
  117. data/lib/rhoconnect/web-console/public/UNVR67bold.ttf +0 -0
  118. data/lib/rhoconnect/web-console/public/bootstrap.css +6 -0
  119. data/lib/rhoconnect/web-console/public/logo.png +0 -0
  120. data/lib/rhoconnect/web-console/server.rb +13 -11
  121. data/lib/rhoconnect/web-console/templates/index.erb +5 -5
  122. data/lib/rhoconnect/web-console/templates/jqplot.erb +1 -0
  123. data/lib/rhoconnect/web-console/views/doc.js +0 -4
  124. data/lib/rhoconnect/web-console/views/home.js +2 -1
  125. data/lib/rhoconnect/web-console/views/new_ping.js +11 -6
  126. data/lib/rhoconnect/web-console/views/stats.js +9 -5
  127. data/rhoconnect.gemspec +6 -4
  128. data/spec/api/app/fast_update_spec.rb +2 -2
  129. data/spec/api/source/get_source_params_spec.rb +1 -0
  130. data/spec/apps/rhotestapp/settings/settings.yml +5 -5
  131. data/spec/client_sync_spec.rb +3 -14
  132. data/spec/perf/perf_spec_helper.rb +11 -7
  133. data/spec/perf/store_perf_spec.rb +88 -11
  134. data/spec/ping/gcm_spec.rb +99 -0
  135. data/spec/server/server_spec.rb +7 -0
  136. data/spec/server/stats_spec.rb +9 -2
  137. data/spec/source_sync_spec.rb +29 -0
  138. data/spec/spec_helper.rb +40 -38
  139. data/spec/stats/record_spec.rb +18 -9
  140. data/spec/store_spec.rb +128 -19
  141. data/spec/testdata/10000-data.txt +0 -0
  142. data/spec/testdata/5-data.txt +0 -0
  143. data/spec/testdata/5000-data.txt +0 -0
  144. data/tasks/jasmine.rake +1 -0
  145. data/tasks/redis.rake +16 -13
  146. metadata +71 -39
  147. data/commands/commands/redis_commands/redis_download.rb +0 -33
  148. data/commands/commands/redis_commands/redis_install.rb +0 -26
  149. data/commands/commands/rhoconnect/attach.rb +0 -8
  150. data/commands/commands/rhoconnect/console.rb +0 -15
  151. data/commands/commands/rhoconnect/start.rb +0 -18
  152. data/commands/utilities/dtach_installed.rb +0 -10
@@ -49,7 +49,7 @@ For example, suppose you have a Rhodes app with a Product model. To use a custom
49
49
  # Uncomment the following line to enable sync with Product.
50
50
  enable :sync
51
51
 
52
- #add model specifc code here
52
+ #add model specific code here
53
53
  property :my_custom_blob_field, :blob, :overwrite
54
54
  end
55
55
 
data/doc/heroku-addon.txt CHANGED
@@ -1,51 +1,145 @@
1
- Heroku Addon
2
- ==========
1
+ RhoConnect is a data synchronization server and client library that keeps enterprise app data current and available on users’ mobile devices.
3
2
 
4
- RhoConnect is now available for those using <a href='http://heroku.com' target='_blank'>Heroku</a> as an addon.
3
+ The information is stored locally on a user’s device, and is available even when disconnected and offline.
5
4
 
5
+ Full documentation on all the capabilities of RhoConnect is in the [RhoConnect Developer Reference](http://docs.rhomobile.com/rhoconnect/introduction).
6
6
 
7
- Adding RhoConnect from Heroku
7
+
8
+ Overview
9
+ --------
10
+ Combining Rhodes, RhoConnect, and `rhoconnect-rb` will allow you to create a mobile app that can connect to and manage your backend rails app seamlessly.
11
+
12
+ <p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/arc_rhoconnect.png' height='400' width='650'/></p>
13
+
14
+ Gem
15
+ -----
16
+ To install the latest stable RhoConnect gem, run:
17
+
18
+ :::term
19
+ $ [sudo] gem install rhoconnect
20
+
21
+ Using from Rails
22
+ ------------
23
+ `rhoconnect-rb` is a ruby gem that allows your rails app to interact with RhoConnect. To use RhoConnect from a rails application you must first install the `rhoconnect-rb` gem.
24
+
25
+ :::term
26
+ $ [sudo] gem install rhoconnect-rb
27
+
28
+ **NOTE: `rhoconnect-rb` only supports rails 3. You will not be able to connect your app to RhoConnect with rails < 3.**
29
+
30
+ Load the `rhoconnect-rb` library
31
+
32
+ :::ruby
33
+ require 'rhoconnect-rb'
34
+
35
+ **NOTE: If you are using DataMapper, install the `dm-serializer` library and require it in your application. `rhoconnect-rb` depends on this utility to interact with RhoConnect applications using JSON.**
36
+
37
+ ###Configuration:
38
+
39
+ You need to define a few configuration variables. You can define them in an initializer. Good practice is to create a file called rhoconnect.rb in the initializers directory of your rails app. Inside of your newly created rhoconnect.rb file you will define the following config block.
40
+
41
+ :::ruby
42
+ Rhoconnectrb.configure do |config|
43
+ config.app_endpoint = "http://localhost:3000"
44
+ config.authenticate = lambda { |credentials| return true }
45
+ end
46
+
47
+ Inside of this block three variables are defined.
48
+
49
+ The `app_endpoint` is the location of your rails app. Defining this variable will cause your rails app to automatically (on startup) set the rails url location in your RhoConnect instance. If you do not define this variable, you will have to manually configure the Backend App URL in the RhoConnect console.
50
+
51
+ The last variable, `authenticate`, is a lambda and can be used to setup any custom authentication you would like. The credentials passed will be a hash containing a login and password (`{'login' => login, 'password' => password}`). You can then write any custom authentication inside of this block. In the example above authentication is ignored.
52
+
53
+ You can also alternatively define these variables in `environment.rb` as an environment variables.
54
+
55
+ :::ruby
56
+ ENV['APP_ENDPOINT'] = "http://localhost:3000"
57
+
58
+
59
+ **NOTE: environment variables take precedence over config variables**
60
+
61
+
62
+ Next you will need to include `Rhoconnectrb::Resource` in the model you want to synchronize with your mobile application:
63
+
64
+ :::ruby
65
+ class Product < ActiveRecord::Base
66
+ include Rhoconnectrb::Resource
67
+ end
68
+
69
+ Or, if you are using DataMapper:
70
+
71
+ :::ruby
72
+ class Product
73
+ include DataMapper::Resource
74
+ include Rhoconnectrb::Resource
75
+ end
76
+
77
+ ###Declaring a partition key
78
+
79
+ Your model must declare a partition key for `rhoconnect-rb`. This partition key is used by `rhoconnect-rb` to uniquely identify the model dataset when it is stored in a RhoConnect application. It is typically an attribute on the model or related model. `rhoconnect-rb` supports two types of partitions:
80
+
81
+ * app - No unique key will be used, a shared dataset is used for all users.
82
+ * lambda\{some lambda\} - Execute a lambda which returns the unique key string.
83
+
84
+ For example, the Product model above might have a belongs_to :user relationship.
85
+
86
+ The partition identifying the username would be declared as:
87
+
88
+ :::ruby
89
+ class Product < ActiveRecord::Base
90
+ include Rhoconnectrb::Resource
91
+
92
+ belongs_to :user
93
+
94
+ def partition
95
+ lambda { self.user.username }
96
+ end
97
+ end
98
+
99
+
100
+ Deploying to Heroku
8
101
  -----------------------
9
102
  To use RhoConnect from Heroku, install the RhoConnect add-on:
10
103
 
11
- :::term
12
- $ heroku addons:add rhoconnect
13
-
14
- ##Setup
104
+ :::term
105
+ $ heroku addons:add rhoconnect
15
106
 
16
- From inside your heroku account, setup the url to your backend service that RhoConnect will connect to.
107
+ ###Setup
17
108
 
18
- First, click the addons drop down and select rhoconnect.
109
+ From inside your Heroku account, setup the url to your backend service that RhoConnect will connect to.
110
+
111
+ First, click the addons drop down and select RhoConnect.
19
112
  <p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/addon_rhoconnect.png' width="479" height="319"/></p>
20
113
 
21
- You will be redirected to the admin console of your RhoConnect instance where you can set the backend app url. Select the Settings tab, then select Plugin Settings from the left menu.
114
+ You will be redirected to the admin console of your RhoConnect instance where you can set the Backend App url to your backend service. Select Backend App Url from the right menu.
115
+ <p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/console.png' /></p>
22
116
 
23
- <img src="http://rhodocs.s3.amazonaws.com/rhoconnect/plugin-settings-console.png"/>
24
117
 
25
118
  From here you can enter a url to your backend service. Enter a url (for example http://myrailsapp.com), and click the add link to save the url.
26
119
 
27
- RhoConnect is now setup with your backend service.
120
+
121
+ RhoConnect is now setup with your backend service.
28
122
 
29
123
  Connecting a simple rhodes app
30
124
  -------------------------------
31
- To view a full tutorial about creating a rhodes application and the features of rhodes see [RhoStudio tutorial](http://docs.rhomobile.com/rhostudio.tutorial).
125
+ To view a full tutorial about creating a rhodes application and the features of rhodes see [Rhodes framework](http://docs.rhomobile.com/rhodes/tutorial).
32
126
 
33
- ##Gem installation:
127
+ ###Gem installation:
34
128
 
35
- :::term
36
- $ [sudo] gem install rhodes
129
+ :::term
130
+ $ gem install rhodes
37
131
 
38
- Next using the rhodes gem you can create a rhodes app.
132
+ Next using the rhodes gem you can create a rhodes app.
39
133
 
40
- :::term
134
+ :::term
41
135
  $ rhodes app sample_app url_of_rhoconnect_instance
42
-
136
+
43
137
  To get the value for the url_of_rhoconnect_instance argument, go to the RhoConnect console and click on the right Backend App URL link. From there you can copy the syncserver url.
44
138
 
45
- <p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/console.png' width="800" height="280"/></p>
46
-
139
+ <p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/console_rhodesurl.png' width="750" height="280"/></p>
47
140
 
48
- ##Other Resources
141
+ Other resources
142
+ ----
49
143
  [RhoConnect Introduction](http://docs.rhomobile.com/rhoconnect/introduction)
50
144
 
51
145
  [RhoConnect Installation](http://docs.rhomobile.com/rhoconnect/install)
@@ -53,3 +147,5 @@ To get the value for the url_of_rhoconnect_instance argument, go to the RhoConne
53
147
  [RhoConnect Tutorial](http://docs.rhomobile.com/rhoconnect/tutorial)
54
148
 
55
149
  [Using RhoConnect from Rails/Sinatra](http://docs.rhomobile.com/rhoconnect/rails-plugin)
150
+
151
+ [Webinar Using Rhoconnect with Rhoconnect-rb](http://player.vimeo.com/video/27495682?byline=0&portrait=0&color=de0909)
data/doc/install.txt CHANGED
@@ -2,81 +2,143 @@
2
2
 
3
3
  This section discusses how to install the development environment for RhoConnect. For those who have developed a RhoConnect application, and now wish to deploy that RhoConnect application on a server, refer to the instructions for deploying a RhoConnect application, such as [preparing a RhoConnect app for production](/rhoconnect/preparing-production) and [deploying a RhoConnect application](/rhoconnect/deploying).
4
4
 
5
- On Windows and Mac OS, the usual way to install the RhoConnect development environment is to install RhoStudio.
5
+ ## Installing RhoConnect with RhoStudio
6
6
 
7
- On Linux, you install the RhoConnect gem from the command line; you can also do this from Windows or Mac OS.
7
+ The most common way to install RhoConnect on a Windows or Macintosh platform is to install RhoMobile Suite. The RhoMobile Suite installer installs Rho products, such as Rhodes, RhoConnect, RhoElements, and RhoStudio. RhoStudio is an Eclipse installation that facilitates development of native smartphone applications.
8
8
 
9
- ## Mac OS
9
+ [Click here for the RhoMobile Suite installation instructions](/rhomobile-install).
10
10
 
11
- If you're running Mac OS, download the latest [Motorola RhoMobile Suite Installer for Macintosh](http://rhomobile.com/rhostudio-mac). This contains [Redis](http://redis.io/), [RhoConnect](/rhoconnect/introduction) and [Rhodes](/rhodes/introduction).
11
+ NOTE: The rest of this chapter consists of instructions for installing RhoConnect from the command line, without using the RhoMobile Suite installer. You do not need to perform those instructions if you installed using the RhoMobile Suite installer.
12
12
 
13
- Although Mac OS has [Ruby](http://www.ruby-lang.org/en/) installed, the official way to install Ruby for RhoStudio is to install [Ruby Version Manager](https://rvm.io//) and then install Ruby version 1.9.3.
13
+ ## Installing RhoConnect from the Command Line
14
14
 
15
- Click on the Motorola RhoMobile Suite Installer for Mac download file to open it. You will get a window similar to this:
15
+ To install RhoConnect on Linux, and to install RhoConnect on Windows or Mac OS using the command line (this does not install RhoStudio), you need to install the Rhodes gem. Download and install:
16
16
 
17
- <img src="http://rhodocs.s3.amazonaws.com/rhodes-devel/rhostudio-mac-install.png" alt="RhoStudioInstaller Mac" />
17
+ 1. [Ruby v1.9.3](http://www.ruby-lang.org/en/downloads/).
18
18
 
19
- Run "Install gems on rvm" (this requires that you have installed Ruby Version Manager). A terminal window will open; wait for the gems install process to complete.
19
+ * On Windows, [RubyInstaller](http://rubyinstaller.org) is a convenient way to install Ruby; you should check "Add Ruby executables to your PATH" and "Associate .rb and .rbw files with this Ruby installation".
20
20
 
21
- Then drag Motorola RhoStudio to the Applications folder.
21
+ * On Macintosh, Ruby is already installed, but this version is outdated and isn't compatible with RhoStudio: install [Ruby Version Manager](https://rvm.io//) (RVM) and then use RVM to install Ruby version 1.9.3.
22
22
 
23
- **NOTE: Installing Ruby into the System folder is not supported by RhoMobile; the official RhoMobile way to install and use Ruby on the Macintosh is with Ruby Version Manager. If you do not use Ruby Version Manager and instead install Ruby into the System folder, you will need to start and run RhoStudio from the command line using sudo.**
23
+ 2. Ruby Web Server - We tested with [thin](http://code.macournoyer.com/thin/), and [passenger](http://www.modrails.com/). WEBrick, the web server that ships with ruby, is known to cause issues with HTTP headers/cookies and is ***not*** recommended.
24
24
 
25
- ## Windows
25
+ 3. [Redis](http://redis.io/) - RhoConnect includes a simple [rhoconnect task](/rhoconnect/command-line#rhoconnect-cli-rhoconnect-v32) `rhoconnect redis-install` to install redis, covered in the [Rhoconnect CLI section](/rhoconnect/command-line#rhoconnect-cli-rhoconnect-v32). Alternatively, you can [install redis directly](http://redis.io/download).
26
26
 
27
- If you're running Windows, download the latest [Motorola RhoMobile Suite Installer for Windows](http://rhomobile.com/rhostudio-windows) and run it. This installs the [Ruby stack](http://www.ruby-lang.org/en/), [Redis](http://redis.io/), [RhoConnect](/rhoconnect/introduction), and [Rhodes](/rhodes/introduction).
27
+ 4. Install the RhoConnect Gem.
28
28
 
29
- If you are running Windows 64-bit, you need to use 32-bit Java when you run RhoStudio. You can include the 32-bit Java in the PATH, or you can run RhoStudio with a link to 32-bit Java:
29
+ Run this command to install the RhoConnect Gem.
30
30
 
31
- C:\RhoStudio\eclipse\RhoStudio.exe -vm "<32-bit java path>\bin\javaw.exe"
31
+ :::term
32
+ $ gem install rhoconnect
32
33
 
33
- ## Java Development Kit (JDK)
34
+ NOTE: If you get any `no such file to load -- something` messages while running the rhoconnect or rhodes commands, this can usually be resolved by putting "sudo" in front of the command, as in `sudo gem install something`.
34
35
 
35
- You need to have the Java Development Kit (JDK) installed for RhoStudio. If you are planning to build for Blackberry or Android, make sure you have JDK version 1.6.0_2 or higher installed; the 32-bit Windows version of the JDK is required for Blackberry tools.
36
+ NOTE: Windows doesn't come with the necessary build tools to install gems ('make', for example). There are various ways to get these tools, but the GnuWin32 project at http://gnuwin32.sourceforge.net/ provides the tools, and can be conveniently installed via the GetGnuWin32 installer at http://sourceforge.net/projects/getgnuwin32/files/. You should follow the GetGnuWin32 instructions carefully.
36
37
 
37
- ### Installing the Java Development Kit
38
+ ## Setting the Location of the RhoStudio Workspace Directory
38
39
 
39
- The Sun JDK for Windows or Linux is available [here](http://java.sun.com/javase/downloads/index.jsp). For Windows, install the 32-bit version of the JDK; RhoStudio needs the 32-bit version.
40
+ When you start RhoStudio, you can set the location of the workspace directory. The path to the workspace directory should not contain space symbols: if the path has spaces, a RhoConnect application created with RhoStudio will not work properly.
40
41
 
41
- For Mac OS 10.6 and earlier, the JDK is already installed. For Mac OS 10.7, Java is not automatically installed. Download the Java for Mac Installer from [Apple support](http://support.apple.com/kb/DL1421) and install Java.
42
+ ## Standalone Ruby Installation and Ruby Version Manager
42
43
 
43
- ### Setting the JDK Path
44
+ Do not install Ruby as a standalone if you also use Ruby Version Manager (rvm) to install Ruby. If you need only one version of Ruby, you can install Ruby as a standalone. If you need more than one version of Ruby, you should uninstall standalone Ruby and then install Ruby with Ruby Version Manager. Mixed standalone Ruby and rvm-controlled Ruby installations can conflict and cause runtime issues in Rhodes applications.
44
45
 
45
- On Windows installs for RhoMobile, go to RhoStudio Preferences (Windows -> Preferences) and set the JDK path in the rhobuild.yml file. On Windows 64-bit installations, you must set this path to the 32-bit version of the JDK, such as `C:/Program Files (x86)/Java/jdk<version number>/bin`.
46
+ ## Migrating to OS X Mountain Lion from the command line
46
47
 
47
- On Mac OS, the path to the JDK is automatically set once Java is installed.
48
+ If you had a workable RhoConnect environment on Macintosh OS X Lion, then after you upgrade to Mountain Lion, you need to do some extra steps to restore your workable environment.
48
49
 
49
- For Linux and for RhoConnect installs from the command line, set the JDK path in JAVA_HOME and PATH.
50
+ ### Getting Xcode and Command Line Tools Installed
50
51
 
51
- ## Installing RhoConnect from the Command Line
52
+ You can get Xcode from the Mac App Store. You’ll need at least version 4.4 of Xcode for it to work with OS X Mountain Lion. After the installation, open Xcode in your /Applications folder. Then go to Xcode -> Preferences -> Downloads tab and install the “Command Line Tools.”
52
53
 
53
- To install RhoConnect on Linux, and to install RhoConnect on Windows or Mac OS using the command line (this does not install RhoStudio), you need to install the Rhodes gem. Download and install:
54
+ ### Installing Homebrew and GCC
54
55
 
55
- 1. [Ruby v1.9.3](http://www.ruby-lang.org/en/downloads/) (On Windows, [RubyInstaller](http://rubyinstaller.org) is a convenient way to install Ruby; you should check "Add Ruby executables to your PATH" and "Associate .rb and .rbw files with this Ruby installation".)
56
+ If you need to install any Ruby that’s older than 1.9.3, such as 1.9.2, 1.8.7 or REE, you’ll need to install GCC 4.2. Apple does not ship the Command Line Tools with gcc-4.2 compiler anymore (you can check by running `which gcc-4.2`), so you need to install it via Homebrew by enabling [homebrew-dupes](https://github.com/Homebrew/homebrew-dupes) repository and installing GCC.
56
57
 
57
- 2. Ruby Web Server - We tested with [thin](http://code.macournoyer.com/thin/), and [passenger](http://www.modrails.com/). WEBrick, the web server that ships with ruby, is known to cause issues with HTTP headers/cookies and is ***not*** recommended.
58
+ :::term
59
+ $ brew tap homebrew/dupes
60
+ $ brew install apple-gcc42
58
61
 
59
- 3. [Redis](http://redis.io/) - RhoConnect includes a simple [rake task](/rhoconnect/command-line#rake-tasks) `redis:install` to install redis, covered in the [Rake Tasks section](rhoconnect/command-line#rake-tasks). Alternatively, you can [install redis directly](http://redis.io/download).
62
+ Apple has removed X11 support from their operating system, but the X11 package is needed to
63
+ compile 1.8.7 or REE. You can get the X11 package from [XQuartz]( http://xquartz.macosforge.org/landing). By default, it installs in the /opt/X11 folder.
60
64
 
61
- 4. Install the RhoConnect Gem.
65
+ If you had Homebrew already installed, then you need only update it
62
66
 
63
- Run this command to install the RhoConnect Gem.
67
+ :::term
68
+ $ brew update
69
+ $ brew doctor
70
+
71
+ If the `brew doctor` command complains about the `/usr/local/bin` path, then edit the `/etc/paths` file to move `/usr/local/bin` line to the top of it.
72
+
73
+ ### Updating RVM (Ruby Version Manager) with Ruby 1.9.3
74
+
75
+ Because the OS X Mountain Lion toolchain is changed, you should use Ruby Version Manager to reinstall existing Ruby 1.9.3.
64
76
 
65
77
  :::term
66
- $ [sudo] gem install rhoconnect
78
+ $ rvm get stable
79
+ $ rvm reinstall 1.9.3
67
80
 
68
- NOTE: If you get any `no such file to load -- something` messages while running the rake tasks or rhodes commands, this can usually be resolved by putting "sudo" in front of the command, as in `sudo gem install something`.
81
+ ### Installing legacy rubies
69
82
 
70
- NOTE: Windows doesn't come with the necessary build tools to install gems ('make', for example). There are various ways to get these tools, but the GnuWin32 project at http://gnuwin32.sourceforge.net/ provides the tools, and can be conveniently installed via the GetGnuWin32 installer at http://sourceforge.net/projects/getgnuwin32/files/. You should follow the GetGnuWin32 instructions carefully.
83
+ Run the following commands to install legacy rubies:
71
84
 
72
- **NOTE: Installing RhoStudio as a plugin for Eclipse is currently disabled.**
85
+ :::term
86
+ $ export CPPFLAGS=-I/opt/X11/include
87
+ $ CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7
88
+ $ CC=/usr/local/bin/gcc-4.2 rvm reinstall ree
73
89
 
74
- RhoSimulator, which comes with RhoStudio for Mac and Windows, does not work with Linux.
90
+ ## Upgrading an Existing Application
75
91
 
76
- ## Setting the Location of the RhoStudio Workspace Directory
92
+ If you have an existing application, upgrading to the latest version of RhoConnect is simple.
77
93
 
78
- When you start RhoStudio, you can set the location of the workspace directory. The path to the workspace directory should not contain space symbols: if the path has spaces, a RhoConnect application created with RhoStudio will not work properly.
94
+ Open the `Gemfile` of your application and find the rhoconnect line, it should look something like:
79
95
 
80
- ## Standalone Ruby Installation and Ruby Version Manager
96
+ :::ruby
97
+ gem 'rhoconnect', '3.3.6'
81
98
 
82
- Do not install Ruby as a standalone if you also use Ruby Version Manager (rvm) to install Ruby. If you need only one version of Ruby, you can install Ruby as a standalone. If you need more than one version of Ruby, you should uninstall standalone Ruby and then install Ruby with Ruby Version Manager. Mixed standalone Ruby and rvm-controlled Ruby installations can conflict and cause runtime issues in Rhodes applications.
99
+ Change this to the latest release version, which you can find on [rubygems.org](http://rubygems.org/gems/rhoconnect), for example if it is 3.4.0:
100
+
101
+ :::ruby
102
+ gem 'rhoconnect', '3.4.0'
103
+
104
+ Run the following command from the root application directory:
105
+
106
+ :::term
107
+ $ bundle install
108
+
109
+ Now update your application's RhoConnect dependency manifest:
110
+
111
+ :::term
112
+ $ rhoconnect update
113
+
114
+ ## Upgrading previous versions to RhoConnect 3.4+
115
+
116
+ If you have an existing RhoConnect application using version < 3.4 and want to upgrade it to RhoConnect 3.4+, then
117
+ you need to update the `Gemfile` file to properly use the latest RhoConnect runtime dependencies.
118
+
119
+ First, follow the instructions described in the [previous section](/rhoconnect/install#upgrading-an-existing-application).
120
+
121
+ Next, make sure your `Gemfile` looks like the following example, replacing the version as necessary.
122
+ The `rhoconnect update` command will generate a reference `Gemfile.new` which you can use to replace your `Gemfile`:
123
+
124
+ :::ruby
125
+ source 'http://rubygems.org'
126
+
127
+ gem 'rhoconnect', '<put correct version here>'
128
+ gemfile_path = File.join(File.dirname(__FILE__), ".rcgemfile")
129
+
130
+ begin
131
+ eval(IO.read(gemfile_path))
132
+ rescue Exception => e
133
+ puts "ERROR: Couldn't read RhoConnect .rcgemfile"
134
+ puts e.message
135
+ exit 1
136
+ end
137
+
138
+ # DON'T FORGET to add your application specific gems after this line ...
139
+ # ...
140
+
141
+ Finally, run `bundle install` to install any missing dependencies:
142
+
143
+ :::term
144
+ $ bundle install
data/doc/java-plugin.txt CHANGED
@@ -129,7 +129,7 @@ Now that the rhoconnect-java jar library is included in your Maven local reposit
129
129
  <type>jar</type>
130
130
  </dependency>
131
131
 
132
- ### Creating the rhoconnect-java Pluigin Jar File from the rhoconnect-java Repository
132
+ ### Creating the rhoconnect-java Plugin Jar File from the rhoconnect-java Repository
133
133
 
134
134
  Instead of downloading the rhoconnect-java plugin jar file, you can generate it from sources by cloning the `rhoconnect-java` repository:
135
135
 
@@ -268,7 +268,7 @@ To help the rhoconnect-java plugin correctly map the model name to the service b
268
268
  * The service bean should be auto-wired into the corresponding controller via @Autowired annotation
269
269
 
270
270
  Data partitioning in your code should be based on filtering data for unique user (i.e. your user name) or per application (shared dataset for all users).
271
- For more information about RhoConnect partitions, please refer to the [RhoConnect docs](http://docs.rhomobile.com/rhosync/source-adapters#data-partitioning).
271
+ For more information about RhoConnect partitions, please refer to the [RhoConnect docs](http://docs.rhomobile.com/rhoconnect/source-adapters#data-partitioning).
272
272
 
273
273
  ## Establishing communication from java backend application to the RhoConnect server
274
274
 
data/doc/licensing.txt CHANGED
@@ -2,7 +2,7 @@ Licensing Your RhoConnect Application
2
2
  ===
3
3
 
4
4
  ## RhoHub License
5
- If you plan to deploy your RhoConnect application on RhoHub under a premium or enterprise plan, just click on the **"Production app?"** button to enable your paid-level license.
5
+ If you plan to deploy your RhoConnect application on RhoHub under a premium or enterprise plan, just click on the **"Live app ON/OFF"** button on the RhoHub page for that RhoConnect app to enable your paid-level license.
6
6
 
7
7
  **NOTE: Toggling this button will re-deploy your RhoConnect application to a new redis database. Make sure you __backup all critical data__ before doing this!**
8
8
 
data/doc/plugin-intro.txt CHANGED
@@ -3,6 +3,8 @@ RhoConnect Plugins Introduction
3
3
 
4
4
  Rhoconnect Plugins allow you to connect your backend apps seamlessly with rhoconnect. You can write the source (query, create, update and delete operations) into a backend application, and use a RhoConnect plugin in the language that matchs your backend application, such as Java or .NET.
5
5
 
6
+ **NOTE: When you create a RhoConnect Plugin to connect your backend apps, you should not create a corresponding RhoConnect source adapter. RhoConnect Plugins do not use RhoConnect source adapters.**
7
+
6
8
  <img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/intro-plugin.png' alt='image' height='467' width='800' />
7
9
 
8
- **NOTE: Another way to connect particular backend applications (such as for Salesforce or Oracle) is to generate a [RhoConnect source adapter](/rhoconnect/source-adapters) which contains the query, create, update and delete operations.**
10
+ **NOTE: Instead of using RhoConnect Plugins to connect particular backend applications (such as for Salesforce or Oracle), you can generate a [RhoConnect source adapter](/rhoconnect/source-adapters) which contains the query, create, update and delete operations.**
@@ -18,17 +18,17 @@ If you don't change the `:secret` setting, RhoConnect automatically warns you ea
18
18
 
19
19
  [11:34:56 AM 2011-01-12] ************************************************************
20
20
 
21
- [11:34:56 AM 2011-01-12] WARNING: Change the session secret in config.ru from <changeme> to something secure.
22
- [11:34:56 AM 2011-01-12] i.e. running `rake rhoconnect:secret` in your app will generate a secret you could use.
21
+ [11:34:56 AM 2012-01-12] WARNING: Change the session secret in config.ru from <changeme> to something secure.
22
+ [11:34:56 AM 2012-01-12] i.e. running `rhoconnect secret` in your app will generate a secret you could use.
23
23
 
24
24
  [11:34:56 AM 2011-01-12] ************************************************************
25
25
 
26
26
 
27
- As this warning states, a good way to generate a cryptographically secure secret is by running `rake rhoconnect:secret` in your RhoConnect application.
27
+ As this warning states, a good way to generate a cryptographically secure secret is by running `rhoconnect secret` in your RhoConnect application.
28
28
 
29
29
  :::term
30
30
  $ cd storemanager-server
31
- $ rake rhoconnect:secret
31
+ $ rhoconnect secret
32
32
  040a2355475e9d0fb591ef78d5b9ca61a34cbcfd3f11942b18bc1d91f1ca66c27b2e0386333843a7efa29f40fff03624cd908d0883364ffbfa3208ab23fa2664
33
33
 
34
34
  Then plug this secret into your `config.ru`:
data/doc/public/cli.txt CHANGED
@@ -84,7 +84,7 @@ The server will show that it is running on the console.
84
84
 
85
85
  ### Start the Application
86
86
 
87
- Open a new console window (since the redis server is running in the previous console window). Then change directories to your rhoconnect applciation and start the application.
87
+ Open a new console window (since the redis server is running in the previous console window). Then change directories to your rhoconnect application and start the application.
88
88
 
89
89
  :::term
90
90
  $ cd storeserver
@@ -159,7 +159,7 @@ Here is a complete list of the rake tasks available in a RhoConnect application:
159
159
  rake redis:about # About redis
160
160
  rake redis:attach # Attach to redis dtach socket
161
161
  rake redis:download # Download package
162
- rake redis:install # Install the latest verison of Redis from Github (requires git, duh)
162
+ rake redis:install # Install the latest version of Redis from Github (requires git, duh)
163
163
  rake redis:restart # Restart redis
164
164
  rake redis:start # Start redis
165
165
  rake redis:stop # Stop redis
@@ -7,7 +7,7 @@ A RhoConnect push to the client consists of executing a RhoConnect ping call. Th
7
7
 
8
8
  You can trigger a push remotely using the [RhoConnect API Ping method](/rhoconnect/rest-api). This is useful if you want to fully control the push process from a remote server, such as when you use a RhoConnect plugin to connect your backend application to the RhoConnect server application.
9
9
 
10
- **NOTE: If you want to sync all the sources, use 'all' for the source list (the soure_name parameter) instead of a comma-separated list of the RhoConnect application source names to sync.**
10
+ **NOTE: If you want to sync all the sources, use 'all' for the source list (the source_name parameter) instead of a comma-separated list of the RhoConnect application source names to sync.**
11
11
 
12
12
  ### Example of Ping for Ruby Backend Application
13
13
 
@@ -145,3 +145,13 @@ To queue a ping that is executed asynchronously in a job, you can have PingJob q
145
145
  )
146
146
 
147
147
  **Note: For this job to execute, you will need to have a resque worker running. See running [async jobs](/rhoconnect/async-jobs) for more information.**
148
+
149
+ ## Triggering Push Automatically after Updating RhoConnect Data from Plugins
150
+
151
+ Whenever a backend application modifies RhoConnect data for one of the sources, you can trigger an automatic push notification to be sent to the user's device(s) whose source data was modified. This will force the user's client application to perform a sync on the modified source.
152
+ To enable this, you need to specify the following setting in the `settings.yml` file:
153
+
154
+ :::yaml
155
+ :push_notify: 'true'
156
+
157
+ **Note: The automatic push notification will be applied only to the user-partitioned sources. App-partitioned sources can not trigger an automatic push notification.**