rhoconnect-client 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/CREDITS +0 -0
  4. data/LICENSE +9 -0
  5. data/README.md +47 -0
  6. data/ext/rhoconnect-client/RhoConnectClient.rb +190 -0
  7. data/ext/rhoconnect-client/ext/RhoConnectClient.xml +726 -0
  8. data/ext/rhoconnect-client/ext/build +26 -0
  9. data/ext/rhoconnect-client/ext/build.bat +30 -0
  10. data/ext/rhoconnect-client/ext/platform/android/ext_java.files +1 -0
  11. data/ext/rhoconnect-client/ext/platform/android/ext_native.files +14 -0
  12. data/ext/rhoconnect-client/ext/platform/android/src/com/rhoconnectclient/RhoconnectClient.java +1 -0
  13. data/ext/rhoconnect-client/ext/platform/iphone/.gitignore +1 -0
  14. data/ext/rhoconnect-client/ext/platform/iphone/Rakefile +74 -0
  15. data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient.xcodeproj/project.pbxproj +390 -0
  16. data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient_Prefix.pch +7 -0
  17. data/ext/rhoconnect-client/ext/platform/iphone/impl/readme.txt +7 -0
  18. data/ext/rhoconnect-client/ext/platform/qt/Rakefile +35 -0
  19. data/ext/rhoconnect-client/ext/platform/qt/rhoconnect-client.pro +88 -0
  20. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.sln +36 -0
  21. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vcproj +774 -0
  22. data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vsprops +15 -0
  23. data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.cpp +40 -0
  24. data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.h +2 -0
  25. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.props +22 -0
  26. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.sln +32 -0
  27. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj +220 -0
  28. data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj.filters +103 -0
  29. data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.cpp +273 -0
  30. data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.h +60 -0
  31. data/ext/rhoconnect-client/ext/shared/RhoConnectClientSingletonImpl.h +53 -0
  32. data/ext/rhoconnect-client/ext/shared/initRhoconnectClient.cpp +207 -0
  33. data/ext/rhoconnect-client/ext/shared/rhoconnectclient.c +18 -0
  34. data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.cpp +398 -0
  35. data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.h +147 -0
  36. data/ext/rhoconnect-client/ext/shared/sync/ISyncProtocol.h +91 -0
  37. data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.cpp +1245 -0
  38. data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.h +213 -0
  39. data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.cpp +737 -0
  40. data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.h +209 -0
  41. data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_3.h +220 -0
  42. data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_4.h +259 -0
  43. data/ext/rhoconnect-client/ext/shared/sync/SyncSource.cpp +1694 -0
  44. data/ext/rhoconnect-client/ext/shared/sync/SyncSource.h +212 -0
  45. data/ext/rhoconnect-client/ext/shared/sync/SyncThread.cpp +583 -0
  46. data/ext/rhoconnect-client/ext/shared/sync/SyncThread.h +250 -0
  47. data/ext/rhoconnect-client/ext.yml +12 -0
  48. data/lib/build/run_rhoconnect_spec.rb +135 -0
  49. data/lib/rhoconnect-client.rb +3 -0
  50. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1673 -0
  51. data/platform/shared/RhoConnectClient/RhoConnectClient.h +181 -0
  52. data/platform/shared/RhoConnectClient/RhoError.h +77 -0
  53. data/rhoconnect-client/C++/Tests/RhoConnectClientTest.cpp +830 -0
  54. data/rhoconnect-client/C++/Tests/win32/.gitignore +3 -0
  55. data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.sln +65 -0
  56. data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.vcproj +634 -0
  57. data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/RhoConnectClientTest.vcproj +222 -0
  58. data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/stdafx.h +65 -0
  59. data/rhoconnect-client/C++/Tests/win32/stdafx.h +65 -0
  60. data/rhoconnect-client/CHANGELOG +18 -0
  61. data/rhoconnect-client/Java/Android/build/android.rake +387 -0
  62. data/rhoconnect-client/Java/Android/build/android_sdk.rb +582 -0
  63. data/rhoconnect-client/Java/Android/build/libcurl_build.files +73 -0
  64. data/rhoconnect-client/Java/Android/build/libjson_build.files +9 -0
  65. data/rhoconnect-client/Java/Android/build/librhocommon_build.files +14 -0
  66. data/rhoconnect-client/Java/Android/build/librhodb_build.files +5 -0
  67. data/rhoconnect-client/Java/Android/build/librhoimpl_build.files +13 -0
  68. data/rhoconnect-client/Java/Android/build/librholog_build.files +4 -0
  69. data/rhoconnect-client/Java/Android/build/libsqlite_build.files +1 -0
  70. data/rhoconnect-client/Java/Android/build/libsync_build.files +7 -0
  71. data/rhoconnect-client/Java/Android/build/libunzip_build.files +1 -0
  72. data/rhoconnect-client/Java/Android/build/rhoconnectclient_build.files +3 -0
  73. data/rhoconnect-client/Java/Android/build/rhoimpljava_build.files +21 -0
  74. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/Capabilities.java +63 -0
  75. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/MemoryInfoCollector.java +79 -0
  76. data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/util/ContextFactory.java +63 -0
  77. data/rhoconnect-client/Java/Android/test/.classpath +9 -0
  78. data/rhoconnect-client/Java/Android/test/.project +33 -0
  79. data/rhoconnect-client/Java/Android/test/AndroidManifest.xml +14 -0
  80. data/rhoconnect-client/Java/Android/test/assets/apps/androidtest.png +0 -0
  81. data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt +19 -0
  82. data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt.timestamp +1 -0
  83. data/rhoconnect-client/Java/Android/test/assets/db/syncdb.schema +44 -0
  84. data/rhoconnect-client/Java/Android/test/assets/db/syncdb.triggers +10 -0
  85. data/rhoconnect-client/Java/Android/test/assets/db/syncdb_java.triggers +21 -0
  86. data/rhoconnect-client/Java/Android/test/assets/rho.dat +9 -0
  87. data/rhoconnect-client/Java/Android/test/proguard.cfg +36 -0
  88. data/rhoconnect-client/Java/Android/test/project.properties +11 -0
  89. data/rhoconnect-client/Java/Android/test/res/drawable-hdpi/icon.png +0 -0
  90. data/rhoconnect-client/Java/Android/test/res/drawable-ldpi/icon.png +0 -0
  91. data/rhoconnect-client/Java/Android/test/res/drawable-mdpi/icon.png +0 -0
  92. data/rhoconnect-client/Java/Android/test/res/layout/main.xml +12 -0
  93. data/rhoconnect-client/Java/Android/test/res/values/strings.xml +5 -0
  94. data/rhoconnect-client/Java/Android/test/rhoimpl.jar +0 -0
  95. data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClient.java +343 -0
  96. data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClientBlobs.java +219 -0
  97. data/rhoconnect-client/Java/RhoConnect/.classpath +6 -0
  98. data/rhoconnect-client/Java/RhoConnect/.project +93 -0
  99. data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt +19 -0
  100. data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt.timestamp +1 -0
  101. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.schema +44 -0
  102. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.triggers +10 -0
  103. data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb_java.triggers +21 -0
  104. data/rhoconnect-client/Java/RhoConnect/assets/rho.dat +8 -0
  105. data/rhoconnect-client/Java/RhoConnect/jni/include/RhoConnectJniNotify.h +61 -0
  106. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectClient.h +181 -0
  107. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify.h +13 -0
  108. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify_IDelegate.h +13 -0
  109. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify.h +13 -0
  110. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify_IDelegate.h +13 -0
  111. data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhomModel.h +103 -0
  112. data/rhoconnect-client/Java/RhoConnect/jni/include/rhojava.inc +76 -0
  113. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniClient.cpp +401 -0
  114. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniModel.cpp +332 -0
  115. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniNotify.cpp +223 -0
  116. data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectUtil.cpp +82 -0
  117. data/rhoconnect-client/Java/RhoConnect/jni/src/RhodesApp.cpp +114 -0
  118. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectClient.java +108 -0
  119. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectNotify.java +78 -0
  120. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectObjectNotify.java +71 -0
  121. data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhomModel.java +195 -0
  122. data/rhoconnect-client/JavaScript/.classpath +10 -0
  123. data/rhoconnect-client/JavaScript/.gitignore +4 -0
  124. data/rhoconnect-client/JavaScript/.project +17 -0
  125. data/rhoconnect-client/JavaScript/README.textile +1 -0
  126. data/rhoconnect-client/JavaScript/build.xml +185 -0
  127. data/rhoconnect-client/JavaScript/doc/fsm-sample.js +44 -0
  128. data/rhoconnect-client/JavaScript/doc/fsm-sample.png +0 -0
  129. data/rhoconnect-client/JavaScript/src/RhoSyncJS.gwt.xml +21 -0
  130. data/rhoconnect-client/JavaScript/stubs/RhoSyncStubsJS.gwt.xml +21 -0
  131. data/rhoconnect-client/JavaScript/stubs/com/rho/Capabilities.java +7 -0
  132. data/rhoconnect-client/JavaScript/stubs/com/rho/IRhoRubyHelper.java +7 -0
  133. data/rhoconnect-client/JavaScript/stubs/com/rho/Mutex.java +5 -0
  134. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoAppAdapter.java +39 -0
  135. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoClassFactory.java +29 -0
  136. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoConf.java +100 -0
  137. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyLogger.java +7 -0
  138. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyProfiler.java +5 -0
  139. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoLogger.java +32 -0
  140. data/rhoconnect-client/JavaScript/stubs/com/rho/RhoProfiler.java +27 -0
  141. data/rhoconnect-client/JavaScript/stubs/com/rho/RhodesApp.java +25 -0
  142. data/rhoconnect-client/JavaScript/stubs/com/rho/TimeInterval.java +22 -0
  143. data/rhoconnect-client/JavaScript/stubs/com/rho/Tokenizer.java +23 -0
  144. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAdapter.java +174 -0
  145. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAttrManager.java +15 -0
  146. data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBException.java +5 -0
  147. data/rhoconnect-client/JavaScript/stubs/com/rho/db/IDBResult.java +27 -0
  148. data/rhoconnect-client/JavaScript/stubs/com/rho/file/IFileAccess.java +7 -0
  149. data/rhoconnect-client/JavaScript/stubs/com/rho/file/SimpleFile.java +15 -0
  150. data/rhoconnect-client/JavaScript/stubs/com/rho/net/IHttpConnection.java +22 -0
  151. data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetRequest.java +324 -0
  152. data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetResponse.java +51 -0
  153. data/rhoconnect-client/JavaScript/stubs/com/rho/net/URI.java +64 -0
  154. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/ClientRegister.java +15 -0
  155. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONArrayIterator.java +37 -0
  156. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONEntry.java +48 -0
  157. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONStructIterator.java +41 -0
  158. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncNotify.java +98 -0
  159. data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncThread.java +92 -0
  160. data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet-deps.jar +0 -0
  161. data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet.jar +0 -0
  162. data/rhoconnect-client/JavaScript/war/js/fsm-sample.js +54 -0
  163. data/rhoconnect-client/JavaScript/war/js/rhosync-api.js +237 -0
  164. data/rhoconnect-client/JavaScript/war/js/rhosync-fsm.js +307 -0
  165. data/rhoconnect-client/JavaScript/war/rhosyncjs/4C71D69C9BBC9E6F05C6BA49B01BCBC1.cache.html +3122 -0
  166. data/rhoconnect-client/JavaScript/war/rhosyncjs/5146F4FFF34511C8BB2661E920B49E3A.cache.html +3254 -0
  167. data/rhoconnect-client/JavaScript/war/rhosyncjs/5248C67481D9D27AD0703D15CDBD2A1C.cache.html +3147 -0
  168. data/rhoconnect-client/JavaScript/war/rhosyncjs/EE1DC2692C9C32367B53A39E2358AF23.cache.html +3195 -0
  169. data/rhoconnect-client/JavaScript/war/rhosyncjs/clear.cache.gif +0 -0
  170. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner.png +0 -0
  171. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner_ie6.png +0 -0
  172. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder.png +0 -0
  173. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder_ie6.png +0 -0
  174. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topleft.png +0 -0
  175. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topright.png +0 -0
  176. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_blue_shadow.png +0 -0
  177. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_gray_shadow.png +0 -0
  178. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_blue_shadow.png +0 -0
  179. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_gray_shadow.png +0 -0
  180. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/splitPanelThumb.png +0 -0
  181. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder.png +0 -0
  182. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder_ie6.png +0 -0
  183. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard.css +1144 -0
  184. data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard_rtl.css +1145 -0
  185. data/rhoconnect-client/JavaScript/war/rhosyncjs/hosted.html +350 -0
  186. data/rhoconnect-client/JavaScript/war/rhosyncjs/rhosyncjs.nocache.js +314 -0
  187. data/rhoconnect-client/JavaScript/war/test/SpecRunner.html +35 -0
  188. data/rhoconnect-client/JavaScript/war/test/dbtest.html +38 -0
  189. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/MIT.LICENSE +20 -0
  190. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine-html.js +188 -0
  191. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.css +166 -0
  192. data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.js +2421 -0
  193. data/rhoconnect-client/JavaScript/war/test/spec/SpecHelper.js +7 -0
  194. data/rhoconnect-client/JavaScript/war/test/spec/SyncApiSpec.js +573 -0
  195. data/rhoconnect-client/JavaScript/war/test/spec/samples/PlayerSpec.js +58 -0
  196. data/rhoconnect-client/JavaScript/war/test/worker-test.js +17 -0
  197. data/rhoconnect-client/LICENSE +41 -0
  198. data/rhoconnect-client/ObjectiveC/RhoConnectClient.h +118 -0
  199. data/rhoconnect-client/ObjectiveC/RhoConnectClient.m +641 -0
  200. data/rhoconnect-client/ObjectiveC/RhoConnectClient.xcodeproj/project.pbxproj +1434 -0
  201. data/rhoconnect-client/ObjectiveC/RhoConnectNotify.h +83 -0
  202. data/rhoconnect-client/ObjectiveC/RhoConnectNotify.m +181 -0
  203. data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.h +65 -0
  204. data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.m +73 -0
  205. data/rhoconnect-client/ObjectiveC/RhomModel.h +101 -0
  206. data/rhoconnect-client/ObjectiveC/RhomModel.m +320 -0
  207. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/MainWindow.xib +198 -0
  208. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest-Info.plist +30 -0
  209. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest.xcodeproj/project.pbxproj +373 -0
  210. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.h +58 -0
  211. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.m +84 -0
  212. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest_Prefix.pch +8 -0
  213. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/invalid_import_db.zip +0 -0
  214. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/main.m +1096 -0
  215. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test.png +0 -0
  216. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test2.png +0 -0
  217. data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/valid_import_db.zip +0 -0
  218. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.h +62 -0
  219. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.m +35 -0
  220. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.h +78 -0
  221. data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.m +549 -0
  222. data/rhoconnect-client/ObjectiveC/Tests/ptests/MainWindow.xib +227 -0
  223. data/rhoconnect-client/ObjectiveC/Tests/ptests/main.m +17 -0
  224. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests-Info.plist +30 -0
  225. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests.xcodeproj/project.pbxproj +363 -0
  226. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptestsViewController.xib +641 -0
  227. data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests_Prefix.pch +8 -0
  228. data/rhoconnect-client/README.textile +23 -0
  229. data/rhoconnect-client/Rakefile +20 -0
  230. data/rhoconnect-client/Samples/Java/android_store/.classpath +8 -0
  231. data/rhoconnect-client/Samples/Java/android_store/.project +33 -0
  232. data/rhoconnect-client/Samples/Java/android_store/AndroidManifest.xml +24 -0
  233. data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt +19 -0
  234. data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt.timestamp +1 -0
  235. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.schema +44 -0
  236. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.triggers +10 -0
  237. data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb_java.triggers +21 -0
  238. data/rhoconnect-client/Samples/Java/android_store/assets/rho.dat +8 -0
  239. data/rhoconnect-client/Samples/Java/android_store/default.properties +11 -0
  240. data/rhoconnect-client/Samples/Java/android_store/project.properties +14 -0
  241. data/rhoconnect-client/Samples/Java/android_store/res/drawable-hdpi/icon.png +0 -0
  242. data/rhoconnect-client/Samples/Java/android_store/res/drawable-ldpi/icon.png +0 -0
  243. data/rhoconnect-client/Samples/Java/android_store/res/drawable-mdpi/icon.png +0 -0
  244. data/rhoconnect-client/Samples/Java/android_store/res/layout/main.xml +12 -0
  245. data/rhoconnect-client/Samples/Java/android_store/res/values/strings.xml +5 -0
  246. data/rhoconnect-client/Samples/Java/android_store/rhoimpl.jar +0 -0
  247. data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreActivity.java +68 -0
  248. data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreApplication.java +15 -0
  249. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.h +70 -0
  250. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.m +94 -0
  251. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.h +82 -0
  252. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.m +119 -0
  253. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.h +63 -0
  254. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.m +314 -0
  255. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.h +65 -0
  256. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.m +110 -0
  257. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.h +61 -0
  258. data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.m +171 -0
  259. data/rhoconnect-client/Samples/ObjectiveC/store/LoginViewController.xib +779 -0
  260. data/rhoconnect-client/Samples/ObjectiveC/store/MainWindow.xib +580 -0
  261. data/rhoconnect-client/Samples/ObjectiveC/store/RootViewController.xib +384 -0
  262. data/rhoconnect-client/Samples/ObjectiveC/store/WaitLoginController.xib +557 -0
  263. data/rhoconnect-client/Samples/ObjectiveC/store/icon.png +0 -0
  264. data/rhoconnect-client/Samples/ObjectiveC/store/main.m +22 -0
  265. data/rhoconnect-client/Samples/ObjectiveC/store/store-Info.plist +30 -0
  266. data/rhoconnect-client/Samples/ObjectiveC/store/store.xcodeproj/project.pbxproj +367 -0
  267. data/rhoconnect-client/Samples/ObjectiveC/store/store_Prefix.pch +14 -0
  268. data/rhoconnect-client/build.yml +3 -0
  269. data/rhoconnect-client/version +1 -0
  270. metadata +314 -0
