rhodes 3.2.0.beta.2 → 3.2.0.beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. data/CHANGELOG +1 -0
  2. data/Manifest.txt +3 -0
  3. data/doc/build.txt +1 -1
  4. data/doc/device-caps.txt +4 -0
  5. data/doc/extensions.txt +3 -0
  6. data/doc/install.txt +3 -2
  7. data/lib/framework/date.rb +13 -0
  8. data/lib/framework/dateME.rb +2 -0
  9. data/lib/framework/rho/rhoapplication.rb +3 -1
  10. data/lib/framework/rho/rhoerror.rb +2 -2
  11. data/lib/framework/rho/rhomsg.rb +2 -2
  12. data/lib/framework/rholang/localization_simplified.rb +39 -13
  13. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyRuntime.java +2 -2
  14. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +1 -1
  15. data/platform/iphone/Classes/Rhodes.m +1 -1
  16. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +8 -8
  17. data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
  18. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +39 -0
  19. data/platform/shared/RhoConnectClient/RhoConnectClient.h +2 -0
  20. data/platform/shared/curl/lib/config-mac.h +956 -0
  21. data/platform/shared/curl/lib/setup.h +1 -1
  22. data/platform/shared/curl/lib/ssluse.h +7 -0
  23. data/platform/shared/qt/RhoSimulator.pro +3 -0
  24. data/platform/shared/qt/curl/curl.pro +2 -1
  25. data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.h +6 -3
  26. data/platform/shared/qt/rhodes/impl/SSLImpl.cpp +69 -0
  27. data/platform/shared/qt/rhodes/impl/SSLImpl.h +49 -0
  28. data/platform/shared/qt/rhodes/rhodes.pro +4 -2
  29. data/platform/symbian/rhodes/rhodes.pro +3 -2
  30. data/platform/symbian/rholib/rholib.pro +6 -0
  31. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  32. data/rhodes.gemspec +1 -1
  33. metadata +7 -4
data/CHANGELOG CHANGED
@@ -4,6 +4,7 @@
4
4
  * Support native JQueryMobile css-styles
5
5
  * Support latest Android NDK
6
6
  * Support Offline map on Android
7
+ * RhoSimulator for OSX Lion
7
8
 
8
9
  ## 3.1
9
10
  * Symbian support(Beta)
data/Manifest.txt CHANGED
@@ -2139,6 +2139,7 @@ platform/shared/curl/include/curl/types.h
2139
2139
  platform/shared/curl/lib/amigaos.c
2140
2140
  platform/shared/curl/lib/arpa_telnet.h
2141
2141
  platform/shared/curl/lib/base64.c
2142
+ platform/shared/curl/lib/config-mac.h
2142
2143
  platform/shared/curl/lib/config-symbian.h
2143
2144
  platform/shared/curl/lib/config-win32.h
2144
2145
  platform/shared/curl/lib/config-win32ce.h
@@ -2382,6 +2383,8 @@ platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp
2382
2383
  platform/shared/qt/rhodes/impl/RhoThreadImpl.h
2383
2384
  platform/shared/qt/rhodes/impl/RingtoneManagerImpl.cpp
2384
2385
  platform/shared/qt/rhodes/impl/SignatureImpl.cpp
2386
+ platform/shared/qt/rhodes/impl/SSLImpl.cpp
2387
+ platform/shared/qt/rhodes/impl/SSLImpl.h
2385
2388
  platform/shared/qt/rhodes/impl/SystemImpl.cpp
2386
2389
  platform/shared/qt/rhodes/impl/WebViewImpl.cpp
2387
2390
  platform/shared/qt/rhodes/main.cpp
data/doc/build.txt CHANGED
@@ -13,7 +13,7 @@ You should check to see that the required software in installed on your computer
13
13
 
14
14
  If you planning to modify or [extend](extensions) Rhodes, you will need the Rhodes source code. It is distributed under MIT license. You don't need it if you are not planning to modify/extend Rhodes.
15
15
 
