rhodes 2.0.0.beta10 → 2.0.0.beta11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/Manifest.txt +5297 -0
  2. data/README.textile +2 -2
  3. data/bin/rhodes-setup +1 -0
  4. data/lib/extensions/digest-md5/ext/Rakefile +6 -5
  5. data/lib/extensions/fcntl/ext.yml +1 -1
  6. data/lib/framework/rho/rho.rb +2 -34
  7. data/lib/framework/rho/rhoapplication.rb +6 -2
  8. data/lib/framework/rho/rhofsconnector.rb +9 -0
  9. data/lib/framework/rhodes.rb +1 -1
  10. data/lib/rhodes.rb +1 -1
  11. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +1 -1
  12. data/platform/shared/common/RhoDefs.h +1 -1
  13. data/platform/shared/common/RhodesApp.cpp +20 -0
  14. data/platform/shared/common/RhodesApp.h +1 -0
  15. data/platform/shared/db/DBAdapter.cpp +34 -9
  16. data/platform/shared/db/DBAdapter.h +3 -3
  17. data/platform/shared/net/AsyncHttp.cpp +1 -1
  18. data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +1 -1
  19. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +1 -1
  20. data/platform/shared/rubyJVM/src/com/rho/net/URI.java +4 -7
  21. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +7 -7
  22. data/platform/shared/sync/SyncEngine.cpp +5 -9
  23. data/platform/shared/sync/SyncThread.cpp +3 -2
  24. data/platform/wm/rhodes/MainWindow.cpp +7 -2
  25. data/platform/wm/rhodes/MainWindow.h +2 -0
  26. data/platform/wm/rhodes/Rhodes.cpp +9 -7
  27. data/res/build-tools/db/syncdb.triggers +5 -0
  28. data/rhodes.gemspec +1 -1
  29. data/spec/framework_spec/app/BlobTest/blob_test.rb +11 -0
  30. data/spec/framework_spec/app/BlobTest/test.png +0 -0
  31. data/spec/framework_spec/app/BlobTest/test2.png +0 -0
  32. data/spec/framework_spec/app/spec/blobsync_spec.rb +155 -0
  33. data/spec/framework_spec/app/spec/syncengine_spec.rb +3 -0
  34. data/spec/framework_spec/app/spec_runner.rb +1 -0
  35. data/spec/framework_spec/build.yml +1 -1
  36. metadata +8 -3
data/README.textile CHANGED
@@ -36,9 +36,9 @@ This will generate a controller as the file controller.rb and several views as a
36
36
 
37
37
  h2. MORE RESOURCES
38
38
 
39
- There is a "tutorial available":http://rhomobile.com/wiki/index.php/Mobilizing_Your_Application_with_Rhomobile on the "Rhomobile site":http://www.rhomobile.com. This includes thorough and current platform by platform build instructions.
39
+ There is a "tutorial available":http://rhomobile.com/wiki/index.php/Tutorial2 on the "Rhomobile site":http://www.rhomobile.com. This includes thorough and current platform by platform build instructions.
40
40
 
41
- The "Rhodes spec":http://rhomobile.com/wiki/index.php/Rhodes is also available on the "Rhomobile documentation wiki":http://rhomobile.com/wiki/index.php?title=Rhomobile.
41
+ The "Rhodes spec":http://rhomobile.com/wiki/index.php/Rhodes for full documentation on the Rhodes framework.
42
42
 
43
43
  For further questions "email us":mailto:info@rhomobile.com or join the "Google Group":http://groups.google.com/group/rhomobile.
44
44
 
data/bin/rhodes-setup CHANGED
@@ -57,6 +57,7 @@ end
57
57
 
58
58
  while true
59
59
  android = prompt_for("Android SDK path", android, false)
60
+ android = "" if android.nil?
60
61
 
61
62
  android = android.gsub(/\\/,"/")
62
63
  apilevel = -1
@@ -10,16 +10,17 @@ def build_extension(name, arch)
10
10
 
11
11
  args = []
12
12
  args << "-I."