@@ -0,0 +1,94 @@
1
+ //
2
+ // LoginViewController.m
3
+ // store
4
+ //
5
+ // Created by Vlad on 8/30/10.
6
+ // Copyright 2010 __MyCompanyName__. All rights reserved.
7
+ //
8
+
9
+ #import "RhoConnectEngine.h"
10
+ #import "LoginViewController.h"
11
+
12
+
13
+ @implementation LoginViewController
14
+
15
+ @synthesize txtLogin, txtPassword, waitPage, indexPage;
16
+
17
+ - (void)viewDidLoad
18
+ {
19
+ if ( [RhoConnectEngine sharedInstance].loginState == logged_in )
20
+ [[self navigationController] pushViewController:indexPage animated:YES];
21
+ else
22
+ [super viewDidLoad];
23
+
24
+ }
25
+
26
+ - (void)loginComplete:(RhoConnectNotify*) notify
27
+ {
28
+ if ( notify.error_code != RHO_ERR_NONE || ![[RhoConnectEngine sharedInstance].syncClient is_logged_in])
29
+ [RhoConnectEngine sharedInstance].loginState = failed;
30
+ else
31
+ [RhoConnectEngine sharedInstance].loginState = logged_in;
32
+
33
+ NSString* error_message = notify.error_message;
34
+ if ( error_message == nil || error_message.length == 0 )
35
+ error_message = [NSString stringWithFormat:@"Error code: %d", notify.error_code];
36
+
37
+ [waitPage loginComplete: error_message ];
38
+
39
+ //[notify release];
40
+ }
41
+
42
+ - (IBAction)doLogin:(id)sender
43
+ {
44
+ [RhoConnectEngine sharedInstance].loginState = in_progress;
45
+ [[self navigationController] pushViewController:waitPage animated:YES];
46
+
47
+ [ [RhoConnectEngine sharedInstance].syncClient loginWithUser:txtLogin.text pwd:txtPassword.text callback:@selector(loginComplete:) target:self];
48
+ }
49
+
50
+ /*
51
+ // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
52
+ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
53
+ if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
54
+ // Custom initialization
55
+ }
56
+ return self;
57
+ }
58
+ */
59
+
60
+ /*
61
+ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
62
+ - (void)viewDidLoad {
63
+ [super viewDidLoad];
64
+ }
65
+ */
66
+
67
+ /*
68
+ // Override to allow orientations other than the default portrait orientation.
69
+ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
70
+ // Return YES for supported orientations
71
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
72
+ }
73
+ */
74
+
75
+ - (void)didReceiveMemoryWarning {
76
+ // Releases the view if it doesn't have a superview.
77
+ [super didReceiveMemoryWarning];
78
+
79
+ // Release any cached data, images, etc that aren't in use.
80
+ }
81
+
82
+ - (void)viewDidUnload {
83
+ [super viewDidUnload];
84
+ // Release any retained subviews of the main view.
85
+ // e.g. self.myOutlet = nil;
86
+ }
87
+
88
+
89
+ - (void)dealloc {
90
+ [super dealloc];
91
+ }
92
+
93
+
94
+ @end
@@ -0,0 +1,82 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+
26
+ * Copyright (c) 2011-2016 Symbol Technologies, Inc.
27
+ *
28
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
29
+ * of this software and associated documentation files (the "Software"), to deal
30
+ * in the Software without restriction, including without limitation the rights
31
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32
+ * copies of the Software, and to permit persons to whom the Software is
33
+ * furnished to do so, subject to the following conditions:
34
+ *
35
+ * The above copyright notice and this permission notice shall be included in
36
+ * all copies or substantial portions of the Software.
37
+ *
38
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44
+ * THE SOFTWARE.
45
+ *
46
+ * http://symbol.com
47
+ *------------------------------------------------------------------------*/
48
+
49
+ #import <Foundation/Foundation.h>
50
+ #import "../../../../ObjectiveC/RhoConnectClient.h"
51
+
52
+ enum LoginState {
53
+ logged_out,
54
+ logged_in,
55
+ in_progress,
56
+ failed
57
+ };
58
+
59
+ @interface RhoConnectEngine : NSObject {
60
+ enum LoginState loginState;
61
+
62
+ RhomModel* customer;
63
+ RhomModel* product;
64
+ RhoConnectClient* sclient;
65
+ }
66
+
67
+ + (void)create;
68
+ + (void)destroy;
69
+
70
+ + (RhoConnectEngine *)sharedInstance;
71
+
72
+ @property enum LoginState loginState;
73
+
74
+ @property(readonly, getter=getSClient) RhoConnectClient* syncClient;
75
+
76
+ @property(readonly) RhomModel* product;
77
+
78
+ - (void)dealloc;
79
+
80
+ @end
81
+
82
+
@@ -0,0 +1,119 @@
1
+ //
2
+ // syncEngine.m
3
+ // store
4
+ //
5
+ // Created by Vlad on 8/30/10.
6
+ // Copyright 2010 __MyCompanyName__. All rights reserved.
7
+ //
8
+
9
+ #import "RhoConnectEngine.h"
10
+
11
+ @implementation RhoConnectEngine
12
+
13
+ @synthesize loginState;
14
+ @synthesize product;
15
+
16
+ static RhoConnectEngine *sharedInst = nil;
17
+
18
+ + (void)create
19
+ {
20
+ @synchronized( self ) {
21
+ if ( sharedInst == nil ) {
22
+ /* sharedInst set up in init */
23
+ [[self alloc] init];
24
+ }
25
+ }
26
+ }
27
+
28
+ + (void)destroy
29
+ {
30
+ if ( sharedInst )
31
+ {
32
+ [sharedInst dealloc];
33
+ sharedInst = nil;
34
+ }
35
+ }
36
+
37
+ + (id)sharedInstance
38
+ {
39
+ return sharedInst;
40
+ }
41
+
42
+ - (id)init
43
+ {
44
+ if ( sharedInst != nil ) {
45
+ [NSException raise:NSInternalInconsistencyException
46
+ format:@"[%@ %@] cannot be called; use +[%@ %@] instead",
47
+ NSStringFromClass([self class]), NSStringFromSelector(_cmd),
48
+ NSStringFromClass([self class]),
49
+ NSStringFromSelector(@selector(sharedInstance))];
50
+ } else if ( self = [super init] ) {
51
+ sharedInst = self;
52
+
53
+ [RhoConnectClient initDatabase];
54
+
55
+ customer = [[RhomModel alloc] init];
56
+ customer.name = @"Customer";
57
+
58
+ product = [[RhomModel alloc] init];
59
+ product.name = @"Product";
60
+
61
+ sclient = [[RhoConnectClient alloc] init];
62
+
63
+
64
+ NSMutableArray* models = [NSMutableArray arrayWithObjects:customer, product, nil];
65
+
66
+ [sclient addModels:models];
67
+
68
+ [sclient setLogSeverity:1];
69
+
70
+ //sclient.sync_server = @"http://store-bulk.rhohub.com";
71
+ //sclient.sync_server = @"http://rhodes-store-server.herokuapp.com";
72
+ sclient.sync_server = @"http://localhost:9292";
73
+ //sclient.sync_server = @"http://localhost:9292/application";
74
+ sclient.threaded_mode = TRUE;
75
+
76
+ loginState = [sclient is_logged_in] ? logged_in : logged_out;
77
+ }
78
+ return sharedInst;
79
+ }
80
+
81
+ - (void)dealloc
82
+ {
83
+ [customer release];
84
+ [product release];
85
+ [sclient release];
86
+
87
+ [super dealloc];
88
+ }
89
+
90
+ - (RhoConnectClient*) getSClient
91
+ {
92
+ return sclient;
93
+ }
94
+
95
+ /* These probably do nothing in
96
+ a GC app. Keeps singleton
97
+ as an actual singleton in a
98
+ non CG app
99
+ */
100
+ - (NSUInteger)retainCount
101
+ {
102
+ return NSUIntegerMax;
103
+ }
104
+
105
+ - (oneway void)release
106
+ {
107
+ }
108
+
109
+ - (id)retain
110
+ {
111
+ return sharedInst;
112
+ }
113
+
114
+ - (id)autorelease
115
+ {
116
+ return sharedInst;
117
+ }
118
+
119
+ @end
@@ -0,0 +1,63 @@
1
+ /*------------------------------------------------------------------------
2
+ * (The MIT License)
3
+ *
4
+ * Copyright (c) 2008-2011 Rhomobile, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ * http://rhomobile.com
25
+
26
+ * Copyright (c) 2011-2016 Symbol Technologies, Inc.
27
+ *
28
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
29
+ * of this software and associated documentation files (the "Software"), to deal
30
+ * in the Software without restriction, including without limitation the rights
31
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32
+ * copies of the Software, and to permit persons to whom the Software is
33
+ * furnished to do so, subject to the following conditions:
34
+ *
35
+ * The above copyright notice and this permission notice shall be included in
36
+ * all copies or substantial portions of the Software.
37
+ *
38
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44
+ * THE SOFTWARE.
45
+ *
46
+ * http://symbol.com
47
+ *------------------------------------------------------------------------*/
48
+
49
+ #import <UIKit/UIKit.h>
50
+
51
+ @interface RootViewController : UITableViewController {
52
+ NSObject* arItems;
53
+ NSString *CurrentTitle;
54
+ NSInteger CurrentLevel;
55
+ }
56
+
57
+ @property (nonatomic, retain) NSObject *arItems;
58
+ @property (nonatomic, retain) NSString *CurrentTitle;
59
+ @property (nonatomic, readwrite) NSInteger CurrentLevel;
60
+
61
+ -(UITableViewCell *)reuseTableViewCellWithIdentifier:(NSString *)identifier;
62
+
63
+ @end
@@ -0,0 +1,314 @@
1
+ //
2
+ // RootViewController.m
3
+ // store
4
+ //
5
+ // Created by Vlad on 8/30/10.
6
+ // Copyright __MyCompanyName__ 2010. All rights reserved.
7
+ //
8
+
9
+ #import "RootViewController.h"
10
+ #import "RhoConnectEngine.h"
11
+
12
+ #define ROW_HEIGHT 40
13
+ #define CELL_WIDTH 320.0
14
+ #define LABEL_HEIGHT 20
15
+
16
+ //Lets define the dimensions of the two columns
17
+ //Set the column offset and the width.
18
+ #define NAME_OFFSET 10.0
19
+ #define NAME_WIDTH 150.0
20
+ #define NAME_TAG 1
21
+
22
+ #define TEXT_OFFSET 160.0
23
+ #define TEXT_WIDTH 160.0
24
+ #define TEXT_TAG 2
25
+
26
+
27
+ @implementation RootViewController
28
+
29
+ @synthesize CurrentLevel;
30
+ @synthesize CurrentTitle;
31
+ @synthesize arItems;
32
+
33
+ #pragma mark -
34
+ #pragma mark View lifecycle
35
+
36
+
37
+ - (void)viewDidLoad {
38
+ [super viewDidLoad];
39
+
40
+
41
+ if(CurrentLevel == 0) {
42
+ self.navigationItem.title = @"Home";
43
+ self.navigationItem.hidesBackButton = true;
44
+ } else {
45
+ self.navigationItem.title = CurrentTitle;
46
+ self.navigationItem.hidesBackButton = false;
47
+ }
48
+
49
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
50
+ // self.navigationItem.rightBarButtonItem = self.editButtonItem;
51
+ }
52
+
53
+ /*
54
+ - (void)viewWillAppear:(BOOL)animated {
55
+ [super viewWillAppear:animated];
56
+ }
57
+ */
58
+ /*
59
+ - (void)viewDidAppear:(BOOL)animated {
60
+ [super viewDidAppear:animated];
61
+ }
62
+ */
63
+ /*
64
+ - (void)viewWillDisappear:(BOOL)animated {
65
+ [super viewWillDisappear:animated];
66
+ }
67
+ */
68
+ /*
69
+ - (void)viewDidDisappear:(BOOL)animated {
70
+ [super viewDidDisappear:animated];
71
+ }
72
+ */
73
+
74
+ /*
75
+ // Override to allow orientations other than the default portrait orientation.
76
+ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
77
+ // Return YES for supported orientations.
78
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
79
+ }
80
+ */
81
+
82
+
83
+ #pragma mark -
84
+ #pragma mark Table view data source
85
+
86
+ // Customize the number of sections in the table view.
87
+ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
88
+ return 1;
89
+ }
90
+
91
+
92
+ // Customize the number of rows in the table view.
93
+ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
94
+ {
95
+ if (!arItems)
96
+ [self setArItems: [[RhoConnectEngine sharedInstance].product find_all:nil]];
97
+
98
+ //warning here because this may be dictionary or an array when called.
99
+ return (NSUInteger)[arItems count];
100
+ }
101
+
102
+ // Customize the appearance of table view cells.
103
+ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
104
+
105
+ static NSString *CellIdentifier = @"Cell";
106
+ static NSString *ColumnCellIdentifier = @"ColumnCell";
107
+
108
+ UITableViewCell *cell;
109
+
110
+ if([arItems isKindOfClass:NSClassFromString(@"NSMutableArray")]) {
111
+ cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
112
+ if (cell == nil) {
113
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
114
+ }
115
+
116
+ // Configure the cell.
117
+ NSDictionary* item = [(NSMutableArray *)arItems objectAtIndex: indexPath.row ];
118
+ cell.textLabel.text = [item valueForKey:@"name"];
119
+ } else if([arItems isKindOfClass:NSClassFromString(@"NSDictionary")]) {
120
+
121
+ cell = [tableView dequeueReusableCellWithIdentifier:ColumnCellIdentifier];
122
+ if(cell == nil)
123
+ cell = [self reuseTableViewCellWithIdentifier:ColumnCellIdentifier];
124
+
125
+ NSString *key = [[(NSDictionary *)arItems allKeys] objectAtIndex:indexPath.row];
126
+
127
+ UILabel *lbl = (UILabel *)[cell viewWithTag:NAME_TAG];
128
+ lbl.text = key;
129
+
130
+ UILabel *lblText = (UILabel *)[cell viewWithTag:TEXT_TAG];
131
+ lblText.text = [arItems valueForKey:key];
132
+ }
133
+ return cell;
134
+ }
135
+
136
+
137
+ /*
138
+ // Override to support conditional editing of the table view.
139
+ - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
140
+ // Return NO if you do not want the specified item to be editable.
141
+ return YES;
142
+ }
143
+ */
144
+
145
+
146
+ /*
147
+ // Override to support editing the table view.
148
+ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
149
+
150
+ if (editingStyle == UITableViewCellEditingStyleDelete) {
151
+ // Delete the row from the data source.
152
+ [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
153
+ }
154
+ else if (editingStyle == UITableViewCellEditingStyleInsert) {
155
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
156
+ }
157
+ }
158
+ */
159
+
160
+
161
+ /*
162
+ // Override to support rearranging the table view.
163
+ - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
164
+ }
165
+ */
166
+
167
+
168
+ /*
169
+ // Override to support conditional rearranging of the table view.
170
+ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
171
+ // Return NO if you do not want the item to be re-orderable.
172
+ return YES;
173
+ }
174
+ */
175
+
176
+
177
+ #pragma mark -
178
+ #pragma mark Table view delegate
179
+
180
+ - (void)doSyncAllTest {
181
+ [[RhoConnectEngine sharedInstance].syncClient setNotification: @selector(syncAllCalback:) target:self];
182
+ [[RhoConnectEngine sharedInstance].syncClient syncAll];
183
+ }
184
+
185
+ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
186
+
187
+ //if (indexPath.row == 3) {
188
+ // [self doSyncAllTest];
189
+ // return;
190
+ //}
191
+
192
+ if([arItems isKindOfClass:NSClassFromString(@"NSMutableArray")]) {
193
+ //Get the dictionary of the selected data source.
194
+ NSDictionary *dictionary = [(NSMutableArray *)arItems objectAtIndex:indexPath.row];
195
+
196
+
197
+ //Prepare to tableview.
198
+ RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
199
+
200
+ //Increment the Current View
201
+ rvController.CurrentLevel += 1;
202
+
203
+ //Set the title;
204
+ rvController.CurrentTitle = [dictionary objectForKey:@"name"];
205
+
206
+ //Push the new table view on the stack
207
+ [self.navigationController pushViewController:rvController animated:YES];
208
+
209
+ rvController.arItems = dictionary;
210
+
211
+ [rvController release];
212
+ }
213
+ }
214
+
215
+ - (void)syncAllCalback:(RhoConnectNotify*) notify {
216
+ NSString* status = notify.status;
217
+ NSString* error = notify.error_message;
218
+ int err_code = notify.error_code;
219
+
220
+ NSLog(@"syncAll DONE, status: '%s' , error_msg: '%s' , error_code: %d",
221
+ [status cStringUsingEncoding: NSUTF8StringEncoding],
222
+ [error cStringUsingEncoding: NSUTF8StringEncoding],
223
+ err_code
224
+ );
225
+
226
+ if ( [notify.status compare:@"in_progress"] == 0) {
227
+
228
+ } else if ([notify.status compare:@"complete"] == 0) {
229
+
230
+ [[RhoConnectEngine sharedInstance].syncClient clearNotification];
231
+
232
+ } else if ([notify.status compare:@"error"] == 0) {
233
+
234
+ if([notify.error_message caseInsensitiveCompare:@"unknown client"] == 0) {
235
+ [[RhoConnectEngine sharedInstance].syncClient database_client_reset];
236
+ [[RhoConnectEngine sharedInstance].syncClient setNotification: @selector(syncAllCalback:) target:self];
237
+ [[RhoConnectEngine sharedInstance].syncClient syncAll];
238
+ } else if( err_code == RHO_ERR_CLIENTISNOTLOGGEDIN
239
+ || err_code == RHO_ERR_UNATHORIZED) {
240
+
241
+ NSLog(@"GO TO LOGIN PAGE!");
242
+ // real code to trigger view transition goes here..
243
+ }
244
+ }
245
+ }
246
+
247
+ #pragma mark -
248
+ #pragma mark Memory management
249
+
250
+ - (void)didReceiveMemoryWarning {
251
+ // Releases the view if it doesn't have a superview.
252
+ [super didReceiveMemoryWarning];
253
+
254
+ // Relinquish ownership any cached data, images, etc that aren't in use.
255
+ }
256
+
257
+ - (void)viewDidUnload {
258
+ // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
259
+ // For example: self.myOutlet = nil;
260
+ }
261
+
262
+
263
+ - (void)dealloc {
264
+ [super dealloc];
265
+ }
266
+
267
+
268
+ #pragma mark -
269
+ #pragma mark Custom Cell
270
+ -(UITableViewCell *)reuseTableViewCellWithIdentifier:(NSString *)identifier {
271
+
272
+ //Rectangle which will be used to create labels and table view cell.
273
+ CGRect cellRectangle;
274
+
275
+ //Returns a rectangle with the coordinates and dimensions.
276
+ cellRectangle = CGRectMake(0.0, 0.0, CELL_WIDTH, ROW_HEIGHT);
277
+
278
+ //Initialize a UITableViewCell with the rectangle we created.
279
+ UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellRectangle reuseIdentifier:identifier] autorelease];
280
+
281
+ //Now we have to create the two labels.
282
+ UILabel *label;
283
+
284
+ //Create a rectangle container for the number text.
285
+ cellRectangle = CGRectMake(NAME_OFFSET, (ROW_HEIGHT - LABEL_HEIGHT) / 2.0, NAME_WIDTH, LABEL_HEIGHT);
286
+
287
+ //Initialize the label with the rectangle.
288
+ label = [[UILabel alloc] initWithFrame:cellRectangle];
289
+
290
+ //Mark the label with a tag
291
+ label.tag = NAME_TAG;
292
+
293
+ //Add the label as a sub view to the cell.
294
+ [cell.contentView addSubview:label];
295
+ [label release];
296
+
297
+ //Create a rectangle container for the custom text.
298
+ cellRectangle = CGRectMake(TEXT_OFFSET, (ROW_HEIGHT - LABEL_HEIGHT) / 2.0, TEXT_WIDTH, LABEL_HEIGHT);
299
+
300
+ //Initialize the label with the rectangle.
301
+ label = [[UILabel alloc] initWithFrame:cellRectangle];
302
+
303
+ //Mark the label with a tag
304
+ label.tag = TEXT_TAG;
305
+
306
+ //Add the label as a sub view to the cell.
307
+ [cell.contentView addSubview:label];
308
+ [label release];
309
+
310
+ return cell;
311
+ }
312
+
313
+ @end
314
+