rhoconnect 3.3.6 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +40 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +27 -25
- data/bench/benchapp/Gemfile +7 -27
- data/bench/benchapp/config.ru +9 -31
- data/bench/blobapp/Gemfile +7 -27
- data/bench/blobapp/config.ru +9 -29
- data/bench/lib/bench.rb +8 -1
- data/bench/lib/bench/test_data.rb +4 -1
- data/bench/scripts/blob_cud_script.rb +4 -0
- data/bench/scripts/cud_script.rb +7 -1
- data/bench/scripts/helpers.rb +1 -1
- data/bench/scripts/test_query_script.rb +20 -7
- data/bench/spec/bench_spec_helper.rb +3 -1
- data/bin/rhoconnect +22 -12
- data/commands/{commands/dtach_commands → dtach}/dtach_about.rb +0 -0
- data/commands/{commands/dtach_commands → dtach}/dtach_install.rb +0 -0
- data/commands/{commands/redis_commands → dtach}/redis_attach.rb +0 -0
- data/commands/execute.rb +14 -15
- data/commands/generators/update.rb +26 -0
- data/commands/{commands/redis_commands → redis}/redis_about.rb +0 -0
- data/commands/redis/redis_download.rb +13 -0
- data/commands/redis/redis_install.rb +26 -0
- data/commands/{commands/redis_commands → redis}/redis_make.rb +0 -0
- data/commands/{commands/redis_commands → redis}/redis_restart.rb +3 -2
- data/commands/{commands/redis_commands → redis}/redis_start.rb +0 -0
- data/commands/{commands/redis_commands → redis}/redis_startbg.rb +0 -0
- data/commands/{commands/redis_commands → redis}/redis_stop.rb +3 -2
- data/commands/{commands/rhoconnect → rhoconnect}/clean_start.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/config.rb +7 -2
- data/commands/{commands/rhoconnect → rhoconnect}/create_user.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/delete_device.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/delete_user.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/flushdb.rb +4 -4
- data/commands/{commands/rhoconnect → rhoconnect}/get_token.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/reset.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/reset_refresh.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/restart.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/secret.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/set_admin_password.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/spec.rb +0 -0
- data/commands/rhoconnect/start.rb +27 -0
- data/commands/{commands/rhoconnect → rhoconnect}/startbg.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/startdebug.rb +2 -2
- data/commands/{commands/rhoconnect → rhoconnect}/stop.rb +3 -4
- data/commands/{commands/rhoconnect → rhoconnect}/version.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect}/web.rb +0 -0
- data/commands/rhoconnect_attach/attach.rb +10 -0
- data/commands/rhoconnect_console/console.rb +16 -0
- data/commands/{commands/rhoconnect → rhoconnect_console}/console_helper.rb +0 -0
- data/commands/{commands/rhoconnect → rhoconnect_war}/war.rb +0 -0
- data/commands/{commands/redis_commands → utilities}/redis_runner.rb +22 -19
- data/commands/utilities/utilities.rb +6 -0
- data/doc/benchmarks.txt +2 -2
- data/doc/bulk-sync.txt +12 -1
- data/doc/client-java.txt +3 -3
- data/doc/client-objc.txt +1 -1
- data/doc/client.txt +5 -5
- data/doc/command-line.txt +80 -135
- data/doc/deploying.txt +119 -12
- data/doc/extending-rhoconnect-server.txt +1 -1
- data/doc/heroku-addon.txt +119 -23
- data/doc/install.txt +101 -39
- data/doc/java-plugin.txt +2 -2
- data/doc/licensing.txt +1 -1
- data/doc/plugin-intro.txt +3 -1
- data/doc/preparing-production.txt +4 -4
- data/doc/public/cli.txt +2 -2
- data/doc/push-backend-setup.txt +11 -1
- data/doc/push-client-setup.txt +72 -2
- data/doc/push-server-setup.txt +129 -8
- data/doc/rails-plugin.txt +245 -40
- data/doc/rest-api.txt +10 -6
- data/doc/rhoconnect-calculator.txt +237 -0
- data/doc/rhoconnect-redis-stack.txt +35 -0
- data/doc/session-and-configuration.txt +24 -0
- data/doc/settings.txt +51 -41
- data/doc/source-adapters.txt +45 -45
- data/doc/stats-middleware.txt +2 -2
- data/doc/supported-platforms.txt +6 -6
- data/doc/testing.txt +2 -2
- data/doc/tutorial.txt +63 -63
- data/examples/simple/Gemfile +7 -35
- data/examples/simple/config.ru +8 -26
- data/examples/simple/sources/product.rb +6 -6
- data/generators/rhoconnect.rb +5 -0
- data/generators/templates/application/Gemfile +7 -37
- data/generators/templates/application/Rakefile +8 -0
- data/generators/templates/application/config.ru +12 -31
- data/generators/templates/application/rcgemfile +44 -0
- data/generators/templates/application/settings/settings.yml +7 -5
- data/install.sh +4 -4
- data/installer/unix-like/create_texts.rb +7 -2
- data/installer/unix-like/rho_connect_install_constants.rb +2 -2
- data/installer/unix-like/rho_connect_install_installers.rb +1 -16
- data/lib/rhoconnect.rb +51 -38
- data/lib/rhoconnect/api/app/query.rb +4 -1
- data/lib/rhoconnect/api/app/search.rb +4 -1
- data/lib/rhoconnect/api/client/list_client_docs.rb +3 -1
- data/lib/rhoconnect/api/user/ping.rb +1 -5
- data/lib/rhoconnect/application/init.rb +43 -0
- data/lib/rhoconnect/async.rb +11 -6
- data/lib/rhoconnect/client_sync.rb +30 -37
- data/lib/rhoconnect/document.rb +4 -0
- data/lib/rhoconnect/graph_helper.rb +74 -56
- data/lib/rhoconnect/middleware/helpers.rb +4 -0
- data/lib/rhoconnect/ping.rb +1 -0
- data/lib/rhoconnect/ping/gcm.rb +58 -0
- data/lib/rhoconnect/predefined_adapters/bench_adapter.rb +7 -1
- data/lib/rhoconnect/source.rb +70 -56
- data/lib/rhoconnect/source_sync.rb +33 -5
- data/lib/rhoconnect/store.rb +358 -110
- data/lib/rhoconnect/user.rb +8 -0
- data/lib/rhoconnect/utilities.rb +16 -14
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect/web-console/models/client.js +1 -1
- data/lib/rhoconnect/web-console/public/UNVR67bold.ttf +0 -0
- data/lib/rhoconnect/web-console/public/bootstrap.css +6 -0
- data/lib/rhoconnect/web-console/public/logo.png +0 -0
- data/lib/rhoconnect/web-console/server.rb +13 -11
- data/lib/rhoconnect/web-console/templates/index.erb +5 -5
- data/lib/rhoconnect/web-console/templates/jqplot.erb +1 -0
- data/lib/rhoconnect/web-console/views/doc.js +0 -4
- data/lib/rhoconnect/web-console/views/home.js +2 -1
- data/lib/rhoconnect/web-console/views/new_ping.js +11 -6
- data/lib/rhoconnect/web-console/views/stats.js +9 -5
- data/rhoconnect.gemspec +6 -4
- data/spec/api/app/fast_update_spec.rb +2 -2
- data/spec/api/source/get_source_params_spec.rb +1 -0
- data/spec/apps/rhotestapp/settings/settings.yml +5 -5
- data/spec/client_sync_spec.rb +3 -14
- data/spec/perf/perf_spec_helper.rb +11 -7
- data/spec/perf/store_perf_spec.rb +88 -11
- data/spec/ping/gcm_spec.rb +99 -0
- data/spec/server/server_spec.rb +7 -0
- data/spec/server/stats_spec.rb +9 -2
- data/spec/source_sync_spec.rb +29 -0
- data/spec/spec_helper.rb +40 -38
- data/spec/stats/record_spec.rb +18 -9
- data/spec/store_spec.rb +128 -19
- data/spec/testdata/10000-data.txt +0 -0
- data/spec/testdata/5-data.txt +0 -0
- data/spec/testdata/5000-data.txt +0 -0
- data/tasks/jasmine.rake +1 -0
- data/tasks/redis.rake +16 -13
- metadata +71 -39
- data/commands/commands/redis_commands/redis_download.rb +0 -33
- data/commands/commands/redis_commands/redis_install.rb +0 -26
- data/commands/commands/rhoconnect/attach.rb +0 -8
- data/commands/commands/rhoconnect/console.rb +0 -15
- data/commands/commands/rhoconnect/start.rb +0 -18
- 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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
##Setup
|
104
|
+
:::term
|
105
|
+
$ heroku addons:add rhoconnect
|
15
106
|
|
16
|
-
|
107
|
+
###Setup
|
17
108
|
|
18
|
-
|
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
|
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
|
-
|
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 [
|
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
|
-
|
127
|
+
###Gem installation:
|
34
128
|
|
35
|
-
|
36
|
-
|
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
|
-
|
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/
|
46
|
-
|
139
|
+
<p><img src='https://s3.amazonaws.com/rhodocs/rhoconnect-service/console_rhodesurl.png' width="750" height="280"/></p>
|
47
140
|
|
48
|
-
|
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
|
-
|
5
|
+
## Installing RhoConnect with RhoStudio
|
6
6
|
|
7
|
-
|
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
|
-
|
9
|
+
[Click here for the RhoMobile Suite installation instructions](/rhomobile-install).
|
10
10
|
|
11
|
-
|
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
|
-
|
13
|
+
## Installing RhoConnect from the Command Line
|
14
14
|
|
15
|
-
|
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
|
-
|
17
|
+
1. [Ruby v1.9.3](http://www.ruby-lang.org/en/downloads/).
|
18
18
|
|
19
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
27
|
+
4. Install the RhoConnect Gem.
|
28
28
|
|
29
|
-
|
29
|
+
Run this command to install the RhoConnect Gem.
|
30
30
|
|
31
|
-
|
31
|
+
:::term
|
32
|
+
$ gem install rhoconnect
|
32
33
|
|
33
|
-
|
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
|
-
|
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
|
-
|
38
|
+
## Setting the Location of the RhoStudio Workspace Directory
|
38
39
|
|
39
|
-
|
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
|
-
|
42
|
+
## Standalone Ruby Installation and Ruby Version Manager
|
42
43
|
|
43
|
-
|
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
|
-
|
46
|
+
## Migrating to OS X Mountain Lion from the command line
|
46
47
|
|
47
|
-
|
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
|
-
|
50
|
+
### Getting Xcode and Command Line Tools Installed
|
50
51
|
|
51
|
-
|
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
|
-
|
54
|
+
### Installing Homebrew and GCC
|
54
55
|
|
55
|
-
|
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
|
-
|
58
|
+
:::term
|
59
|
+
$ brew tap homebrew/dupes
|
60
|
+
$ brew install apple-gcc42
|
58
61
|
|
59
|
-
|
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
|
-
|
65
|
+
If you had Homebrew already installed, then you need only update it
|
62
66
|
|
63
|
-
|
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
|
-
$
|
78
|
+
$ rvm get stable
|
79
|
+
$ rvm reinstall 1.9.3
|
67
80
|
|
68
|
-
|
81
|
+
### Installing legacy rubies
|
69
82
|
|
70
|
-
|
83
|
+
Run the following commands to install legacy rubies:
|
71
84
|
|
72
|
-
|
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
|
-
|
90
|
+
## Upgrading an Existing Application
|
75
91
|
|
76
|
-
|
92
|
+
If you have an existing application, upgrading to the latest version of RhoConnect is simple.
|
77
93
|
|
78
|
-
|
94
|
+
Open the `Gemfile` of your application and find the rhoconnect line, it should look something like:
|
79
95
|
|
80
|
-
|
96
|
+
:::ruby
|
97
|
+
gem 'rhoconnect', '3.3.6'
|
81
98
|
|
82
|
-
|
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
|
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/
|
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 **"
|
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:
|
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
|
22
|
-
[11:34:56 AM
|
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 `
|
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
|
-
$
|
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
|
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
|
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
|
data/doc/push-backend-setup.txt
CHANGED
@@ -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
|
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.**
|