rhodes 2.3.0 → 2.3.1.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Manifest.txt +5819 -0
- data/README.md +2 -2
- data/Rakefile +9 -5
- data/doc/build.txt +7 -13
- data/doc/configuration.txt +4 -0
- data/doc/connect-to-web-services.txt +0 -1
- data/doc/device-caps.txt +2 -2
- data/doc/extensions.txt +2 -0
- data/doc/linea.txt +699 -0
- data/doc/rhom.txt +2 -1
- data/doc/synchronization.txt +39 -2
- data/doc/ui.txt +1 -0
- data/installer/README.html +1 -1
- data/lib/build/jake.rb +3 -0
- data/lib/framework/res/esri.wm.png +0 -0
- data/lib/framework/rho/render.rb +2 -0
- data/lib/framework/rho/rho.rb +17 -10
- data/lib/framework/rho/rhoapplication.rb +13 -3
- data/lib/framework/rho/rhoevent_bb.rb +3 -1
- data/lib/framework/rho/rhoevent_c.rb +4 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom.rb +10 -0
- data/lib/framework/rhom/rhom_object_factory.rb +45 -0
- data/lib/framework/rhom/rhom_source.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +1 -1
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +1 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +9 -11
- data/platform/android/Rhodes/jni/src/event.cpp +17 -9
- data/platform/android/Rhodes/jni/src/mapview.cpp +34 -4
- data/platform/android/Rhodes/jni/src/rhodes.cpp +1 -1
- data/platform/android/Rhodes/res/drawable/esri.png +0 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +8 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +80 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +29 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +50 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +3 -0
- data/platform/android/build/android.rake +45 -23
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedDataRow.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/CachedRow.java +3 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Row.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/CachedObject.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/DataFileCache.java +66 -16
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoCrypto.java +116 -0
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +39 -2
- data/platform/bb/RubyVM/src/com/rho/Tokenizer.java +11 -6
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +157 -150
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +15 -0
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +35 -23
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +6 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +54 -16
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +18 -9
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +37 -59
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +3 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +4 -5
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +4 -1
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/resources/esri.png +0 -0
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +2 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +8 -3
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +4 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +2 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +9 -0
- data/platform/iphone/Classes/Event/Event.m +12 -2
- data/platform/iphone/Classes/NativeBar.h +12 -11
- data/platform/iphone/Classes/NativeBar.m +13 -3
- data/platform/iphone/Classes/Rhodes.m +48 -10
- data/platform/iphone/Classes/SimpleMainView.h +1 -0
- data/platform/iphone/Classes/SimpleMainView.m +7 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +3 -0
- data/platform/iphone/Classes/SplitView/RightViewController.m +11 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +8 -0
- data/platform/iphone/Classes/TabbedMainView.m +39 -3
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +3 -3
- data/platform/shared/SyncClient/SyncClient.cpp +23 -23
- data/platform/shared/common/IRhoClassFactory.h +6 -4
- data/platform/shared/common/RhoAppAdapter.h +1 -1
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMutexLock.h +1 -1
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +2 -2
- data/platform/shared/common/RhoThread.h +1 -2
- data/platform/shared/common/RhodesApp.cpp +33 -55
- data/platform/shared/common/RhodesApp.h +0 -5
- data/platform/shared/common/RhodesAppBase.cpp +1 -1
- data/platform/shared/common/SplashScreen.cpp +1 -2
- data/platform/shared/common/ThreadQueue.cpp +31 -4
- data/platform/shared/common/ThreadQueue.h +10 -3
- data/platform/shared/common/Tokenizer.cpp +12 -8
- data/platform/shared/common/iphone/RhoClassFactory.cpp +5 -8
- data/platform/shared/common/iphone/RhoClassfactory.h +1 -1
- data/platform/shared/common/map/ESRIMapEngine.cpp +17 -7
- data/platform/shared/common/map/ESRIMapEngine.h +11 -1
- data/platform/shared/common/map/GoogleMapEngine.cpp +3 -3
- data/platform/shared/common/map/GoogleMapEngine.h +2 -2
- data/platform/shared/common/map/MapEngine.cpp +37 -0
- data/platform/shared/common/map/MapEngine.h +5 -0
- data/platform/shared/db/DBAdapter.cpp +113 -81
- data/platform/shared/db/DBAdapter.h +21 -5
- data/platform/shared/db/DBAttrManager.cpp +2 -2
- data/platform/shared/db/DBResult.h +28 -0
- data/platform/shared/net/AsyncHttp.cpp +48 -48
- data/platform/shared/net/AsyncHttp.h +15 -12
- data/platform/shared/net/CURLNetRequest.cpp +27 -105
- data/platform/shared/net/CURLNetRequest.h +8 -15
- data/platform/shared/net/INetRequest.cpp +122 -0
- data/platform/shared/net/INetRequest.h +96 -23
- data/platform/shared/net/ssl.cpp +1 -1
- data/platform/shared/ruby/ext/calendar/calendar.i +2 -2
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +30 -3
- data/platform/shared/rubyext/GeoLocation.cpp +4 -5
- data/platform/shared/rubyext/GeoLocation.h +4 -4
- data/platform/shared/rubyext/RhoAppAdapter.cpp +1 -1
- data/platform/shared/rubyext/System.cpp +3 -0
- data/platform/shared/sync/ClientRegister.cpp +6 -9
- data/platform/shared/sync/ClientRegister.h +8 -6
- data/platform/shared/sync/SyncEngine.cpp +54 -30
- data/platform/shared/sync/SyncEngine.h +9 -11
- data/platform/shared/sync/SyncNotify.cpp +19 -14
- data/platform/shared/sync/SyncNotify.h +5 -12
- data/platform/shared/sync/SyncSource.cpp +53 -76
- data/platform/shared/sync/SyncSource.h +5 -4
- data/platform/shared/sync/SyncThread.cpp +5 -7
- data/platform/shared/sync/SyncThread.h +2 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +43 -39
- data/platform/wm/build/wm.rake +19 -17
- data/platform/wm/rhodes/AppManager.cpp +4 -4
- data/platform/wm/rhodes/MainWindow.cpp +0 -1
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +4 -0
- data/platform/wm/rhodes/Vibrate.cpp +2 -2
- data/platform/wm/rhodes/Vibrate.h +1 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -5
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +3 -3
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +24 -10
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +49 -25
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +16 -2
- data/platform/wm/rhodes/rhodes.vcproj +77 -85
- data/platform/wm/tools/detool/detool.cpp +16 -6
- data/rakefile.rb +9 -5
- data/res/build-tools/detool.exe +0 -0
- data/rhodes.gemspec +2 -2
- data/spec/phone_spec/app/spec/blobsync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/events_spec.rb +13 -2
- data/spec/phone_spec/app/spec/mapview_spec.rb +2 -2
- data/spec/phone_spec/app/spec/nativebar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/navbar_spec.rb +3 -3
- data/spec/phone_spec/app/spec/rho_spec.rb +1 -1
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +1 -1
- data/spec/phone_spec/app/spec/syncengine_spec.rb +219 -0
- data/spec/phone_spec/build.yml +1 -0
- metadata +15 -8
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +0 -89
- data/platform/wm/rhodes/rho/net/NetRequest.h +0 -45
@@ -67,7 +67,7 @@ CSyncSource::CSyncSource(int id, const String& strName, const String& strSyncTyp
|
|
67
67
|
|
68
68
|
m_nErrCode = RhoAppAdapter.ERR_NONE;
|
69
69
|
|
70
|
-
|
70
|
+
IDBResult res = db.executeSQL("SELECT token,associations from sources WHERE source_id=?", m_nID);
|
71
71
|
if ( !res.isEnd() )
|
72
72
|
{
|
73
73
|
m_token = res.getUInt64ByIdx(0);
|
@@ -105,7 +105,7 @@ void CSyncSource::parseAssociations(const String& strAssociations)
|
|
105
105
|
}
|
106
106
|
}
|
107
107
|
|
108
|
-
|
108
|
+
net::CNetRequestWrapper CSyncSource::getNet(){ return getSync().getNet(); }
|
109
109
|
CSyncNotify& CSyncSource::getNotify(){ return getSync().getNotify(); }
|
110
110
|
ISyncProtocol& CSyncSource::getProtocol(){ return getSync().getProtocol(); }
|
111
111
|
|
@@ -158,7 +158,7 @@ boolean CSyncSource::syncClientChanges()
|
|
158
158
|
|
159
159
|
boolean bSyncClient = false;
|
160
160
|
{
|
161
|
-
|
161
|
+
IDBResult res = getDB().executeSQL("SELECT object FROM changed_values WHERE source_id=? LIMIT 1 OFFSET 0", getID());
|
162
162
|
bSyncClient = !res.isEnd();
|
163
163
|
}
|
164
164
|
if ( bSyncClient )
|
@@ -175,7 +175,7 @@ boolean CSyncSource::syncClientChanges()
|
|
175
175
|
|
176
176
|
boolean CSyncSource::isPendingClientChanges()
|
177
177
|
{
|
178
|
-
|
178
|
+
IDBResult res = getDB().executeSQL("SELECT object FROM changed_values WHERE source_id=? and update_type='create' and sent>1 LIMIT 1 OFFSET 0", getID());
|
179
179
|
return !res.isEnd();
|
180
180
|
}
|
181
181
|
|
@@ -229,7 +229,7 @@ void CSyncSource::doSyncClientChanges()
|
|
229
229
|
oItem.m_strName = "cud";
|
230
230
|
m_arMultipartItems.addElement(pItem);
|
231
231
|
|
232
|
-
NetResponse
|
232
|
+
NetResponse resp = getNet().pushMultipartData( getProtocol().getClientChangesUrl(), m_arMultipartItems, &getSync(), null);
|
233
233
|
if ( !resp.isOK() )
|
234
234
|
{
|
235
235
|
getSync().setState(CSyncEngine::esStop);
|
@@ -238,7 +238,7 @@ void CSyncSource::doSyncClientChanges()
|
|
238
238
|
}
|
239
239
|
}else
|
240
240
|
{
|
241
|
-
NetResponse
|
241
|
+
NetResponse resp = getNet().pushData( getProtocol().getClientChangesUrl(), strBody, &getSync());
|
242
242
|
if ( !resp.isOK() )
|
243
243
|
{
|
244
244
|
getSync().setState(CSyncEngine::esStop);
|
@@ -290,8 +290,8 @@ void CSyncSource::makePushBody_Ver3(String& strBody, const String& strUpdateType
|
|
290
290
|
if ( isSync )
|
291
291
|
getDB().updateAllAttribChanges();
|
292
292
|
|
293
|
-
|
294
|
-
"FROM changed_values where source_id=? and update_type =? and sent<=1 ORDER BY object", getID(), strUpdateType.c_str() )
|
293
|
+
IDBResult res = getDB().executeSQL("SELECT attrib, object, value, attrib_type "
|
294
|
+
"FROM changed_values where source_id=? and update_type =? and sent<=1 ORDER BY object", getID(), strUpdateType.c_str() );
|
295
295
|
|
296
296
|
if ( res.isEnd() )
|
297
297
|
{
|
@@ -411,22 +411,23 @@ void CSyncSource::syncServerChanges()
|
|
411
411
|
|
412
412
|
LOG(INFO) + "Pull changes from server. Url: " + (strUrl+strQuery);
|
413
413
|
PROF_START("Net");
|
414
|
-
NetResponse
|
415
|
-
|
414
|
+
NetResponse resp = getNet().pullData(strUrl+strQuery, &getSync());
|
415
|
+
PROF_STOP("Net");
|
416
416
|
|
417
417
|
if ( !resp.isOK() )
|
418
418
|
{
|
419
419
|
getSync().stopSync();
|
420
|
-
|
420
|
+
m_nErrCode = RhoAppAdapter.getErrorFromResponse(resp);
|
421
421
|
m_strError = resp.getCharData();
|
422
422
|
continue;
|
423
423
|
}
|
424
424
|
|
425
|
-
const char* szData =
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
425
|
+
const char* szData = null;
|
426
|
+
String strTestResp = getSync().getSourceOptions().getProperty(getID(), "rho_server_response");
|
427
|
+
if ( strTestResp.length() > 0 )
|
428
|
+
szData = strTestResp.c_str();
|
429
|
+
else
|
430
|
+
szData = resp.getCharData();
|
430
431
|
|
431
432
|
//LOG(INFO) + szData;
|
432
433
|
PROF_START("Parse");
|
@@ -446,71 +447,47 @@ void CSyncSource::syncServerChanges()
|
|
446
447
|
getSync().stopSync();
|
447
448
|
}
|
448
449
|
|
450
|
+
//{"create-error":{"0_broken_object_id":{"name":"wrongname","an_attribute":"error create"},"0_broken_object_id-error":{"message":"error create"}}}
|
449
451
|
boolean CSyncSource::processServerErrors(CJSONEntry& oCmds)
|
450
452
|
{
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
CJSONStructIterator errIter(errSrc);
|
455
|
-
for( ; !errIter.isEnd(); errIter.next() )
|
456
|
-
{
|
457
|
-
m_nErrCode = RhoAppAdapter.ERR_CUSTOMSYNCSERVER;
|
458
|
-
m_strError = errIter.getCurValue().getString("message");
|
459
|
-
m_strErrorType = errIter.getCurKey();
|
460
|
-
}
|
461
|
-
}else if ( oCmds.hasName("search-error") )
|
462
|
-
{
|
463
|
-
CJSONEntry errSrc = oCmds.getEntry("search-error");
|
464
|
-
CJSONStructIterator errIter(errSrc);
|
465
|
-
for( ; !errIter.isEnd(); errIter.next() )
|
466
|
-
{
|
467
|
-
m_nErrCode = RhoAppAdapter.ERR_CUSTOMSYNCSERVER;
|
468
|
-
m_strError = errIter.getCurValue().getString("message");
|
469
|
-
m_strErrorType = errIter.getCurKey();
|
470
|
-
}
|
471
|
-
}else if ( oCmds.hasName("create-error") )
|
453
|
+
const char* arErrTypes[] = {"source-error", "search-error", "create-error", "update-error", "delete-error", null};
|
454
|
+
boolean bRes = false;
|
455
|
+
for( int i = 0; ; i++ )
|
472
456
|
{
|
473
|
-
|
474
|
-
|
457
|
+
if ( arErrTypes[i] == null )
|
458
|
+
break;
|
459
|
+
if ( !oCmds.hasName(arErrTypes[i]) )
|
460
|
+
continue;
|
475
461
|
|
476
|
-
|
477
|
-
CJSONStructIterator errIter(errSrc);
|
478
|
-
for( ; !errIter.isEnd(); errIter.next() )
|
479
|
-
{
|
480
|
-
String strKey = errIter.getCurKey();
|
481
|
-
if ( String_endsWith(strKey, "-error") )
|
482
|
-
m_strError = errIter.getCurValue().getString("message");
|
483
|
-
}
|
484
|
-
}else if ( oCmds.hasName("update-error") )
|
485
|
-
{
|
462
|
+
bRes = true;
|
486
463
|
m_nErrCode = RhoAppAdapter.ERR_CUSTOMSYNCSERVER;
|
487
|
-
m_strErrorType = "update-error";
|
488
464
|
|
489
|
-
CJSONEntry errSrc = oCmds.getEntry(
|
465
|
+
CJSONEntry errSrc = oCmds.getEntry(arErrTypes[i]);
|
490
466
|
CJSONStructIterator errIter(errSrc);
|
491
467
|
for( ; !errIter.isEnd(); errIter.next() )
|
492
468
|
{
|
493
469
|
String strKey = errIter.getCurKey();
|
494
|
-
if ( String_endsWith(strKey, "-error") )
|
495
|
-
m_strError = errIter.getCurValue().getString("message");
|
496
|
-
}
|
497
|
-
}else if ( oCmds.hasName("delete-error") )
|
498
|
-
{
|
499
|
-
m_nErrCode = RhoAppAdapter.ERR_CUSTOMSYNCSERVER;
|
500
|
-
m_strErrorType = "delete-error";
|
501
470
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
471
|
+
if ( i == 0 || i == 1 )//"source-error", "search-error"
|
472
|
+
{
|
473
|
+
if ( errIter.getCurValue().hasName("message") )
|
474
|
+
m_strServerError += "server_errors[" + strKey + "][message]=" + URI::urlEncode(errIter.getCurValue().getString("message"));
|
475
|
+
}
|
476
|
+
else
|
477
|
+
{
|
478
|
+
//"create-error", "update-error", "delete-error"
|
479
|
+
String strObject = strKey;
|
480
|
+
|
481
|
+
if ( String_endsWith(strObject, "-error") )
|
482
|
+
{
|
483
|
+
strObject = strObject.substr(0, strKey.length()-6);
|
484
|
+
m_strServerError += "server_errors[" + String(arErrTypes[i]) + "][" + strObject + "][message]=" + URI::urlEncode(errIter.getCurValue().getString("message"));
|
485
|
+
}
|
486
|
+
}
|
509
487
|
}
|
510
|
-
}
|
511
|
-
return false;
|
488
|
+
}
|
512
489
|
|
513
|
-
return
|
490
|
+
return bRes;
|
514
491
|
}
|
515
492
|
|
516
493
|
void CSyncSource::processServerResponse_ver3(CJSONArrayIterator& oJsonArr)
|
@@ -747,7 +724,7 @@ void CSyncSource::processServerCmd_Ver3_Schema(const String& strCmd, const Strin
|
|
747
724
|
if ( !getSync().isContinueSync() )
|
748
725
|
return;
|
749
726
|
|
750
|
-
|
727
|
+
IDBResult resInsert = getDB().executeSQLReportNonUniqueEx(strSqlInsert.c_str(), vecValues );
|
751
728
|
if ( resInsert.isNonUnique() )
|
752
729
|
{
|
753
730
|
String strSqlUpdate = "UPDATE ";
|
@@ -794,7 +771,7 @@ void CSyncSource::processServerCmd_Ver3_Schema(const String& strCmd, const Strin
|
|
794
771
|
getDB().executeSQL(strSqlUpdate.c_str(), strObject);
|
795
772
|
//Remove item if all nulls
|
796
773
|
String strSelect = String("SELECT * FROM ") + getName() + " WHERE object=?";
|
797
|
-
|
774
|
+
IDBResult res = getDB().executeSQL( strSelect.c_str(), strObject );
|
798
775
|
if ( !res.isEnd() )
|
799
776
|
{
|
800
777
|
boolean bAllNulls = true;
|
@@ -855,7 +832,7 @@ boolean CSyncSource::processBlob( const String& strCmd, const String& strObject,
|
|
855
832
|
if ( m_bSchemaSource )
|
856
833
|
{
|
857
834
|
String strSelect = String("SELECT ") + oAttrValue.m_strAttrib + " FROM " + getName() + " WHERE object=?";
|
858
|
-
|
835
|
+
IDBResult res = getDB().executeSQL( strSelect.c_str(), strObject);
|
859
836
|
if (!res.isEnd())
|
860
837
|
{
|
861
838
|
strDbValue = res.getStringByIdx(0);
|
@@ -863,9 +840,9 @@ boolean CSyncSource::processBlob( const String& strCmd, const String& strObject,
|
|
863
840
|
}
|
864
841
|
}else
|
865
842
|
{
|
866
|
-
|
843
|
+
IDBResult res = getDB().executeSQL(
|
867
844
|
"SELECT value FROM object_values WHERE object=? and attrib=? and source_id=?",
|
868
|
-
strObject, oAttrValue.m_strAttrib, getID() )
|
845
|
+
strObject, oAttrValue.m_strAttrib, getID() );
|
869
846
|
if (!res.isEnd())
|
870
847
|
{
|
871
848
|
strDbValue = res.getStringByIdx(0);
|
@@ -896,9 +873,9 @@ void CSyncSource::processServerCmd_Ver3(const String& strCmd, const String& strO
|
|
896
873
|
if ( !processBlob(strCmd,strObject,oAttrValue) )
|
897
874
|
return;
|
898
875
|
|
899
|
-
|
876
|
+
IDBResult resInsert = getDB().executeSQLReportNonUnique("INSERT INTO object_values \
|
900
877
|
(attrib, source_id, object, value) VALUES(?,?,?,?)",
|
901
|
-
oAttrValue.m_strAttrib, getID(), strObject, oAttrValue.m_strValue )
|
878
|
+
oAttrValue.m_strAttrib, getID(), strObject, oAttrValue.m_strValue );
|
902
879
|
if ( resInsert.isNonUnique() )
|
903
880
|
{
|
904
881
|
getDB().executeSQL("UPDATE object_values \
|
@@ -1004,7 +981,7 @@ boolean CSyncSource::downloadBlob(CAttrValue& value)//throws Exception
|
|
1004
981
|
url += "?";
|
1005
982
|
url += "client_id=" + getSync().getClientID();
|
1006
983
|
|
1007
|
-
NetResponse
|
984
|
+
NetResponse resp = getNet().pullFile(url, fName, &getSync(), null);
|
1008
985
|
if ( !resp.isOK() )
|
1009
986
|
{
|
1010
987
|
getSync().stopSync();
|
@@ -10,8 +10,8 @@ namespace db {
|
|
10
10
|
class CDBAdapter;
|
11
11
|
}
|
12
12
|
namespace net {
|
13
|
-
struct INetRequest;
|
14
13
|
struct CMultipartItem;
|
14
|
+
class CNetRequestWrapper;
|
15
15
|
}
|
16
16
|
namespace json {
|
17
17
|
class CJSONEntry;
|
@@ -65,8 +65,7 @@ private:
|
|
65
65
|
|
66
66
|
public:
|
67
67
|
int m_nErrCode;
|
68
|
-
String m_strError;
|
69
|
-
String m_strErrorType;
|
68
|
+
String m_strError, m_strServerError;
|
70
69
|
|
71
70
|
public:
|
72
71
|
CSyncSource(int id, const String& strName, const String& strSyncType, db::CDBAdapter& db, CSyncEngine& syncEngine );
|
@@ -76,6 +75,8 @@ public:
|
|
76
75
|
int getID()const { return m_nID; }
|
77
76
|
String getName() { return m_strName; }
|
78
77
|
String getSyncType(){ return m_strSyncType; }
|
78
|
+
String getServerError(){ return m_strServerError; }
|
79
|
+
int getErrorCode(){ return m_nErrCode; }
|
79
80
|
|
80
81
|
int getServerObjectsCount()const{ return m_nInserted+m_nDeleted; }
|
81
82
|
|
@@ -137,7 +138,7 @@ public:
|
|
137
138
|
private:
|
138
139
|
CSyncEngine& getSync(){ return m_syncEngine; }
|
139
140
|
CSyncNotify& getNotify();
|
140
|
-
net::
|
141
|
+
net::CNetRequestWrapper getNet();
|
141
142
|
ISyncProtocol& getProtocol();
|
142
143
|
|
143
144
|
};
|
@@ -18,12 +18,12 @@ using namespace rho::db;
|
|
18
18
|
IMPLEMENT_LOGCLASS(CSyncThread,"Sync");
|
19
19
|
CSyncThread* CSyncThread::m_pInstance = 0;
|
20
20
|
|
21
|
-
/*static*/ CSyncThread* CSyncThread::Create(
|
21
|
+
/*static*/ CSyncThread* CSyncThread::Create()
|
22
22
|
{
|
23
23
|
if ( m_pInstance )
|
24
24
|
return m_pInstance;
|
25
25
|
|
26
|
-
m_pInstance = new CSyncThread(
|
26
|
+
m_pInstance = new CSyncThread();
|
27
27
|
return m_pInstance;
|
28
28
|
}
|
29
29
|
|
@@ -35,15 +35,13 @@ CSyncThread* CSyncThread::m_pInstance = 0;
|
|
35
35
|
m_pInstance = 0;
|
36
36
|
}
|
37
37
|
|
38
|
-
CSyncThread::CSyncThread(
|
38
|
+
CSyncThread::CSyncThread() : CThreadQueue()
|
39
39
|
{
|
40
40
|
CThreadQueue::setLogCategory(getLogCategory());
|
41
41
|
|
42
42
|
if( RHOCONF().isExist("sync_poll_interval") )
|
43
43
|
setPollInterval(RHOCONF().getInt("sync_poll_interval"));
|
44
44
|
|
45
|
-
m_oSyncEngine.setFactory(factory);
|
46
|
-
|
47
45
|
LOG(INFO) + "sync_poll_interval: " + RHOCONF().getInt("sync_poll_interval");
|
48
46
|
LOG(INFO) + "syncserver: " + RHOCONF().getString("syncserver");
|
49
47
|
LOG(INFO) + "bulksync_state: " + RHOCONF().getInt("bulksync_state");
|
@@ -96,7 +94,7 @@ int CSyncThread::getLastPollInterval()
|
|
96
94
|
{
|
97
95
|
db::CDBAdapter& dbPart = db::CDBAdapter::getDB(arPartNames.elementAt(i).c_str());
|
98
96
|
|
99
|
-
|
97
|
+
IDBResult res = dbPart.executeSQL("SELECT last_updated from sources");
|
100
98
|
for ( ; !res.isEnd(); res.next() )
|
101
99
|
{
|
102
100
|
uint64 timeUpdated = res.getUInt64ByIdx(0);
|
@@ -435,7 +433,7 @@ void rho_sync_set_source_property(int nSrcID, const char* szPropName, const char
|
|
435
433
|
|
436
434
|
void rho_sync_set_ssl_verify_peer(int b)
|
437
435
|
{
|
438
|
-
CSyncThread::getSyncEngine().
|
436
|
+
CSyncThread::getSyncEngine().setSslVerifyPeer(b == 0 ? false : true);
|
439
437
|
}
|
440
438
|
|
441
439
|
}
|
@@ -104,7 +104,7 @@ private:
|
|
104
104
|
public:
|
105
105
|
~CSyncThread(void);
|
106
106
|
|
107
|
-
static CSyncThread* Create(
|
107
|
+
static CSyncThread* Create();
|
108
108
|
static void Destroy();
|
109
109
|
static CSyncThread* getInstance(){ return m_pInstance; }
|
110
110
|
static CSyncEngine& getSyncEngine(){ return m_pInstance->m_oSyncEngine; }
|
@@ -113,7 +113,7 @@ public:
|
|
113
113
|
|
114
114
|
unsigned long getRetValue();
|
115
115
|
private:
|
116
|
-
CSyncThread(
|
116
|
+
CSyncThread();
|
117
117
|
|
118
118
|
virtual int getLastPollInterval();
|
119
119
|
virtual void processCommand(IQueueCommand* pCmd);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="windows-1251"?>
|
2
2
|
<VisualStudioProject
|
3
3
|
ProjectType="Visual C++"
|
4
|
-
Version="8
|
4
|
+
Version="8.00"
|
5
5
|
Name="RhoLib"
|
6
6
|
ProjectGUID="{F196A418-11F1-4067-9F4F-BCC7D70E6EC5}"
|
7
7
|
RootNamespace="RhoLib"
|
@@ -169,7 +169,7 @@
|
|
169
169
|
/>
|
170
170
|
</Configuration>
|
171
171
|
<Configuration
|
172
|
-
Name="
|
172
|
+
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
173
173
|
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
174
174
|
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
175
175
|
ConfigurationType="4"
|
@@ -193,10 +193,11 @@
|
|
193
193
|
<Tool
|
194
194
|
Name="VCCLCompilerTool"
|
195
195
|
ExecutionBucket="7"
|
196
|
-
Optimization="
|
196
|
+
Optimization="0"
|
197
197
|
AdditionalIncludeDirectories="../../shared/ruby;../../shared"
|
198
|
-
PreprocessorDefinitions="
|
199
|
-
|
198
|
+
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
199
|
+
MinimalRebuild="true"
|
200
|
+
RuntimeLibrary="1"
|
200
201
|
UsePrecompiledHeader="0"
|
201
202
|
WarningLevel="3"
|
202
203
|
DebugInformationFormat="3"
|
@@ -206,7 +207,7 @@
|
|
206
207
|
/>
|
207
208
|
<Tool
|
208
209
|
Name="VCResourceCompilerTool"
|
209
|
-
PreprocessorDefinitions="
|
210
|
+
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
210
211
|
Culture="1033"
|
211
212
|
AdditionalIncludeDirectories="$(IntDir)"
|
212
213
|
/>
|
@@ -215,7 +216,7 @@
|
|
215
216
|
/>
|
216
217
|
<Tool
|
217
218
|
Name="VCLibrarianTool"
|
218
|
-
AdditionalOptions=" /subsystem:windowsce,5.
|
219
|
+
AdditionalOptions=" /subsystem:windowsce,5.01"
|
219
220
|
OutputFile="$(OutDir)/RhoLib.lib"
|
220
221
|
/>
|
221
222
|
<Tool
|
@@ -243,7 +244,7 @@
|
|
243
244
|
/>
|
244
245
|
</Configuration>
|
245
246
|
<Configuration
|
246
|
-
Name="
|
247
|
+
Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
|
247
248
|
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
248
249
|
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
249
250
|
ConfigurationType="4"
|
@@ -266,10 +267,12 @@
|
|
266
267
|
/>
|
267
268
|
<Tool
|
268
269
|
Name="VCCLCompilerTool"
|
269
|
-
|
270
|
+
ExecutionBucket="7"
|
271
|
+
Optimization="0"
|
270
272
|
AdditionalIncludeDirectories="../../shared/ruby;../../shared"
|
271
|
-
PreprocessorDefinitions="
|
272
|
-
|
273
|
+
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
274
|
+
MinimalRebuild="true"
|
275
|
+
RuntimeLibrary="1"
|
273
276
|
UsePrecompiledHeader="0"
|
274
277
|
WarningLevel="3"
|
275
278
|
DebugInformationFormat="3"
|
@@ -279,7 +282,7 @@
|
|
279
282
|
/>
|
280
283
|
<Tool
|
281
284
|
Name="VCResourceCompilerTool"
|
282
|
-
PreprocessorDefinitions="
|
285
|
+
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
283
286
|
Culture="1033"
|
284
287
|
AdditionalIncludeDirectories="$(IntDir)"
|
285
288
|
/>
|
@@ -288,7 +291,7 @@
|
|
288
291
|
/>
|
289
292
|
<Tool
|
290
293
|
Name="VCLibrarianTool"
|
291
|
-
AdditionalOptions=" /subsystem:windowsce,5.
|
294
|
+
AdditionalOptions=" /subsystem:windowsce,5.01"
|
292
295
|
OutputFile="$(OutDir)/RhoLib.lib"
|
293
296
|
/>
|
294
297
|
<Tool
|
@@ -301,14 +304,22 @@
|
|
301
304
|
Name="VCBscMakeTool"
|
302
305
|
/>
|
303
306
|
<Tool
|
304
|
-
Name="
|
307
|
+
Name="VCCodeSignTool"
|
305
308
|
/>
|
306
309
|
<Tool
|
307
310
|
Name="VCPostBuildEventTool"
|
308
311
|
/>
|
312
|
+
<DeploymentTool
|
313
|
+
ForceDirty="-1"
|
314
|
+
RemoteDirectory=""
|
315
|
+
RegisterOutput="0"
|
316
|
+
AdditionalFiles=""
|
317
|
+
/>
|
318
|
+
<DebuggerTool
|
319
|
+
/>
|
309
320
|
</Configuration>
|
310
321
|
<Configuration
|
311
|
-
Name="Debug|Windows Mobile
|
322
|
+
Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"
|
312
323
|
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
313
324
|
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
314
325
|
ConfigurationType="4"
|
@@ -355,7 +366,7 @@
|
|
355
366
|
/>
|
356
367
|
<Tool
|
357
368
|
Name="VCLibrarianTool"
|
358
|
-
AdditionalOptions=" /subsystem:windowsce,5.
|
369
|
+
AdditionalOptions=" /subsystem:windowsce,5.02"
|
359
370
|
OutputFile="$(OutDir)/RhoLib.lib"
|
360
371
|
/>
|
361
372
|
<Tool
|
@@ -383,7 +394,7 @@
|
|
383
394
|
/>
|
384
395
|
</Configuration>
|
385
396
|
<Configuration
|
386
|
-
Name="
|
397
|
+
Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
|
387
398
|
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
388
399
|
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
389
400
|
ConfigurationType="4"
|
@@ -407,11 +418,10 @@
|
|
407
418
|
<Tool
|
408
419
|
Name="VCCLCompilerTool"
|
409
420
|
ExecutionBucket="7"
|
410
|
-
Optimization="
|
421
|
+
Optimization="2"
|
411
422
|
AdditionalIncludeDirectories="../../shared/ruby;../../shared"
|
412
|
-
PreprocessorDefinitions="
|
413
|
-
|
414
|
-
RuntimeLibrary="1"
|
423
|
+
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
424
|
+
RuntimeLibrary="0"
|
415
425
|
UsePrecompiledHeader="0"
|
416
426
|
WarningLevel="3"
|
417
427
|
DebugInformationFormat="3"
|
@@ -421,7 +431,7 @@
|
|
421
431
|
/>
|
422
432
|
<Tool
|
423
433
|
Name="VCResourceCompilerTool"
|
424
|
-
PreprocessorDefinitions="
|
434
|
+
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
425
435
|
Culture="1033"
|
426
436
|
AdditionalIncludeDirectories="$(IntDir)"
|
427
437
|
/>
|
@@ -430,7 +440,7 @@
|
|
430
440
|
/>
|
431
441
|
<Tool
|
432
442
|
Name="VCLibrarianTool"
|
433
|
-
AdditionalOptions=" /subsystem:windowsce,5.
|
443
|
+
AdditionalOptions=" /subsystem:windowsce,5.02"
|
434
444
|
OutputFile="$(OutDir)/RhoLib.lib"
|
435
445
|
/>
|
436
446
|
<Tool
|
@@ -458,7 +468,7 @@
|
|
458
468
|
/>
|
459
469
|
</Configuration>
|
460
470
|
<Configuration
|
461
|
-
Name="
|
471
|
+
Name="Release|Win32"
|
462
472
|
OutputDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
463
473
|
IntermediateDirectory="..\bin\$(PlatformName)\$(ProjectName)\$(ConfigurationName)"
|
464
474
|
ConfigurationType="4"
|
@@ -481,12 +491,10 @@
|
|
481
491
|
/>
|
482
492
|
<Tool
|
483
493
|
Name="VCCLCompilerTool"
|
484
|
-
|
485
|
-
Optimization="0"
|
494
|
+
Optimization="2"
|
486
495
|
AdditionalIncludeDirectories="../../shared/ruby;../../shared"
|
487
|
-
PreprocessorDefinitions="
|
488
|
-
|
489
|
-
RuntimeLibrary="1"
|
496
|
+
PreprocessorDefinitions="_NDEBUG;NDEBUG;WIN32;_WINDOWS"
|
497
|
+
RuntimeLibrary="0"
|
490
498
|
UsePrecompiledHeader="0"
|
491
499
|
WarningLevel="3"
|
492
500
|
DebugInformationFormat="3"
|
@@ -496,7 +504,7 @@
|
|
496
504
|
/>
|
497
505
|
<Tool
|
498
506
|
Name="VCResourceCompilerTool"
|
499
|
-
PreprocessorDefinitions="
|
507
|
+
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
500
508
|
Culture="1033"
|
501
509
|
AdditionalIncludeDirectories="$(IntDir)"
|
502
510
|
/>
|
@@ -518,19 +526,11 @@
|
|
518
526
|
Name="VCBscMakeTool"
|
519
527
|
/>
|
520
528
|
<Tool
|
521
|
-
Name="
|
529
|
+
Name="VCFxCopTool"
|
522
530
|
/>
|
523
531
|
<Tool
|
524
532
|
Name="VCPostBuildEventTool"
|
525
533
|
/>
|
526
|
-
<DeploymentTool
|
527
|
-
ForceDirty="-1"
|
528
|
-
RemoteDirectory=""
|
529
|
-
RegisterOutput="0"
|
530
|
-
AdditionalFiles=""
|
531
|
-
/>
|
532
|
-
<DebuggerTool
|
533
|
-
/>
|
534
534
|
</Configuration>
|
535
535
|
<Configuration
|
536
536
|
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
@@ -1017,6 +1017,10 @@
|
|
1017
1017
|
RelativePath="..\..\shared\net\HttpServer.h"
|
1018
1018
|
>
|
1019
1019
|
</File>
|
1020
|
+
<File
|
1021
|
+
RelativePath="..\..\shared\net\INetRequest.cpp"
|
1022
|
+
>
|
1023
|
+
</File>
|
1020
1024
|
<File
|
1021
1025
|
RelativePath="..\..\shared\net\inetrequest.h"
|
1022
1026
|
>
|
data/platform/wm/build/wm.rake
CHANGED
@@ -250,20 +250,8 @@ end
|
|
250
250
|
|
251
251
|
namespace "run" do
|
252
252
|
|
253
|
-
namespace "wm" do
|
254
|
-
|
255
|
-
desc "Build and run on the Windows Phone"
|
256
|
-
task :dev => ["device:wm:production"] do
|
257
|
-
cd $startdir + "/res/build-tools"
|
258
|
-
detool = "detool.exe"
|
259
|
-
args = [ 'dev', $appname, $srcdir, $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe" ]
|
260
|
-
puts "\nStarting application on the device"
|
261
|
-
puts "Please, connect you device via ActiveSync.\n\n"
|
262
|
-
Jake.run(detool,args)
|
263
|
-
end
|
264
|
-
|
265
253
|
desc "Build and run on WM6 emulator"
|
266
|
-
task :
|
254
|
+
task :wm => ["device:wm:production"] do
|
267
255
|
cd $startdir + "/res/build-tools"
|
268
256
|
detool = "detool.exe"
|
269
257
|
args = [ 'emu', '"Windows Mobile 6 Professional Emulator"', $appname, $srcdir, $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe" ]
|
@@ -271,18 +259,32 @@ namespace "run" do
|
|
271
259
|
Jake.run(detool,args)
|
272
260
|
end
|
273
261
|
|
274
|
-
|
275
|
-
|
262
|
+
namespace "wm" do
|
263
|
+
|
264
|
+
desc "Build and run on the Windows Phone"
|
265
|
+
task :device => ["device:wm:production"] do
|
276
266
|
cd $startdir + "/res/build-tools"
|
277
267
|
detool = "detool.exe"
|
278
|
-
args = ['
|
268
|
+
args = [ 'dev', $appname, $srcdir, $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe" ]
|
279
269
|
puts "\nStarting application on the device"
|
280
270
|
puts "Please, connect you device via ActiveSync.\n\n"
|
281
271
|
Jake.run(detool,args)
|
282
272
|
end
|
283
273
|
|
274
|
+
namespace "device" do
|
275
|
+
desc "Build, install .cab and run on the Windows Phone"
|
276
|
+
task :cab => ["device:wm:production"] do
|
277
|
+
cd $startdir + "/res/build-tools"
|
278
|
+
detool = "detool.exe"
|
279
|
+
args = ['devcab', $targetdir + '/' + $appname + ".cab", $appname]
|
280
|
+
puts "\nStarting application on the device"
|
281
|
+
puts "Please, connect you device via ActiveSync.\n\n"
|
282
|
+
Jake.run(detool,args)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
284
286
|
desc "Build, install .cab and run on WM6 emulator"
|
285
|
-
task :
|
287
|
+
task :cab => ["device:wm:production"] do
|
286
288
|
cd $startdir + "/res/build-tools"
|
287
289
|
detool = "detool.exe"
|
288
290
|
args = ['emucab', '"Windows Mobile 6 Professional Emulator"', $targetdir + '/' + $appname + ".cab", $appname]
|