16
- Rhodes source code is available on github.com. You will need Git to get it. If you used [Instant Rhodes](install#install-on-windows) you probably already have Git installed on your system. Otherwise, load it from [here](http://git-scm.com).
16
+ Rhodes source code is available on github.com. You will need Git to get it. If you used [RhoStudio for Windows](http://rhomobile.com/rhostudio-windows) you probably already have Git installed on your system. Otherwise, load it from [here](http://git-scm.com).
17
17
 
18
18
  To clone Rhodes to your local computer, execute git clone from the command line:
19
19
 
data/doc/device-caps.txt CHANGED
@@ -115,6 +115,10 @@ Set application icon badge (number) - only for iPhone. set badge to 0 (zero) for
115
115
  :::ruby
116
116
  System.set_application_icon_badge(badge_number)
117
117
 
118
+ Switch locale at runtime:
119
+ :::ruby
120
+ System::set_locale('es') #set current locale to Spanish
121
+
118
122
  ### Sample
119
123
  See layout.erb of [System API Sample application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/layout.erb) for some of the examples of how to use System class. There is also [system test](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/SystemTest/controller.rb) which demonstrate System class usage.
120
124
 
data/doc/extensions.txt CHANGED
@@ -57,6 +57,9 @@ And use this string in the view:
57
57
  <li><%= Localization::Views[:greeting] %></li>
58
58
  </ul>
59
59
 
60
+ To switch locale at runtime use:
61
+ :::ruby
62
+ System::set_locale('es') #set current locale to Spanish
60
63
  #### Details:
61
64
 
62
65
  All non-ascii symbols should be utf-8 encoded
data/doc/install.txt CHANGED
@@ -1,7 +1,8 @@
1
1
  # Install Rhodes
2
2
 
3
- ## Instant Rhodes (Windows)
4
- The easiest way to install Rhodes on Windows is to use the [Instant Rhodes installer](http://rhomobile.com/instant-rhodes). This will install Ruby, Rubygems, Redis, Rhodes and Rhosync gems and dependencies.
3
+ ## Windows
4
+
5
+ If you're running Windows, download the latest [RhoStudio for Windows](http://rhomobile.com/rhostudio-windows). This installs the [Ruby stack](http://www.ruby-lang.org/en/), [Redis](http://redis.io/), [RhoConnect](/rhoconnect/introduction) and [Rhodes](/rhodes/introduction).
5
6
 
6
7
  Once the installer has completed, and you have installed the Java Development Kit, you can skip to the [Setup Rhodes section](#setup-rhodes).
7
8
 
@@ -8,6 +8,8 @@ end
8
8
  require 'rholang/localization_simplified'
9
9
  # Modification of ruby constants
10
10
  class Date
11
+ alias_method :old_strftime, :strftime
12
+
11
13
  #FIXME as these are defined as Ruby constants, they can not be overwritten
12
14
  MONTHNAMES = LocalizationSimplified::DateHelper::Monthnames
13
15
  ABBR_MONTHNAMES = LocalizationSimplified::DateHelper::AbbrMonthnames
@@ -18,6 +20,17 @@ class Date
18
20
  #, :long_ordinal => lambda { |date| date.strftime("%B #{date.day.ordinalize}, %Y") }, # => "April 25th, 2007" :rfc822 => "%e %b %Y"
19
21
  DATE_FORMATS.merge!(LocalizationSimplified::DateHelper::DateFormats)
20
22
 
23
+ def strftime(date)
24
+
25
+ if LocalizationSimplified::get_cur_locale() == 'en'
26
+ return old_strftime(date)
27
+ end
28
+
29
+ tmpdate=date.dup
30
+ LocalizationSimplified::localize_strftime(tmpdate, self)
31
+ old_strftime(tmpdate)
32
+ end
33
+
21
34
  def to_formatted_s(type)
22
35
  strftime(DATE_FORMATS[type])
23
36
  end
@@ -106,6 +106,8 @@ end
106
106
 
107
107
  class Date
108
108
 
109
+ SECONDS_IN_DAY = Rational(1, 86400) # :nodoc:
110
+
109
111
  def self.today
110
112
  Date.new( Time.now )
111
113
  end
@@ -31,6 +31,8 @@ require 'rho/rhomsg'
31
31
  require 'rho/rhotabbar'
32
32
  require 'rho/rhotoolbar'
33
33
 
34
+ ::System::set_locale(nil, nil)
35
+
34
36
  module Rho
35
37
  class RhoApplication
36
38
  attr_accessor :default_menu
@@ -44,7 +46,7 @@ module Rho
44
46
  {:action => :home}, {:action => :refresh}, {:action => :options} ]
45
47
 
46
48
  def initialize
47
- LocalizationSimplified.requre_loc(Rho::RhoFSConnector::get_app_path('app') + 'lang/lang_',true)
49
+ #LocalizationSimplified.requre_loc(Rho::RhoFSConnector::get_app_path('app') + 'lang/lang_',true)
48
50
 
49
51
  unless @rhom
50
52
  @rhom = Rhom::Rhom.new
@@ -57,5 +57,5 @@ module Rho
57
57
  end # RhoError
58
58
  end # Rho
59
59
 
60
- require 'rholang/localization_simplified'
61
- LocalizationSimplified.requre_loc('rholang/rhoerror_',false)
60
+ #require 'rholang/localization_simplified'
61
+ #LocalizationSimplified.requre_loc('rholang/rhoerror_',false)
@@ -32,5 +32,5 @@ module Rho
32
32
  end # RhoMessages
33
33
  end # Rho
34
34
 
35
- require 'rholang/localization_simplified'
36
- LocalizationSimplified.requre_loc('rholang/rhomsg_',false)
35
+ #require 'rholang/localization_simplified'
36
+ #LocalizationSimplified.requre_loc('rholang/rhomsg_',false)
@@ -6,7 +6,8 @@
6
6
 
7
7
  module LocalizationSimplified
8
8
  @@ignore = "\xFF\xFF\xFF\xFF" # %% == Literal "%" character
9
- @@cur_locale = 'en'
9
+ @@cur_locale = nil #'en'
10
+ @@cur_country = nil #'en'
10
11
  # substitute all daynames and monthnames with localized names
11
12
  # from RUtils plugin
12
13
  def self.localize_strftime(date='%d.%m.%Y', time='')
@@ -22,12 +23,24 @@ module LocalizationSimplified
22
23
  @@cur_locale
23
24
  end
24
25
 
25
- def self.requre_loc(file,check_exist)
26
- curLocale = System::get_locale().downcase
27
- curCountry = System::get_property("country").downcase
26
+ def self.set_cur_locale(loc, country)
27
+ @@cur_locale = loc
28
+ @@cur_country = country
29
+ end
30
+
31
+ def self.init_current_locale
32
+ return if @@cur_locale
33
+
34
+ @@cur_locale = System::get_locale().downcase
35
+ @@cur_locale = 'en' unless @@cur_locale
36
+ @@cur_country = System::get_property("country").downcase
28
37
 
29
- puts "Current locale: #{curLocale}; Country code: #{curCountry}"
30
- @@cur_locale = curLocale
38
+ puts "Current locale: #{@@cur_locale}; Country code: #{@@cur_country}"
39
+
40
+ end
41
+
42
+ def self.requre_loc(file,check_exist)
43
+ init_current_locale()
31
44
 
32
45
  unless check_exist
33
46
  if defined?( RHODES_EMULATOR )
@@ -38,13 +51,15 @@ end
38
51
  puts "file: #{file}"
39
52
  end
40
53
 
41
- if curCountry && curCountry.length() > 0 && Rho::file_exist?(file + curLocale + '_' + curCountry + RHO_RB_EXT)
42
- require file + curLocale + '_' + curCountry
43
- elsif Rho::file_exist?(file + curLocale + RHO_RB_EXT)
44
- require file + curLocale
54
+ puts "Current locale: #{@@cur_locale}; Country code: #{@@cur_country}"
55
+
56
+ if @@cur_country && @@cur_country.length() > 0 && Rho::file_exist?(file + @@cur_locale + '_' + @@cur_country + RHO_RB_EXT)
57
+ require file + @@cur_locale + '_' + @@cur_country
58
+ elsif Rho::file_exist?(file + @@cur_locale + RHO_RB_EXT)
59
+ require file + @@cur_locale
45
60
  else
46
- puts 'Could not find resources for locale: ' + curLocale.to_s + ";file: #{file}"if curLocale != 'en'
47
- if curLocale != 'en' && Rho::file_exist?(file + 'en' + RHO_RB_EXT)
61
+ puts 'Could not find resources for locale: ' + @@cur_locale.to_s + ";file: #{file}" if @@cur_locale != 'en'
62
+ if @@cur_locale != 'en' && Rho::file_exist?(file + 'en' + RHO_RB_EXT)
48
63
  puts 'Load english resources.'
49
64
  require file + 'en'
50
65
  end
@@ -53,7 +68,18 @@ end
53
68
 
54
69
  end
55
70
 
56
- LocalizationSimplified.requre_loc('rholang/lang_',false)
71
+ #LocalizationSimplified.requre_loc('rholang/lang_',false)
72
+
73
+ module System
74
+ def self.set_locale(locale_code, country_code = nil)
75
+ LocalizationSimplified::set_cur_locale(locale_code, country_code)
76
+
77
+ LocalizationSimplified.requre_loc('rholang/lang_',false)
78
+ LocalizationSimplified.requre_loc(Rho::RhoFSConnector::get_app_path('app') + 'lang/lang_',true)
79
+ LocalizationSimplified.requre_loc('rholang/rhoerror_',false)
80
+ LocalizationSimplified.requre_loc('rholang/rhomsg_',false)
81
+ end
82
+ end
57
83
 
58
84
  class Hash
59
85
  def reverse_merge(other_hash)
@@ -98,7 +98,7 @@ public class RubyRuntime
98
98
  public static RubyClass EVRecordClass;
99
99
  public static RubyClass GeoLocationClass;
100
100
  public static RubyModule AsyncHttpModule;
101
- public static RubyClass SystemClass;
101
+ public static RubyModule SystemClass;
102
102
  public static RubyModule JSONClass;
103
103
  public static RubyClass CameraClass;
104
104
  public static RubyClass RhoBluetoothClass;
@@ -311,7 +311,7 @@ public class RubyRuntime
311
311
  EVRecordClass = RubyAPI.defineClass("EVRecord", RubyRuntime.ObjectClass);
312
312
  GeoLocationClass = RubyAPI.defineClass("GeoLocation", RubyRuntime.ObjectClass);
313
313
  AsyncHttpModule = rhoModule.defineModule("AsyncHttp");
314
- SystemClass = RubyAPI.defineClass("System", RubyRuntime.ObjectClass);
314
+ SystemClass = RubyAPI.defineModule("System");//, RubyRuntime.ObjectClass);
315
315
  JSONClass = rhoModule.defineModule("JSON" );//, RubyRuntime.ObjectClass);
316
316
  CameraClass = RubyAPI.defineClass("Camera", RubyRuntime.ObjectClass);
317
317
  RhoBluetoothClass = RubyAPI.defineClass("RhoBluetooth", RubyRuntime.ObjectClass);
@@ -58,7 +58,7 @@ public class System {
58
58
 
59
59
  private static RhodesApp RHODESAPP(){ return RhodesApp.getInstance(); }
60
60
 
61
- public static void initMethods(RubyClass klass){
61
+ public static void initMethods(RubyModule klass){
62
62
  klass.getSingletonClass().defineMethod( "get_property", new RubyOneArgMethod(){
63
63
  protected RubyValue run(RubyValue receiver, RubyValue arg, RubyBlock block )
64
64
  {
@@ -30,7 +30,7 @@
30
30
  #import "ParamsWrapper.h"
31
31
 
32
32
  #include "sync/ClientRegister.h"
33
- #include "sync/syncthread.h"
33
+ #include "sync/SyncThread.h"
34
34
  #include "logging/RhoLogConf.h"
35
35
  #include "logging/RhoLog.h"
36
36
  #include "common/RhoConf.h"
@@ -26,8 +26,8 @@
26
26
  46E9214C0E9BF40A00F14AC8 /* printbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = 46E9213A0E9BF40A00F14AC8 /* printbuf.c */; };
27
27
  46E9214D0E9BF40A00F14AC8 /* printbuf.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E9213B0E9BF40A00F14AC8 /* printbuf.h */; };
28
28
  5C329221112C748F00FD3F13 /* RJSONTokener.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C329220112C748F00FD3F13 /* RJSONTokener.c */; };
29
- 5C5335AC0FC2F3AB00F268F0 /* syncthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5335AA0FC2F3AB00F268F0 /* syncthread.cpp */; };
30
- 5C5335AD0FC2F3AB00F268F0 /* syncthread.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5335AB0FC2F3AB00F268F0 /* syncthread.h */; };
29
+ 5C5335AC0FC2F3AB00F268F0 /* SyncThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C5335AA0FC2F3AB00F268F0 /* SyncThread.cpp */; };
30
+ 5C5335AD0FC2F3AB00F268F0 /* SyncThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5335AB0FC2F3AB00F268F0 /* SyncThread.h */; };
31
31
  5C74058A1064AA4900163569 /* DBAttrManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7405881064AA4900163569 /* DBAttrManager.cpp */; };
32
32
  5C74058B1064AA4900163569 /* DBAttrManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7405891064AA4900163569 /* DBAttrManager.h */; };
