rhodes 1.5.5 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Manifest.txt +214 -32
- data/Rakefile +33 -10
- data/bin/upgrade-rhodes-app +0 -1
- data/lib/build/compileERB/bb.rb +2 -2
- data/lib/build/compileERB/default.rb +7 -5
- data/lib/build/jake.rb +1 -1
- data/lib/extensions/digest-md5/ext.yml +1 -1
- data/lib/extensions/digest-md5/ext/Rakefile +35 -36
- data/lib/extensions/digest-md5/ext/build.bat +1 -0
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +203 -0
- data/lib/extensions/digest-sha1/ext.yml +1 -1
- data/lib/extensions/digest/ext.yml +1 -1
- data/lib/extensions/digest/ext/Rakefile +35 -39
- data/lib/extensions/digest/ext/build.bat +1 -2
- data/lib/extensions/digest/ext/digest.vcproj +203 -0
- data/lib/framework/rho/render.rb +79 -22
- data/lib/framework/rho/rho.rb +294 -56
- data/lib/framework/rho/rhoapplication.rb +10 -0
- data/lib/framework/rho/rhofsconnector.rb +2 -6
- data/lib/framework/rho/rhoutils.rb +56 -14
- data/lib/framework/rho/rhoviewhelpers.rb +2 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/rhom/rhom.rb +42 -15
- data/lib/framework/rhom/rhom_db_adapter.rb +165 -159
- data/lib/framework/rhom/rhom_object.rb +0 -1
- data/lib/framework/rhom/rhom_object_factory.rb +343 -166
- data/lib/framework/rhom/rhom_source.rb +28 -15
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +39 -44
- data/platform/android/Rhodes/jni/include/JNIRhodes.h +1 -1
- data/platform/android/Rhodes/jni/include/details/rhojava.inc +23 -20
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_RhoMenu.h +61 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_Rhodes.h +16 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_alert_Alert.h +21 -0
- data/platform/android/Rhodes/jni/include/sslimpl.h +1 -1
- data/platform/android/Rhodes/jni/src/alert.cpp +32 -5
- data/platform/android/Rhodes/jni/src/callbacks.cpp +51 -21
- data/platform/android/Rhodes/jni/src/mapview.cpp +3 -8
- data/platform/android/Rhodes/jni/src/menu.cpp +70 -0
- data/platform/android/Rhodes/jni/src/navbar.cpp +16 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +37 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
- data/platform/android/Rhodes/jni/src/webview.cpp +21 -7
- data/platform/android/Rhodes/res/drawable/alert_alert.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_question.png +0 -0
- data/platform/android/Rhodes/res/drawable/camera.png +0 -0
- data/platform/android/Rhodes/res/layout/camera.xml +18 -3
- data/platform/android/Rhodes/res/menu/options.xml +0 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +5 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +105 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +157 -122
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +7 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +220 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +22 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +44 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +44 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +47 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +13 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +11 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +1 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +61 -0
- data/platform/android/build/RhodesSRC_build.files +3 -0
- data/platform/android/build/android.rake +173 -60
- data/platform/android/build/androidcommon.rb +1 -2
- data/platform/android/build/librhocommon_build.files +5 -0
- data/platform/android/build/librhodes_build.files +2 -0
- data/platform/android/build/libruby_build.files +2 -1
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -3
- data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +16 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +5 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +25 -4
- data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -1
- data/platform/bb/Hsqldb/src/j2me/math/Number.java +6 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Result.java +2 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Select.java +12 -6
- data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +19 -12
- data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +10 -4
- data/platform/bb/Hsqldb/src/org/hsqldb/Token.java +10 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +3 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/lib/java/JavaSystem.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlProperties.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/ScaledRAFile.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java +1 -1
- data/platform/bb/RubyVM/RubyVM.jdp +9 -10
- data/platform/bb/build/RubyVM_build.files +9 -7
- data/platform/bb/build/bb.rake +13 -3
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -2
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +154 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/rhodes.jdp +12 -7
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +331 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +10 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +4 -0
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +2 -4
- data/platform/bb/rhodes/src/com/rho/{Jsr75File.java → file/Jsr75File.java} +83 -36
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/Jsr75RAFileImpl.java +0 -1
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/PersistRAFileImpl.java +0 -2
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +8 -10
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +39 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +63 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +100 -0
- data/platform/bb/rhodes/src/rhomobile/LogScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +13 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +138 -492
- data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +11 -2
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +14 -10
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +5 -14
- data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +2 -2
- data/platform/iphone/Classes/AppManager/AppManager.m +37 -14
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +15 -4
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +53 -50
- data/platform/iphone/Classes/DateTimePicker.h +17 -0
- data/platform/iphone/Classes/DateTimePicker.m +35 -0
- data/platform/iphone/Classes/GeoLocation/LocationController.m +2 -3
- data/platform/iphone/Classes/LogOptionsController.m +3 -2
- data/platform/iphone/Classes/LogViewController.m +4 -2
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +12 -20
- data/platform/iphone/Classes/MapView/MapAnnotation.h +9 -13
- data/platform/iphone/Classes/MapView/MapAnnotation.m +17 -65
- data/platform/iphone/Classes/MapView/MapViewController.h +1 -7
- data/platform/iphone/Classes/MapView/MapViewController.m +51 -25
- data/platform/iphone/Classes/NativeBar.h +0 -12
- data/platform/iphone/Classes/NativeBar.m +121 -2
- data/platform/iphone/Classes/NavBar.h +16 -0
- data/platform/iphone/Classes/NavBar.m +115 -0
- data/platform/iphone/Classes/RhoAlert.h +19 -0
- data/platform/iphone/Classes/RhoAlert.m +258 -0
- data/platform/iphone/Classes/RhoDelegate.m +1 -0
- data/platform/iphone/Classes/RhoMainView.h +33 -0
- data/platform/iphone/Classes/Rhodes.h +56 -0
- data/platform/iphone/Classes/Rhodes.m +533 -0
- data/platform/iphone/Classes/RingtoneManager.h +17 -0
- data/platform/iphone/Classes/RingtoneManager.m +73 -0
- data/platform/iphone/Classes/SimpleMainView.h +30 -0
- data/platform/iphone/Classes/SimpleMainView.m +380 -0
- data/platform/iphone/Classes/TabbedMainView.h +24 -0
- data/platform/iphone/Classes/TabbedMainView.m +202 -0
- data/platform/iphone/Classes/WebView.m +123 -0
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +2 -2
- data/platform/iphone/Classes/rho/net/sslimpl.cpp +13 -1
- data/platform/iphone/Classes/rho/net/sslimpl.h +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +44 -0
- data/platform/iphone/main.m +1 -2
- data/platform/iphone/rbuild/iphone.rake +8 -16
- data/platform/iphone/rhoextlib/dosyscall.c +1 -1
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +6 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +97 -62
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +12 -0
- data/platform/osx/Rhodes Launcher/launch.rb +14 -21
- data/platform/shared/common/AppMenu.cpp +122 -0
- data/platform/shared/common/AppMenu.h +46 -0
- data/platform/shared/common/PosixThreadImpl.cpp +1 -1
- data/platform/shared/common/RhoConf.cpp +27 -2
- data/platform/shared/common/RhoConf.h +5 -0
- data/platform/shared/common/RhoFilePath.h +21 -0
- data/platform/shared/common/RhoStd.h +44 -5
- data/platform/shared/common/RhoTime.h +20 -7
- data/platform/shared/common/RhodesApp.cpp +236 -177
- data/platform/shared/common/RhodesApp.h +36 -13
- data/platform/shared/common/SplashScreen.cpp +2 -2
- data/platform/shared/common/StringConverter.h +10 -11
- data/platform/shared/common/rhoparams.c +0 -6
- data/platform/shared/curl/lib/rhossl.c +3 -2
- data/platform/shared/curl/lib/url.c +0 -5
- data/platform/shared/db/DBAdapter.cpp +304 -81
- data/platform/shared/db/DBAdapter.h +24 -7
- data/platform/shared/db/DBAttrManager.cpp +83 -30
- data/platform/shared/db/DBAttrManager.h +6 -0
- data/platform/shared/db/DBResult.h +15 -4
- data/platform/shared/json/JSONIterator.cpp +100 -3
- data/platform/shared/json/JSONIterator.h +28 -3
- data/platform/shared/net/AsyncHttp.cpp +25 -22
- data/platform/shared/net/AsyncHttp.h +10 -6
- data/platform/shared/net/CURLNetRequest.cpp +115 -36
- data/platform/shared/net/CURLNetRequest.h +6 -0
- data/platform/shared/net/HttpServer.cpp +6 -4
- data/platform/shared/net/HttpServer.h +0 -1
- data/platform/shared/net/INetRequest.h +19 -3
- data/platform/shared/net/URI.cpp +2 -2
- data/platform/shared/net/ssl.cpp +2 -2
- data/platform/shared/net/ssl.h +2 -2
- data/platform/shared/ruby/ext/alert/alert.i +14 -2
- data/platform/shared/ruby/ext/alert/alert_wrap.c +40 -20
- data/platform/shared/ruby/ext/asynchttp/asynchttp.i +8 -8
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +112 -16
- data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -12
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +481 -125
- data/platform/shared/ruby/ext/navbar/navbar.i +20 -0
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +1859 -0
- data/platform/shared/ruby/ext/rho/extensions.c +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +32 -2
- data/platform/shared/ruby/ext/rho/rhoruby.h +7 -2
- data/platform/shared/ruby/ext/rhoconf/rhoconf.i +4 -0
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +31 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +188 -3226
- data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -25
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +96 -104
- data/platform/shared/ruby/ext/system/system.i +12 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +101 -7
- data/platform/shared/ruby/ext/webview/webview.i +20 -15
- data/platform/shared/ruby/ext/webview/webview_wrap.c +42 -16
- data/platform/shared/ruby/thread_pthread.c +4 -4
- data/platform/shared/ruby/thread_win32.c +4 -4
- data/platform/shared/ruby/wince/io_wce.c +0 -1
- data/platform/shared/rubyJVM/src/com/rho/FilePath.java +18 -2
- data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/Properties.java +9 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +2 -3
- data/platform/shared/rubyJVM/src/com/rho/RhoConf.java +47 -8
- data/platform/shared/rubyJVM/src/com/rho/RhoLogConf.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoLogFileSink.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoRuby.java +43 -5
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +98 -3
- data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +460 -175
- data/platform/shared/rubyJVM/src/com/rho/db/DBAttrManager.java +81 -33
- data/platform/shared/rubyJVM/src/com/rho/db/IDBCallback.java +3 -5
- data/platform/shared/rubyJVM/src/com/rho/db/IDBResult.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/db/IDBStorage.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/{IFile.java → file/IFile.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IFileAccess.java → file/IFileAccess.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IRAFile.java → file/IRAFile.java} +1 -1
- data/platform/{bb/Hsqldb/src/com/rho/db → shared/rubyJVM/src/com/rho/file}/RandomAccessFile.java +1 -2
- data/platform/shared/rubyJVM/src/com/rho/{SimpleFile.java → file/SimpleFile.java} +5 -1
- data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +23 -18
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +167 -250
- data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +100 -30
- data/platform/shared/rubyJVM/src/com/rho/net/URI.java +0 -1
- data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +30 -33
- data/platform/shared/rubyJVM/src/com/rho/sync/ISyncProtocol.java +20 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java +5 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONStructIterator.java +74 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +486 -257
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncNotify.java +89 -58
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncProtocol_3.java +79 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +634 -495
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +74 -90
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +1 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyThread.java +6 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyRuntime.java +6 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +17 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyValue.java +1 -0
- data/platform/shared/rubyJVM/src/org/json/me/JSONObject.java +3 -0
- data/platform/shared/rubyext/GeoLocation.cpp +23 -0
- data/platform/shared/rubyext/GeoLocation.h +2 -0
- data/platform/shared/rubyext/RhoRuby.cpp +31 -0
- data/platform/shared/rubyext/RhoRuby.h +32 -0
- data/platform/shared/rubyext/System.cpp +14 -3
- data/platform/shared/rubyext/WebView.h +21 -0
- data/platform/shared/sync/ClientRegister.cpp +23 -28
- data/platform/shared/sync/ClientRegister.h +6 -2
- data/platform/shared/sync/ISyncProtocol.h +29 -0
- data/platform/shared/sync/SyncEngine.cpp +450 -190
- data/platform/shared/sync/SyncEngine.h +28 -38
- data/platform/shared/sync/SyncNotify.cpp +43 -41
- data/platform/shared/sync/SyncNotify.h +7 -7
- data/platform/shared/sync/SyncProtocol_3.h +86 -0
- data/platform/shared/sync/SyncSource.cpp +535 -371
- data/platform/shared/sync/SyncSource.h +48 -55
- data/platform/shared/sync/SyncThread.cpp +59 -103
- data/platform/shared/sync/SyncThread.h +10 -23
- data/platform/shared/unzip/unzip.cpp +3 -2
- data/platform/shared/unzip/unzip.h +5 -1
- data/platform/shared/wtl80/include/atlapp.h +10 -10
- data/platform/wm/RhoLib/RhoLib.vcproj +32 -0
- data/platform/wm/build/build_inf.js +40 -3
- data/platform/wm/build/wm.rake +95 -9
- data/platform/wm/rhodes/Alert.cpp +4 -0
- data/platform/wm/rhodes/DateTimePicker.cpp +183 -0
- data/platform/wm/rhodes/DateTimePicker.h +100 -0
- data/platform/wm/rhodes/MainWindow.cpp +222 -209
- data/platform/wm/rhodes/MainWindow.h +28 -35
- data/platform/wm/rhodes/Rhodes.cpp +20 -60
- data/platform/wm/rhodes/Rhodes.rc +41 -7
- data/platform/wm/rhodes/Utils.cpp +65 -0
- data/platform/wm/rhodes/Utils.h +9 -0
- data/platform/wm/rhodes/camera/Camera.cpp +2 -2
- data/platform/wm/rhodes/menubar.cpp +2 -33
- data/platform/wm/rhodes/menubar.h +0 -14
- data/platform/wm/rhodes/resource.h +13 -11
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +16 -35
- data/platform/wm/rhodes/rho/net/NetRequest.h +8 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +264 -46
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +14 -4
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +77 -4
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +63 -0
- data/platform/wm/rhodes/rhodes.vcproj +20 -66
- data/platform/wm/rhodes/stdafx.h +22 -0
- data/platform/wm/rubylib/rubylib.vcproj +4 -0
- data/platform/wm/syncengine/syncengine.vcproj +8 -0
- data/platform/wm/tools/detool.sln +66 -0
- data/platform/wm/tools/detool/DEMComInterface.tlb +0 -0
- data/platform/wm/tools/detool/ReadMe.txt +33 -0
- data/platform/wm/tools/detool/detool.cpp +559 -0
- data/platform/wm/tools/detool/detool.h +5 -0
- data/platform/wm/tools/detool/detool.vcproj +233 -0
- data/platform/wm/tools/detool/stdafx.cpp +8 -0
- data/platform/wm/tools/detool/stdafx.h +15 -0
- data/platform/wm/tools/detool/targetver.h +24 -0
- data/platform/wm/tools/rhosetup/ReadMe.txt +41 -0
- data/platform/wm/tools/rhosetup/rhosetup.cpp +52 -0
- data/platform/wm/tools/rhosetup/rhosetup.vcproj +641 -0
- data/platform/wm/tools/rhosetup/stdafx.cpp +8 -0
- data/platform/wm/tools/rhosetup/stdafx.h +59 -0
- data/rakefile.rb +33 -10
- data/res/build-tools/db/syncdb.schema +25 -23
- data/res/build-tools/db/syncdb.triggers +1 -1
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/rhosetup.dll +0 -0
- data/res/generators/rhogen.rb +27 -22
- data/res/generators/templates/application/app/Settings/controller.rb +3 -1
- data/res/generators/templates/application/app/Settings/home.bb.erb +17 -0
- data/res/generators/templates/application/app/Settings/home.erb +21 -12
- data/res/generators/templates/application/app/Settings/index.bb.erb +32 -0
- data/res/generators/templates/application/app/Settings/index.erb +44 -15
- data/res/generators/templates/application/app/Settings/login.bb.erb +35 -0
- data/res/generators/templates/application/app/Settings/login.erb +29 -30
- data/res/generators/templates/application/app/Settings/reset.bb.erb +15 -0
- data/res/generators/templates/application/app/Settings/reset.erb +16 -13
- data/res/generators/templates/application/app/Settings/wait.bb.erb +3 -0
- data/res/generators/templates/application/app/Settings/wait.erb +4 -4
- data/res/generators/templates/application/app/application.rb +8 -0
- data/res/generators/templates/application/app/helpers/browser_helper.rb +13 -0
- data/res/generators/templates/application/app/index.bb.erb +26 -0
- data/res/generators/templates/application/app/index.erb +21 -12
- data/res/generators/templates/application/app/layout.erb +9 -11
- data/res/generators/templates/application/public/css/android.css +285 -0
- data/res/generators/templates/application/public/css/blackberry.css +85 -78
- data/res/generators/templates/application/public/css/iphone.css +286 -296
- data/res/generators/templates/application/public/css/webkit.css +34 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +208 -0
- data/res/generators/templates/application/public/icons/Read me first - license.txt +14 -0
- 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 +22 -0
- 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/images/android/btn_check_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_check_on.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_on.png +0 -0
- data/res/generators/templates/application/public/images/android/ic_menu_more.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure_detail.png +0 -0
- data/res/generators/templates/application/public/images/iphone/radiobutton.png +0 -0
- data/res/generators/templates/application/public/images/iphone/select.png +0 -0
- data/res/generators/templates/application/public/images/iphone/switch.png +0 -0
- data/res/generators/templates/application/public/images/listArrow.png +0 -0
- data/res/generators/templates/application/public/images/listArrowDown.png +0 -0
- data/res/generators/templates/model/controller.rb +2 -0
- data/res/generators/templates/model/edit.bb.erb +24 -0
- data/res/generators/templates/model/edit.erb +21 -25
- data/res/generators/templates/model/index.bb.erb +21 -0
- data/res/generators/templates/model/index.erb +28 -14
- data/res/generators/templates/model/new.bb.erb +24 -0
- data/res/generators/templates/model/new.erb +20 -20
- data/res/generators/templates/model/show.bb.erb +21 -0
- data/res/generators/templates/model/show.erb +15 -15
- data/rhobuild.yml +37 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/Account/config.rb +57 -1
- data/spec/framework_spec/app/Case/config.rb +1 -1
- data/spec/framework_spec/app/Customer/config.rb +1 -1
- data/spec/framework_spec/app/Product/config.rb +15 -1
- data/spec/framework_spec/app/spec/fixtures/object_values.txt +90 -90
- data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +91 -91
- data/spec/framework_spec/app/spec/rho_spec.rb +1 -1
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +47 -28
- data/spec/framework_spec/app/spec/rhom_spec.rb +8 -8
- data/spec/framework_spec/app/spec/spec_helper.rb +13 -5
- data/spec/framework_spec/app/spec_runner.rb +5 -4
- data/spec/framework_spec/public/css/base.css +0 -1
- data/spec/framework_spec/public/css/iphone.css +0 -1
- data/spec/framework_spec/rhoconfig.txt +3 -1
- metadata +220 -37
- data/platform/bb/rhodes/src/rhomobile/WebView.java +0 -90
- data/platform/iphone/Classes/BarItem.h +0 -27
- data/platform/iphone/Classes/BarItem.m +0 -32
- data/platform/iphone/Classes/JSString.h +0 -12
- data/platform/iphone/Classes/JSString.m +0 -7
- data/platform/iphone/Classes/RhoRunnerAppDelegate.h +0 -48
- data/platform/iphone/Classes/RhoRunnerAppDelegate.m +0 -617
- data/platform/iphone/Classes/Server/ServerHost.h +0 -81
- data/platform/iphone/Classes/Server/ServerHost.m +0 -597
- data/platform/iphone/Classes/Server/WebViewUrl.h +0 -13
- data/platform/iphone/Classes/Server/WebViewUrl.m +0 -8
- data/platform/iphone/Classes/TabBarDelegate.h +0 -39
- data/platform/iphone/Classes/TabBarDelegate.m +0 -151
- data/platform/iphone/Classes/Utils/unzip.cpp +0 -4328
- data/platform/iphone/Classes/Utils/unzip.h +0 -234
- data/platform/iphone/Classes/WebViewController.h +0 -59
- data/platform/iphone/Classes/WebViewController.m +0 -472
- data/platform/wm/rhodes/GetURLDialog.cpp +0 -64
- data/platform/wm/rhodes/GetURLDialog.h +0 -39
- data/res/generators/templates/application/public/css/base.css +0 -39
- data/res/generators/templates/application/public/css/rho.css +0 -3
- data/res/generators/templates/application/public/css/xhtml.css +0 -114
- data/spec/framework_spec/app/Question/config.rb +0 -3
- data/spec/generator_spec/source_generator_spec.rb +0 -27
@@ -4,6 +4,7 @@
|
|
4
4
|
#include "common/IRhoClassFactory.h"
|
5
5
|
#include "common/RhoMutexLock.h"
|
6
6
|
#include "net/INetRequest.h"
|
7
|
+
#include "ISyncProtocol.h"
|
7
8
|
|
8
9
|
#include "SyncSource.h"
|
9
10
|
#include "SyncNotify.h"
|
@@ -11,54 +12,31 @@
|
|
11
12
|
#include "logging/RhoLog.h"
|
12
13
|
|
13
14
|
namespace rho {
|
14
|
-
struct _CRhoRuby {
|
15
|
-
static const int ERR_NONE = 0;
|
16
|
-
static const int ERR_NETWORK = 1;
|
17
|
-
static const int ERR_REMOTESERVER = 2;
|
18
|
-
static const int ERR_RUNTIME = 3;
|
19
|
-
static const int ERR_UNEXPECTEDSERVERRESPONSE = 4;
|
20
|
-
static const int ERR_DIFFDOMAINSINSYNCSRC = 5;
|
21
|
-
static const int ERR_NOSERVERRESPONSE = 6;
|
22
|
-
static const int ERR_CLIENTISNOTLOGGEDIN = 7;
|
23
|
-
static const int ERR_CUSTOMSYNCSERVER = 8;
|
24
|
-
static const int ERR_UNATHORIZED = 9;
|
25
|
-
static const int ERR_CANCELBYUSER = 10;
|
26
|
-
static const int ERR_SYNCVERSION = 11;
|
27
|
-
static const int ERR_GEOLOCATION = 12;
|
28
|
-
|
29
|
-
static String getMessageText(const char* szName);
|
30
|
-
static String getErrorText(int nError);
|
31
|
-
};
|
32
|
-
extern const _CRhoRuby& RhoRuby;
|
33
|
-
|
34
15
|
namespace sync {
|
35
16
|
|
36
17
|
class CSyncEngine : public net::IRhoSession
|
37
18
|
{
|
38
19
|
DEFINE_LOGCLASS;
|
39
20
|
public:
|
40
|
-
enum ESyncState{ esNone, esSyncAllSources, esSyncSource, esStop, esExit };
|
41
|
-
|
42
|
-
static String SYNC_SOURCE_FORMAT() { return "?format=json"; }
|
43
|
-
static int SYNC_VERSION() { return 2; }
|
44
|
-
|
45
|
-
static String SYNC_ASK_ACTION() { return "/ask"; }
|
46
|
-
// static int MAX_SYNC_TRY_COUNT() { return 2; }
|
21
|
+
enum ESyncState{ esNone, esSyncAllSources, esSyncSource, esSearch, esStop, esExit };
|
47
22
|
|
48
23
|
struct CSourceID
|
49
24
|
{
|
50
25
|
String m_strName;
|
51
|
-
String m_strUrl;
|
52
26
|
int m_nID;
|
53
27
|
|
28
|
+
CSourceID(int id, const String& strName ){ m_nID = id; m_strName = strName; }
|
29
|
+
CSourceID(const String& strName ){ m_strName = strName; }
|
30
|
+
|
54
31
|
String toString()const;
|
55
32
|
boolean isEqual(CSyncSource& src)const;
|
56
33
|
};
|
57
34
|
|
58
35
|
private:
|
59
36
|
VectorPtr<CSyncSource*> m_sources;
|
60
|
-
|
37
|
+
Vector<String> m_arPartitions;
|
61
38
|
common::CAutoPtr<net::INetRequest> m_NetRequest;
|
39
|
+
common::CAutoPtr<ISyncProtocol> m_SyncProtocol;
|
62
40
|
ESyncState m_syncState;
|
63
41
|
String m_clientID;
|
64
42
|
common::CMutex m_mxLoadClientID;
|
@@ -66,10 +44,11 @@ private:
|
|
66
44
|
CSyncNotify m_oSyncNotify;
|
67
45
|
boolean m_bStopByUser;
|
68
46
|
int m_nSyncPageSize;
|
69
|
-
|
47
|
+
boolean m_bNoThreaded;
|
48
|
+
int m_nErrCode;
|
70
49
|
|
71
50
|
public:
|
72
|
-
CSyncEngine(
|
51
|
+
CSyncEngine();
|
73
52
|
~CSyncEngine(void){}
|
74
53
|
|
75
54
|
void setFactory(common::IRhoClassFactory* factory){
|
@@ -77,7 +56,9 @@ public:
|
|
77
56
|
}
|
78
57
|
|
79
58
|
void doSyncAllSources();
|
80
|
-
void doSyncSource(const CSourceID& oSrcID
|
59
|
+
void doSyncSource(const CSourceID& oSrcID);
|
60
|
+
void doSearch(rho::Vector<rho::String>& arSources, String strParams, String strAction, boolean bSearchSyncChanges, int nProgressStep);
|
61
|
+
|
81
62
|
void login(String name, String password, String callback);
|
82
63
|
boolean isLoggedIn();
|
83
64
|
String loadSession();
|
@@ -95,26 +76,28 @@ public:
|
|
95
76
|
//private:
|
96
77
|
String getClientID()const{ return m_clientID; }
|
97
78
|
void setSession(String strSession){m_strSession=strSession;}
|
98
|
-
const String& getSession(){ return m_strSession; }
|
99
79
|
boolean isSessionExist(){ return m_strSession.length() > 0; }
|
100
|
-
|
101
|
-
|
80
|
+
//IRhoSession
|
81
|
+
virtual const String& getSession(){ return m_strSession; }
|
82
|
+
virtual const String& getContentType(){ return getProtocol().getContentType();}
|
102
83
|
|
103
84
|
void loadAllSources();
|
104
85
|
void syncAllSources();
|
86
|
+
void prepareSync(ESyncState eState);
|
87
|
+
|
105
88
|
VectorPtr<CSyncSource*>& getSources(){ return m_sources; }
|
106
89
|
int getStartSource();
|
107
90
|
String loadClientID();
|
108
91
|
String requestClientIDByNet();
|
109
92
|
boolean resetClientIDByNet(const String& strClientID);//throws Exception
|
93
|
+
void doBulkSync();//throws Exception
|
110
94
|
|
111
|
-
db::CDBAdapter& getDB(){ return m_dbAdapter; }
|
112
95
|
CSyncNotify& getNotify(){ return m_oSyncNotify; }
|
113
96
|
net::INetRequest& getNet(){ return *m_NetRequest; }
|
97
|
+
ISyncProtocol& getProtocol(){ return *m_SyncProtocol; }
|
114
98
|
|
115
99
|
CSyncSource* findSourceByName(const String& strSrcName);
|
116
100
|
|
117
|
-
String SYNC_PAGE_SIZE();
|
118
101
|
int getSyncPageSize() { return m_nSyncPageSize; }
|
119
102
|
void setSyncPageSize(int nPageSize){ m_nSyncPageSize = nPageSize; }
|
120
103
|
|
@@ -124,7 +107,14 @@ private:
|
|
124
107
|
|
125
108
|
CSyncSource* findSource(const CSourceID& oSrcID);
|
126
109
|
|
127
|
-
|
110
|
+
void loadBulkPartition(const String& strPartition);
|
111
|
+
String makeBulkDataFileName(String strDataUrl, String strDbPath, String strExt);
|
112
|
+
db::CDBAdapter& getUserDB(){ return db::CDBAdapter::getUserDB(); }
|
113
|
+
db::CDBAdapter& getDB(const String& strPartition){ return db::CDBAdapter::getDB(strPartition.c_str()); }
|
114
|
+
|
115
|
+
void initProtocol();
|
116
|
+
void processServerSources(String strSources);
|
117
|
+
|
128
118
|
friend class CSyncSource;
|
129
119
|
};
|
130
120
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#include "SyncNotify.h"
|
2
2
|
#include "SyncEngine.h"
|
3
3
|
#include "net/URI.h"
|
4
|
-
#include "
|
4
|
+
#include "rubyext/RhoRuby.h"
|
5
5
|
|
6
6
|
namespace rho {
|
7
7
|
namespace sync {
|
@@ -14,7 +14,6 @@ String CSyncNotify::m_strObjectNotifyUrl;
|
|
14
14
|
common::CMutex CSyncNotify::m_mxObjectNotify;
|
15
15
|
|
16
16
|
INetRequest& CSyncNotify::getNet(){ return getSync().getNet(); }
|
17
|
-
CDBAdapter& CSyncNotify::getDB(){ return getSync().getDB(); }
|
18
17
|
|
19
18
|
void CSyncNotify::addObjectNotify(int nSrcID, const String& strObject)
|
20
19
|
{
|
@@ -97,14 +96,16 @@ void CSyncNotify::fireObjectsNotification()
|
|
97
96
|
int nNotifyType = itObject->second;
|
98
97
|
if (nNotifyType == enNone)
|
99
98
|
continue;
|
100
|
-
|
99
|
+
//This is slow operation
|
100
|
+
/*
|
101
101
|
if ( nNotifyType == enDelete )
|
102
102
|
{
|
103
|
+
//TODO: get db for source
|
103
104
|
DBResult( res , getDB().executeSQL("SELECT object FROM object_values where object=? LIMIT 1 OFFSET 0", itObject->first ));
|
104
105
|
if ( !res.isEnd() )
|
105
106
|
nNotifyType = enUpdate;
|
106
107
|
}
|
107
|
-
|
108
|
+
*/
|
108
109
|
if ( strBody.length() > 0 )
|
109
110
|
strBody += "&rho_callback=1&";
|
110
111
|
|
@@ -230,7 +231,7 @@ void CSyncNotify::setSyncNotification(int source_id, String strUrl, String strPa
|
|
230
231
|
|
231
232
|
if ( strFullUrl.length() > 0 )
|
232
233
|
{
|
233
|
-
DBResult( res,
|
234
|
+
DBResult( res, CDBAdapter::getUserDB().executeSQL("SELECT source_id from sources order by source_id") );
|
234
235
|
for ( ; !res.isEnd(); res.next() )
|
235
236
|
m_mapSyncNotifications.put( res.getIntByIdx(0),new CSyncNotification( strFullUrl, strParams, false ) );
|
236
237
|
}
|
@@ -251,27 +252,27 @@ void CSyncNotify::setSyncNotification(int source_id, String strUrl, String strPa
|
|
251
252
|
}
|
252
253
|
}
|
253
254
|
|
254
|
-
void CSyncNotify::setSearchNotification(
|
255
|
+
void CSyncNotify::setSearchNotification(String strUrl, String strParams )
|
255
256
|
{
|
256
|
-
LOG(INFO) + "Set search notification.
|
257
|
+
LOG(INFO) + "Set search notification. Url :" + strUrl + "; Params: " + strParams;
|
257
258
|
String strFullUrl = getNet().resolveUrl(strUrl);
|
258
259
|
|
259
260
|
if ( strFullUrl.length() > 0 )
|
260
261
|
{
|
261
262
|
synchronized(m_mxSyncNotifications)
|
262
263
|
{
|
263
|
-
|
264
|
+
m_pSearchNotification = new CSyncNotification( strFullUrl, strParams, true );
|
264
265
|
|
265
|
-
LOG(INFO) + " Done Set search notification.
|
266
|
+
LOG(INFO) + " Done Set search notification. Url :" + strFullUrl + "; Params: " + strParams;
|
266
267
|
}
|
267
268
|
}
|
268
269
|
}
|
269
270
|
|
270
|
-
void CSyncNotify::
|
271
|
+
void CSyncNotify::setBulkSyncNotification(String strUrl, String strParams )//throws Exception
|
271
272
|
{
|
272
273
|
String strFullUrl = getNet().resolveUrl(strUrl);
|
273
274
|
|
274
|
-
|
275
|
+
m_bulkSyncNotify = CSyncNotification( strFullUrl, strParams, false );
|
275
276
|
}
|
276
277
|
|
277
278
|
extern "C" void alert_show_popup(const char* message);
|
@@ -283,15 +284,10 @@ void CSyncNotify::reportSyncStatus(String status, int error, String strDetails)
|
|
283
284
|
return;
|
284
285
|
}
|
285
286
|
//TODO: reportStatus
|
286
|
-
//if (m_statusListener != null
|
287
|
-
//
|
288
|
-
//
|
289
|
-
//
|
290
|
-
// {
|
291
|
-
//if ( strDetails.length() == 0 )
|
292
|
-
// strDetails = RhoRuby.getErrorText(error);
|
293
|
-
//status += (strDetails.length() > 0 ? RhoRuby.getMessageText("details") + strDetails: "");
|
294
|
-
// }
|
287
|
+
//if (m_statusListener != null) {
|
288
|
+
// if ( strDetails.length() == 0 )
|
289
|
+
// strDetails = RhoRuby.getErrorText(error);
|
290
|
+
// status += (strDetails.length() > 0 ? RhoRuby.getMessageText("details") + strDetails: "");
|
295
291
|
// m_statusListener.reportStatus( status, error);
|
296
292
|
//}
|
297
293
|
//LOG(INFO) + "Status: "+status;
|
@@ -305,7 +301,7 @@ void CSyncNotify::fireAllSyncNotifications( boolean bFinish, int nErrCode, Strin
|
|
305
301
|
}
|
306
302
|
}
|
307
303
|
|
308
|
-
void CSyncNotify::
|
304
|
+
void CSyncNotify::fireBulkSyncNotification( boolean bFinish, String status, String partition, int nErrCode )
|
309
305
|
{
|
310
306
|
if ( getSync().getState() == CSyncEngine::esExit )
|
311
307
|
return;
|
@@ -313,7 +309,7 @@ void CSyncNotify::fireInitialSyncNotification( boolean bFinish, int nErrCode )
|
|
313
309
|
//TODO: show report
|
314
310
|
if( nErrCode != RhoRuby.ERR_NONE)
|
315
311
|
{
|
316
|
-
String strMessage = RhoRuby.getMessageText("sync_failed_for") + "
|
312
|
+
String strMessage = RhoRuby.getMessageText("sync_failed_for") + "bulk.";
|
317
313
|
reportSyncStatus(strMessage,nErrCode,"");
|
318
314
|
}
|
319
315
|
|
@@ -322,16 +318,18 @@ void CSyncNotify::fireInitialSyncNotification( boolean bFinish, int nErrCode )
|
|
322
318
|
{
|
323
319
|
synchronized(m_mxSyncNotifications)
|
324
320
|
|
325
|
-
if (
|
321
|
+
if ( m_bulkSyncNotify.m_strUrl.length() == 0 )
|
326
322
|
return;
|
327
323
|
|
328
|
-
strUrl =
|
324
|
+
strUrl = m_bulkSyncNotify.m_strUrl;
|
329
325
|
strBody = "rho_callback=1";
|
326
|
+
strBody += "&partition=" + partition;
|
327
|
+
strBody += "&bulk_status="+status;
|
330
328
|
strBody += "&status=";
|
331
329
|
if ( bFinish )
|
332
330
|
{
|
333
331
|
if ( nErrCode == RhoRuby.ERR_NONE )
|
334
|
-
|
332
|
+
strBody += "ok";
|
335
333
|
else
|
336
334
|
{
|
337
335
|
if ( getSync().isStoppedByUser() )
|
@@ -344,19 +342,19 @@ void CSyncNotify::fireInitialSyncNotification( boolean bFinish, int nErrCode )
|
|
344
342
|
else
|
345
343
|
strBody += "in_progress";
|
346
344
|
|
347
|
-
if (
|
348
|
-
strBody += "&" +
|
345
|
+
if ( m_bulkSyncNotify.m_strParams.length() > 0 )
|
346
|
+
strBody += "&" + m_bulkSyncNotify.m_strParams;
|
349
347
|
|
350
|
-
bRemoveAfterFire = bRemoveAfterFire &&
|
348
|
+
bRemoveAfterFire = bRemoveAfterFire && m_bulkSyncNotify.m_bRemoveAfterFire;
|
351
349
|
}
|
352
350
|
|
353
351
|
if ( bRemoveAfterFire )
|
354
|
-
|
352
|
+
clearBulkSyncNotification();
|
355
353
|
|
356
|
-
LOG(INFO) + "Fire
|
354
|
+
LOG(INFO) + "Fire Bulk notification.Url :" + strUrl + "; Body: " + strBody;
|
357
355
|
|
358
356
|
if ( callNotify(strUrl, strBody) )
|
359
|
-
|
357
|
+
clearBulkSyncNotification();
|
360
358
|
}
|
361
359
|
|
362
360
|
void CSyncNotify::fireSyncNotification( CSyncSource* psrc, boolean bFinish, int nErrCode, String strMessage)
|
@@ -366,7 +364,7 @@ void CSyncNotify::fireSyncNotification( CSyncSource* psrc, boolean bFinish, int
|
|
366
364
|
|
367
365
|
if( strMessage.length() > 0 || nErrCode != RhoRuby.ERR_NONE)
|
368
366
|
{
|
369
|
-
if ( !( psrc != null && psrc->
|
367
|
+
if ( !( psrc != null && psrc->isSearch()) )
|
370
368
|
{
|
371
369
|
// if ( psrc != null && strMessage.length() == 0 )
|
372
370
|
// strMessage = RhoRuby.getMessageText("sync_failed_for") + psrc->getName() + ".";
|
@@ -389,8 +387,13 @@ void CSyncNotify::doFireSyncNotification( CSyncSource* psrc, boolean bFinish, in
|
|
389
387
|
{
|
390
388
|
synchronized(m_mxSyncNotifications)
|
391
389
|
{
|
392
|
-
CSyncNotification* pSN =
|
393
|
-
|
390
|
+
CSyncNotification* pSN = 0;
|
391
|
+
if ( src.isSearch() )
|
392
|
+
pSN = m_pSearchNotification;
|
393
|
+
else
|
394
|
+
pSN = m_mapSyncNotifications.get(src.getID());
|
395
|
+
|
396
|
+
if ( pSN == 0 )
|
394
397
|
return;
|
395
398
|
CSyncNotification& sn = *pSN;
|
396
399
|
|
@@ -398,8 +401,8 @@ void CSyncNotify::doFireSyncNotification( CSyncSource* psrc, boolean bFinish, in
|
|
398
401
|
strBody = "";
|
399
402
|
strBody = "total_count=" + convertToStringA(src.getTotalCount());
|
400
403
|
strBody += "&processed_count=" + convertToStringA(src.getCurPageCount());
|
401
|
-
strBody += "&processed_objects_count=" + convertToStringA(getLastSyncObjectCount(src.getID()));
|
402
|
-
strBody += "&cumulative_count=" + convertToStringA(src.
|
404
|
+
//strBody += "&processed_objects_count=" + convertToStringA(getLastSyncObjectCount(src.getID()));
|
405
|
+
strBody += "&cumulative_count=" + convertToStringA(getLastSyncObjectCount(src.getID()));
|
403
406
|
strBody += "&source_id=" + convertToStringA(src.getID());
|
404
407
|
strBody += "&source_name=" + src.getName();
|
405
408
|
strBody += "&rho_callback=1";
|
@@ -476,7 +479,7 @@ void CSyncNotify::clearNotification(CSyncSource& src)
|
|
476
479
|
synchronized(m_mxSyncNotifications)
|
477
480
|
{
|
478
481
|
if ( src.isSearch() )
|
479
|
-
|
482
|
+
m_pSearchNotification = null;
|
480
483
|
else
|
481
484
|
m_mapSyncNotifications.remove(src.getID());
|
482
485
|
}
|
@@ -495,12 +498,12 @@ void CSyncNotify::clearSyncNotification(int source_id)
|
|
495
498
|
}
|
496
499
|
}
|
497
500
|
|
498
|
-
void CSyncNotify::
|
501
|
+
void CSyncNotify::clearBulkSyncNotification()
|
499
502
|
{
|
500
|
-
LOG(INFO) + "Clear
|
503
|
+
LOG(INFO) + "Clear bulk notification.";
|
501
504
|
|
502
505
|
synchronized(m_mxSyncNotifications){
|
503
|
-
|
506
|
+
m_bulkSyncNotify = CSyncNotification();
|
504
507
|
}
|
505
508
|
}
|
506
509
|
|
@@ -553,6 +556,5 @@ void CSyncNotify::callLoginCallback(String callback, int nErrCode, String strMes
|
|
553
556
|
// LOG.ERROR("Call Login callback failed.", exc);
|
554
557
|
//}
|
555
558
|
}
|
556
|
-
|
557
559
|
}
|
558
560
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
#include "common/RhoStd.h"
|
4
4
|
#include "logging/RhoLog.h"
|
5
|
+
#include "common/AutoPointer.h"
|
5
6
|
|
6
7
|
namespace rho {
|
7
8
|
namespace db {
|
@@ -46,13 +47,12 @@ private:
|
|
46
47
|
static common::CMutex m_mxObjectNotify;
|
47
48
|
|
48
49
|
HashtablePtr<int,CSyncNotification*> m_mapSyncNotifications;
|
49
|
-
|
50
|
-
|
50
|
+
common::CAutoPtr<CSyncNotification> m_pSearchNotification;
|
51
|
+
CSyncNotification m_bulkSyncNotify;
|
51
52
|
common::CMutex m_mxSyncNotifications;
|
52
53
|
|
53
54
|
net::INetRequest& getNet();
|
54
55
|
CSyncEngine& getSync(){ return m_syncEngine; }
|
55
|
-
db::CDBAdapter& getDB();
|
56
56
|
public:
|
57
57
|
CSyncNotify( CSyncEngine& syncEngine ) : m_syncEngine(syncEngine), m_bEnableReporting(false){}
|
58
58
|
|
@@ -70,7 +70,7 @@ public:
|
|
70
70
|
|
71
71
|
//Sync notifications
|
72
72
|
void setSyncNotification(int source_id, String strUrl, String strParams );
|
73
|
-
void setSearchNotification(
|
73
|
+
void setSearchNotification(String strUrl, String strParams );
|
74
74
|
|
75
75
|
void clearSyncNotification(int source_id);
|
76
76
|
void clearNotification(CSyncSource& src);
|
@@ -78,9 +78,9 @@ public:
|
|
78
78
|
void onSyncSourceEnd( int nSrc, VectorPtr<CSyncSource*>& sources );
|
79
79
|
void fireSyncNotification( CSyncSource* psrc, boolean bFinish, int nErrCode, String strMessage);
|
80
80
|
|
81
|
-
void
|
82
|
-
void
|
83
|
-
void
|
81
|
+
void setBulkSyncNotification(String strUrl, String strParams );//throws Exception
|
82
|
+
void fireBulkSyncNotification( boolean bFinish, String status, String partition, int nErrCode );
|
83
|
+
void clearBulkSyncNotification();
|
84
84
|
|
85
85
|
void cleanLastSyncObjectCount();
|
86
86
|
int incLastSyncObjectCount(int nSrcID);
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "ISyncProtocol.h"
|
4
|
+
#include "common/StringConverter.h"
|
5
|
+
#include "common/RhoFilePath.h"
|
6
|
+
|
7
|
+
namespace rho {
|
8
|
+
namespace sync {
|
9
|
+
|
10
|
+
struct CSyncProtocol_3 : public ISyncProtocol
|
11
|
+
{
|
12
|
+
String m_strContentType;
|
13
|
+
|
14
|
+
CSyncProtocol_3()
|
15
|
+
{
|
16
|
+
m_strContentType = "application/json";
|
17
|
+
}
|
18
|
+
|
19
|
+
const String& getContentType(){ return m_strContentType; }
|
20
|
+
virtual int getVersion(){ return 3; }
|
21
|
+
|
22
|
+
String getLoginUrl()
|
23
|
+
{
|
24
|
+
return RHOCONF().getPath("syncserver") + "clientlogin";
|
25
|
+
}
|
26
|
+
|
27
|
+
String getLoginBody( const String& name, const String& password)
|
28
|
+
{
|
29
|
+
return "{\"login\":\"" + name + "\",\"password\":\"" + password + "\",\"remember_me\":1}";
|
30
|
+
}
|
31
|
+
|
32
|
+
String getClientCreateUrl()
|
33
|
+
{
|
34
|
+
return RHOCONF().getPath("syncserver") + "clientcreate";
|
35
|
+
}
|
36
|
+
|
37
|
+
String getClientRegisterUrl()
|
38
|
+
{
|
39
|
+
return RHOCONF().getPath("syncserver") + "clientregister";
|
40
|
+
}
|
41
|
+
|
42
|
+
String getClientRegisterBody( const String& strClientID, const String& strPin, int nPort, const String& strType )
|
43
|
+
{
|
44
|
+
return "{\"client_id\":\"" + strClientID +
|
45
|
+
"\",\"device_pin\":\"" + strPin +
|
46
|
+
"\",\"device_port\":\"" + common::convertToStringA(nPort) +
|
47
|
+
"\",\"device_type\":\"" + strType + "\"}";
|
48
|
+
}
|
49
|
+
|
50
|
+
String getClientResetUrl(const String& strClientID)
|
51
|
+
{
|
52
|
+
return RHOCONF().getPath("syncserver") + "clientreset?client_id=" + strClientID;
|
53
|
+
}
|
54
|
+
|
55
|
+
String getClientChangesUrl()
|
56
|
+
{
|
57
|
+
String strUrl = RHOCONF().getPath("syncserver");
|
58
|
+
return strUrl.substr(0,strUrl.length()-1);
|
59
|
+
}
|
60
|
+
|
61
|
+
String getServerQueryUrl(const String& strAction )
|
62
|
+
{
|
63
|
+
String strUrl = RHOCONF().getPath("syncserver");
|
64
|
+
if ( strAction.length() > 0 )
|
65
|
+
strUrl = common::CFilePath::join(strUrl, strAction);
|
66
|
+
else
|
67
|
+
strUrl = strUrl.substr(0,strUrl.length()-1);
|
68
|
+
|
69
|
+
return strUrl;
|
70
|
+
}
|
71
|
+
|
72
|
+
String getServerQueryBody(const String& strSrcName, const String& strClientID, int nPageSize )
|
73
|
+
{
|
74
|
+
String strQuery = "?client_id=" + strClientID +
|
75
|
+
"&p_size=" + common::convertToStringA(nPageSize) + "&version=3";
|
76
|
+
|
77
|
+
if ( strSrcName.length() > 0 )
|
78
|
+
strQuery += "&source_name=" + strSrcName;
|
79
|
+
|
80
|
+
return strQuery;
|
81
|
+
}
|
82
|
+
|
83
|
+
};
|
84
|
+
|
85
|
+
}
|
86
|
+
}
|