13
- args << "-I../../../../platform/shared/ruby/include"
14
- args << "-I../../../../platform/shared"
13
+ args << "-I#{$rhoroot}/lib/extensions/digest/ext"
14
+ args << "-I#{$rhoroot}/platform/shared/ruby/include"
15
+ args << "-I#{$rhoroot}/platform/shared"
15
16
 
16
17
  if ENV['RHO_PLATFORM'] == 'android'
17
- args << "-I../../../../platform/shared/ruby/linux"
18
- args << "-I../../../../platform/shared/ruby/generated"
18
+ args << "-I#{$rhoroot}/platform/shared/ruby/linux"
19
+ args << "-I#{$rhoroot}/platform/shared/ruby/generated"
19
20
  cc_compile f, $tempdir, args or exit 1
20
21
 
21
22
  elsif ENV['RHO_PLATFORM'] == 'iphone'
22
- args << "-I../../../../platform/shared/ruby/iphone"
23
+ args << "-I#{$rhoroot}/platform/shared/ruby/iphone"
23
24
  args << "-D_XOPEN_SOURCE"
24
25
  args << "-D_DARWIN_C_SOURCE"
25
26
  args << "-isysroot #{$sdkroot}"
@@ -1,2 +1,2 @@
1
1
  entry: Init_fcntl
2
- libraries: [ "libfcntl.a" ]
2
+ libraries: [ "fcntl" ]
@@ -192,44 +192,12 @@ module Rho
192
192
  puts "sources after: #{Rho::RhoConfig::sources()}"
193
193
  return
194
194
  end
195
-
196
- arSrc = res['sources']
197
- puts "arSrc: #{arSrc}"
198
- return unless arSrc
199
-
200
- hashSrcs = Rhom::RhomSource::find_all_ashash
201
- puts "hashSrcs : #{hashSrcs}"
202
- Rho::RhoConfig::reset_max_config_srcid()
203
- arSrc.each do |name, src|
204
- oldSrc = hashSrcs[name]
205
- puts "oldSrc: #{oldSrc}"
206
- #update schema_version
207
- src['schema_version'] = src['schema']['version'] if src['schema'] && src['schema']['version']
208
- src['sync_type'] ||= 'incremental'
209
- #if oldSrc
210
- # oldVer = oldSrc.schema_version
211
- # newVer = src['schema_version']
212
- # if ( oldVer != newVer )
213
- # get_app(APPNAME).on_migrate_source(oldSrc.schema_version, src)
214
- # end
215
- #end
216
-
217
- Rho::RhoConfig::sources[name] = nil
218
- @db_partitions.each_value do |db_part|
219
- db_part.delete_from_table('sources', {"name"=>name})
220
- end
221
-
222
- Rho::RhoConfig::add_source(name, src)
223
- end
224
-
225
- init_sources()
226
-
227
- check_source_migration(get_app(APPNAME))
228
195
  rescue Exception => e
229
196
  puts "Error load_server_sources: #{e}"
230
197
  puts "Trace: #{e.backtrace}"
231
198
  end
232
-
199
+
200
+ raise ArgumentError, "load_server_sources should be called only from bulk sync with partition parameter!"
233
201
  end
234
202
 
235
203
  def find_src_byname(uniq_sources, src_name)
@@ -78,8 +78,12 @@ module Rho
78
78
  Rho::RhoFSConnector::get_model_path(appname, modelname)
79
79
  end
80
80
 
81
- def get_blob_path(relative_file_path)
82
- File.join(__rhoGetCurrentDir(), relative_file_path)
81
+ def get_blob_folder()
82
+ Rho::RhoFSConnector::get_blob_folder()
83
+ end
84
+
85
+ def get_blob_path(relative_path)
86
+ Rho::RhoFSConnector::get_blob_path(relative_path)
83
87
  end
84
88
 
85
89
  end
@@ -27,6 +27,15 @@ module Rho
27
27
  def get_db_fullpathname(postfix)
28
28
  File.join(__rhoGetCurrentDir(), 'db/syncdb' + postfix + '.sqlite')
29
29
  end
30
+
31
+ def get_blob_folder()
32
+ File.join(__rhoGetCurrentDir(), 'db/db-files')
33
+ end
34
+
35
+ def get_blob_path(relative_path)
36
+ File.join(__rhoGetCurrentDir(), relative_path)
37
+ end
38
+
30
39
  end