33
33
  5C7405F2106CF7F400163569 /* SyncNotify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7405F0106CF7F400163569 /* SyncNotify.cpp */; };
@@ -69,8 +69,8 @@
69
69
  46E9213A0E9BF40A00F14AC8 /* printbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = printbuf.c; path = ../../shared/json/printbuf.c; sourceTree = SOURCE_ROOT; };
70
70
  46E9213B0E9BF40A00F14AC8 /* printbuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = printbuf.h; path = ../../shared/json/printbuf.h; sourceTree = SOURCE_ROOT; };
71
71
  5C329220112C748F00FD3F13 /* RJSONTokener.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = RJSONTokener.c; sourceTree = "<group>"; };
72
- 5C5335AA0FC2F3AB00F268F0 /* syncthread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = syncthread.cpp; path = ../../shared/sync/syncthread.cpp; sourceTree = SOURCE_ROOT; };
73
- 5C5335AB0FC2F3AB00F268F0 /* syncthread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = syncthread.h; path = ../../shared/sync/syncthread.h; sourceTree = SOURCE_ROOT; };
72
+ 5C5335AA0FC2F3AB00F268F0 /* SyncThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SyncThread.cpp; path = ../../shared/sync/SyncThread.cpp; sourceTree = SOURCE_ROOT; };
73
+ 5C5335AB0FC2F3AB00F268F0 /* SyncThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SyncThread.h; path = ../../shared/sync/SyncThread.h; sourceTree = SOURCE_ROOT; };
74
74
  5C7405881064AA4900163569 /* DBAttrManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DBAttrManager.cpp; path = ../../shared/db/DBAttrManager.cpp; sourceTree = SOURCE_ROOT; };
75
75
  5C7405891064AA4900163569 /* DBAttrManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DBAttrManager.h; path = ../../shared/db/DBAttrManager.h; sourceTree = SOURCE_ROOT; };
76
76
  5C7405F0106CF7F400163569 /* SyncNotify.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SyncNotify.cpp; path = ../../shared/sync/SyncNotify.cpp; sourceTree = SOURCE_ROOT; };
@@ -168,8 +168,8 @@
168
168
  5C7405F1106CF7F400163569 /* SyncNotify.h */,
