rhodes 2.2.6 → 2.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +20 -0
- data/README.md +46 -0
- data/Rakefile +85 -80
- data/bin/rhodes +2 -2
- data/bin/rhogen +1 -1
- data/doc/application.txt +277 -0
- data/doc/bb-css.txt +209 -0
- data/doc/build.txt +785 -0
- data/doc/configuration.txt +236 -0
- data/doc/connect-to-web-services.txt +282 -0
- data/doc/contributing.txt +64 -0
- data/doc/css-framework.txt +144 -0
- data/doc/device-caps.txt +1152 -0
- data/doc/extensions.txt +528 -0
- data/doc/files.txt +4 -0
- data/doc/generator.txt +141 -0
- data/doc/install.txt +35 -0
- data/doc/introduction.txt +88 -0
- data/doc/rhom.txt +826 -0
- data/doc/standard-css.txt +392 -0
- data/doc/synchronization.txt +542 -0
- data/doc/test-log-debug.txt +148 -0
- data/doc/tutorial.txt +136 -0
- data/doc/ui.txt +766 -0
- data/installer/EnvVarUpdate.nsh +328 -0
- data/installer/README.html +81 -0
- data/installer/RHOSYNC-LICENSE.txt +675 -0
- data/installer/icon.ico +0 -0
- data/installer/instant-rhodes.nsi +427 -0
- data/lib/build/jake.rb +15 -1
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/imageprovider.cpp +1 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/Barcode6.files +45 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/bb/barcode6.jdp +92 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +7 -4
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +2 -1
- data/lib/extensions/barcode/ext/barcode/platform/wm/src/wm_imageprovider.cpp +1 -1
- data/lib/extensions/digest-sha1/ext/build.bat +1 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +335 -0
- data/lib/extensions/esri/ext/build +17 -0
- data/lib/extensions/esri/ext/build.bat +29 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.h +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactory.mm +58 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewFactoryRegister.mm +22 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.h +21 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/ESRIViewManager.mm +32 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/InitESRI.c +5 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +143 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +919 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +320 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI_Prefix.pch +7 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +76 -0
- data/lib/extensions/esri/ext.yml +3 -0
- data/lib/extensions/net-http/monitor.rb +265 -0
- data/lib/extensions/net-http/net/ftp.rb +981 -0
- data/lib/extensions/net-http/thread.rb +367 -0
- data/lib/extensions/rhocgi/cgi.rb +16 -0
- data/lib/extensions/rhospec/rhospec.rb +118 -0
- data/lib/framework/base64.rb +91 -0
- data/lib/framework/builtinME.rb +13 -10
- data/lib/framework/ostruct.rb +145 -0
- data/lib/framework/res/back_btn.wm.png +0 -0
- data/lib/framework/res/blue_pushpin.wm.png +0 -0
- data/lib/framework/res/blue_pushpin_small.wm.png +0 -0
- data/lib/framework/res/callout.wm.png +0 -0
- data/lib/framework/res/callout_link.wm.png +0 -0
- data/lib/framework/res/forward_btn.wm.png +0 -0
- data/lib/framework/res/home_btn.wm.png +0 -0
- data/lib/framework/res/options_btn.wm.png +0 -0
- data/lib/framework/res/refresh_btn.wm.png +0 -0
- data/lib/framework/rho/render.rb +5 -2
- data/lib/framework/rho/rho.rb +320 -50
- data/lib/framework/rho/rhoapplication.rb +48 -10
- data/lib/framework/rho/rhonativeviewmanager.rb +73 -0
- data/lib/framework/rho/rhosupport.rb +15 -1
- data/lib/framework/rho/rhotabbar.rb +29 -0
- data/lib/framework/rho/rhotoolbar.rb +17 -0
- data/lib/framework/rho/rhoutils.rb +22 -6
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +4 -3
- data/lib/framework/rholang/rhomsg_en.rb +1 -0
- data/lib/framework/rholang/rhomsg_es.rb +1 -0
- data/lib/framework/rholang/rhomsg_it.rb +1 -0
- data/lib/framework/rhom/rhom.rb +31 -10
- data/lib/framework/rhom/rhom_db_adapter.rb +33 -23
- data/lib/framework/rhom/rhom_object_factory.rb +465 -249
- data/lib/framework/rhom/rhom_source.rb +22 -7
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +83 -20
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +5 -0
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +2 -0
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +9 -5
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesAppOptions.h +53 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +46 -56
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +10 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mapview_MapView.h +93 -0
- data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +38 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +64 -8
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +6 -0
- data/platform/android/Rhodes/jni/src/alert.cpp +5 -11
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +66 -29
- data/platform/android/Rhodes/jni/src/callbacks.cpp +24 -21
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -6
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +13 -11
- data/platform/android/Rhodes/jni/src/event.cpp +9 -15
- data/platform/android/Rhodes/jni/src/fileapi.cpp +13 -27
- data/platform/android/Rhodes/jni/src/logconf.cpp +3 -3
- data/platform/android/Rhodes/jni/src/mapview.cpp +696 -16
- data/platform/android/Rhodes/jni/src/menu.cpp +3 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +55 -4
- data/platform/android/Rhodes/jni/src/nativeview.cpp +33 -0
- data/platform/android/Rhodes/jni/src/phonebook.cpp +6 -11
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +4 -4
- data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +87 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +55 -34
- data/platform/android/Rhodes/jni/src/ringtones.cpp +2 -3
- data/platform/android/Rhodes/jni/src/signature.cpp +3 -5
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +7 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +17 -20
- data/platform/android/Rhodes/jni/src/webview.cpp +13 -12
- data/platform/android/Rhodes/res/drawable/callout.png +0 -0
- data/platform/android/Rhodes/res/drawable/callout_link.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_cancel.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_clear.png +0 -0
- data/platform/android/Rhodes/res/drawable/signature_ok.png +0 -0
- data/platform/android/Rhodes/res/layout/datetime.xml +4 -0
- data/platform/android/Rhodes/res/layout/signature.xml +24 -17
- data/platform/android/Rhodes/res/layout/status_bar_ongoing_event_progress_bar.xml +102 -0
- data/platform/android/Rhodes/res/values/strings.xml +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Base64.java +575 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +83 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +21 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +23 -15
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +151 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +372 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +58 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +705 -523
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +167 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +36 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +4 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +33 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +2 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +106 -36
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +15 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +4 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +91 -27
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +6 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +275 -42
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +1 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +120 -43
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +518 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +434 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +20 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +296 -336
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +111 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +77 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +6 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +6 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +0 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +9 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +8 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +11 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +3 -5
- data/platform/android/build/RhodesSRC_build.files +32 -23
- data/platform/android/build/android.rake +28 -11
- data/platform/android/build/androidcommon.rb +2 -0
- data/platform/android/build/librhocommon_build.files +9 -5
- data/platform/android/build/librhodes_build.files +1 -0
- data/platform/android/build/libruby_build.files +1 -0
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +10 -2
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +37 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Column.java +5 -5
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Function.java +73 -78
- data/platform/bb/Hsqldb/src/org/hsqldb/Library.java +288 -8
- data/platform/bb/RubyVM/RubyVM.jdp +3 -0
- data/platform/bb/RubyVM/src/com/rho/FilePath.java +13 -1
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +12 -0
- data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +18 -1
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +128 -108
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +9 -10
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +16 -1
- data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +20 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +5 -2
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +65 -46
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +192 -50
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +8 -114
- data/platform/bb/RubyVM/src/com/rho/db/DBException.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +5 -3
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +5 -1
- data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +109 -0
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +85 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +12 -4
- data/platform/bb/RubyVM/src/com/rho/net/NetResponse.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +37 -23
- data/platform/bb/RubyVM/src/com/rho/net/URI.java +84 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +119 -61
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +61 -24
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +108 -54
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +121 -163
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +23 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyMutex.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRange.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyRegexp.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +208 -25
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +3 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RhoSupport.java +5 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +12 -5
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyID.java +1 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +16 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyValue.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/stdlib/RubyStringIO.java +4 -1
- data/platform/bb/{Hsqldb → RubyVM}/src/j2me/math/Number.java +33 -0
- data/platform/bb/build/RubyVM_build.files +3 -0
- data/platform/bb/build/bb.rake +140 -62
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -0
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +43 -7
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +23 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +5 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +3 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +12 -2
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +2 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +2 -0
- data/platform/bb/rhodes/resources/mappin.png +0 -0
- data/platform/bb/rhodes/rhodes.jdp +3 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +21 -18
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +150 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +1 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +63 -4
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -5
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +242 -2
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +143 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +269 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +446 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +1 -1
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +71 -14
- data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +4 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +28 -12
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +100 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +3 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/NativeBar.java +32 -0
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +9 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +174 -41
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +52 -3
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +33 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +2 -14
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +686 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +14 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +13 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +174 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +104 -330
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +79 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +35 -12
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +2 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +336 -44
- data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +3 -6
- data/platform/iphone/Classes/AppManager/AppManager.m +19 -4
- data/platform/iphone/Classes/DateTime.h +4 -0
- data/platform/iphone/Classes/DateTime.m +1 -1
- data/platform/iphone/Classes/DateTimePicker.m +8 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.m +7 -1
- data/platform/iphone/Classes/Event/Event.m +2 -2
- data/platform/iphone/Classes/MapView/MapViewController.h +4 -1
- data/platform/iphone/Classes/MapView/MapViewController.m +6 -46
- data/platform/iphone/Classes/MapView/MapViewManager.h +26 -0
- data/platform/iphone/Classes/MapView/MapViewManager.m +172 -0
- data/platform/iphone/Classes/NativeBar.h +34 -0
- data/platform/iphone/Classes/NativeBar.m +131 -26
- data/platform/iphone/Classes/NativeView/NVDelegate.h +26 -0
- data/platform/iphone/Classes/NativeView/NVDelegate.m +40 -0
- data/platform/iphone/Classes/NativeView/NVViewController.h +24 -0
- data/platform/iphone/Classes/NativeView/NVViewController.m +90 -0
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +449 -0
- data/platform/iphone/Classes/{RhoNativeViewManagerOC.h → NativeView/RhoNativeViewManagerOC.h} +15 -0
- data/platform/iphone/Classes/RhoAlert.m +3 -3
- data/platform/iphone/Classes/RhoMainView.h +3 -0
- data/platform/iphone/Classes/Rhodes.h +6 -2
- data/platform/iphone/Classes/Rhodes.m +47 -79
- data/platform/iphone/Classes/Signature/SignatureViewController.m +1 -0
- data/platform/iphone/Classes/SimpleMainView.h +18 -1
- data/platform/iphone/Classes/SimpleMainView.m +180 -35
- data/platform/iphone/Classes/SplitView/LeftViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/LeftViewController.m +13 -7
- data/platform/iphone/Classes/SplitView/RightViewController.h +1 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +26 -11
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +1 -6
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +14 -52
- data/platform/iphone/Classes/TabbedMainView.h +25 -3
- data/platform/iphone/Classes/TabbedMainView.m +340 -14
- data/platform/iphone/ESRI/BluePushpin.png +0 -0
- data/platform/iphone/ESRI/BluePushpin@2x.png +0 -0
- data/platform/iphone/ESRI/esri.png +0 -0
- data/platform/iphone/ESRI/esri@2x.png +0 -0
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +26 -3
- data/platform/iphone/rbuild/iphone.rake +100 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +116 -12
- data/platform/shared/SyncClient/SyncClient.cpp +29 -3
- data/platform/shared/SyncClient/SyncClient.h +2 -1
- data/platform/shared/common/IRhoClassFactory.h +3 -0
- data/platform/shared/common/IRhoCrypt.h +16 -0
- data/platform/shared/common/IRhoThreadImpl.h +1 -0
- data/platform/shared/common/RhoAppAdapter.h +2 -0
- data/platform/shared/common/RhoConf.cpp +97 -46
- data/platform/shared/common/RhoConf.h +14 -13
- data/platform/shared/common/RhoFile.cpp +10 -0
- data/platform/shared/common/RhoFile.h +1 -0
- data/platform/shared/common/RhoMath.cpp +43 -0
- data/platform/shared/common/RhoMath.h +27 -0
- data/platform/shared/common/RhoNativeViewManager.h +27 -1
- data/platform/shared/common/RhoPort.h +11 -0
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoThread.cpp +1 -1
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +381 -139
- data/platform/shared/common/RhodesApp.h +24 -10
- data/platform/shared/common/RhodesAppBase.cpp +72 -1
- data/platform/shared/common/RhodesAppBase.h +5 -1
- data/platform/shared/common/SplashScreen.h +4 -4
- data/platform/shared/common/ThreadQueue.cpp +44 -17
- data/platform/shared/common/ThreadQueue.h +4 -0
- data/platform/shared/common/app_build_configs.c +0 -1
- data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
- data/platform/shared/common/iphone/RhoCryptImpl.h +47 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +286 -0
- data/platform/shared/common/map/ESRIMapEngine.cpp +921 -0
- data/platform/shared/common/map/ESRIMapEngine.h +255 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +160 -0
- data/platform/shared/common/map/GoogleMapEngine.h +52 -0
- data/platform/shared/common/map/MapEngine.cpp +304 -0
- data/platform/shared/common/map/MapEngine.h +214 -0
- data/platform/shared/db/DBAdapter.cpp +147 -18
- data/platform/shared/db/DBAdapter.h +38 -12
- data/platform/shared/db/DBAttrManager.cpp +4 -3
- data/platform/shared/db/DBAttrManager.h +7 -7
- data/platform/shared/db/res/db/syncdb.triggers +0 -5
- data/platform/shared/db/res/db/syncdb_java.triggers +21 -0
- data/platform/shared/json/JSONIterator.cpp +11 -1
- data/platform/shared/json/JSONIterator.h +1 -0
- data/platform/shared/logging/RhoLogConf.cpp +29 -12
- data/platform/shared/net/CURLNetRequest.cpp +80 -25
- data/platform/shared/net/CURLNetRequest.h +6 -2
- data/platform/shared/net/HttpServer.cpp +12 -6
- data/platform/shared/net/HttpServer.h +2 -1
- data/platform/shared/net/INetRequest.h +1 -0
- data/platform/shared/ruby/ext/alert/alert.i +5 -0
- data/platform/shared/ruby/ext/alert/alert_wrap.c +439 -108
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +42 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +521 -120
- data/platform/shared/ruby/ext/nativebar/nativebar.i +16 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +623 -128
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager.i +18 -0
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +2321 -0
- data/platform/shared/ruby/ext/rho/extensions.c +0 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +53 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +6 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +6 -3
- data/platform/shared/ruby/ext/syncengine/syncengine.i +9 -1
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +61 -0
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +33 -5
- data/platform/shared/rubyext/RhoAppAdapter.cpp +11 -1
- data/platform/shared/rubyext/System.cpp +9 -0
- data/platform/shared/rubyext/WebView.h +1 -0
- data/platform/shared/sqlite/crypto.c +907 -0
- data/platform/shared/sqlite/sqlite3.c +6 -0
- data/platform/shared/sync/SyncEngine.cpp +49 -19
- data/platform/shared/sync/SyncEngine.h +0 -1
- data/platform/shared/sync/SyncNotify.cpp +14 -5
- data/platform/shared/sync/SyncNotify.h +2 -2
- data/platform/shared/sync/SyncSource.cpp +79 -33
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +26 -11
- data/platform/shared/xruby/src/com/xruby/compiler/codedom/StringExpression.java +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +108 -72
- data/platform/wm/build/wm.rake +6 -0
- data/platform/wm/rhodes/Alert.cpp +4 -3
- data/platform/wm/rhodes/Alert.h +1 -1
- data/platform/wm/rhodes/DateTimePicker.cpp +30 -3
- data/platform/wm/rhodes/DateTimePicker.h +9 -1
- data/platform/wm/rhodes/MainWindow.cpp +121 -61
- data/platform/wm/rhodes/MainWindow.h +29 -4
- data/platform/wm/rhodes/MapView/Graphics.cpp +547 -0
- data/platform/wm/rhodes/MapView/Graphics.h +136 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +391 -0
- data/platform/wm/rhodes/MapView/MapViewManager.h +158 -0
- data/platform/wm/rhodes/RhoCryptImpl.cpp +248 -0
- data/platform/wm/rhodes/RhoCryptImpl.h +51 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +208 -0
- data/platform/wm/rhodes/Rhodes.cpp +94 -102
- data/platform/wm/rhodes/Rhodes.rc +27 -0
- data/platform/wm/rhodes/SyncStatusDlg.cpp +1 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +2 -1
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +7 -4
- data/platform/wm/rhodes/camera/Camera.cpp +36 -15
- data/platform/wm/rhodes/camera/Camera.h +0 -4
- data/platform/wm/rhodes/resource.h +10 -2
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +7 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +1 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +10 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +10 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +513 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +74 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +22 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +38 -2
- data/platform/wm/rhodes/stdafx.h +2 -1
- data/platform/wm/rubylib/rubylib.vcproj +12 -0
- data/rakefile.rb +85 -80
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +14 -3
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +2 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/templates/application/app/application.rb +2 -2
- data/res/generators/templates/application/app/helpers/application_helper.rb +1 -1
- data/res/generators/templates/application/public/css/android.css +1 -0
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
- data/res/generators/templates/application/rhoconfig.txt +66 -14
- data/rhodes.gemspec +3 -3
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +7 -3
- data/spec/framework_spec/build.yml +1 -1
- data/spec/phone_spec/Rakefile +1 -0
- data/spec/phone_spec/app/Account/account.rb +2 -0
- data/spec/phone_spec/app/Account_s/account_s.rb +7 -0
- data/spec/phone_spec/app/spec/{fixtures → array/fixtures}/classes.rb +0 -0
- data/spec/phone_spec/app/spec/{array_pack_spec.rb → array/pack_spec.rb} +2 -1
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/contacts_spec.rb +2 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +34 -233
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +396 -87
- data/spec/phone_spec/app/spec/string/element_set_spec.rb +251 -0
- data/spec/phone_spec/app/spec/string/end_with_spec.rb +49 -0
- data/spec/phone_spec/app/spec/string/fixtures/classes.rb +27 -0
- data/spec/phone_spec/app/spec/{lstrip_spec.rb → string/lstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/replace_spec.rb +52 -0
- data/spec/phone_spec/app/spec/{rstrip_spec.rb → string/rstrip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/string/slice_spec.rb +473 -0
- data/spec/phone_spec/app/spec/string/split_spec.rb +302 -0
- data/spec/phone_spec/app/spec/string/start_with_spec.rb +48 -0
- data/spec/phone_spec/app/spec/{strip_spec.rb → string/strip_spec.rb} +0 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +30 -1
- data/spec/phone_spec/app/spec_runner.rb +15 -7
- data/spec/phone_spec/build.yml +2 -2
- metadata +154 -25
- data/README.textile +0 -45
- data/platform/android/Rhodes/AndroidManifest.full.xml +0 -62
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/Manifest.java +0 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoActivity.java +0 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +0 -193
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -25
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +0 -22
- data/platform/bb/RubyVM/src/com/rho/Capabilities.java +0 -6
- data/platform/bb/RubyVM/src/com/rho/Extensions.java +0 -11
- data/platform/iphone/Classes/RhoNativeViewManager.mm +0 -226
data/CHANGELOG
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## 2.3
|
2
|
+
* ESRI map support on all platforms
|
3
|
+
* Add Infinite Peripherals extension
|
4
|
+
* Encryption database support for all platforms
|
5
|
+
* Support built-in sqlite database on Blackberry
|
6
|
+
* Fix IN operation in Rhom find conditions
|
7
|
+
* Add browser_helper methods to partials
|
8
|
+
* Native Toolbar improvements, add support for Windows Mobile
|
9
|
+
* Add Range to DateTime Picker
|
10
|
+
* Add rake commands to reuse Blackberry simulator
|
11
|
+
* Stop GPS by inactivity.
|
12
|
+
* Run external application with parameters
|
13
|
+
* Improve startup time on iPhone and Blackberry
|
14
|
+
* Add NativeToolbar and NativeTabbar classes
|
15
|
+
* Place non-synced sources in 'local' partition
|
16
|
+
* Rhoconfig support conflict resolution after application upgrade
|
17
|
+
* Fix Barcode for Blackbery 6
|
18
|
+
* Fix issue with input type="number" in jquery
|
19
|
+
* Support on_ui_created and on_ui_destroyed in Application class
|
20
|
+
|
1
21
|
## 2.2.6
|
2
22
|
* Fix issue with adding new model(duplicate source_id)
|
3
23
|
* Fix issue with JSON parse of Unicode codes(\u00AB)
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Rhodes
|
2
|
+
===
|
3
|
+
|
4
|
+
The [Rhodes framework](http://github.com/rhomobile/rhodes) is a framework for building locally executing, device-optimized mobile applications for smartphone devices. These applications are optimized for interacting with transactional enterprise application backends (with synced local data via [RhoSync](http://github.com/rhomobile/rhosync)). Rhodes is available for iPhone, Windows Mobile, and Research in Motion (Blackberry) smartphones.
|
5
|
+
|
6
|
+
Rhodes is available as an open source product under the MIT license. For developers interested a commercial license is still [available](http://rhomobile.com/products/rhodes/license/).
|
7
|
+
|
8
|
+
## Introduction
|
9
|
+
|
10
|
+
Rhodes takes much of its inspiration from web-oriented MVC style frameworks such as Ruby on Rails. However it has several simplifications and optimizations for the mobile scenario. Some of these are to make it easier for the developer. Most of them are to keep the framework as lightweight as possible to be able to run on mobile devices with limited memory. As with developing apps on any good app framework (Rails, Merb, Django), building a Rhodes mobile application consists of building a set of files and putting them into the right directories for the respective models.
|
11
|
+
|
12
|
+
## Installing Rhodes
|
13
|
+
|
14
|
+
Install Rhodes:
|
15
|
+
|
16
|
+
$ gem install rhodes
|
17
|
+
|
18
|
+
## Generating an Application
|
19
|
+
|
20
|
+
Rhodes features an application generator called 'rhodes' that generates a controller and views for a given model. The syntax for running Rhodes is:
|
21
|
+
|
22
|
+
$ rhodes app appname
|
23
|
+
|
24
|
+
This will generate a new directory called `appname` with several application files.
|
25
|
+
|
26
|
+
## Generate a Model and Associated Controller and Templates
|
27
|
+
|
28
|
+
$ cd appname
|
29
|
+
$ rhodes model modelname options
|
30
|
+
|
31
|
+
This will generate a model file, controller file, and several views (corresponding to the actions below). Each Rhodes model has several actions to perform basic CRUD (create, read, update and delete) on the object generated by default by the scaffold . Specifically the template views generated are:
|
32
|
+
|
33
|
+
* index - to list all objects
|
34
|
+
* new - to display the editing form for creating a new object
|
35
|
+
* edit - to edit the actual object
|
36
|
+
* show - to show the object attributes
|
37
|
+
|
38
|
+
## More Resources
|
39
|
+
|
40
|
+
There is a [tutorial available](http://wiki.rhomobile.com/index.php/Tutorial) on the [Rhomobile site](http://www.rhomobile.com). This includes thorough and current platform-by-platform build instructions.
|
41
|
+
|
42
|
+
The [Rhodes Developer Reference](http://wiki.rhomobile.com/index.php/Rhodes) for full documentation on the Rhodes framework.
|
43
|
+
|
44
|
+
For further questions [email us](mailto:info@rhomobile.com) or join the [Google Group](http://groups.google.com/group/rhomobile).
|
45
|
+
|
46
|
+
For questions on licensing contact [our sales team](mailto:sales@rhomobile.com).
|
data/Rakefile
CHANGED
@@ -51,20 +51,62 @@ namespace "framework" do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
|
54
|
-
$application_build_configs_keys = ['security_token']
|
54
|
+
$application_build_configs_keys = ['security_token', 'encrypt_database']
|
55
55
|
|
56
56
|
def make_application_build_config_header_file
|
57
|
-
|
58
|
-
|
57
|
+
f = StringIO.new("", "w+")
|
58
|
+
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
59
|
+
#f.puts "// Generated #{Time.now.to_s}"
|
60
|
+
f.puts ""
|
61
|
+
f.puts "#include <string.h>"
|
62
|
+
f.puts ""
|
63
|
+
f.puts '#include "app_build_configs.h"'
|
64
|
+
f.puts ""
|
65
|
+
|
66
|
+
f.puts 'static const char* keys[] = { ""'
|
67
|
+
$application_build_configs.keys.each do |key|
|
68
|
+
f.puts ',"'+key+'"'
|
69
|
+
end
|
70
|
+
f.puts '};'
|
71
|
+
f.puts ''
|
72
|
+
|
73
|
+
count = 1
|
74
|
+
|
75
|
+
f.puts 'static const char* values[] = { ""'
|
76
|
+
$application_build_configs.keys.each do |key|
|
77
|
+
f.puts ',"'+$application_build_configs[key]+'"'
|
78
|
+
count = count + 1
|
79
|
+
end
|
80
|
+
f.puts '};'
|
81
|
+
f.puts ''
|
82
|
+
|
83
|
+
f.puts '#define APP_BUILD_CONFIG_COUNT '+count.to_s
|
84
|
+
f.puts ''
|
85
|
+
f.puts 'const char* get_app_build_config_item(const char* key) {'
|
86
|
+
f.puts ' int i;'
|
87
|
+
f.puts ' for (i = 1; i < APP_BUILD_CONFIG_COUNT; i++) {'
|
88
|
+
f.puts ' if (strcmp(key, keys[i]) == 0) {'
|
89
|
+
f.puts ' return values[i];'
|
90
|
+
f.puts ' }'
|
91
|
+
f.puts ' }'
|
92
|
+
f.puts ' return 0;'
|
93
|
+
f.puts '}'
|
94
|
+
f.puts ''
|
95
|
+
|
96
|
+
Jake.modify_file_if_content_changed(File.join($startdir, "platform", "shared", "common", "app_build_configs.c"), f)
|
97
|
+
end
|
98
|
+
|
99
|
+
def make_application_build_config_java_file
|
100
|
+
|
101
|
+
f = StringIO.new("", "w+")
|
59
102
|
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
60
|
-
f.puts "// Generated #{Time.now.to_s}"
|
61
|
-
|
62
|
-
f.puts "
|
63
|
-
f.puts ""
|
64
|
-
f.puts '#include "app_build_configs.h"'
|
103
|
+
#f.puts "// Generated #{Time.now.to_s}"
|
104
|
+
|
105
|
+
f.puts "package com.rho;"
|
65
106
|
f.puts ""
|
66
|
-
|
67
|
-
|
107
|
+
f.puts "public class AppBuildConfig {"
|
108
|
+
|
109
|
+
f.puts 'static final String keys[] = { ""'
|
68
110
|
$application_build_configs.keys.each do |key|
|
69
111
|
f.puts ',"'+key+'"'
|
70
112
|
end
|
@@ -73,7 +115,7 @@ def make_application_build_config_header_file
|
|
73
115
|
|
74
116
|
count = 1
|
75
117
|
|
76
|
-
f.puts 'static
|
118
|
+
f.puts 'static final String values[] = { ""'
|
77
119
|
$application_build_configs.keys.each do |key|
|
78
120
|
f.puts ',"'+$application_build_configs[key]+'"'
|
79
121
|
count = count + 1
|
@@ -81,62 +123,19 @@ def make_application_build_config_header_file
|
|
81
123
|
f.puts '};'
|
82
124
|
f.puts ''
|
83
125
|
|
84
|
-
f.puts '
|
126
|
+
f.puts 'static final int APP_BUILD_CONFIG_COUNT = '+count.to_s + ';'
|
85
127
|
f.puts ''
|
86
|
-
f.puts '
|
87
|
-
f.puts ' int i;'
|
88
|
-
f.puts '
|
89
|
-
f.puts ' if (strcmp(key, keys[i]) == 0) {'
|
128
|
+
f.puts 'public static String getItem(String key){'
|
129
|
+
f.puts ' for (int i = 1; i < APP_BUILD_CONFIG_COUNT; i++) {'
|
130
|
+
f.puts ' if ( key.compareTo( keys[i]) == 0) {'
|
90
131
|
f.puts ' return values[i];'
|
91
132
|
f.puts ' }'
|
92
133
|
f.puts ' }'
|
93
|
-
f.puts ' return
|
134
|
+
f.puts ' return null;'
|
94
135
|
f.puts '}'
|
95
|
-
f.puts
|
96
|
-
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def make_application_build_config_java_file
|
101
|
-
file_name = $startdir + "/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java"
|
102
|
-
|
103
|
-
File.open(file_name, "w") do |f|
|
104
|
-
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
105
|
-
f.puts "// Generated #{Time.now.to_s}"
|
106
|
-
|
107
|
-
f.puts "package com.rho;"
|
108
|
-
f.puts ""
|
109
|
-
f.puts "public class AppBuildConfig {"
|
110
|
-
|
111
|
-
f.puts 'static final String keys[] = { ""'
|
112
|
-
$application_build_configs.keys.each do |key|
|
113
|
-
f.puts ',"'+key+'"'
|
114
|
-
end
|
115
|
-
f.puts '};'
|
116
|
-
f.puts ''
|
136
|
+
f.puts "}"
|
117
137
|
|
118
|
-
|
119
|
-
|
120
|
-
f.puts 'static final String values[] = { ""'
|
121
|
-
$application_build_configs.keys.each do |key|
|
122
|
-
f.puts ',"'+$application_build_configs[key]+'"'
|
123
|
-
count = count + 1
|
124
|
-
end
|
125
|
-
f.puts '};'
|
126
|
-
f.puts ''
|
127
|
-
|
128
|
-
f.puts 'static final int APP_BUILD_CONFIG_COUNT = '+count.to_s + ';'
|
129
|
-
f.puts ''
|
130
|
-
f.puts 'public static String getItem(String key){'
|
131
|
-
f.puts ' for (int i = 1; i < APP_BUILD_CONFIG_COUNT; i++) {'
|
132
|
-
f.puts ' if ( key.compareTo( keys[i]) == 0) {'
|
133
|
-
f.puts ' return values[i];'
|
134
|
-
f.puts ' }'
|
135
|
-
f.puts ' }'
|
136
|
-
f.puts ' return null;'
|
137
|
-
f.puts '}'
|
138
|
-
f.puts "}"
|
139
|
-
end
|
138
|
+
Jake.modify_file_if_content_changed( File.join( $startdir, "platform/bb/RubyVM/src/com/rho/AppBuildConfig.java" ), f )
|
140
139
|
end
|
141
140
|
|
142
141
|
namespace "config" do
|
@@ -305,7 +304,7 @@ def init_extensions(startdir, dest)
|
|
305
304
|
extentries = []
|
306
305
|
extlibs = []
|
307
306
|
extpaths = $app_config["extpaths"]
|
308
|
-
|
307
|
+
|
309
308
|
$app_config["extensions"].each do |extname|
|
310
309
|
extpath = nil
|
311
310
|
extpaths.each do |p|
|
@@ -350,8 +349,10 @@ def init_extensions(startdir, dest)
|
|
350
349
|
|
351
350
|
end
|
352
351
|
|
352
|
+
exts = File.join($startdir, "platform", "shared", "ruby", "ext", "rho", "extensions.c")
|
353
|
+
|
354
|
+
#if $config["platform"] != "bb" && !FileUtils.uptodate?(exts,[File.join($app_path, "build.yml")])
|
353
355
|
if $config["platform"] != "bb"
|
354
|
-
exts = File.join($startdir, "platform", "shared", "ruby", "ext", "rho", "extensions.c")
|
355
356
|
exists = []
|
356
357
|
File.new(exts, "r").read.split("\n").each do |line|
|
357
358
|
next if line !~ /^\s*extern\s+void\s+([A-Za-z_][A-Za-z0-9_]*)/
|
@@ -361,7 +362,7 @@ def init_extensions(startdir, dest)
|
|
361
362
|
if exists.sort! != extentries.sort!
|
362
363
|
File.open(exts, "w") do |f|
|
363
364
|
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
364
|
-
f.puts "// Generated #{Time.now.to_s}"
|
365
|
+
#f.puts "// Generated #{Time.now.to_s}"
|
365
366
|
if $config["platform"] == "wm" || $config["platform"] == "win32"
|
366
367
|
# Add libraries through pragma
|
367
368
|
extlibs.each do |lib|
|
@@ -434,6 +435,7 @@ def common_bundle_start(startdir, dest)
|
|
434
435
|
|
435
436
|
app_version = "\r\napp_version='#{$app_config["version"]}'"
|
436
437
|
File.open(File.join($srcdir,'apps/rhoconfig.txt'), "a"){ |f| f.write(app_version) }
|
438
|
+
File.open(File.join($srcdir,'apps/rhoconfig.txt.timestamp'), "w"){ |f| f.write(Time.now.to_f().to_s()) }
|
437
439
|
|
438
440
|
unless $debug
|
439
441
|
rm_rf $srcdir + "/apps/app/test"
|
@@ -446,24 +448,27 @@ def common_bundle_start(startdir, dest)
|
|
446
448
|
|
447
449
|
copy_assets($assetfolder) if ($assetfolder and File.exists? $assetfolder)
|
448
450
|
|
449
|
-
chdir File.join($srcdir,'apps')
|
450
|
-
|
451
451
|
replace_platform = $config['platform']
|
452
452
|
replace_platform = "bb6" if $bb6
|
453
|
-
|
454
|
-
oldfile = file.gsub(Regexp.new(Regexp.escape('.') + replace_platform + Regexp.escape('.')),'.')
|
455
|
-
rm oldfile if File.exists? oldfile
|
456
|
-
mv file,oldfile
|
457
|
-
end
|
453
|
+
replace_platform = "wm" if replace_platform == 'win32'
|
458
454
|
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
455
|
+
[File.join($srcdir,'apps'), ($current_platform == "bb" ? File.join($srcdir,'res') : File.join($srcdir,'lib/res'))].each do |folder|
|
456
|
+
chdir folder
|
457
|
+
|
458
|
+
Dir.glob("**/*.#{replace_platform}.*").each do |file|
|
459
|
+
oldfile = file.gsub(Regexp.new(Regexp.escape('.') + replace_platform + Regexp.escape('.')),'.')
|
460
|
+
rm oldfile if File.exists? oldfile
|
461
|
+
mv file,oldfile
|
462
|
+
end
|
463
|
+
|
464
|
+
Dir.glob("**/*.wm.*").each { |f| rm f }
|
465
|
+
Dir.glob("**/*.iphone.*").each { |f| rm f }
|
466
|
+
Dir.glob("**/*.bb.*").each { |f| rm f }
|
467
|
+
Dir.glob("**/*.bb6.*").each { |f| rm f }
|
468
|
+
Dir.glob("**/*.android.*").each { |f| rm f }
|
469
|
+
Dir.glob("**/.svn").each { |f| rm_rf f }
|
470
|
+
Dir.glob("**/CVS").each { |f| rm_rf f }
|
471
|
+
end
|
467
472
|
end
|
468
473
|
|
469
474
|
def create_manifest
|
@@ -931,4 +936,4 @@ namespace "build" do
|
|
931
936
|
|
932
937
|
rm_rf bin_dir
|
933
938
|
end
|
934
|
-
end
|
939
|
+
end
|
data/bin/rhodes
CHANGED
data/bin/rhogen
CHANGED
data/doc/application.txt
ADDED
@@ -0,0 +1,277 @@
|
|
1
|
+
# Rhodes Application
|
2
|
+
|
3
|
+
## App structure
|
4
|
+
The Rhodes application generator generates a basic application from the "rhodes app" option. It will generate subdirectories and controller and template files when specifying a model and actions. Please refer to the [Rhodes generator](generator) documentation for more detailed information about the Rhodes directory structure.
|
5
|
+
|
6
|
+
### Example Directory Structure
|
7
|
+
As an example, /sugar could be the root folder for an application that provides mobile access to SugarCRM. The app's root directory will contain a few .erb files, depending on the app's functionality. At the very least there will be an index.erb file that serves as the default landing page. This default landing page will typically have links to the controllers for some of the data models, and is not associated with any specific controller. In case the application needs a default landing page associated with a controller, it is recommended to create a model/controller/view folder and use an action on this controller as a default start path. To do that, edit the start_path property in the [Configuration]() framework configuration file.
|
8
|
+
|
9
|
+
## Model/View/Controller
|
10
|
+
By convention, files for each Model include a controller, a model class and view templates described below.
|
11
|
+
|
12
|
+
### Controller
|
13
|
+
Developer may create any number of controller actions by simple defining new methods in the controller class. Each action associated with url and can be performed by calling that url from the View in the WebView control. WebView control is a Web Browser imbedded in the application UI.
|
14
|
+
|
15
|
+
For example, if you have Account Model your controller actions will be in account_controller.rb file. To defined action 'list' you will create method 'list' in the account_controller.rb file:
|
16
|
+
:::ruby
|
17
|
+
def list
|
18
|
+
#implement required business logic here
|
19
|
+
#...
|
20
|
+
#return result to the browser
|
21
|
+
render :action => :list
|
22
|
+
end
|
23
|
+
|
24
|
+
From the View list action will be available as 'Account/list' url.
|
25
|
+
|
26
|
+
Each generated model controller has several actions to perform basic CRUD (create, read, update and delete) on the object. These actions are:
|
27
|
+
|
28
|
+
* index - lists all objects
|
29
|
+
* new - displays the editing form for creating a new object
|
30
|
+
* create - actually creates the object
|
31
|
+
* edit - edits an existing object
|
32
|
+
* update - updates properties of the object
|
33
|
+
* show - views the object
|
34
|
+
* delete - deletes the object
|
35
|
+
|
36
|
+
Generated set of actions (and the associated URL paths) follows the Rails scaffolding pattern for creating CRUD actions for objects and the associated "map resources" convention for routing to those actions.
|
37
|
+
|
38
|
+
### Model
|
39
|
+
To store data locally Rhodes uses Sqlite on iPhone, Android, and Windows Mobile. On Blackberry version up to 5.0 Rhodes uses Hsql. On version 5.0 and higher it is possible to use Sqlite or Hsql. To access and manipulate stored data you may use [Rhom](rhom). Rhom is a mini ORM (object relational mapper) for Rhodes. It provides a high level way to make the local database easier to program to.
|
40
|
+
|
41
|
+
By convention, your model class is located in the model's folder. For the model "UserBase" the file would be called "user_base.rb"
|
42
|
+
|
43
|
+
Example of added upper_name method to the model:
|
44
|
+
|
45
|
+
:::ruby
|
46
|
+
class UserBase
|
47
|
+
include Rhom::PropertyBag
|
48
|
+
#add model specific code here
|
49
|
+
def upper_name
|
50
|
+
self.name.upcase
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
You may define PropertyBag model or FixedSchema models. In first case model object may have any number of attributes and developer may create them on the fly by assigning values to an attribute. Fixed schema is more rigid and attributes of such objects should be defined at compile time. But Fixed Schema objects will require significantly less space on the target device. See more details about Rhom [here](rhom).
|
55
|
+
|
56
|
+
### Views (Templates)
|
57
|
+
Each controller action usually associated with a View template. The .erb files mentioned above are the templates used for views. Rhodes follows the Rails convention for template naming.
|
58
|
+
|
59
|
+
* index.erb - lists the data model objects
|
60
|
+
* edit.erb - lets you edit the object
|
61
|
+
* show.erb - shows the object's attribute values
|
62
|
+
* new.erb - creates a new object
|
63
|
+
|
64
|
+
These files are all created by the [rhodes generator](generator). Inside the template, any valid HTML, JavaScript, and Ruby can be used, with Ruby code enclosed in <% and %> tags. See more information about ERB [here](http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/).
|
65
|
+
|
66
|
+
To send View to the browser, use render method in your controller. For example, to render list.erb, make following call in your controller:
|
67
|
+
|
68
|
+
:::ruby
|
69
|
+
render :action => :list
|
70
|
+
|
71
|
+
Rhodes framework will load list.erb template, process it, and send resulted HTML to the browser.
|
72
|
+
|
73
|
+
## AppApplication class
|
74
|
+
To coordinate application startup Rhodes framework introduced Application class. This class persistent all the time while app is running and across all requests to the controller actions. You can store session data here. To get an instance of the AppApplication object in your controller, use:
|
75
|
+
|
76
|
+
:::ruby
|
77
|
+
::Rho.get_app
|
78
|
+
|
79
|
+
AppAplication class defined in the application.rb file:
|
80
|
+
:::ruby
|
81
|
+
class AppApplication < Rho::RhoApplication
|
82
|
+
def initialize
|
83
|
+
# put initialization code here
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
You may listen for activation/deactivation/upgrade events if you define following methods on AppApplication class.
|
88
|
+
|
89
|
+
Method on_ui_created will be invoked after application's UI was created (usually on app start)
|
90
|
+
:::ruby
|
91
|
+
def on_ui_created
|
92
|
+
# put your application UI creation code here
|
93
|
+
# for example, create tab bar:
|
94
|
+
# NativeBar.create(Rho::RhoApplication::TABBAR_TYPE, tabs)
|
95
|
+
end
|
96
|
+
|
97
|
+
Method on_ui_destroyed will be invoked when application's UI was destroyed (usually on app exit)
|
98
|
+
:::ruby
|
99
|
+
def on_ui_destroyed
|
100
|
+
# put your code here
|
101
|
+
# example:
|
102
|
+
# @forbid_ui_operations = true
|
103
|
+
end
|
104
|
+
|
105
|
+
Method on_activate_app will be invoked after application is activated.
|
106
|
+
:::ruby
|
107
|
+
def on_activate_app
|
108
|
+
# put your application activation code here
|
109
|
+
end
|
110
|
+
|
111
|
+
Method on_deactivate_app will be invoked before application goes to background.
|
112
|
+
:::ruby
|
113
|
+
def on_deactivate_app
|
114
|
+
# Don't call any UI operations here, they'll be ignored
|
115
|
+
# For example, WebView.refresh
|
116
|
+
|
117
|
+
# to stop sync background thread call
|
118
|
+
# SyncEngine.stop_sync; SyncEngine.set_pollinterval(0)
|
119
|
+
|
120
|
+
# To stop local web server when application switched to
|
121
|
+
# background return "stop_local_server"
|
122
|
+
# return "stop_local_server"
|
123
|
+
end
|
124
|
+
|
125
|
+
Method on_reinstall_config_update may be called after application was upgraded. If application bundle contain rhoconfig with properties modified locally on the phone conflicts is a hash name to array of conflicted values(old local value, new upgrade value). By default local values are kept in place but you may overwrite configuration with new values and any other steps required for your application upgrade.
|
126
|
+
:::ruby
|
127
|
+
def on_reinstall_config_update(conflicts)
|
128
|
+
# puts "on_reinstall_config_update: #{conflicts}"
|
129
|
+
end
|
130
|
+
|
131
|
+
### Relative order of callbacks and conditions where they occurs
|
132
|
+
Look to the scheme of application life cycle:
|
133
|
+
|
134
|
+
initialize -> called when application start
|
135
|
+
on_ui_created -> called when application's UI created
|
136
|
+
on_activate_app -> called when application become foreground
|
137
|
+
|
138
|
+
Now application is live and visible on the screen. Assume now that user somehow
|
139
|
+
switched to another application (for example, answering to incoming call) or
|
140
|
+
explicitly send app to background.
|
141
|
+
|
142
|
+
on_deactivate_app -> called when application switched to background
|
143
|
+
|
144
|
+
Now, on this stage, application can be activated again (in this case *on_activate_app*
|
145
|
+
will be called) or system can destroy it's UI to free some memory (in this case
|
146
|
+
*on_ui_destroyed* will be called).
|
147
|
+
Let's look on case if app's UI was destroyed but then we activated app again:
|
148
|
+
|
149
|
+
on_ui_destroyed -> called when OS destroy app's UI
|
150
|
+
on_ui_created -> called just after user request system activate
|
151
|
+
app (for example, tap app's icon on screen)
|
152
|
+
on_activate_app -> called when app goes to foreground
|
153
|
+
|
154
|
+
Ok, now user choose to exit from app completely (either by selecting menu item
|
155
|
+
"Close" or calling System.exit method somewhere in app code).
|
156
|
+
Let's look on callbacks chain in this case:
|
157
|
+
|
158
|
+
on_deactivate_app -> at first, app will be deactivated (become
|
159
|
+
invisible on screen)
|
160
|
+
on_ui_destroyed -> then, app's UI will be destroyed
|
161
|
+
Kernel.at_exit -> all calls registered by calling of
|
162
|
+
Kernel.at_exit will be called as in usual Ruby.
|
163
|
+
|
164
|
+
That's how it's working. Important thing to understand is that *on_activate_app* callback
|
165
|
+
always called **after** *on_ui_created* and *on_deactivate_app* always called **before** *on_ui_destroyed*
|
166
|
+
|
167
|
+
## Application Helpers
|
168
|
+
Few helper methods defined as part of the Rhodes framework. There are just a few of them because Rhodes framework designed for mobile environment where size is still of some concern and we tried to keep framework as tight as possible.
|
169
|
+
|
170
|
+
Generated application comes with number of other helpers (see app/helpers folder). These helpers are not used by the framework internally and may be modified/deleted/extended at will.
|
171
|
+
|
172
|
+
### link_to
|
173
|
+
Examples of how to use the link_to method:
|
174
|
+
|
175
|
+
link_to "Visit Other Site", "http://www.rhomobile.com/"
|
176
|
+
==> <a href="http://www.rhomobile.com/" >Visit Other Site</a>
|
177
|
+
|
178
|
+
link_to "Help", { :action => "help" }
|
179
|
+
==> <a href="/app/model/help" >Help</a>
|
180
|
+
|
181
|
+
link_to "Delete", { :action => "delete", :id => '{12}' }
|
182
|
+
==> <a href="/app/model/{12}/delete" onclick="
|
183
|
+
var f = document.createElement('form');
|
184
|
+
f.style.display = 'none'; this.parentNode.appendChild(f);
|
185
|
+
f.method = 'POST'; f.action = this.href; f.submit();
|
186
|
+
return false;">Delete</a>
|
187
|
+
|
188
|
+
link_to "Show", { :action => "show", :id => '{12}'},
|
189
|
+
"style=\"height:4px;width:7px;border-width:0px;\""
|
190
|
+
==> <a href="/app/model/{12}/show"
|
191
|
+
style="height:4px;width:7px;border-width:0px;">Show</a>
|
192
|
+
|
193
|
+
link_to "Delete", { :action => "delete", :id => '{12}' },
|
194
|
+
"class=\"delete_link\""
|
195
|
+
==> <a href="/app/model/{12}/delete" class="delete_link"
|
196
|
+
onclick="var f = document.createElement('form');
|
197
|
+
f.style.display = 'none'; this.parentNode.appendChild(f);
|
198
|
+
f.method = 'POST'; f.action = this.href; f.submit();
|
199
|
+
return false;\">Delete</a>"
|
200
|
+
|
201
|
+
link_to "Invite",:action => :invite,
|
202
|
+
:query => {:name=>'John Smith','address'=>"http://john.smith.com"}
|
203
|
+
==> <a href="/app/model/invite?
|
204
|
+
name=John%20Smith&address=http%3A%2F%2Fjohn.smith.com">
|
205
|
+
Invite</a>
|
206
|
+
|
207
|
+
### url_for
|
208
|
+
Examples of how to use the url_for method:
|
209
|
+
|
210
|
+
url_for '/some_url'
|
211
|
+
==> /some_url
|
212
|
+
|
213
|
+
When generating a new URL, missing values may be filled in from the current request's parameters.
|
214
|
+
For example, if the application name or model are not specified in the call parameters, they would be filled from the request.
|
215
|
+
|
216
|
+
url_for :action => :index
|
217
|
+
==> /app/model
|
218
|
+
|
219
|
+
url_for :action => :create
|
220
|
+
==> /app/model
|
221
|
+
|
222
|
+
url_for :action => :new
|
223
|
+
==> /app/model/new
|
224
|
+
|
225
|
+
url_for :action => :show, :id => '{12}'
|
226
|
+
==> /app/model/{12}/show
|
227
|
+
|
228
|
+
url_for :model => :another_model,
|
229
|
+
:action => :show, :id => '{12}'
|
230
|
+
==> /app/another_model/{12}/show
|
231
|
+
|
232
|
+
url_for :controller => :another_controller,
|
233
|
+
:action => :show, :id => '{12}'
|
234
|
+
==> /app/another_controller/{12}/show
|
235
|
+
|
236
|
+
url_for :application => :another_app,
|
237
|
+
:model => :another_model, :action => :show, :id => '{12}'
|
238
|
+
==> /another_app/another_model/{12}/show
|
239
|
+
|
240
|
+
url_for :action => :create, :query =>
|
241
|
+
{:name => 'John Smith', 'address' => "http://john.smith.com"}
|
242
|
+
==> /app/model?name=John%20Smith&address=http%3A%2F%2Fjohn.smith.com
|
243
|
+
|
244
|
+
url_for :action => :show, :id => '{12}', :fragment => "an-anchor"
|
245
|
+
==> /app/model/{12}/show#an-anchor
|
246
|
+
|
247
|
+
## Error handlers(400,500)
|
248
|
+
|
249
|
+
Rhodes can display the following error pages: app\E400.erb and app\E500.erb
|
250
|
+
|
251
|
+
* error 400 occurs when there's a Rho::RecordNotFound exception (for example, when you search for a non-existent objectID)
|
252
|
+
* error 500 occurs for any other unhanded exception
|
253
|
+
|
254
|
+
To get exception object use $! or Rho::RHO.current_exception
|
255
|
+
|
256
|
+
## Per Platform Files
|
257
|
+
|
258
|
+
On a per platform basis, you can use alternative files for any given file in your 'app' or 'public' folder. To do this, make a second file with the platform in the name of the file.
|
259
|
+
|
260
|
+
For example, to replace these files on the Android platform:
|
261
|
+
|
262
|
+
default.css
|
263
|
+
index.erb
|
264
|
+
|
265
|
+
All you need to do is add the two files:
|
266
|
+
|
267
|
+
default.android.css
|
268
|
+
index.android.erb
|
269
|
+
|
270
|
+
Note that you must still have the base file present for it to be replaced on a platform.
|
271
|
+
|
272
|
+
Valid platform names are:
|
273
|
+
|
274
|
+
* android
|
275
|
+
* wm
|
276
|
+
* bb
|
277
|
+
* iphone
|