rhodes 2.0.0.beta2 → 2.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +2 -0
- data/Manifest.txt +27 -148
- data/Rakefile +49 -3
- data/lib/framework/builtinME.rb +6 -0
- data/lib/framework/rho/render.rb +13 -8
- data/lib/framework/rho/rho.rb +97 -43
- data/lib/framework/rho/rhoapplication.rb +8 -3
- data/lib/framework/rho/rhocontroller.rb +1 -1
- data/lib/framework/rhodes-framework.rb +1 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +7 -22
- data/lib/framework/rhofsconnector.rb +1 -1
- data/lib/framework/rholang/localization_simplified.rb +2 -2
- data/lib/framework/rhom/rhom.rb +1 -0
- data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
- data/lib/framework/rhom/rhom_model.rb +98 -0
- data/lib/framework/rhom/rhom_object_factory.rb +13 -12
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/include/{JNIRhodes.h → rhodes/JNIRhodes.h} +3 -54
- data/platform/android/Rhodes/jni/include/{RhoClassFactory.h → rhodes/RhoClassFactory.h} +0 -0
- data/platform/android/Rhodes/jni/include/{SystemInfoImpl.h → rhodes/SystemInfoImpl.h} +0 -0
- data/platform/android/Rhodes/jni/include/{details → rhodes/details}/rhojava.inc +1 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Logger.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoConf.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoLogConf.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoMenu.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Rhodes.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_SplashScreen.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_alert_Alert.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_camera_Camera.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_datetime_DateTimePicker.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_geolocation_GeoLocationImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_RhoSocketImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_SSLImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{sslimpl.h → rhodes/sslimpl.h} +0 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +59 -0
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +3 -3
- data/platform/android/Rhodes/jni/src/alert.cpp +2 -2
- data/platform/android/Rhodes/jni/src/callbacks.cpp +4 -3
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -2
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -2
- data/platform/android/Rhodes/jni/src/geolocation.cpp +2 -2
- data/platform/android/Rhodes/jni/src/logconf.cpp +2 -2
- data/platform/android/Rhodes/jni/src/logger.cpp +2 -2
- data/platform/android/Rhodes/jni/src/mapview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/menu.cpp +2 -2
- data/platform/android/Rhodes/jni/src/nativebar.cpp +1 -1
- data/platform/android/Rhodes/jni/src/navbar.cpp +17 -3
- data/platform/android/Rhodes/jni/src/phonebook.cpp +1 -1
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +2 -2
- data/platform/android/Rhodes/jni/src/rhodes.cpp +3 -3
- data/platform/android/Rhodes/jni/src/ringtones.cpp +1 -1
- data/platform/android/Rhodes/jni/src/socketimpl.cpp +2 -2
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +2 -2
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
- data/platform/android/Rhodes/jni/src/syncengine.cpp +2 -2
- data/platform/android/Rhodes/jni/src/webview.cpp +15 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +52 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +8 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +26 -28
- data/platform/android/build/RhodesSRC_build.files +21 -20
- data/platform/android/build/android.rake +69 -24
- data/platform/android/build/androidcommon.rb +17 -12
- data/platform/bb/build/bb.rake +23 -21
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +5 -2
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +9 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +31 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +17 -6
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +6 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +16 -4
- data/platform/iphone/Classes/DateTime.h +5 -6
- data/platform/iphone/Classes/DateTimePicker.m +4 -18
- data/platform/iphone/Classes/DateTimePickerDelegate.h +7 -9
- data/platform/iphone/Classes/DateTimePickerDelegate.m +141 -152
- data/platform/iphone/Classes/Rhodes.h +6 -1
- data/platform/iphone/Classes/Rhodes.m +17 -43
- data/platform/iphone/Classes/SimpleMainView.h +1 -1
- data/platform/iphone/Classes/SimpleMainView.m +54 -4
- data/platform/iphone/Classes/WebView.m +17 -0
- data/platform/iphone/rbuild/iphone.rake +1 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +0 -45
- data/platform/shared/common/PosixThreadImpl.cpp +8 -0
- data/platform/shared/common/PosixThreadImpl.h +1 -0
- data/platform/shared/common/RhoThread.cpp +1 -0
- data/platform/shared/common/RhoThread.h +4 -2
- data/platform/shared/curl/include/curl/curl.h +4 -0
- data/platform/shared/db/DBAdapter.cpp +47 -60
- data/platform/shared/db/DBAdapter.h +6 -2
- data/platform/shared/net/AsyncHttp.cpp +27 -11
- data/platform/shared/net/AsyncHttp.h +3 -1
- data/platform/shared/net/CURLNetRequest.cpp +11 -10
- data/platform/shared/net/CURLNetRequest.h +6 -4
- data/platform/shared/net/HttpServer.cpp +11 -6
- data/platform/shared/ruby/ext/asynchttp/asynchttp.i +2 -2
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +22 -11
- data/platform/shared/ruby/ext/rho/rhoruby.c +2 -2
- data/platform/shared/ruby/ext/rho/rhosupport.c +23 -3
- data/platform/shared/ruby/ext/webview/webview.i +4 -0
- data/platform/shared/ruby/ext/webview/webview_wrap.c +39 -0
- data/platform/shared/ruby/re.c +8 -0
- data/platform/shared/ruby/string.c +1 -1
- data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +6 -1
- data/platform/shared/rubyJVM/src/com/rho/RhoThread.java +3 -0
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +34 -0
- data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +40 -53
- data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +32 -15
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +31 -17
- data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +3 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONArrayIterator.java +17 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +158 -137
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +18 -17
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +10 -2
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubyFile_Methods.java +6 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyFile.java +18 -3
- data/platform/shared/rubyJVM/src/j2me/io/File.java +37 -9
- data/platform/shared/sqlite/sqlite3.c +14613 -13016
- data/platform/shared/sqlite/sqlite3.h +1461 -1499
- data/platform/shared/sqlite/sqlite3ext.h +0 -2
- data/platform/shared/sync/ClientRegister.cpp +3 -3
- data/platform/shared/sync/ClientRegister.h +2 -1
- data/platform/shared/sync/SyncEngine.cpp +20 -8
- data/platform/shared/sync/SyncSource.cpp +12 -12
- data/platform/shared/sync/SyncSource.h +4 -4
- data/platform/shared/sync/SyncThread.cpp +8 -1
- data/platform/shared/tcmalloc/rhomem.h +3 -0
- data/platform/shared/tcmalloc/tcmalloc_.cpp +11 -0
- data/platform/wm/rhodes/Alert.cpp +148 -101
- data/platform/wm/rhodes/Alert.h +4 -1
- data/platform/wm/rhodes/AppManager.cpp +212 -72
- data/platform/wm/rhodes/AppManager.h +24 -3
- data/platform/wm/rhodes/DateTimePicker.cpp +23 -11
- data/platform/wm/rhodes/DateTimePicker.h +16 -5
- data/platform/wm/rhodes/MainWindow.cpp +22 -7
- data/platform/wm/rhodes/OkCancelModalDialog.h +63 -0
- data/platform/wm/rhodes/Rhodes.cpp +29 -17
- data/platform/wm/rhodes/phonebook/NativeAddressBook.cpp +128 -4
- data/platform/wm/rhodes/phonebook/NativeAddressBook.h +33 -3
- data/platform/wm/rhodes/resource.h +1 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +5 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +136 -102
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +12 -5
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +24 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +6 -0
- data/platform/wm/rhodes/rhodes.vcproj +4 -0
- data/platform/wm/tools/detool/detool.cpp +17 -4
- data/rakefile.rb +49 -3
- data/res/build-tools/db/syncdb.schema +2 -2
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +10 -10
- data/res/generators/templates/application/app/helpers/browser_helper.rb +9 -4
- data/res/generators/templates/application/app/index.bb.erb +5 -5
- data/res/generators/templates/application/build.yml +1 -0
- data/res/generators/templates/application/public/css/android.css +10 -8
- data/res/generators/templates/application/public/css/blackberry.css +40 -31
- data/res/generators/templates/application/public/css/iphone.css +4 -4
- data/res/generators/templates/application/public/css/webkit.css +7 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +31 -27
- data/res/generators/templates/application/rhoconfig.txt +2 -2
- data/res/generators/templates/model/edit.bb.erb +2 -2
- data/res/generators/templates/model/index.bb.erb +6 -4
- data/res/generators/templates/model/model.rb +2 -1
- data/res/generators/templates/model/new.bb.erb +2 -2
- data/res/generators/templates/model/show.bb.erb +2 -2
- data/rhobuild.yml +37 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/Account/account.rb +7 -0
- data/spec/framework_spec/app/Case/case.rb +6 -0
- data/spec/framework_spec/app/Customer/customer.rb +6 -0
- data/spec/framework_spec/app/Product/product.rb +9 -0
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +1 -1
- data/spec/framework_spec/app/spec/syncengine_spec.rb +2 -1
- metadata +45 -151
- data/lib/build/manifest/createAppManifest.rb +0 -18
- data/lib/build/tasks/android.rake +0 -317
- data/lib/build/tasks/blackberry.rake +0 -355
- data/lib/build/tasks/common.rake +0 -62
- data/lib/build/tasks/iphone.rake +0 -108
- data/lib/build/tasks/linux.rake +0 -81
- data/lib/build/tasks/rhodes-build.rb +0 -11
- data/lib/build/tasks/rspec.rake +0 -20
- data/lib/build/tasks/symbian.rake +0 -202
- data/lib/build/tasks/wm.rake +0 -166
- data/lib/framework/ServeME.rb +0 -7
- data/platform/bb/build/MANIFEST.MF +0 -12
- data/platform/iphone/Classes/DateTimePicker.h +0 -17
- data/res/generators/templates/application/public/icons/Read me first - license.txt +0 -14
- data/res/generators/templates/application/public/icons/about.png +0 -0
- data/res/generators/templates/application/public/icons/airplane.png +0 -0
- data/res/generators/templates/application/public/icons/baby.png +0 -0
- data/res/generators/templates/application/public/icons/badge.png +0 -0
- data/res/generators/templates/application/public/icons/bandaid.png +0 -0
- data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
- data/res/generators/templates/application/public/icons/battery.png +0 -0
- data/res/generators/templates/application/public/icons/beaker.png +0 -0
- data/res/generators/templates/application/public/icons/beaker2.png +0 -0
- data/res/generators/templates/application/public/icons/beermug.png +0 -0
- data/res/generators/templates/application/public/icons/bird.png +0 -0
- data/res/generators/templates/application/public/icons/book.png +0 -0
- data/res/generators/templates/application/public/icons/bookmark.png +0 -0
- data/res/generators/templates/application/public/icons/brightness.png +0 -0
- data/res/generators/templates/application/public/icons/bug.png +0 -0
- data/res/generators/templates/application/public/icons/cabinet.png +0 -0
- data/res/generators/templates/application/public/icons/calendar.png +0 -0
- data/res/generators/templates/application/public/icons/camera.png +0 -0
- data/res/generators/templates/application/public/icons/changeName.rb +0 -22
- data/res/generators/templates/application/public/icons/chat2.png +0 -0
- data/res/generators/templates/application/public/icons/chicken.png +0 -0
- data/res/generators/templates/application/public/icons/clock.png +0 -0
- data/res/generators/templates/application/public/icons/cloud.png +0 -0
- data/res/generators/templates/application/public/icons/coffee.png +0 -0
- data/res/generators/templates/application/public/icons/compass.png +0 -0
- data/res/generators/templates/application/public/icons/contrast.png +0 -0
- data/res/generators/templates/application/public/icons/dashboard.png +0 -0
- data/res/generators/templates/application/public/icons/display.png +0 -0
- data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
- data/res/generators/templates/application/public/icons/download.png +0 -0
- data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
- data/res/generators/templates/application/public/icons/ekg.png +0 -0
- data/res/generators/templates/application/public/icons/envelope.png +0 -0
- data/res/generators/templates/application/public/icons/equalizer.png +0 -0
- data/res/generators/templates/application/public/icons/eye.png +0 -0
- data/res/generators/templates/application/public/icons/film-roll.png +0 -0
- data/res/generators/templates/application/public/icons/flag.png +0 -0
- data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
- data/res/generators/templates/application/public/icons/fuel.png +0 -0
- data/res/generators/templates/application/public/icons/gameplan.png +0 -0
- data/res/generators/templates/application/public/icons/gear.png +0 -0
- data/res/generators/templates/application/public/icons/gear2.png +0 -0
- data/res/generators/templates/application/public/icons/gift.png +0 -0
- data/res/generators/templates/application/public/icons/heart.png +0 -0
- data/res/generators/templates/application/public/icons/house.png +0 -0
- data/res/generators/templates/application/public/icons/inbox.png +0 -0
- data/res/generators/templates/application/public/icons/index-cards.png +0 -0
- data/res/generators/templates/application/public/icons/iphone.png +0 -0
- data/res/generators/templates/application/public/icons/ipod.png +0 -0
- data/res/generators/templates/application/public/icons/key.png +0 -0
- data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
- data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
- data/res/generators/templates/application/public/icons/line-chart.png +0 -0
- data/res/generators/templates/application/public/icons/location.png +0 -0
- data/res/generators/templates/application/public/icons/lock.png +0 -0
- data/res/generators/templates/application/public/icons/loopback.png +0 -0
- data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
- data/res/generators/templates/application/public/icons/map-marker.png +0 -0
- data/res/generators/templates/application/public/icons/map.png +0 -0
- data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
- data/res/generators/templates/application/public/icons/medical.png +0 -0
- data/res/generators/templates/application/public/icons/microphone.png +0 -0
- data/res/generators/templates/application/public/icons/movie1.png +0 -0
- data/res/generators/templates/application/public/icons/movie2.png +0 -0
- data/res/generators/templates/application/public/icons/network.png +0 -0
- data/res/generators/templates/application/public/icons/note.png +0 -0
- data/res/generators/templates/application/public/icons/outlet.png +0 -0
- data/res/generators/templates/application/public/icons/palette.png +0 -0
- data/res/generators/templates/application/public/icons/paperclip.png +0 -0
- data/res/generators/templates/application/public/icons/phone.png +0 -0
- data/res/generators/templates/application/public/icons/photos.png +0 -0
- data/res/generators/templates/application/public/icons/piano.png +0 -0
- data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
- data/res/generators/templates/application/public/icons/pill.png +0 -0
- data/res/generators/templates/application/public/icons/pin.png +0 -0
- data/res/generators/templates/application/public/icons/pinetree.png +0 -0
- data/res/generators/templates/application/public/icons/planet.png +0 -0
- data/res/generators/templates/application/public/icons/puzzle.png +0 -0
- data/res/generators/templates/application/public/icons/radar.png +0 -0
- data/res/generators/templates/application/public/icons/redo.png +0 -0
- data/res/generators/templates/application/public/icons/refresh.png +0 -0
- data/res/generators/templates/application/public/icons/runner.png +0 -0
- data/res/generators/templates/application/public/icons/shoebox.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
- data/res/generators/templates/application/public/icons/shuffle.png +0 -0
- data/res/generators/templates/application/public/icons/signpost.png +0 -0
- data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
- data/res/generators/templates/application/public/icons/skull.png +0 -0
- data/res/generators/templates/application/public/icons/sliders.png +0 -0
- data/res/generators/templates/application/public/icons/spraycan.png +0 -0
- data/res/generators/templates/application/public/icons/squiggle.png +0 -0
- data/res/generators/templates/application/public/icons/star.png +0 -0
- data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
- data/res/generators/templates/application/public/icons/suitcase.png +0 -0
- data/res/generators/templates/application/public/icons/tag.png +0 -0
- data/res/generators/templates/application/public/icons/tags.png +0 -0
- data/res/generators/templates/application/public/icons/target.png +0 -0
- data/res/generators/templates/application/public/icons/testtube.png +0 -0
- data/res/generators/templates/application/public/icons/thermometer.png +0 -0
- data/res/generators/templates/application/public/icons/toolbox.png +0 -0
- data/res/generators/templates/application/public/icons/trophy.png +0 -0
- data/res/generators/templates/application/public/icons/tshirt.png +0 -0
- data/res/generators/templates/application/public/icons/tv.png +0 -0
- data/res/generators/templates/application/public/icons/umbrella.png +0 -0
- data/res/generators/templates/application/public/icons/walk.png +0 -0
- data/res/generators/templates/application/public/icons/weather.png +0 -0
- data/res/generators/templates/application/public/icons/widescreen.png +0 -0
- data/res/generators/templates/application/public/icons/wineglass.png +0 -0
- data/res/generators/templates/application/public/icons/zap.png +0 -0
- data/res/generators/templates/application/public/js/jquery-1.2.6.min.js +0 -32
- data/res/generators/templates/model/config.rb +0 -3
- data/res/generators/templates/spec/app/spec/webview_spec.rb +0 -5
- data/spec/framework_spec/app/Account/config.rb +0 -59
- data/spec/framework_spec/app/Case/config.rb +0 -3
- data/spec/framework_spec/app/Customer/config.rb +0 -3
- data/spec/framework_spec/app/Product/config.rb +0 -17
@@ -11,7 +11,7 @@
|
|
11
11
|
extern VALUE rho_asynchttp_downloadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
12
12
|
#define do_downloadfile rho_asynchttp_downloadfile
|
13
13
|
|
14
|
-
extern VALUE rho_asynchttp_uploadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
14
|
+
extern VALUE rho_asynchttp_uploadfile(const char* url, VALUE headers, const char* body, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
15
15
|
#define do_uploadfile rho_asynchttp_uploadfile
|
16
16
|
|
17
17
|
extern void rho_asynchttp_cancel(const char* cancel_callback);
|
@@ -26,5 +26,5 @@
|
|
26
26
|
extern VALUE do_get(const char* url, VALUE headers, const char* callback, const char* callback_params, int ssl_verify_peer);
|
27
27
|
extern VALUE do_post(const char* url, VALUE headers, const char* body, const char* callback, const char* callback_params, int ssl_verify_peer);
|
28
28
|
extern VALUE do_downloadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
29
|
-
extern VALUE do_uploadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
29
|
+
extern VALUE do_uploadfile(const char* url, VALUE headers, const char* body, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
30
30
|
extern void cancel(const char* cancel_callback);
|
@@ -1555,7 +1555,7 @@ static VALUE mAsyncHttp;
|
|
1555
1555
|
extern VALUE rho_asynchttp_downloadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
1556
1556
|
#define do_downloadfile rho_asynchttp_downloadfile
|
1557
1557
|
|
1558
|
-
extern VALUE rho_asynchttp_uploadfile(const char* url, VALUE headers, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
1558
|
+
extern VALUE rho_asynchttp_uploadfile(const char* url, VALUE headers, const char* body, const char* filename, const char* callback, const char* callback_params, int ssl_verify_peer);
|
1559
1559
|
#define do_uploadfile rho_asynchttp_uploadfile
|
1560
1560
|
|
1561
1561
|
extern void rho_asynchttp_cancel(const char* cancel_callback);
|
@@ -1886,7 +1886,8 @@ _wrap_do_uploadfile(int argc, VALUE *argv, VALUE self) {
|
|
1886
1886
|
char *arg3 = (char *) 0 ;
|
1887
1887
|
char *arg4 = (char *) 0 ;
|
1888
1888
|
char *arg5 = (char *) 0 ;
|
1889
|
-
|
1889
|
+
char *arg6 = (char *) 0 ;
|
1890
|
+
int arg7 ;
|
1890
1891
|
VALUE result;
|
1891
1892
|
int res1 ;
|
1892
1893
|
char *buf1 = 0 ;
|
@@ -1900,12 +1901,15 @@ _wrap_do_uploadfile(int argc, VALUE *argv, VALUE self) {
|
|
1900
1901
|
int res5 ;
|
1901
1902
|
char *buf5 = 0 ;
|
1902
1903
|
int alloc5 = 0 ;
|
1903
|
-
int
|
1904
|
-
|
1904
|
+
int res6 ;
|
1905
|
+
char *buf6 = 0 ;
|
1906
|
+
int alloc6 = 0 ;
|
1907
|
+
int val7 ;
|
1908
|
+
int ecode7 = 0 ;
|
1905
1909
|
VALUE vresult = Qnil;
|
1906
1910
|
|
1907
|
-
if ((argc <
|
1908
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for
|
1911
|
+
if ((argc < 7) || (argc > 7)) {
|
1912
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
|
1909
1913
|
}
|
1910
1914
|
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
1911
1915
|
if (!SWIG_IsOK(res1)) {
|
@@ -1928,23 +1932,30 @@ _wrap_do_uploadfile(int argc, VALUE *argv, VALUE self) {
|
|
1928
1932
|
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "do_uploadfile" "', argument " "5"" of type '" "char const *""'");
|
1929
1933
|
}
|
1930
1934
|
arg5 = (char *)(buf5);
|
1931
|
-
|
1932
|
-
if (!SWIG_IsOK(
|
1933
|
-
SWIG_exception_fail(SWIG_ArgError(
|
1935
|
+
res6 = SWIG_AsCharPtrAndSize(argv[5], &buf6, NULL, &alloc6);
|
1936
|
+
if (!SWIG_IsOK(res6)) {
|
1937
|
+
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "do_uploadfile" "', argument " "6"" of type '" "char const *""'");
|
1938
|
+
}
|
1939
|
+
arg6 = (char *)(buf6);
|
1940
|
+
ecode7 = SWIG_AsVal_int(argv[6], &val7);
|
1941
|
+
if (!SWIG_IsOK(ecode7)) {
|
1942
|
+
SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "do_uploadfile" "', argument " "7"" of type '" "int""'");
|
1934
1943
|
}
|
1935
|
-
|
1936
|
-
result = (VALUE)do_uploadfile((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6);
|
1944
|
+
arg7 = (int)(val7);
|
1945
|
+
result = (VALUE)do_uploadfile((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,arg7);
|
1937
1946
|
vresult = result;
|
1938
1947
|
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1939
1948
|
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
|
1940
1949
|
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
|
1941
1950
|
if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
|
1951
|
+
if (alloc6 == SWIG_NEWOBJ) free((char*)buf6);
|
1942
1952
|
return vresult;
|
1943
1953
|
fail:
|
1944
1954
|
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1945
1955
|
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
|
1946
1956
|
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
|
1947
1957
|
if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
|
1958
|
+
if (alloc6 == SWIG_NEWOBJ) free((char*)buf6);
|
1948
1959
|
return Qnil;
|
1949
1960
|
}
|
1950
1961
|
|
@@ -486,7 +486,7 @@ VALUE callFramework(VALUE hashReq) {
|
|
486
486
|
|
487
487
|
rb_gc_register_mark_object(callres);
|
488
488
|
//TBD: need to cleanup memory
|
489
|
-
rb_gc();
|
489
|
+
//rb_gc();
|
490
490
|
|
491
491
|
return callres;
|
492
492
|
}
|
@@ -505,7 +505,7 @@ VALUE callServeIndex(char* index_name) {
|
|
505
505
|
rb_gc_register_mark_object(callres);
|
506
506
|
|
507
507
|
//TBD: need to cleanup memory
|
508
|
-
rb_gc();
|
508
|
+
//rb_gc();
|
509
509
|
|
510
510
|
return callres;
|
511
511
|
}
|
@@ -269,22 +269,42 @@ VALUE isAlreadyLoaded(VALUE path)
|
|
269
269
|
|
270
270
|
RHO_INIT_LOCK(require_lock);
|
271
271
|
|
272
|
+
static int String_endsWith(const char* str, const char* szSuffix)
|
273
|
+
{
|
274
|
+
int nOff = 0;
|
275
|
+
if ( !szSuffix || !*szSuffix )
|
276
|
+
return 0;
|
277
|
+
|
278
|
+
nOff = strlen(str) - strlen(szSuffix);
|
279
|
+
if ( nOff < 0 )
|
280
|
+
return 0;
|
281
|
+
|
282
|
+
return strcmp(str+nOff, szSuffix) == 0;
|
283
|
+
}
|
284
|
+
|
272
285
|
VALUE require_compiled(VALUE fname, VALUE* result)
|
273
286
|
{
|
274
287
|
VALUE path;
|
275
288
|
char* szName1 = 0;
|
276
289
|
VALUE retval = Qtrue;
|
277
290
|
|
278
|
-
|
279
|
-
rb_funcall(fname, rb_intern("sub!"), 2, rb_str_new2(".rb"), rb_str_new2("") );
|
291
|
+
szName1 = RSTRING_PTR(fname);
|
280
292
|
|
293
|
+
if ( String_endsWith(szName1,".rb") )
|
294
|
+
{
|
295
|
+
rb_str_chop_bang(fname); rb_str_chop_bang(fname); rb_str_chop_bang(fname);
|
296
|
+
}
|
297
|
+
//rb_funcall(fname, rb_intern("sub!"), 2, rb_str_new2(".rb"), rb_str_new2("") );
|
281
298
|
szName1 = RSTRING_PTR(fname);
|
299
|
+
|
282
300
|
if ( strcmp("strscan",szName1)==0 || strcmp("enumerator",szName1)==0 ||
|
283
301
|
strcmp("stringio",szName1)==0 || strcmp("socket",szName1)==0 ||
|
284
302
|
strcmp("digest.so",szName1)==0 ||
|
285
303
|
strcmp("fcntl",szName1)==0 || strcmp("digest/md5",szName1)==0 ||
|
286
304
|
strcmp("digest/sha1",szName1)==0 )
|
287
|
-
|
305
|
+
return Qtrue;
|
306
|
+
|
307
|
+
RHO_LOCK(require_lock);
|
288
308
|
|
289
309
|
if ( isAlreadyLoaded(fname) == Qtrue )
|
290
310
|
goto RCompExit;
|
@@ -17,6 +17,9 @@ extern int rho_webview_active_tab();
|
|
17
17
|
extern void rho_webview_full_screen_mode(int enable);
|
18
18
|
#define full_screen_mode rho_webview_full_screen_mode
|
19
19
|
|
20
|
+
extern void rho_webview_set_cookie(const char* url, const char* cookie);
|
21
|
+
#define set_cookie rho_webview_set_cookie
|
22
|
+
|
20
23
|
%}
|
21
24
|
|
22
25
|
%typemap(default) int index {
|
@@ -30,3 +33,4 @@ extern const char* execute_js(const char* js, int index);
|
|
30
33
|
extern void set_menu_items(VALUE argv);
|
31
34
|
extern int active_tab();
|
32
35
|
extern void full_screen_mode(int enable);
|
36
|
+
extern void set_cookie(const char* url, const char* cookie);
|
@@ -1561,6 +1561,9 @@ extern int rho_webview_active_tab();
|
|
1561
1561
|
extern void rho_webview_full_screen_mode(int enable);
|
1562
1562
|
#define full_screen_mode rho_webview_full_screen_mode
|
1563
1563
|
|
1564
|
+
extern void rho_webview_set_cookie(const char* url, const char* cookie);
|
1565
|
+
#define set_cookie rho_webview_set_cookie
|
1566
|
+
|
1564
1567
|
|
1565
1568
|
|
1566
1569
|
#include <limits.h>
|
@@ -1898,6 +1901,41 @@ fail:
|
|
1898
1901
|
}
|
1899
1902
|
|
1900
1903
|
|
1904
|
+
SWIGINTERN VALUE
|
1905
|
+
_wrap_set_cookie(int argc, VALUE *argv, VALUE self) {
|
1906
|
+
char *arg1 = (char *) 0 ;
|
1907
|
+
char *arg2 = (char *) 0 ;
|
1908
|
+
int res1 ;
|
1909
|
+
char *buf1 = 0 ;
|
1910
|
+
int alloc1 = 0 ;
|
1911
|
+
int res2 ;
|
1912
|
+
char *buf2 = 0 ;
|
1913
|
+
int alloc2 = 0 ;
|
1914
|
+
|
1915
|
+
if ((argc < 2) || (argc > 2)) {
|
1916
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
1917
|
+
}
|
1918
|
+
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
1919
|
+
if (!SWIG_IsOK(res1)) {
|
1920
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_cookie" "', argument " "1"" of type '" "char const *""'");
|
1921
|
+
}
|
1922
|
+
arg1 = (char *)(buf1);
|
1923
|
+
res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
|
1924
|
+
if (!SWIG_IsOK(res2)) {
|
1925
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "set_cookie" "', argument " "2"" of type '" "char const *""'");
|
1926
|
+
}
|
1927
|
+
arg2 = (char *)(buf2);
|
1928
|
+
set_cookie((char const *)arg1,(char const *)arg2);
|
1929
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1930
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
1931
|
+
return Qnil;
|
1932
|
+
fail:
|
1933
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1934
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
1935
|
+
return Qnil;
|
1936
|
+
}
|
1937
|
+
|
1938
|
+
|
1901
1939
|
|
1902
1940
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
1903
1941
|
|
@@ -2167,5 +2205,6 @@ SWIGEXPORT void Init_WebView(void) {
|
|
2167
2205
|
rb_define_module_function(mWebView, "set_menu_items", _wrap_set_menu_items, -1);
|
2168
2206
|
rb_define_module_function(mWebView, "active_tab", _wrap_active_tab, -1);
|
2169
2207
|
rb_define_module_function(mWebView, "full_screen_mode", _wrap_full_screen_mode, -1);
|
2208
|
+
rb_define_module_function(mWebView, "set_cookie", _wrap_set_cookie, -1);
|
2170
2209
|
}
|
2171
2210
|
|
data/platform/shared/ruby/re.c
CHANGED
@@ -1232,6 +1232,14 @@ rb_reg_prepare_re(VALUE re, VALUE str)
|
|
1232
1232
|
rb_encoding *enc = rb_reg_prepare_enc(re, str, 1);
|
1233
1233
|
|
1234
1234
|
if (reg->enc == enc) return reg;
|
1235
|
+
//RHO
|
1236
|
+
if (reg->enc->ruby_encoding_index == rb_ascii8bit_encindex() &&
|
1237
|
+
enc->ruby_encoding_index == rb_usascii_encindex() )
|
1238
|
+
return reg;
|
1239
|
+
if (reg->enc->ruby_encoding_index == rb_usascii_encindex() &&
|
1240
|
+
enc->ruby_encoding_index == rb_ascii8bit_encindex() )
|
1241
|
+
return reg;
|
1242
|
+
//RHO
|
1235
1243
|
|
1236
1244
|
rb_reg_check(re);
|
1237
1245
|
reg = RREGEXP(re)->ptr;
|
@@ -14,6 +14,7 @@ public interface IRhoRubyHelper {
|
|
14
14
|
public abstract IDBStorage createDBStorage();
|
15
15
|
public abstract IFileAccess createFileAccess();
|
16
16
|
public abstract IRAFile createRAFile();
|
17
|
+
public abstract IRAFile createFSRAFile();
|
17
18
|
|
18
19
|
public void loadBackTrace(RubyArray backtrace);
|
19
20
|
public String getDeviceId();
|
@@ -45,7 +45,12 @@ public class RhoClassFactory
|
|
45
45
|
{
|
46
46
|
return RhoClassFactory.createRhoRubyHelper().createRAFile();
|
47
47
|
}
|
48
|
-
|
48
|
+
|
49
|
+
public static IRAFile createFSRAFile() throws Exception
|
50
|
+
{
|
51
|
+
return RhoClassFactory.createRhoRubyHelper().createFSRAFile();
|
52
|
+
}
|
53
|
+
|
49
54
|
public static IDBStorage createDBStorage() throws Exception
|
50
55
|
{
|
51
56
|
return RhoClassFactory.createRhoRubyHelper().createDBStorage();
|
@@ -13,6 +13,7 @@ public class RhodesApp
|
|
13
13
|
static RhodesApp m_pInstance;
|
14
14
|
|
15
15
|
private String m_strRhoRootPath, m_strBlobsDirPath, m_strDBDirPath;
|
16
|
+
private String m_strHomeUrl;
|
16
17
|
|
17
18
|
Vector/*<unsigned long>*/ m_arCallbackObjects = new Vector();
|
18
19
|
private SplashScreen m_oSplashScreen = new SplashScreen();
|
@@ -23,6 +24,9 @@ public class RhodesApp
|
|
23
24
|
Mutex m_mxScreenRotationCallback = new Mutex();
|
24
25
|
String m_strScreenRotationCallback = "", m_strScreenRotationCallbackParams = "";
|
25
26
|
|
27
|
+
int m_currentTabIndex = 0;
|
28
|
+
String[] m_currentUrls = new String[5];
|
29
|
+
|
26
30
|
NetRequest getNet() { return RhoClassFactory.createNetRequest();}
|
27
31
|
|
28
32
|
public static RhodesApp Create(String strRootPath)
|
@@ -57,6 +61,7 @@ public class RhodesApp
|
|
57
61
|
|
58
62
|
void initAppUrls()
|
59
63
|
{
|
64
|
+
m_strHomeUrl = "http://localhost:8080";
|
60
65
|
m_strBlobsDirPath = getRhoRootPath() + "db/db-files";
|
61
66
|
m_strDBDirPath = getRhoRootPath() + "db";
|
62
67
|
}
|
@@ -181,5 +186,34 @@ public class RhodesApp
|
|
181
186
|
strBody += "&rho_callback=1";
|
182
187
|
getNet().pushData( strCallbackUrl, strBody, null );
|
183
188
|
}
|
189
|
+
|
190
|
+
public String getCurrentUrl(int index)
|
191
|
+
{
|
192
|
+
return m_currentUrls[m_currentTabIndex];
|
193
|
+
}
|
184
194
|
|
195
|
+
public void keepLastVisitedUrl(String strUrl)
|
196
|
+
{
|
197
|
+
//LOG(INFO) + "Current URL: " + strUrl;
|
198
|
+
|
199
|
+
try{
|
200
|
+
m_currentUrls[m_currentTabIndex] = canonicalizeRhoUrl(strUrl);
|
201
|
+
|
202
|
+
if ( RHOCONF().getBool("KeepTrackOfLastVisitedPage") )
|
203
|
+
{
|
204
|
+
if ( strUrl.startsWith(m_strHomeUrl) )
|
205
|
+
strUrl = strUrl.substring(m_strHomeUrl.length());
|
206
|
+
|
207
|
+
int nFragment = strUrl.indexOf('#');
|
208
|
+
if ( nFragment >= 0 )
|
209
|
+
strUrl = strUrl.substring(0, nFragment);
|
210
|
+
|
211
|
+
RHOCONF().setString("LastVisitedPage",strUrl);
|
212
|
+
RHOCONF().saveToFile();
|
213
|
+
}
|
214
|
+
}catch(Exception exc)
|
215
|
+
{
|
216
|
+
LOG.ERROR("Save current location failed.", exc);
|
217
|
+
}
|
218
|
+
}
|
185
219
|
}
|
@@ -18,8 +18,8 @@ public class DBAdapter extends RubyBasic
|
|
18
18
|
|
19
19
|
private IDBStorage m_dbStorage;
|
20
20
|
private boolean m_bIsOpen = false;
|
21
|
-
private String m_strDBPath;
|
22
|
-
private String
|
21
|
+
private String m_strDBPath, m_strDBVerPath;
|
22
|
+
private String m_strDbPartition;
|
23
23
|
private DBAttrManager m_attrMgr = new DBAttrManager();
|
24
24
|
static Hashtable/*Ptr<String,CDBAdapter*>*/ m_mapDBPartitions = new Hashtable();
|
25
25
|
|
@@ -27,6 +27,7 @@ public class DBAdapter extends RubyBasic
|
|
27
27
|
int m_nTransactionCounter=0;
|
28
28
|
boolean m_bUIWaitDB = false;
|
29
29
|
|
30
|
+
static String USER_PARTITION_NAME(){return "user";}
|
30
31
|
static Hashtable/*Ptr<String,CDBAdapter*>&*/ getDBPartitions(){ return m_mapDBPartitions; }
|
31
32
|
|
32
33
|
DBAdapter(RubyClass c) {
|
@@ -46,6 +47,11 @@ public class DBAdapter extends RubyBasic
|
|
46
47
|
return m_Instance;
|
47
48
|
}*/
|
48
49
|
|
50
|
+
private void setDbPartition(String strPartition)
|
51
|
+
{
|
52
|
+
m_strDbPartition = strPartition;
|
53
|
+
}
|
54
|
+
|
49
55
|
public void close()
|
50
56
|
{
|
51
57
|
try{
|
@@ -613,15 +619,7 @@ public class DBAdapter extends RubyBasic
|
|
613
619
|
if ( destroyTableName( tableName, vecIncludes, vecExcludes ) )
|
614
620
|
continue;
|
615
621
|
|
616
|
-
|
617
|
-
String strInsert = "";
|
618
|
-
for ( ; !res.isEnd(); res.next() )
|
619
|
-
{
|
620
|
-
if ( strInsert.length() == 0 )
|
621
|
-
strInsert = createInsertStatement(res, tableName);
|
622
|
-
|
623
|
-
db.executeSQL(strInsert, res.getCurData(), false );
|
624
|
-
}
|
622
|
+
copyTable(tableName, this.m_dbStorage, db );
|
625
623
|
}
|
626
624
|
|
627
625
|
db.commit();
|
@@ -682,6 +680,19 @@ public class DBAdapter extends RubyBasic
|
|
682
680
|
return RubyConstant.QNIL;
|
683
681
|
}
|
684
682
|
|
683
|
+
private void copyTable(String tableName, IDBStorage dbFrom, IDBStorage dbTo)throws DBException
|
684
|
+
{
|
685
|
+
IDBResult res = dbFrom.executeSQL("SELECT * from " + tableName, null, false);
|
686
|
+
String strInsert = "";
|
687
|
+
for ( ; !res.isEnd(); res.next() )
|
688
|
+
{
|
689
|
+
if ( strInsert.length() == 0 )
|
690
|
+
strInsert = createInsertStatement(res, tableName);
|
691
|
+
|
692
|
+
dbTo.executeSQL(strInsert, res.getCurData(), false );
|
693
|
+
}
|
694
|
+
}
|
695
|
+
|
685
696
|
public void setBulkSyncDB(String fDbName, String fScriptName)
|
686
697
|
{
|
687
698
|
IDBStorage db = null;
|
@@ -691,48 +702,23 @@ public class DBAdapter extends RubyBasic
|
|
691
702
|
|
692
703
|
db.startTransaction();
|
693
704
|
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
{
|
709
|
-
String tableName = "sources";
|
710
|
-
String strSelect = "SELECT * from " + tableName;
|
711
|
-
IDBResult res = executeSQL( strSelect );
|
712
|
-
String strInsert = "";
|
713
|
-
for ( ; !res.isEnd(); res.next() )
|
714
|
-
{
|
715
|
-
String strName = res.getStringByIdx(1);
|
716
|
-
Object[] values = {strName};
|
717
|
-
IDBResult res2 = db.executeSQL("SELECT name from sources where name=?", values, false);
|
718
|
-
if (!res2.isEnd())
|
719
|
-
continue;
|
705
|
+
copyTable("client_info", this.m_dbStorage, db );
|
706
|
+
|
707
|
+
//update User partition
|
708
|
+
if ( m_strDbPartition.compareTo(USER_PARTITION_NAME()) == 0 )
|
709
|
+
{
|
710
|
+
//copy all NOT user sources from current db to bulk db
|
711
|
+
executeSQL("DELETE FROM sources WHERE partition=?", m_strDbPartition);
|
712
|
+
copyTable("sources", this.m_dbStorage, db );
|
713
|
+
}else
|
714
|
+
{
|
715
|
+
//remove all m_strDbPartition sources from user db
|
716
|
+
//copy all sources from bulk db to user db
|
717
|
+
DBAdapter dbUser = getDB(USER_PARTITION_NAME());
|
718
|
+
dbUser.executeSQL("DELETE FROM sources WHERE partition=?", m_strDbPartition);
|
720
719
|
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
db.executeSQL(strInsert, res.getCurData(), false );
|
725
|
-
}
|
726
|
-
/*
|
727
|
-
IDBResult res = executeSQL("SELECT name, sync_type, partition, priority from sources", null);
|
728
|
-
for ( ; !res.isEnd(); res.next() )
|
729
|
-
{
|
730
|
-
String strName = res.getStringByIdx(0);
|
731
|
-
Object[] values = {res.getStringByIdx(1), new Integer(res.getIntByIdx(2)),new Integer(res.getIntByIdx(3)),strName};
|
732
|
-
|
733
|
-
db.executeSQL("UPDATE sources SET sync_type=?, partition=?, priority=? where name=?",values, false);
|
734
|
-
}*/
|
735
|
-
}
|
720
|
+
copyTable("sources", db, dbUser.m_dbStorage );
|
721
|
+
}
|
736
722
|
|
737
723
|
db.commit();
|
738
724
|
db.close();
|
@@ -899,7 +885,7 @@ public class DBAdapter extends RubyBasic
|
|
899
885
|
|
900
886
|
public static DBAdapter getUserDB()
|
901
887
|
{
|
902
|
-
return (DBAdapter)getDBPartitions().get(
|
888
|
+
return (DBAdapter)getDBPartitions().get(USER_PARTITION_NAME());
|
903
889
|
}
|
904
890
|
|
905
891
|
public static DBAdapter getDB(String szPartition)
|
@@ -937,6 +923,7 @@ public class DBAdapter extends RubyBasic
|
|
937
923
|
String szDbName = arg1.toStr();
|
938
924
|
String szDbPartition = arg2.toStr();
|
939
925
|
((DBAdapter)receiver).openDB(szDbName);
|
926
|
+
((DBAdapter)receiver).setDbPartition(szDbPartition);
|
940
927
|
|
941
928
|
DBAdapter.getDBPartitions().put(szDbPartition, receiver);
|
942
929
|
|
@@ -28,6 +28,7 @@ public class AsyncHttp extends RhoThread
|
|
28
28
|
private Hashtable/*<String,String>*/ m_mapHeaders = new Hashtable();
|
29
29
|
|
30
30
|
private String m_strUrl, m_strBody, m_strCallback, m_strCallbackParams;
|
31
|
+
private String m_strFilePath;
|
31
32
|
private String m_strResBody = "";
|
32
33
|
boolean m_bFinished = false;
|
33
34
|
|
@@ -38,13 +39,14 @@ public class AsyncHttp extends RhoThread
|
|
38
39
|
private RhodesApp RHODESAPP(){ return RhodesApp.getInstance(); }
|
39
40
|
|
40
41
|
AsyncHttp(RhoClassFactory factory, int eCmd,
|
41
|
-
String url, RubyValue headers, String body, String callback, String callback_params)
|
42
|
+
String url, RubyValue headers, String body, String filepath, String callback, String callback_params)
|
42
43
|
{
|
43
44
|
super(factory);
|
44
45
|
|
45
46
|
m_ptrFactory = factory;
|
46
47
|
m_strUrl = url != null ? url : "";
|
47
48
|
m_strBody = body != null ? body : "";
|
49
|
+
m_strFilePath = filepath != null ? filepath : "";
|
48
50
|
m_strCallback = callback != null ? callback : "";
|
49
51
|
m_strCallbackParams = callback_params != null ? callback_params : "";
|
50
52
|
m_eCmd = eCmd;
|
@@ -150,11 +152,22 @@ public class AsyncHttp extends RhoThread
|
|
150
152
|
|
151
153
|
case hcUpload:
|
152
154
|
{
|
155
|
+
Vector/*Ptr<net::CMultipartItem*>*/ arMultipartItems = new Vector();
|
156
|
+
|
153
157
|
MultipartItem oItem = new MultipartItem();
|
154
|
-
oItem.m_strFilePath =
|
158
|
+
oItem.m_strFilePath = m_strFilePath;
|
155
159
|
oItem.m_strContentType = "application/octet-stream";
|
156
|
-
|
157
|
-
|
160
|
+
arMultipartItems.addElement(oItem);
|
161
|
+
|
162
|
+
if ( m_strBody.length() > 0 )
|
163
|
+
{
|
164
|
+
MultipartItem oItem2 = new MultipartItem();
|
165
|
+
oItem2.m_strBody = m_strBody;
|
166
|
+
oItem2.m_strContentType = (String)m_mapHeaders.get("content-type");
|
167
|
+
arMultipartItems.addElement(oItem2);
|
168
|
+
}
|
169
|
+
|
170
|
+
m_pNetResponse = m_pNetRequest.pushMultipartData( m_strUrl, arMultipartItems, null, m_mapHeaders );
|
158
171
|
break;
|
159
172
|
}
|
160
173
|
}
|
@@ -253,7 +266,10 @@ public class AsyncHttp extends RhoThread
|
|
253
266
|
if (cookies.length()>0)
|
254
267
|
m_strResBody += "&cookies=" + URI.urlEncode(cookies);
|
255
268
|
|
256
|
-
|
269
|
+
String strHeaders = makeHeadersString();
|
270
|
+
if ( strHeaders != null && strHeaders.length() > 0 )
|
271
|
+
m_strResBody += "&" + makeHeadersString();
|
272
|
+
|
257
273
|
m_strResBody += "&" + RHODESAPP().addCallbackObject(m_valBody, "body");
|
258
274
|
}
|
259
275
|
|
@@ -290,7 +306,7 @@ public class AsyncHttp extends RhoThread
|
|
290
306
|
String callback = args.get(2).toStr();
|
291
307
|
String callback_params = args.get(3).toStr();
|
292
308
|
boolean ssl_verify_peer = args.get(4).toInt() != 0 ? true : false;
|
293
|
-
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcGet, url, args.get(1), null, callback, callback_params );
|
309
|
+
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcGet, url, args.get(1), null, null, callback, callback_params );
|
294
310
|
return pHttp.getRetValue();
|
295
311
|
} catch(Exception e) {
|
296
312
|
LOG.ERROR("do_get failed", e);
|
@@ -312,7 +328,7 @@ public class AsyncHttp extends RhoThread
|
|
312
328
|
String callback = args.get(3).toStr();
|
313
329
|
String callback_params = args.get(4).toStr();
|
314
330
|
boolean ssl_verify_peer = args.get(5).toInt() != 0 ? true : false;
|
315
|
-
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcPost, url, args.get(1), body, callback, callback_params );
|
331
|
+
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcPost, url, args.get(1), body, null, callback, callback_params );
|
316
332
|
return pHttp.getRetValue();
|
317
333
|
} catch(Exception e) {
|
318
334
|
LOG.ERROR("do_post failed", e);
|
@@ -334,7 +350,7 @@ public class AsyncHttp extends RhoThread
|
|
334
350
|
String callback = args.get(3).toStr();
|
335
351
|
String callback_params = args.get(4).toStr();
|
336
352
|
boolean ssl_verify_peer = args.get(5).toInt() != 0 ? true : false;
|
337
|
-
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcDownload, url, args.get(1), filepath, callback, callback_params );
|
353
|
+
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcDownload, url, args.get(1), null, filepath, callback, callback_params );
|
338
354
|
return pHttp.getRetValue();
|
339
355
|
} catch(Exception e) {
|
340
356
|
LOG.ERROR("do_downloadfile failed", e);
|
@@ -346,17 +362,18 @@ public class AsyncHttp extends RhoThread
|
|
346
362
|
klass.getSingletonClass().defineMethod("do_uploadfile", new RubyVarArgMethod(){
|
347
363
|
protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block )
|
348
364
|
{
|
349
|
-
if ( args.size() !=
|
365
|
+
if ( args.size() != 7 )
|
350
366
|
throw new RubyException(RubyRuntime.ArgumentErrorClass,
|
351
|
-
"in AsyncHttp.do_uploadfile: wrong number of arguments ( " + args.size() + " for " +
|
367
|
+
"in AsyncHttp.do_uploadfile: wrong number of arguments ( " + args.size() + " for " + 7 + " )");
|
352
368
|
|
353
369
|
try {
|
354
370
|
String url = args.get(0).toStr();
|
355
|
-
String
|
356
|
-
String
|
357
|
-
String
|
358
|
-
|
359
|
-
|
371
|
+
String body = args.get(2).toStr();
|
372
|
+
String filepath = args.get(3).toStr();
|
373
|
+
String callback = args.get(4).toStr();
|
374
|
+
String callback_params = args.get(5).toStr();
|
375
|
+
boolean ssl_verify_peer = args.get(6).toInt() != 0 ? true : false;
|
376
|
+
AsyncHttp pHttp = new AsyncHttp(new RhoClassFactory(), AsyncHttp.hcUpload, url, args.get(1), body, filepath, callback, callback_params );
|
360
377
|
return pHttp.getRetValue();
|
361
378
|
} catch(Exception e) {
|
362
379
|
LOG.ERROR("do_uploadfile failed", e);
|