169
169
  5CE294091009D8B7009A75F6 /* ClientRegister.cpp */,
170
170
  5CE2940A1009D8B7009A75F6 /* ClientRegister.h */,
171
- 5C5335AA0FC2F3AB00F268F0 /* syncthread.cpp */,
172
- 5C5335AB0FC2F3AB00F268F0 /* syncthread.h */,
171
+ 5C5335AA0FC2F3AB00F268F0 /* SyncThread.cpp */,
172
+ 5C5335AB0FC2F3AB00F268F0 /* SyncThread.h */,
173
173
  5C9817260FBC4F41002597A5 /* SyncEngine.cpp */,
174
174
  5C9817270FBC4F41002597A5 /* SyncEngine.h */,
175
175
  5C9817280FBC4F41002597A5 /* SyncSource.cpp */,
@@ -221,7 +221,7 @@
221
221
  5C98172D0FBC4F41002597A5 /* SyncSource.h in Headers */,
222
222
  5C9817340FBC4F70002597A5 /* DBAdapter.h in Headers */,
223
223
  5C9817360FBC4F70002597A5 /* DBResult.h in Headers */,
224
- 5C5335AD0FC2F3AB00F268F0 /* syncthread.h in Headers */,
224
+ 5C5335AD0FC2F3AB00F268F0 /* SyncThread.h in Headers */,
225
225
  5CE2940C1009D8B7009A75F6 /* ClientRegister.h in Headers */,