31
40
  end # RhoApplication
32
41
  end # Rho
@@ -3,7 +3,7 @@ module Rhodes
3
3
  VERSION = '2.0.0'
4
4
  end
5
5
  unless defined? Rhodes::DBVERSION
6
- DBVERSION = '2.0.4'
6
+ DBVERSION = '2.0.5'
7
7
  end
8
8
 
9
9
  end
data/lib/rhodes.rb CHANGED
@@ -3,7 +3,7 @@ module Rhodes
3
3
  VERSION = '2.0.0'
4
4
  end
5
5
  unless defined? Rhodes::DBVERSION
6
- DBVERSION = '2.0.4'
6
+ DBVERSION = '2.0.5'
7
7
  end
8
8
 
9
9
  end
@@ -164,7 +164,7 @@ public class NetworkAccess implements INetworkAccess {
164
164
  url = url.substring(0, fragment);
165
165
  }
166
166
 
167
- boolean ignoreSuffix = ignoreSuffixOnSim && DeviceInfo.isSimulator();
167
+ boolean ignoreSuffix = !URI.isLocalHost(url) && ignoreSuffixOnSim && DeviceInfo.isSimulator();
168
168
  HttpConnection http = (HttpConnection)baseConnect(url, ignoreSuffix );
169
169
  return new BBHttpConnection(http);
170
170
  }
@@ -61,7 +61,7 @@
61
61
  #define L_NUM_SEVERITIES 5
62
62
 
63
63
  #define RHO_STRIP_LOG 0
64
- #define RHO_STRIP_PROFILER 0
64
+ #define RHO_STRIP_PROFILER 1
65
65
 
66
66
  typedef int LogSeverity;
67
67
 
@@ -448,6 +448,26 @@ void CRhodesApp::setAppBackUrl(const String& url)
448
448
  m_strAppBackUrl = "";
449
449
  }
450
450
 
451
+ String CRhodesApp::getAppTitle()
452
+ {
453
+ String strTitle = RHOCONF().getString("title_text");
454
+ if ( strTitle.length() == 0 )
455
+ {
456
+ #ifdef OS_WINCE
457
+ String path = rho_native_rhopath();
458
+ int last, pre_last;
459
+
460
+ last = path.find_last_of('\\');
461
+ pre_last = path.substr(0, last).find_last_of('\\');
462
+ strTitle = path.substr(pre_last + 1, last - pre_last - 1);
463
+ #else
464
+ strTitle = "Rhodes";
465
+ #endif
466
+ }
467
+
468
+ return strTitle;
469
+ }
470
+
451
471
  const String& CRhodesApp::getStartUrl()
