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
@@ -77,6 +77,10 @@ describe "SyncEngine_test" do
|
|
77
77
|
|
78
78
|
after (:each) do
|
79
79
|
Rho::RhoConfig.syncserver = SYNC_SERVER_URL
|
80
|
+
|
81
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", "" )
|
82
|
+
::Rho::RHO.get_user_db().delete_all_from_table('changed_values')
|
83
|
+
|
80
84
|
end
|
81
85
|
|
82
86
|
it "should update syncserver at runtime" do
|
@@ -349,7 +353,222 @@ describe "SyncEngine_test" do
|
|
349
353
|
item2 = getProduct.find(item.object)
|
350
354
|
item2.should be_nil
|
351
355
|
end
|
356
|
+
|
357
|
+
it "should process create-error : delete" do
|
358
|
+
|
359
|
+
item = getProduct.create({:name => 'Test', :brand => "Rho"})
|
360
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
361
|
+
records.length.should == 1
|
362
|
+
records[0]['attrib'].should == 'object'
|
363
|
+
|
364
|
+
item.update_attributes({:price => "123"})
|
365
|
+
|
366
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
367
|
+
records.length.should == 1
|
368
|
+
records[0]['attrib'].should == 'object'
|
369
|
+
|
370
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"create-error\":{\"" + item.object + "\":{\"name\":\"wrongname\",\"an_attribute\":\"error create\"},\"" + item.object + "-error\":{\"message\":\"error create\"}}}]"
|
371
|
+
|
372
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
373
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
374
|
+
|
375
|
+
res['server_errors'].should_not be_nil
|
376
|
+
res['server_errors']['create-error'].should_not be_nil
|
377
|
+
res['server_errors']['create-error'][item.object].should_not be_nil
|
378
|
+
res['server_errors']['create-error'][item.object]['message'].should == "error create"
|
379
|
+
|
380
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
381
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
382
|
+
records2[0]['attrib'].should_not == 'object'
|
383
|
+
records2[0]['sent'].should == 2
|
384
|
+
|
385
|
+
item.update_attributes({:price => "456"})
|
386
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
387
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
388
|
+
records2[0]['attrib'].should_not == 'object'
|
389
|
+
records2[0]['sent'].should == 2
|
390
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
391
|
+
records2.length.should == 1
|
392
|
+
records2[0]['attrib'].should == 'price'
|
393
|
+
records2[0]['sent'].should == 0
|
394
|
+
|
395
|
+
getProduct.on_sync_create_error( res['server_errors']['create-error'].keys(), :delete)
|
396
|
+
|
397
|
+
records3 = getTestDB().select_from_table('changed_values','*', 'object' => item.object)
|
398
|
+
records3.length.should == 0
|
399
|
+
records4 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
400
|
+
records4.length.should == 0
|
401
|
+
|
402
|
+
item = getProduct.find(item.object)
|
403
|
+
item.should be_nil
|
404
|
+
end
|
405
|
+
|
406
|
+
it "should process create-error : recreate" do
|
407
|
+
|
408
|
+
item = getProduct.create({:name => 'Test', :brand => "Rho"})
|
409
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
410
|
+
records.length.should == 1
|
411
|
+
records[0]['attrib'].should == 'object'
|
412
|
+
|
413
|
+
item.update_attributes({:price => "123"})
|
414
|
+
|
415
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
416
|
+
records.length.should == 1
|
417
|
+
records[0]['attrib'].should == 'object'
|
418
|
+
|
419
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"create-error\":{\"" + item.object + "\":{\"name\":\"wrongname\",\"an_attribute\":\"error create\"},\"" + item.object + "-error\":{\"message\":\"error create\"}}}]"
|
420
|
+
|
421
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
422
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
423
|
+
|
424
|
+
res['server_errors'].should_not be_nil
|
425
|
+
res['server_errors']['create-error'].should_not be_nil
|
426
|
+
res['server_errors']['create-error'][item.object].should_not be_nil
|
427
|
+
res['server_errors']['create-error'][item.object]['message'].should == "error create"
|
428
|
+
|
429
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
430
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
431
|
+
records2[0]['attrib'].should_not == 'object'
|
432
|
+
records2[0]['sent'].should == 2
|
433
|
+
|
434
|
+
item.update_attributes({:price => "456"})
|
435
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
436
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
437
|
+
records2[0]['attrib'].should_not == 'object'
|
438
|
+
records2[0]['sent'].should == 2
|
439
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
440
|
+
records2.length.should == 1
|
441
|
+
records2[0]['attrib'].should == 'price'
|
442
|
+
records2[0]['sent'].should == 0
|
443
|
+
|
444
|
+
getProduct.on_sync_create_error( res['server_errors']['create-error'].keys(), :recreate)
|
445
|
+
|
446
|
+
records3 = getTestDB().select_from_table('changed_values','*', 'object' => item.object)
|
447
|
+
records3.length.should == 1
|
448
|
+
records3[0]['attrib'].should == 'object'
|
449
|
+
|
450
|
+
records4 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
451
|
+
records4.length.should == 0
|
452
|
+
|
453
|
+
item = getProduct.find(item.object)
|
454
|
+
item.should_not be_nil
|
455
|
+
|
456
|
+
end
|
457
|
+
|
458
|
+
it "should process create-error : recreate deleted item" do
|
459
|
+
|
460
|
+
item = getProduct.create({:name => 'Test', :brand => "Rho"})
|
461
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
462
|
+
records.length.should == 1
|
463
|
+
records[0]['attrib'].should == 'object'
|
464
|
+
|
465
|
+
item.update_attributes({:price => "123"})
|
466
|
+
|
467
|
+
records = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
468
|
+
records.length.should == 1
|
469
|
+
records[0]['attrib'].should == 'object'
|
470
|
+
|
471
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"create-error\":{\"" + item.object + "\":{\"name\":\"wrongname\",\"an_attribute\":\"error create\"},\"" + item.object + "-error\":{\"message\":\"error create\"}}}]"
|
472
|
+
|
473
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
474
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
475
|
+
|
476
|
+
res['server_errors'].should_not be_nil
|
477
|
+
res['server_errors']['create-error'].should_not be_nil
|
478
|
+
res['server_errors']['create-error'][item.object].should_not be_nil
|
479
|
+
res['server_errors']['create-error'][item.object]['message'].should == "error create"
|
480
|
+
|
481
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
482
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
483
|
+
records2[0]['attrib'].should_not == 'object'
|
484
|
+
records2[0]['sent'].should == 2
|
485
|
+
|
486
|
+
item.destroy
|
487
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'create')
|
488
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
489
|
+
records2[0]['attrib'].should_not == 'object'
|
490
|
+
records2[0]['sent'].should == 2
|
491
|
+
records2 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'delete')
|
492
|
+
records2.length.should == ($spec_settings[:schema_model] ? 7 : 3)
|
493
|
+
records2[0]['attrib'].should_not == 'object'
|
494
|
+
records2[0]['sent'].should == 0
|
495
|
+
|
496
|
+
getProduct.on_sync_create_error( res['server_errors']['create-error'].keys(), :recreate)
|
497
|
+
|
498
|
+
records3 = getTestDB().select_from_table('changed_values','*', 'object' => item.object)
|
499
|
+
records3.length.should == 0
|
500
|
+
|
501
|
+
records4 = getTestDB().select_from_table('changed_values','*', 'update_type' => 'update')
|
502
|
+
records4.length.should == 0
|
503
|
+
|
504
|
+
item = getProduct.find(item.object)
|
505
|
+
item.should be_nil
|
506
|
+
|
507
|
+
end
|
508
|
+
|
509
|
+
it "should process update-error" do
|
510
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"update-error\":{\"broken_object_id\":{\"name\":\"wrongname\",\"an_attribute\":\"error update\"},\"broken_object_id-error\":{\"message\":\"error update\"}}}]"
|
511
|
+
|
512
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
513
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
514
|
+
puts "res : #{res}"
|
515
|
+
|
516
|
+
res['server_errors'].should_not be_nil
|
517
|
+
res['server_errors']['update-error'].should_not be_nil
|
518
|
+
res['server_errors']['update-error']['broken_object_id'].should_not be_nil
|
519
|
+
res['server_errors']['update-error']['broken_object_id']['message'].should == "error update"
|
520
|
+
|
521
|
+
end
|
522
|
+
|
523
|
+
it "should process delete-error" do
|
524
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"delete-error\":{\"broken_object_id\":{\"name\":\"wrongname\",\"an_attribute\":\"error delete\"},\"broken_object_id-error\":{\"message\":\"Error delete record\"}}}]"
|
525
|
+
|
526
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
527
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
528
|
+
puts "res : #{res}"
|
529
|
+
|
530
|
+
res['server_errors'].should_not be_nil
|
531
|
+
res['server_errors']['delete-error'].should_not be_nil
|
532
|
+
res['server_errors']['delete-error']['broken_object_id'].should_not be_nil
|
533
|
+
res['server_errors']['delete-error']['broken_object_id']['message'].should == "Error delete record"
|
352
534
|
|
535
|
+
end
|
536
|
+
|
537
|
+
it "should process source-error" do
|
538
|
+
err_resp = "[{\"version\":3},{\"token\":\"\"},{\"count\":0},{\"progress_count\":0},{\"total_count\":0},{\"source-error\":{\"query-error\":{\"message\":\"Error during query\"}}}]"
|
539
|
+
|
540
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
541
|
+
res = ::Rho::RhoSupport::parse_query_parameters getProduct.sync( "/app/Settings/sync_notify")
|
542
|
+
puts "res : #{res}"
|
543
|
+
|
544
|
+
res['server_errors'].should_not be_nil
|
545
|
+
res['server_errors']['query-error'].should_not be_nil
|
546
|
+
res['server_errors']['query-error']['message'].should == "Error during query"
|
547
|
+
|
548
|
+
end
|
549
|
+
|
550
|
+
it "should process search-error" do
|
551
|
+
err_resp = "[[{\"version\":3},{\"source\":\"" + getProduct_str() + "\"},{\"search-error\":{\"search-error\":{\"message\":\"Error during search\"}}}]]"
|
552
|
+
|
553
|
+
SyncEngine.set_source_property(getProduct().get_source_id.to_i(), "rho_server_response", err_resp )
|
554
|
+
_search_id = Time.now.to_i.to_s
|
555
|
+
search_res = getProduct.search(
|
556
|
+
:from => 'search',
|
557
|
+
:search_params => { :filterData => "Test", :search_id => _search_id },
|
558
|
+
:offset => 0,
|
559
|
+
:max_results => 1000,
|
560
|
+
:progress_step => 10,
|
561
|
+
:callback => '/app/Contact/search_callback',
|
562
|
+
:callback_param => "")
|
563
|
+
res = ::Rho::RhoSupport::parse_query_parameters(search_res)
|
564
|
+
puts "res : #{res}"
|
565
|
+
|
566
|
+
res['server_errors'].should_not be_nil
|
567
|
+
res['server_errors']['search-error'].should_not be_nil
|
568
|
+
res['server_errors']['search-error']['message'].should == "Error during search"
|
569
|
+
|
570
|
+
end
|
571
|
+
|
353
572
|
it "should logout" do
|
354
573
|
SyncEngine.logout()
|
355
574
|
|
data/spec/phone_spec/build.yml
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 62196441
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
|
9
|
+
- 1
|
10
|
+
- beta
|
11
|
+
- 1
|
12
|
+
version: 2.3.1.beta.1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Rhomobile
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2011-
|
20
|
+
date: 2011-03-01 00:00:00 -08:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
@@ -137,6 +139,7 @@ files:
|
|
137
139
|
- doc/generator.txt
|
138
140
|
- doc/install.txt
|
139
141
|
- doc/introduction.txt
|
142
|
+
- doc/linea.txt
|
140
143
|
- doc/rhom.txt
|
141
144
|
- doc/standard-css.txt
|
142
145
|
- doc/synchronization.txt
|
@@ -755,6 +758,7 @@ files:
|
|
755
758
|
- lib/framework/res/blue_pushpin_small.wm.png
|
756
759
|
- lib/framework/res/callout.wm.png
|
757
760
|
- lib/framework/res/callout_link.wm.png
|
761
|
+
- lib/framework/res/esri.wm.png
|
758
762
|
- lib/framework/res/forward_btn.wm.png
|
759
763
|
- lib/framework/res/home_btn.wm.png
|
760
764
|
- lib/framework/res/options_btn.wm.png
|
@@ -810,6 +814,7 @@ files:
|
|
810
814
|
- lib/test/rho_stubs.rb
|
811
815
|
- lib/test/syncdb.sqlite
|
812
816
|
- LICENSE
|
817
|
+
- Manifest.txt
|
813
818
|
- platform/android/build/android.rake
|
814
819
|
- platform/android/build/androidcommon.rb
|
815
820
|
- platform/android/build/libcurl_build.files
|
@@ -883,6 +888,7 @@ files:
|
|
883
888
|
- platform/android/Rhodes/res/drawable/callout.png
|
884
889
|
- platform/android/Rhodes/res/drawable/callout_link.png
|
885
890
|
- platform/android/Rhodes/res/drawable/camera.png
|
891
|
+
- platform/android/Rhodes/res/drawable/esri.png
|
886
892
|
- platform/android/Rhodes/res/drawable/exit.png
|
887
893
|
- platform/android/Rhodes/res/drawable/home.png
|
888
894
|
- platform/android/Rhodes/res/drawable/icon.png
|
@@ -1174,6 +1180,7 @@ files:
|
|
1174
1180
|
- platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java
|
1175
1181
|
- platform/bb/rhodes/platform/common/com/rho/RhodesApplicationPlatform.java
|
1176
1182
|
- platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java
|
1183
|
+
- platform/bb/rhodes/resources/esri.png
|
1177
1184
|
- platform/bb/rhodes/resources/icon.png
|
1178
1185
|
- platform/bb/rhodes/resources/mappin.png
|
1179
1186
|
- platform/bb/rhodes/rhodes.csl
|
@@ -1267,6 +1274,7 @@ files:
|
|
1267
1274
|
- platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java
|
1268
1275
|
- platform/bb/RubyVM/src/com/rho/RhoClassFactory.java
|
1269
1276
|
- platform/bb/RubyVM/src/com/rho/RhoConf.java
|
1277
|
+
- platform/bb/RubyVM/src/com/rho/RhoCrypto.java
|
1270
1278
|
- platform/bb/RubyVM/src/com/rho/RhodesApp.java
|
1271
1279
|
- platform/bb/RubyVM/src/com/rho/RhoEmptyLogger.java
|
1272
1280
|
- platform/bb/RubyVM/src/com/rho/RhoEmptyProfiler.java
|
@@ -2143,6 +2151,7 @@ files:
|
|
2143
2151
|
- platform/shared/net/CURLNetRequest.h
|
2144
2152
|
- platform/shared/net/HttpServer.cpp
|
2145
2153
|
- platform/shared/net/HttpServer.h
|
2154
|
+
- platform/shared/net/INetRequest.cpp
|
2146
2155
|
- platform/shared/net/INetRequest.h
|
2147
2156
|
- platform/shared/net/iphone/sslimpl.cpp
|
2148
2157
|
- platform/shared/net/iphone/sslimpl.h
|
@@ -4021,8 +4030,6 @@ files:
|
|
4021
4030
|
- platform/wm/rhodes/rho/common/RhoClassFactory.h
|
4022
4031
|
- platform/wm/rhodes/rho/common/RhoThreadImpl.cpp
|
4023
4032
|
- platform/wm/rhodes/rho/common/RhoThreadImpl.h
|
4024
|
-
- platform/wm/rhodes/rho/net/NetRequest.cpp
|
4025
|
-
- platform/wm/rhodes/rho/net/NetRequest.h
|
4026
4033
|
- platform/wm/rhodes/rho/net/NetRequestImpl.cpp
|
4027
4034
|
- platform/wm/rhodes/rho/net/NetRequestImpl.h
|
4028
4035
|
- platform/wm/rhodes/rho/rubyext/calendar.cpp
|
@@ -5957,7 +5964,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
5957
5964
|
requirements: []
|
5958
5965
|
|
5959
5966
|
rubyforge_project: rhodes
|
5960
|
-
rubygems_version: 1.
|
5967
|
+
rubygems_version: 1.3.7
|
5961
5968
|
signing_key:
|
5962
5969
|
specification_version: 2
|
5963
5970
|
summary: The Rhodes framework is the easiest way to develop NATIVE apps with full device capabilities (GPS, PIM, camera, etc.) for any smartphone.
|
@@ -1,89 +0,0 @@
|
|
1
|
-
#include "stdafx.h"
|
2
|
-
|
3
|
-
#include "NetRequest.h"
|
4
|
-
#include "common/AutoPointer.h"
|
5
|
-
#include "common/RhoFile.h"
|
6
|
-
#include "common/RhoFilePath.h"
|
7
|
-
#include "NetRequestImpl.h"
|
8
|
-
#include "common/RhodesApp.h"
|
9
|
-
|
10
|
-
namespace rho {
|
11
|
-
namespace net {
|
12
|
-
IMPLEMENT_LOGCLASS(CNetRequest,"Net");
|
13
|
-
|
14
|
-
INetResponse* CNetRequest::pullData(const String& strUrl, IRhoSession* oSession )
|
15
|
-
{
|
16
|
-
return doRequest("GET",strUrl,String(),oSession,null);
|
17
|
-
}
|
18
|
-
|
19
|
-
INetResponse* CNetRequest::pushData(const String& strUrl, const String& strBody, IRhoSession* oSession)
|
20
|
-
{
|
21
|
-
return doRequest("POST",strUrl,strBody,oSession,null);
|
22
|
-
}
|
23
|
-
|
24
|
-
INetResponse* CNetRequest::pullCookies(const String& strUrl, const String& strBody, IRhoSession* oSession)
|
25
|
-
{
|
26
|
-
INetResponse* pResp = doRequest("POST", strUrl, strBody, oSession, null );
|
27
|
-
if ( pResp->isOK() )
|
28
|
-
((CNetResponseImpl*)pResp)->getRawData() = pResp->getCookies();
|
29
|
-
|
30
|
-
return pResp;
|
31
|
-
}
|
32
|
-
|
33
|
-
INetResponse* CNetRequest::doRequest( const char* method, const String& strUrl, const String& strBody, IRhoSession* oSession, Hashtable<String,String>* pHeaders )
|
34
|
-
{
|
35
|
-
m_bCancel = false;
|
36
|
-
CNetRequestImpl oImpl(this, method,strUrl,oSession,pHeaders, m_sslVerifyPeer);
|
37
|
-
return oImpl.sendString(strBody);
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
String CNetRequest::resolveUrl(const String& strUrl)
|
42
|
-
{
|
43
|
-
return RHODESAPPBASE().canonicalizeRhoUrl(strUrl);
|
44
|
-
}
|
45
|
-
|
46
|
-
void CNetRequest::cancel()
|
47
|
-
{
|
48
|
-
m_bCancel = true;
|
49
|
-
if ( m_pCurNetRequestImpl != null )
|
50
|
-
m_pCurNetRequestImpl->cancel();
|
51
|
-
}
|
52
|
-
|
53
|
-
INetResponse* CNetRequest::pushMultipartData(const String& strUrl, VectorPtr<CMultipartItem*>& arItems, IRhoSession* oSession, Hashtable<String,String>* pHeaders)
|
54
|
-
{
|
55
|
-
m_bCancel = false;
|
56
|
-
CNetRequestImpl oImpl(this, "POST",strUrl,oSession,pHeaders,m_sslVerifyPeer);
|
57
|
-
CNetResponseImpl* pResp = oImpl.sendMultipartData(arItems);
|
58
|
-
return pResp;
|
59
|
-
}
|
60
|
-
|
61
|
-
INetResponse* CNetRequest::pushMultipartData(const String& strUrl, CMultipartItem& oItem, IRhoSession* oSession, Hashtable<String,String>* pHeaders)
|
62
|
-
{
|
63
|
-
m_bCancel = false;
|
64
|
-
VectorPtr<CMultipartItem*> arItems;
|
65
|
-
arItems.addElement(&oItem);
|
66
|
-
|
67
|
-
INetResponse* pResp = pushMultipartData(strUrl, arItems, oSession, pHeaders);
|
68
|
-
|
69
|
-
arItems[0] = 0; //do not delete item
|
70
|
-
return pResp;
|
71
|
-
}
|
72
|
-
|
73
|
-
INetResponse* CNetRequest::pullFile(const String& strUrl, const String& strFilePath, IRhoSession* oSession, Hashtable<String,String>* pHeaders)
|
74
|
-
{
|
75
|
-
m_bCancel = false;
|
76
|
-
common::CRhoFile oFile;
|
77
|
-
if ( !oFile.open(strFilePath.c_str(),common::CRhoFile::OpenForAppend) )
|
78
|
-
{
|
79
|
-
LOG(ERROR) + "pullFile: cannot create file :" + strFilePath;
|
80
|
-
return new CNetResponseImpl();
|
81
|
-
}
|
82
|
-
|
83
|
-
CNetRequestImpl oImpl(this, "GET",strUrl,oSession,pHeaders,m_sslVerifyPeer);
|
84
|
-
CNetResponseImpl* pResp = oImpl.downloadFile(oFile);
|
85
|
-
return pResp;
|
86
|
-
}
|
87
|
-
|
88
|
-
}
|
89
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include "net/INetRequest.h"
|
4
|
-
#include "logging/RhoLog.h"
|
5
|
-
|
6
|
-
namespace rho {
|
7
|
-
namespace net {
|
8
|
-
|
9
|
-
class CNetRequestImpl;
|
10
|
-
class CNetRequest : public INetRequest
|
11
|
-
{
|
12
|
-
DEFINE_LOGCLASS;
|
13
|
-
boolean m_bCancel;
|
14
|
-
boolean m_sslVerifyPeer;
|
15
|
-
public:
|
16
|
-
CNetRequestImpl* m_pCurNetRequestImpl;
|
17
|
-
|
18
|
-
CNetRequest(void) : m_pCurNetRequestImpl(null), m_bCancel(false), m_sslVerifyPeer(true) {}
|
19
|
-
virtual ~CNetRequest(void){}
|
20
|
-
|
21
|
-
virtual INetResponse* pullData(const String& strUrl, IRhoSession* oSession );
|
22
|
-
virtual INetResponse* pushData(const String& strUrl, const String& strBody, IRhoSession* oSession);
|
23
|
-
virtual INetResponse* pushMultipartData(const String& strUrl, VectorPtr<CMultipartItem*>& arItems, IRhoSession* oSession, Hashtable<String,String>* pHeaders);
|
24
|
-
virtual INetResponse* pushMultipartData(const String& strUrl, CMultipartItem& oItem, IRhoSession* oSession, Hashtable<String,String>* pHeaders);
|
25
|
-
|
26
|
-
virtual INetResponse* pullFile(const String& strUrl, const String& strFilePath, IRhoSession* oSession, Hashtable<String,String>* pHeaders);
|
27
|
-
virtual INetResponse* pullCookies(const String& strUrl, const String& strBody, IRhoSession* oSession);
|
28
|
-
|
29
|
-
virtual INetResponse* doRequest( const char* method, const String& strUrl, const String& strBody, IRhoSession* oSession, Hashtable<String,String>* pHeaders );
|
30
|
-
|
31
|
-
virtual boolean sslVerifyPeer() {return m_sslVerifyPeer;}
|
32
|
-
virtual void sslVerifyPeer(boolean mode) {m_sslVerifyPeer = mode;}
|
33
|
-
|
34
|
-
virtual String resolveUrl(const String& strUrl);
|
35
|
-
|
36
|
-
virtual void cancel();
|
37
|
-
virtual boolean isCancelled(){return m_bCancel;}
|
38
|
-
|
39
|
-
protected:
|
40
|
-
};
|
41
|
-
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
extern "C" int rho_net_has_network();
|