226
226
  5C74058B1064AA4900163569 /* DBAttrManager.h in Headers */,
227
227
  5C7405F3106CF7F400163569 /* SyncNotify.h in Headers */,
@@ -286,7 +286,7 @@
286
286
  5C98172C0FBC4F41002597A5 /* SyncSource.cpp in Sources */,
287
287
  5C9817330FBC4F70002597A5 /* DBAdapter.cpp in Sources */,
288
288
  5C9817350FBC4F70002597A5 /* DBResult.cpp in Sources */,
289
- 5C5335AC0FC2F3AB00F268F0 /* syncthread.cpp in Sources */,
289
+ 5C5335AC0FC2F3AB00F268F0 /* SyncThread.cpp in Sources */,
290
290
  5CE2940B1009D8B7009A75F6 /* ClientRegister.cpp in Sources */,
291
291
  5C74058A1064AA4900163569 /* DBAttrManager.cpp in Sources */,
292
292
  5C7405F2106CF7F400163569 /* SyncNotify.cpp in Sources */,
@@ -413,6 +413,45 @@ unsigned long rho_connectclient_find_first(const char* szModel, unsigned long ha
413
413
  return rhom_find( szModel, hash, 1 );
414
414
  }
415
415
 
416
+ unsigned long rho_connectclient_findbysql(const char* szModel, const char* szSql, unsigned long arParams )
417
+ {
418
+ String src_name = szModel;
419
+
420
+ IDBResult res = db::CDBAdapter::getUserDB().executeSQL("SELECT source_id, partition, schema, sync_type from sources WHERE name=?", src_name);
421
+ if ( res.isEnd())
422
+ {
423
+ //TODO: report error - unknown source
424
+ return 0;
425
+ }
426
+
427
+ int nSrcID = res.getIntByIdx(0);
428
+ String db_partition = res.getStringByIdx(1);
429
+ bool isSchemaSrc = res.getStringByIdx(2).length() > 0;
430
+ db::CDBAdapter& db = db::CDBAdapter::getDB(db_partition.c_str());
431
+
432
+ unsigned long items = rho_connectclient_strhasharray_create();
433
+
434
+ IDBResult res1 = !arParams ? db.executeSQL(szSql) : db.executeSQLEx( szSql, *((Vector<String>*) arParams) );
435
+ if ( res1.isEnd() )
436
+ return items;
437
+
438
+ for ( ; !res1.isEnd(); res1.next() )
439
+ {
440
+ unsigned long item = rho_connectclient_hash_create();
441
+
442
+ for (int i = 0; i < res1.getColCount(); i++ )
443
+ {
444
+ if ( !res1.isNullByIdx(i))
445
+ rho_connectclient_hash_put(item, res1.getColName(i).c_str(), res1.getStringByIdx(i).c_str() );
446
+ }
447
+
448
+ rho_connectclient_strhasharray_add(items, item );
449
+ }
450
+
451
+ return items;
452
+
453
+ }
454
+
416
455
  void rho_connectclient_start_bulkupdate(const char* szModel)
417
456
  {
418
457
  String src_name = szModel;
@@ -106,6 +106,8 @@ void rho_connectclient_create_object(const char* szModel, unsigned long hash);
106
106
  unsigned long rho_connectclient_find(const char* szModel,const char* szObject );
107
107
  unsigned long rho_connectclient_find_first(const char* szModel, unsigned long hashCond );
108
108
  unsigned long rho_connectclient_find_all(const char* szModel, unsigned long hashCond );
109
+ unsigned long rho_connectclient_findbysql(const char* szModel, const char* szSql, unsigned long arParams );
110
+
109
111
  void rho_connectclient_save( const char* szModel, unsigned long hash );
110
112
  void rho_connectclient_itemdestroy( const char* szModel, unsigned long hash );
111
113