452
472
  {
453
473
  m_strStartUrl = canonicalizeRhoUrl( RHOCONF().getString("start_path") );
@@ -84,6 +84,7 @@ public:
84
84
 
85
85
  const String& getAppBackUrl(){return m_strAppBackUrl;}
86
86
  void setAppBackUrl(const String& url);
87
+ String getAppTitle();
87
88
 
88
89
  void callCameraCallback(String strCallbackUrl, const String& strImagePath, const String& strError, boolean bCancel );
89
90
  void callDateTimeCallback(String strCallbackUrl, long lDateTime, const char* szData, int bCancel );
@@ -38,6 +38,22 @@ void SyncBlob_DeleteCallback(sqlite3_context* dbContext, int nArgs, sqlite3_valu
38
38
  attrMgr.remove( nSrcID, szAttrName );
39
39
  }
40
40
 
41
+ void SyncBlob_UpdateCallback(sqlite3_context* dbContext, int nArgs, sqlite3_value** ppArgs)
42
+ {
43
+ if ( nArgs < 3 )
44
+ return;
45
+
46
+ CDBAttrManager& attrMgr = CDBAdapter::getDBByHandle(sqlite3_context_db_handle(dbContext)).getAttrMgr();
47
+
48
+ char* szAttrName = (char*)sqlite3_value_text(*(ppArgs+2));
49
+ int nSrcID = sqlite3_value_int(*(ppArgs+1));
50
+ if ( attrMgr.isBlobAttr(nSrcID, szAttrName) )
51
+ {
52
+ String strFilePath = RHODESAPP().resolveDBFilesPath((char*)sqlite3_value_text(*(ppArgs)));
53
+ CRhoFile::deleteFile(strFilePath.c_str());
54
+ }
55
+ }
56
+
41
57
  void SyncBlob_DeleteSchemaCallback(sqlite3_context* dbContext, int nArgs, sqlite3_value** ppArgs)
42
58
  {
43
59
  CDBAttrManager& attrMgr = CDBAdapter::getDBByHandle(sqlite3_context_db_handle(dbContext)).getAttrMgr();
@@ -107,6 +123,9 @@ void CDBAdapter::open (String strDbPath, String strVer, boolean bTemp)
107
123
 
108
124
  sqlite3_create_function( m_dbHandle, "rhoOnDeleteObjectRecord", 3, SQLITE_ANY, 0,
109
125
  SyncBlob_DeleteCallback, 0, 0 );
126
+ sqlite3_create_function( m_dbHandle, "rhoOnUpdateObjectRecord", 3, SQLITE_ANY, 0,
127
+ SyncBlob_UpdateCallback, 0, 0 );
128
+
110
129
  sqlite3_create_function( m_dbHandle, "rhoOnDeleteRecord", 1, SQLITE_ANY, 0,
111
130
  SyncBlob_DeleteSchemaCallback, 0, 0 );
112
131
 
@@ -140,7 +159,7 @@ boolean CDBAdapter::migrateDB(const CDBVersion& dbVer, const String& strRhoDBVer
140
159
  //id INTEGER PRIMARY KEY, REMOVE
141
160
  LOG(INFO) + "Migrate database from " + dbVer.m_strRhoVer + " to " + strRhoDBVer;
142
161
 
143
- CDBAdapter db(m_strDbPartition.c_str());
162
+ CDBAdapter db(m_strDbPartition.c_str(), true);
144
163
  db.open( m_strDbPath, m_strDbVer, true );
145
164
  DBResult( res, db.executeSQL( "ALTER TABLE sources ADD priority INTEGER" ));
146
165
  DBResult( res1, db.executeSQL( "ALTER TABLE sources ADD backend_refresh_time int default 0" ));
@@ -335,7 +354,7 @@ void CDBAdapter::destroy_tables(const rho::Vector<rho::String>& arIncludeTables,
335
354
  CRhoFile::deleteFile((dbNewName+"-journal").c_str());
336
355
  CRhoFile::deleteFile((dbNewName+".version").c_str());
337
356
 
338
- CDBAdapter db(m_strDbPartition.c_str());
357
+ CDBAdapter db(m_strDbPartition.c_str(), true);
339
358
  db.open( dbNewName, m_strDbVer, true );
340
359
 
341
360
  //Copy all tables
@@ -389,7 +408,7 @@ void CDBAdapter::copyTable(String tableName, CDBAdapter& dbFrom, CDBAdapter& dbT
389
408
 
390
409
  void CDBAdapter::setBulkSyncDB(String fDataName)
391
410
  {
392
- CDBAdapter db(m_strDbPartition.c_str());
411
+ CDBAdapter db(m_strDbPartition.c_str(), true);
393
412
  db.open( fDataName, m_strDbVer, true );
394
413
  db.createTriggers();
395
414
 
@@ -718,7 +737,7 @@ int rho_db_open(const char* szDBPath, const char* szDBPartition, void** ppDB)
718
737
  CDBAdapter* pDB = CDBAdapter::getDBPartitions().get(szDBPartition);
719
738
  if ( !pDB )
720
739
  {
721
- pDB = new CDBAdapter(szDBPartition);
740
+ pDB = new CDBAdapter(szDBPartition, false);
722
741
  CDBAdapter::getDBPartitions().put(szDBPartition, pDB);
723
742
  }
724
743
 
@@ -833,13 +852,16 @@ void rho_db_init_attr_manager()
833
852
  namespace rho{
834
853
  namespace common{
835
854
 
836
- CRubyMutex::CRubyMutex() : m_nLockCount(0), m_valThread(0), m_valMutex(null)
855
+ CRubyMutex::CRubyMutex(boolean bIgnore) : m_nLockCount(0), m_valThread(0), m_valMutex(null)
837
856
  {
857
+ if ( !bIgnore )
858
+ m_valMutex = rho_ruby_create_mutex();
838
859
  }
839
860
 
840
861
  CRubyMutex::~CRubyMutex()
841
862
  {
842
- rho_ruby_destroy_mutex(m_valMutex);
863
+ if ( m_valMutex )
864
+ rho_ruby_destroy_mutex(m_valMutex);
843
865
  }
844
866
 
845
867
  boolean CRubyMutex::isMainRubyThread()
@@ -849,15 +871,15 @@ boolean CRubyMutex::isMainRubyThread()
849
871
 
850
872
  void CRubyMutex::Lock()
851
873
  {
874
+ if ( m_valMutex == null )
875
+ return;
876
+
852
877
  unsigned long curThread = rho_ruby_current_thread();
853
878
  if ( curThread == null )
854
879
  return;
855
880
 
856
881
  if ( m_valThread != curThread )
857
882
  {
858
- if ( m_valMutex == null )
859
- m_valMutex = rho_ruby_create_mutex();
860
-
861
883
  rho_ruby_lock_mutex(m_valMutex);
862
884
  m_valThread = curThread;
863
885
  m_nLockCount = 1;
@@ -867,6 +889,9 @@ void CRubyMutex::Lock()
867
889
 
868
890
  void CRubyMutex::Unlock()
869
891
  {
892
+ if ( m_valMutex == null )
893
+ return;
894
+
870
895
  m_nLockCount--;
871
896
  if ( m_nLockCount == 0 )
872
897
  {
@@ -12,7 +12,7 @@ class CRubyMutex
12
12
  unsigned long m_valThread, m_valMutex;
13
13
 
14
14
  public:
15
- CRubyMutex();
15
+ CRubyMutex(boolean bIgnore);
16
16
  ~CRubyMutex();
17
17
 
18
18
  boolean isMainRubyThread();
@@ -54,8 +54,8 @@ class CDBAdapter
54
54
  public:
55
55
  DEFINE_LOGCLASS;
56
56
 
57
- CDBAdapter(const char* szDBPartition) : m_dbHandle(0), m_strDbPath(""), m_strDbPartition(szDBPartition),
58
- m_bUIWaitDB(false), m_nTransactionCounter(0) {}
57
+ CDBAdapter(const char* szDBPartition, boolean bNoRubyLock) : m_dbHandle(0), m_strDbPath(""), m_strDbPartition(szDBPartition),
58
+ m_bUIWaitDB(false), m_nTransactionCounter(0), m_mxRuby(bNoRubyLock) {}
59
59
  ~CDBAdapter(void){}
60
60
 
61
61
  void open (String strDbPath, String strVer, boolean bTemp);
@@ -91,7 +91,7 @@ CAsyncHttp::CHttpCommand::CHttpCommand(
91
91
  const char* file_path,
92
92
  const char* callback, const char* callback_params, boolean ssl_verify_peer)
93
93
  {
94
- m_strUrl = url != null ? url : "";
94
+ m_strUrl = RHODESAPP().canonicalizeRhoUrl(url != null ? url : "");
95
95
  m_strBody = body != null ? body : "";
96
96
  m_strFilePath = file_path != null ? file_path : "";
97
97
  m_strCallback = callback != null ? callback : "";
@@ -44,7 +44,7 @@ public class AsyncHttp extends RhoThread
44
44
  super(factory);
45
45
 
46
46
  m_ptrFactory = factory;
47
- m_strUrl = url != null ? url : "";
47
+ m_strUrl = RHODESAPP().canonicalizeRhoUrl(url != null ? url : "");
48
48
  m_strBody = body != null ? body : "";
49
49
  m_strFilePath = filepath != null ? filepath : "";
50
50
  m_strCallback = callback != null ? callback : "";
@@ -556,7 +556,7 @@ public class NetRequest
556
556
  }
557
557
  }while( !m_bCancel && nRead >= 0 );
558
558
 
559
- if ( code == IHttpConnection.HTTP_PARTIAL_CONTENT && isFinishDownload() )
559
+ if ( code == IHttpConnection.HTTP_OK || (code == IHttpConnection.HTTP_PARTIAL_CONTENT && isFinishDownload()) )
560
560
  m_nCurDownloadSize = 0;
561
561
  }
562
562
 
@@ -800,7 +800,8 @@ import com.rho.Tokenizer;
800
800
  return schemespec.toString();
801
801
  }
802
802
 
803
- public String getPathSpecificPart() {
803
+ public String getHostSpecificPart()
804
+ {
804
805
  StringBuffer schemespec = new StringBuffer();
805
806
 
806
807
  if (m_scheme != null) {
@@ -832,10 +833,6 @@ import com.rho.Tokenizer;
832
833
  }
833
834
  }
834
835
 
835
- if (m_path != null) {
836
- schemespec.append((m_path));
837
- }
838
-
839
836
  return schemespec.toString();
840
837
  }
841
838
 
@@ -1219,12 +1216,12 @@ import com.rho.Tokenizer;
1219
1216
 
1220
1217
  return sb.toString();
1221
1218
  }
1222
- /*
1219
+
1223
1220
  public static boolean isLocalHost(String strUrl)
1224
1221
  {
1225
1222
  return strUrl.startsWith("http://localhost") ||
1226
1223
  strUrl.startsWith("http://127.0.0.1");
1227
- }*/
1224
+ }
1228
1225
 
1229
1226
  public static boolean isLocalData(String strUrl)
1230
1227
  {
@@ -499,10 +499,10 @@ public class SyncEngine implements NetRequest.IRhoSession
499
499
 
500
500
  if ( !resp.isOK() )
501
501
  m_nErrCode = RhoRuby.getErrorFromResponse(resp);
502
- else
502
+ /*else
503
503
  {
504
504
  processServerSources(resp.getCharData());
505
- }
505
+ }*/
506
506
 
507
507
  return resp.isOK();
508
508
  }
@@ -521,8 +521,8 @@ public class SyncEngine implements NetRequest.IRhoSession
521
521
 
522
522
  JSONEntry oJsonEntry = new JSONEntry(szData);
523
523
 
524
- if (oJsonEntry.hasName("sources") )
525
- processServerSources(szData);
524
+ //if (oJsonEntry.hasName("sources") )
525
+ // processServerSources(szData);
526
526
 
527
527
  JSONEntry oJsonObject = oJsonEntry.getEntry("client");
528
528
  if ( !oJsonObject.isEmpty() )
@@ -614,7 +614,7 @@ public class SyncEngine implements NetRequest.IRhoSession
614
614
  getNotify().fireBulkSyncNotification(false, "download", strPartition, RhoRuby.ERR_NONE);
615
615
 
616
616
  String fDataName = makeBulkDataFileName(strDataUrl, dbPartition.getDBPath(), "_bulk.data");
617
- String strHsqlDataUrl = getHostFromUrl(serverUrl) + strDataUrl + ".hsqldb.data";
617
+ String strHsqlDataUrl = FilePath.join(getHostFromUrl(serverUrl), strDataUrl) + ".hsqldb.data";
618
618
  LOG.INFO("Bulk sync: download data from server: " + strHsqlDataUrl);
619
619
  {
620
620
  NetResponse resp1 = getNet().pullFile(strHsqlDataUrl, fDataName, this, null);
@@ -631,7 +631,7 @@ public class SyncEngine implements NetRequest.IRhoSession
631
631
  return;
632
632
 
633
633
  String fScriptName = makeBulkDataFileName(strDataUrl, dbPartition.getDBPath(), "_bulk.script" );
634
- String strHsqlScriptUrl = getHostFromUrl(serverUrl) + strDataUrl + ".hsqldb.script";
634
+ String strHsqlScriptUrl = FilePath.join(getHostFromUrl(serverUrl), strDataUrl) + ".hsqldb.script";
635
635
  LOG.INFO("Bulk sync: download script from server: " + strHsqlScriptUrl);
636
636
  {
637
637
  NetResponse resp1 = getNet().pullFile(strHsqlScriptUrl, fScriptName, this, null);
@@ -820,7 +820,7 @@ public class SyncEngine implements NetRequest.IRhoSession
820
820
  static String getHostFromUrl( String strUrl )
821
821
  {
822
822
  URI uri = new URI(strUrl);
823
- return uri.getPathSpecificPart() + "/";
823
+ return uri.getHostSpecificPart() + "/";
824
824
  }
825
825
 
826
826
  }
@@ -395,10 +395,10 @@ boolean CSyncEngine::resetClientIDByNet(const String& strClientID)//throws Excep
395
395
 
396
396
  if ( !resp.isOK() )
397
397
  m_nErrCode = RhoRuby.getErrorFromResponse(resp);
398
- else
398
+ /*else
399
399
  {
400
400
  processServerSources(resp.getCharData());
401
- }
401
+ } */
402
402
 
403
403
  return resp.isOK();
404
404
  }
@@ -429,8 +429,8 @@ String CSyncEngine::requestClientIDByNet()
429
429
 
430
430
  CJSONEntry oJsonEntry(szData);
431
431
 
432
- if (oJsonEntry.hasName("sources") )
433
- processServerSources(szData);
432
+ //if (oJsonEntry.hasName("sources") )
433
+ // processServerSources(szData);
434
434
 
435
435
  CJSONEntry oJsonObject = oJsonEntry.getEntry("client");
436
436
  if ( !oJsonObject.isEmpty() )
@@ -527,11 +527,7 @@ void CSyncEngine::loadBulkPartition(const String& strPartition )
527
527
 
528
528
  String fDataName = makeBulkDataFileName(strDataUrl, dbPartition.getDBPath(), "");
529
529
  String strZip = ".rzip";
530
- String hostName = getHostFromUrl(serverUrl);
531
- if (hostName.c_str()[hostName.length()-1] == '/') {
532
- hostName = hostName.substr(0,hostName.length()-1);
533
- }
534
- String strSqlDataUrl = hostName + strDataUrl+strZip;
530
+ String strSqlDataUrl = CFilePath::join(getHostFromUrl(serverUrl), strDataUrl) +strZip;
535
531
  LOG(INFO) + "Bulk sync: download data from server: " + strSqlDataUrl;
536
532
  {
537
533
  NetResponse( resp1, getNet().pullFile(strSqlDataUrl, fDataName+strZip, this, null) );
@@ -308,12 +308,13 @@ int rho_sync_get_pagesize()
308
308
 
309
309
  void rho_sync_set_pagesize(int nPageSize)
310
310
  {
311
- return CSyncThread::getSyncEngine().setSyncPageSize(nPageSize);
311
+ CSyncThread::getSyncEngine().setSyncPageSize(nPageSize);
312
312
  }
313
313
 
314
314
  void rho_sync_set_threaded_mode(int b)
315
315
  {
316
- return CSyncThread::getSyncEngine().setNonThreadedMode(b==0);
316
+ CSyncThread::getInstance()->setNonThreadedMode(b==0);
317
+ CSyncThread::getSyncEngine().setNonThreadedMode(b==0);
317
318
  }
318
319
 
319
320
  }
@@ -216,6 +216,11 @@ Error:
216
216
  return SUCCEEDED(hr) ? 0 : -1;
217
217
  }
218
218
 
219
+ LRESULT CMainWindow::OnSetText(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
220
+ {
221
+ return TRUE;
222
+ }
223
+
219
224
  LRESULT CMainWindow::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
220
225
  {
221
226
  #if defined (_WIN32_WCE)
@@ -550,12 +555,12 @@ void __stdcall CMainWindow::OnBeforeNavigate2(IDispatch* pDisp, VARIANT * pvtURL
550
555
  LPCTSTR szURL = OLE2CT(V_BSTR(pvtURL));
551
556
 
552
557
  LOG(TRACE) + "OnBeforeNavigate2: " + szURL ;
553
-
558
+ /*
554
559
  String strTitle = RHOCONF().getString("title_text");
555
560
  if ( strTitle.length() > 0 )
556
561
  SetWindowText(convertToStringW(strTitle).c_str());
557
562
  else
558
- SetWindowText(TEXT("Untitled"));
563
+ SetWindowText(TEXT("Untitled"));*/
559
564
 
560
565
  //RHO_ASSERT(SetMenuItemEnabled(IDM_STOP, TRUE));
561
566
  }
@@ -74,6 +74,7 @@ public:
74
74
  MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
75
75
  MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)
76
76
  MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
77
+ MESSAGE_HANDLER(WM_SETTEXT, OnSetText)
77
78
  MESSAGE_HANDLER(WM_PAINT, OnPaint)
78
79
  COMMAND_ID_HANDLER(IDM_EXIT, OnExitCommand)
79
80
  COMMAND_ID_HANDLER(IDM_NAVIGATE_BACK, OnNavigateBackCommand)
@@ -102,6 +103,7 @@ private:
102
103
  LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
103
104
  LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
104
105
  LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
106
+ LRESULT OnSetText(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
105
107
 
106
108
  // WM_COMMAND handlers
107
109
  LRESULT OnExitCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
@@ -61,14 +61,15 @@ public :
61
61
  }
62
62
 
63
63
  #if defined(OS_WINDOWS)
64
- if (wcsncmp(lpszToken, _T("http_proxy"),10)==0) {
64
+ if (wcsncmp(lpszToken, _T("http_proxy_url"),14)==0) {
65
65
  char *token = wce_wctomb(lpszToken);
66
66
  char *proxy =parseToken(token,strlen(token));
67
+
68
+ if (proxy)
69
+ httpProxy = proxy;
67
70
 
68
- httpProxy = proxy;
69
-
70
- free(proxy);
71
- free(token);
71
+ if (proxy) free(proxy);
72
+ if (token) free(token);
72
73
 
73
74
  } else if (wcsncmp(lpszToken, _T("approot"),7)==0) {
74
75
  char* token = wce_wctomb(lpszToken);
@@ -175,9 +176,10 @@ public :
175
176
  }
176
177
 
177
178
  rho::common::CRhodesApp::Create(m_strRootPath );
179
+ String strTitle = RHODESAPP().getAppTitle();
178
180
 
179
181
  // Create the main application window
180
- m_appWindow.Create(NULL, CWindow::rcDefault, TEXT("Rhodes"), WS_VISIBLE);
182
+ m_appWindow.Create(NULL, CWindow::rcDefault, convertToStringW(strTitle).c_str(), WS_VISIBLE);
181
183
  if (NULL == m_appWindow.m_hWnd)
182
184
  {
183
185
  return S_FALSE;
@@ -201,7 +203,7 @@ public :
201
203
  NULL,
202
204
  &g_hNotify);
203
205
  #else
204
- rho_clientregister_create("win32_client");
206
+ //rho_clientregister_create("win32_client");
205
207
  #endif
206
208
 
207
209
  return S_OK;
@@ -2,6 +2,11 @@ CREATE TRIGGER rhodeleteTrigger BEFORE DELETE ON object_values FOR EACH ROW
2
2
  BEGIN
3
3
  SELECT rhoOnDeleteObjectRecord(OLD.value, OLD.source_id, OLD.attrib );
4
4
  END;
5
+ ;
6
+ CREATE TRIGGER rhoupdateTrigger BEFORE UPDATE ON object_values FOR EACH ROW WHEN NEW.value != OLD.value
7
+ BEGIN
8
+ SELECT rhoOnUpdateObjectRecord(OLD.value, OLD.source_id, OLD.attrib );
9
+ END;
5
10
  ;
6
11
  CREATE TRIGGER rhoinsertTrigger AFTER INSERT ON object_values FOR EACH ROW
7
12
  BEGIN
data/rhodes.gemspec CHANGED
@@ -3,7 +3,7 @@ require "lib/rhodes.rb"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rhodes}
6
- s.version = '2.0.0.beta10'
6
+ s.version = '2.0.0.beta11'
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
@@ -0,0 +1,11 @@
1
+ require 'rhom'
2
+
3
+ class BlobTest
4
+ include Rhom::PropertyBag
5
+
6
+ enable :sync
7
+
8
+ property :image_uri, :blob, :overwrite
9
+
10
+
11
+ end