rsence 2.0.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. data/INSTALL.rdoc +295 -0
  2. data/LICENSE +622 -0
  3. data/README.rdoc +24 -0
  4. data/VERSION +1 -0
  5. data/bin/build_client.rb +254 -0
  6. data/bin/help +6 -0
  7. data/bin/launch.rb +120 -0
  8. data/bin/rdoc.sh +2 -0
  9. data/bin/restart +6 -0
  10. data/bin/rsence +120 -0
  11. data/bin/run +6 -0
  12. data/bin/run.rb +6 -0
  13. data/bin/save +6 -0
  14. data/bin/start +6 -0
  15. data/bin/status +6 -0
  16. data/bin/stop +6 -0
  17. data/conf/config.ru +5 -0
  18. data/conf/default_conf.yaml +337 -0
  19. data/conf/default_strings.yaml +77 -0
  20. data/conf/local_conf.yaml +14 -0
  21. data/conf/unicorn.conf +78 -0
  22. data/js/comm/comm/autosync/autosync.js +18 -0
  23. data/js/comm/comm/autosync/js.inc +0 -0
  24. data/js/comm/comm/comm.js +195 -0
  25. data/js/comm/comm/js.inc +0 -0
  26. data/js/comm/comm/queue/js.inc +0 -0
  27. data/js/comm/comm/queue/queue.js +183 -0
  28. data/js/comm/comm/session/js.inc +0 -0
  29. data/js/comm/comm/session/session.js +51 -0
  30. data/js/comm/comm/sessionwatcher/js.inc +0 -0
  31. data/js/comm/comm/sessionwatcher/sessionwatcher.js +43 -0
  32. data/js/comm/comm/transporter/js.inc +0 -0
  33. data/js/comm/comm/transporter/transporter.js +257 -0
  34. data/js/comm/comm/urlresponder/js.inc +0 -0
  35. data/js/comm/comm/urlresponder/urlresponder.js +148 -0
  36. data/js/comm/comm/values/js.inc +0 -0
  37. data/js/comm/comm/values/values.js +432 -0
  38. data/js/comm/jsloader/js.inc +0 -0
  39. data/js/comm/jsloader/jsloader.js +114 -0
  40. data/js/comm/reloadapp/js.inc +0 -0
  41. data/js/comm/reloadapp/reloadapp.js +150 -0
  42. data/js/comm/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
  43. data/js/comm/reloadapp/themes/default/reloadapp_warning.png +0 -0
  44. data/js/comm/sha/js.inc +0 -0
  45. data/js/comm/sha/sha.js +432 -0
  46. data/js/comm/values/value/js.inc +0 -0
  47. data/js/comm/values/value/value.js +182 -0
  48. data/js/comm/values/valuematrix/js.inc +0 -0
  49. data/js/comm/values/valuematrix/valuematrix.js +138 -0
  50. data/js/controls/button/button.js +57 -0
  51. data/js/controls/button/js.inc +0 -0
  52. data/js/controls/button/themes/bright/button.css +89 -0
  53. data/js/controls/button/themes/bright/button.html +7 -0
  54. data/js/controls/button/themes/bright/button_parts1-ie6.gif +0 -0
  55. data/js/controls/button/themes/bright/button_parts1.png +0 -0
  56. data/js/controls/button/themes/default/button.css +89 -0
  57. data/js/controls/button/themes/default/button.html +7 -0
  58. data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
  59. data/js/controls/button/themes/default/button_parts1.png +0 -0
  60. data/js/controls/checkbox/checkbox.js +47 -0
  61. data/js/controls/checkbox/js.inc +0 -0
  62. data/js/controls/checkbox/themes/default/checkbox.css +69 -0
  63. data/js/controls/checkbox/themes/default/checkbox.html +5 -0
  64. data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
  65. data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
  66. data/js/controls/datetime/calendar/calendar.js +197 -0
  67. data/js/controls/datetime/calendar/js.inc +0 -0
  68. data/js/controls/datetime/calendar/themes/default/calendar.css +108 -0
  69. data/js/controls/datetime/calendar/themes/default/calendar.html +9 -0
  70. data/js/controls/datetime/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
  71. data/js/controls/datetime/calendar/themes/default/calendar_arrows.png +0 -0
  72. data/js/controls/datetime/datetimevalue/datetimevalue.js +246 -0
  73. data/js/controls/datetime/datetimevalue/js.inc +0 -0
  74. data/js/controls/datetime/timesheet/js.inc +0 -0
  75. data/js/controls/datetime/timesheet/themes/default/timesheet.css +30 -0
  76. data/js/controls/datetime/timesheet/themes/default/timesheet.html +2 -0
  77. data/js/controls/datetime/timesheet/timesheet.js +182 -0
  78. data/js/controls/datetime/timesheet_item/js.inc +0 -0
  79. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.css +42 -0
  80. data/js/controls/datetime/timesheet_item/themes/default/timesheet_item.html +8 -0
  81. data/js/controls/datetime/timesheet_item/timesheet_item.js +247 -0
  82. data/js/controls/datetime/timesheet_item_edit/js.inc +0 -0
  83. data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +274 -0
  84. data/js/controls/dialogs/alert_sheet/alert_sheet.js +62 -0
  85. data/js/controls/dialogs/alert_sheet/js.inc +0 -0
  86. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +36 -0
  87. data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
  88. data/js/controls/dialogs/sheet/js.inc +0 -0
  89. data/js/controls/dialogs/sheet/sheet.js +83 -0
  90. data/js/controls/dialogs/sheet/themes/default/sheet.css +64 -0
  91. data/js/controls/dialogs/sheet/themes/default/sheet.html +14 -0
  92. data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
  93. data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
  94. data/js/controls/dialogs/sheet/themes/default/sheet_dim-ie6.gif +0 -0
  95. data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
  96. data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
  97. data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
  98. data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
  99. data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
  100. data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
  101. data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
  102. data/js/controls/imageview/imageview.js +108 -0
  103. data/js/controls/imageview/js.inc +0 -0
  104. data/js/controls/imageview/themes/default/blank.gif +0 -0
  105. data/js/controls/lists/checkboxlist/checkboxlist.js +170 -0
  106. data/js/controls/lists/checkboxlist/js.inc +0 -0
  107. data/js/controls/lists/listitems/js.inc +0 -0
  108. data/js/controls/lists/listitems/listitems.js +65 -0
  109. data/js/controls/lists/radiobuttonlist/js.inc +0 -0
  110. data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +126 -0
  111. data/js/controls/passwordcontrol/js.inc +0 -0
  112. data/js/controls/passwordcontrol/passwordcontrol.js +22 -0
  113. data/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
  114. data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +18 -0
  115. data/js/controls/progress/progressbar/js.inc +0 -0
  116. data/js/controls/progress/progressbar/progressbar.js +36 -0
  117. data/js/controls/progress/progressbar/themes/default/progressbar.css +16 -0
  118. data/js/controls/progress/progressbar/themes/default/progressbar.html +2 -0
  119. data/js/controls/progress/progressindicator/js.inc +0 -0
  120. data/js/controls/progress/progressindicator/progressindicator.js +43 -0
  121. data/js/controls/radiobutton/js.inc +0 -0
  122. data/js/controls/radiobutton/radiobutton.js +41 -0
  123. data/js/controls/radiobutton/themes/default/radiobutton.css +69 -0
  124. data/js/controls/radiobutton/themes/default/radiobutton.html +5 -0
  125. data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
  126. data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
  127. data/js/controls/sliders/slider/js.inc +0 -0
  128. data/js/controls/sliders/slider/slider.js +356 -0
  129. data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
  130. data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
  131. data/js/controls/sliders/slider/themes/default/slider.css +108 -0
  132. data/js/controls/sliders/slider/themes/default/slider.html +5 -0
  133. data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
  134. data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
  135. data/js/controls/sliders/vslider/js.inc +0 -0
  136. data/js/controls/sliders/vslider/themes/default/vslider.css +52 -0
  137. data/js/controls/sliders/vslider/themes/default/vslider.html +5 -0
  138. data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
  139. data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
  140. data/js/controls/sliders/vslider/vslider.js +40 -0
  141. data/js/controls/stepper/js.inc +0 -0
  142. data/js/controls/stepper/stepper.js +212 -0
  143. data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
  144. data/js/controls/stepper/themes/default/stepper.css +14 -0
  145. data/js/controls/stepper/themes/default/stepper.html +2 -0
  146. data/js/controls/stepper/themes/default/stepper.png +0 -0
  147. data/js/controls/stringview/js.inc +0 -0
  148. data/js/controls/stringview/stringview.js +49 -0
  149. data/js/controls/stringview/themes/default/stringview.css +8 -0
  150. data/js/controls/stringview/themes/default/stringview.html +1 -0
  151. data/js/controls/tab/js.inc +0 -0
  152. data/js/controls/tab/tab.js +276 -0
  153. data/js/controls/tab/themes/bright/tab.css +76 -0
  154. data/js/controls/tab/themes/bright/tab.html +6 -0
  155. data/js/controls/tab/themes/bright/tab_bg_color-ie6.gif +0 -0
  156. data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
  157. data/js/controls/tab/themes/bright/tab_border_pattern-ie6.gif +0 -0
  158. data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
  159. data/js/controls/tab/themes/bright/tab_parts1-ie6.gif +0 -0
  160. data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
  161. data/js/controls/tab/themes/default/tab.css +77 -0
  162. data/js/controls/tab/themes/default/tab.html +6 -0
  163. data/js/controls/tab/themes/default/tab_bg_color-ie6.gif +0 -0
  164. data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
  165. data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
  166. data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
  167. data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
  168. data/js/controls/tab/themes/default/tab_parts1.png +0 -0
  169. data/js/controls/textarea/js.inc +0 -0
  170. data/js/controls/textarea/textarea.js +23 -0
  171. data/js/controls/textarea/themes/default/textarea.css +21 -0
  172. data/js/controls/textarea/themes/default/textarea.html +18 -0
  173. data/js/controls/textcontrol/js.inc +0 -0
  174. data/js/controls/textcontrol/textcontrol.js +372 -0
  175. data/js/controls/textcontrol/themes/default/textcontrol.css +107 -0
  176. data/js/controls/textcontrol/themes/default/textcontrol.html +18 -0
  177. data/js/controls/textcontrol/themes/default/textcontrol_parts1-ie6.gif +0 -0
  178. data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
  179. data/js/controls/textcontrol/themes/default/textcontrol_parts2-ie6.gif +0 -0
  180. data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
  181. data/js/controls/textcontrol/themes/default/textcontrol_parts3-ie6.gif +0 -0
  182. data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
  183. data/js/controls/uploader/js.inc +0 -0
  184. data/js/controls/uploader/themes/default/upload_progress.gif +0 -0
  185. data/js/controls/uploader/themes/default/uploader.css +108 -0
  186. data/js/controls/uploader/themes/default/uploader.html +27 -0
  187. data/js/controls/uploader/uploader.js +153 -0
  188. data/js/controls/validatorview/js.inc +0 -0
  189. data/js/controls/validatorview/themes/default/validator-ie6.gif +0 -0
  190. data/js/controls/validatorview/themes/default/validator.png +0 -0
  191. data/js/controls/validatorview/themes/default/validatorview.css +0 -0
  192. data/js/controls/validatorview/themes/default/validatorview.html +0 -0
  193. data/js/controls/validatorview/validatorview.js +55 -0
  194. data/js/controls/window/js.inc +0 -0
  195. data/js/controls/window/themes/default/window.css +219 -0
  196. data/js/controls/window/themes/default/window.html +17 -0
  197. data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
  198. data/js/controls/window/themes/default/window_bg_active.png +0 -0
  199. data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
  200. data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
  201. data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
  202. data/js/controls/window/themes/default/window_buttons.png +0 -0
  203. data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
  204. data/js/controls/window/themes/default/window_parts1.png +0 -0
  205. data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
  206. data/js/controls/window/themes/default/window_parts2.png +0 -0
  207. data/js/controls/window/window.js +284 -0
  208. data/js/core/class/class.js +317 -0
  209. data/js/core/class/js.inc +0 -0
  210. data/js/core/elem/elem.js +1376 -0
  211. data/js/core/elem/js.inc +0 -0
  212. data/js/core/event/event.js +1021 -0
  213. data/js/core/event/js.inc +0 -0
  214. data/js/core/iefix/ie_css_element.htc +5 -0
  215. data/js/core/iefix/ie_css_style.htc +5 -0
  216. data/js/core/iefix/iefix.js +359 -0
  217. data/js/core/iefix/js.inc +0 -0
  218. data/js/debugg/debugg.js +43 -0
  219. data/js/debugg/js.inc +0 -0
  220. data/js/foundation/application/application.js +209 -0
  221. data/js/foundation/application/js.inc +0 -0
  222. data/js/foundation/control/control.js +342 -0
  223. data/js/foundation/control/controldefaults/controldefaults.js +59 -0
  224. data/js/foundation/control/controldefaults/js.inc +0 -0
  225. data/js/foundation/control/dummyvalue/dummyvalue.js +50 -0
  226. data/js/foundation/control/dummyvalue/js.inc +0 -0
  227. data/js/foundation/control/dyncontrol/dyncontrol.js +494 -0
  228. data/js/foundation/control/dyncontrol/js.inc +0 -0
  229. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.css +0 -0
  230. data/js/foundation/control/dyncontrol/themes/default/dyncontrol.html +0 -0
  231. data/js/foundation/control/eventresponder/eventresponder.js +713 -0
  232. data/js/foundation/control/eventresponder/js.inc +0 -0
  233. data/js/foundation/control/js.inc +0 -0
  234. data/js/foundation/control/valueresponder/js.inc +0 -0
  235. data/js/foundation/control/valueresponder/valueresponder.js +77 -0
  236. data/js/foundation/geom/point/js.inc +0 -0
  237. data/js/foundation/geom/point/point.js +202 -0
  238. data/js/foundation/geom/rect/js.inc +0 -0
  239. data/js/foundation/geom/rect/rect.js +610 -0
  240. data/js/foundation/json_renderer/js.inc +0 -0
  241. data/js/foundation/json_renderer/json_renderer.js +231 -0
  242. data/js/foundation/system/js.inc +0 -0
  243. data/js/foundation/system/system.js +369 -0
  244. data/js/foundation/thememanager/js.inc +0 -0
  245. data/js/foundation/thememanager/thememanager.js +387 -0
  246. data/js/foundation/view/js.inc +0 -0
  247. data/js/foundation/view/markupview/js.inc +0 -0
  248. data/js/foundation/view/markupview/markupview.js +113 -0
  249. data/js/foundation/view/morphanimation/js.inc +0 -0
  250. data/js/foundation/view/morphanimation/morphanimation.js +236 -0
  251. data/js/foundation/view/view.js +1804 -0
  252. data/js/foundation/view/viewdefaults/js.inc +0 -0
  253. data/js/foundation/view/viewdefaults/viewdefaults.js +25 -0
  254. data/js/views/centerview/centerview.js +45 -0
  255. data/js/views/centerview/js.inc +0 -0
  256. data/js/views/inlineview/inlineview.js +14 -0
  257. data/js/views/inlineview/js.inc +0 -0
  258. data/js/views/scrollview/js.inc +0 -0
  259. data/js/views/scrollview/scrollview.js +39 -0
  260. data/lib/conf/default.rb +220 -0
  261. data/lib/conf/wizard.rb +303 -0
  262. data/lib/daemon/daemon.rb +293 -0
  263. data/lib/http/broker.rb +102 -0
  264. data/lib/http/rackup.rb +88 -0
  265. data/lib/http/request.rb +69 -0
  266. data/lib/http/response.rb +63 -0
  267. data/lib/plugins/gui_plugin.rb +129 -0
  268. data/lib/plugins/guiparser.rb +114 -0
  269. data/lib/plugins/plugin.rb +652 -0
  270. data/lib/plugins/plugin_plugins.rb +47 -0
  271. data/lib/plugins/plugin_sqlite_db.rb +72 -0
  272. data/lib/plugins/plugin_util.rb +96 -0
  273. data/lib/plugins/pluginmanager.rb +517 -0
  274. data/lib/plugins/servlet.rb +69 -0
  275. data/lib/session/msg.rb +291 -0
  276. data/lib/session/sessionmanager.rb +491 -0
  277. data/lib/session/sessionstorage.rb +314 -0
  278. data/lib/transporter/transporter.rb +254 -0
  279. data/lib/util/gzstring.rb +5 -0
  280. data/lib/values/hvalue.rb +323 -0
  281. data/lib/values/valuemanager.rb +152 -0
  282. data/plugins/client_pkg/client_pkg.rb +186 -0
  283. data/plugins/client_pkg/info.yaml +25 -0
  284. data/plugins/client_pkg/lib/client_pkg_build.rb +569 -0
  285. data/plugins/client_pkg/lib/client_pkg_cache.rb +50 -0
  286. data/plugins/client_pkg/lib/client_pkg_serve.rb +210 -0
  287. data/plugins/client_pkg/log/build_log +0 -0
  288. data/plugins/index_html/img/loading.gif +0 -0
  289. data/plugins/index_html/img/riassence.gif +0 -0
  290. data/plugins/index_html/index_html.rb +150 -0
  291. data/plugins/index_html/tmpl/index.html +22 -0
  292. data/plugins/index_html/tmpl/startup_index.html +29 -0
  293. data/plugins/legacy/disabled +0 -0
  294. data/plugins/legacy/disabled- +0 -0
  295. data/plugins/legacy/info.yaml +22 -0
  296. data/plugins/legacy/legacy.rb +15 -0
  297. data/plugins/main/js/riassence_ns.js +87 -0
  298. data/plugins/main/main.rb +234 -0
  299. data/plugins/main/values.yaml +8 -0
  300. data/plugins/ticketservices/lib/common.rb +300 -0
  301. data/plugins/ticketservices/lib/favicon.rb +38 -0
  302. data/plugins/ticketservices/lib/file.rb +58 -0
  303. data/plugins/ticketservices/lib/img.rb +50 -0
  304. data/plugins/ticketservices/lib/objblob.rb +66 -0
  305. data/plugins/ticketservices/lib/rsrc.rb +34 -0
  306. data/plugins/ticketservices/lib/upload.rb +206 -0
  307. data/plugins/ticketservices/ticketservices.rb +268 -0
  308. data/var/db/.git_include +0 -0
  309. data/var/log/.git_include +0 -0
  310. data/var/run/.git_include +0 -0
  311. metadata +390 -0
File without changes
@@ -0,0 +1,25 @@
1
+ /* Riassence Framework
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+ /*** = Description
10
+ ** Define default HView setting here. Will be used, when no or invalid constructor
11
+ ** options are supplied.
12
+ ***/
13
+ HViewDefaults = HClass.extend({
14
+
15
+ /** The default label. A label is the "visual value" of a component that
16
+ * operates on a "hidden" value.
17
+ **/
18
+ label: "",
19
+
20
+ /** The default initial visibility of the component.
21
+ **/
22
+ visible: true
23
+
24
+ });
25
+
@@ -0,0 +1,45 @@
1
+ /* Riassence Framework
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+ // Simple view for centering a view.
10
+ // The rect's left position is used as the minimum left position, the rects
11
+ // top and width are used as-is and the HCenterView itself is geometrically
12
+ // centered inside its parent by adjusting its "left" style property.
13
+ // Designed to be used as a root-level view, listens to the resize event and
14
+ // re-calculates the center position accordingly. Likely to evolve a lot still.
15
+ HCenterView = HControl.extend({
16
+ defaultEvents: {
17
+ resize: true
18
+ },
19
+ drawRect: function(_selfCalled){
20
+ this.base();
21
+ if(!_selfCalled){
22
+ this.resize();
23
+ }
24
+ },
25
+ minLeft: false,
26
+ resize: function(){
27
+ if(this.minLeft === false){
28
+ this.minLeft = this.rect.left;
29
+ }
30
+ var
31
+ _rect = this.rect,
32
+ _winSize = ELEM.windowSize(),
33
+ _winWidth = _winSize[0],
34
+ _winHeight = _winSize[1],
35
+ _rectWidth = _rect.width,
36
+ _rectWidthHalf = Math.floor(_rectWidth/2),
37
+ _winWidthHalf = Math.floor(_winWidth/2),
38
+ _left = _winWidthHalf - _rectWidthHalf;
39
+ if( _left < this.minLeft ){
40
+ _left = this.minLeft;
41
+ }
42
+ _rect.offsetTo( _left, _rect.top );
43
+ this.drawRect(true);
44
+ }
45
+ });
File without changes
@@ -0,0 +1,14 @@
1
+ /* Riassence Framework
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+ // Simple view for inline content (relative positioning and inline view instead of block)
10
+ HInlineView = HView.extend({
11
+ isAbsolute: false,
12
+ isRelative: true,
13
+ displayMode: 'inline'
14
+ });
File without changes
File without changes
@@ -0,0 +1,39 @@
1
+ /* Riassence Framework
2
+ * Copyright 2010 Riassence Inc.
3
+ * http://riassence.com/
4
+ *
5
+ * You should have received a copy of the GNU General Public License along
6
+ * with this software package. If not, contact licensing@riassence.com
7
+ */
8
+
9
+ // Simple view for scrolling purposes.
10
+ // Uses two special options for setting scroll bar behavior:
11
+ // - scrollX: true | false | 'auto'
12
+ // - scrollY: true | false | 'auto'
13
+ HScrollView = HControl.extend({
14
+ controlDefaults: HControlDefaults.extend({
15
+ scrollX: true,
16
+ scrollY: true
17
+ }),
18
+ drawSubviews: function(){
19
+ if(!this.options.scrollX){
20
+ this.setStyle('overflow-x','hidden');
21
+ }
22
+ else if(this.options.scrollX === 'auto'){
23
+ this.setStyle('overflow-x','auto');
24
+ }
25
+ else {
26
+ this.setStyle('overflow-x','scroll');
27
+ }
28
+ if(!this.options.scrollY){
29
+ this.setStyle('overflow-y','hidden');
30
+ }
31
+ else if(this.options.scrollY === 'auto'){
32
+ this.setStyle('overflow-y','auto');
33
+ }
34
+ else {
35
+ this.setStyle('overflow-y','scroll');
36
+ }
37
+ }
38
+ });
39
+
@@ -0,0 +1,220 @@
1
+ #--
2
+ ## Riassence Framework
3
+ # Copyright 2008 Riassence Inc.
4
+ # http://riassence.com/
5
+ #
6
+ # You should have received a copy of the GNU General Public License along
7
+ # with this software package. If not, contact licensing@riassence.com
8
+ ##
9
+ #++
10
+
11
+ require 'rubygems'
12
+ require 'rack'
13
+ require 'yaml'
14
+
15
+ # Legacy:
16
+ LIB_PATHS = []
17
+ PIDPATH = File.join(SERVER_PATH,'var','run')
18
+ LOGPATH = File.join(SERVER_PATH,'var','log')
19
+ def load_legacy( local_config_file_path )
20
+ require local_config_file_path[0..-4]
21
+ end
22
+
23
+ module RSence
24
+
25
+ class Configuration
26
+ def array_merge( target, source )
27
+ source.each do |item|
28
+ unless target.include?(item)
29
+ if item.class == Array
30
+ sub_arr = []
31
+ array_merge( sub_arr, item )
32
+ target.push( sub_arr )
33
+ elsif item.class == Hash
34
+ sub_hash = {}
35
+ hash_merge( sub_hash, item )
36
+ target.push( sub_hash )
37
+ else
38
+ target.push( item )
39
+ end
40
+ end
41
+ end
42
+ end
43
+ def hash_merge( target, source )
44
+ source.each do |key,item|
45
+ if not target.has_key?key or target[key] != item
46
+ if item.class == Array
47
+ target[key] = [] unless target.has_key?(key)
48
+ array_merge( target[key], item )
49
+ elsif item.class == Hash
50
+ target[key] = {} unless target.has_key?key
51
+ hash_merge( target[key], item )
52
+ else
53
+ target[key] = item
54
+ end
55
+ end
56
+ end
57
+ end
58
+ def initialize
59
+ ## Paths for log and pid files
60
+ pidpath = File.join(SERVER_PATH,'var','run')
61
+ logpath = File.join(SERVER_PATH,'var','log')
62
+
63
+ yaml_conf_path = File.join( SERVER_PATH, 'conf', 'default_conf.yaml' )
64
+
65
+ yaml_strings_path = File.join( SERVER_PATH, 'conf', 'default_strings.yaml' )
66
+ strings = YAML.load( File.read( yaml_strings_path ) )
67
+
68
+ ## Global configuration hash
69
+ config = YAML.load( File.read( yaml_conf_path ) )
70
+ config[:transporter_conf][:messages] = strings[:messages][:transporter]
71
+
72
+ default_plugins_path = File.join( SERVER_PATH, 'plugins' )
73
+
74
+ unless config[:plugin_paths].include? default_plugins_path
75
+ config[:plugin_paths].push( default_plugins_path )
76
+ end
77
+
78
+ ## Paths of server libraries
79
+ lib_paths = [
80
+ ## already included in launch.rb; override this one in local config, if needed
81
+ #File.join( SERVER_PATH, 'lib' )
82
+ ]
83
+
84
+ ## Create default local configuratation override file, if it does not exist:
85
+ local_config_file_paths = [
86
+ File.join(SERVER_PATH,'conf','local_conf.yaml'),
87
+ File.join( File.split( SERVER_PATH )[0], 'conf', 'local_conf.yaml' ),
88
+ File.join( Dir.pwd, 'conf', 'local_conf.yaml' ),
89
+ File.join(SERVER_PATH,'conf','local_conf.rb'),
90
+ File.join( File.split( SERVER_PATH )[0], 'conf', 'local_conf.rb' ),
91
+ File.join( Dir.pwd, 'conf', 'local_conf.rb' )
92
+ ]
93
+ if ARGV.include?('--config')
94
+ argv_conf_file = ARGV[ARGV.index('--config')+1]
95
+ if not argv_conf_file.begin_with? '/'
96
+ argv_conf_file = File.join( Dir.pwd, conf_file )
97
+ end
98
+ local_config_file_paths.push( argv_conf_file )
99
+ end
100
+
101
+ local_config_file_path_found = false
102
+ local_config_file_paths.each do |local_config_file_path|
103
+ if File.exists? local_config_file_path and File.file? local_config_file_path
104
+ if local_config_file_path.end_with? '.yaml'
105
+ local_conf = YAML.load( File.read( local_config_file_path ) )
106
+ hash_merge( config, local_conf )
107
+ local_config_file_path_found = true
108
+ elsif local_config_file_path.end_with? '.rb'
109
+ # Legacy work-arounds
110
+ prev_pidpath = PIDPATH
111
+ prev_logpath = LOGPATH
112
+ # /Legacy work-arounds
113
+ load_legacy( local_config_file_path )
114
+ # Legacy work-arounds
115
+ pidpath = PIDPATH if PIDPATH != prev_pidpath
116
+ logpath = LOGPATH if LOGPATH != prev_logpath
117
+ # /Legacy work-arounds
118
+ local_config_file_path_found = true
119
+ else
120
+ warn "Only Yaml and Ruby configuration files are allowed at this time."
121
+ end
122
+ end
123
+ end
124
+
125
+ if not local_config_file_path_found or ARGV.include? '--run-wizard'
126
+ puts "NOTE: No local configuration file found, running the, configuration wizard." unless ARGV.include? '--run-wizard'
127
+ puts "Please answer the following questions, blank lines equal to the default in brackets:"
128
+ require 'conf/wizard'
129
+ if File.directory?( File.join( Dir.pwd, 'conf' ) )
130
+ wizard_conf_file = File.join( Dir.pwd, 'conf', 'local_conf.yaml' )
131
+ else
132
+ wizard_conf_file = File.join( SERVER_PATH, 'conf', 'local_conf.yaml' )
133
+ end
134
+ wizard_config_data = ConfigWizard.new(config).run( wizard_conf_file )
135
+ config.merge!( wizard_config_data )
136
+ end
137
+
138
+ if not config[:database].has_key?( :ses_db ) and config[:database].has_key?( :auth_setup )
139
+ warn "WARNING: The database is not configured with a :ses_db url."
140
+ warn " You are advised to convert the :root_setup and :auth_setup keys of"
141
+ warn " config[:database] to the new url format."
142
+ db_auth = config[:database][:auth_setup]
143
+ config[:database][:ses_db] = "mysql://#{db_auth[:user]}:#{db_auth[:pass]}@#{db_auth[:host]}:#{db_auth[:port]}/#{db_auth[:db]}"
144
+ warn " -> Performed automatic conversion of :auth_setup as"
145
+ warn " config[:database][:ses_db] = #{config[:database][:ses_db].inspect}"
146
+ end
147
+
148
+
149
+ config[:trace] = true if ARGV.include?('--trace-js')
150
+ config[:debug_mode] = true if ARGV.include?('-d') or ARGV.include?('--debug')
151
+ config[:http_server][:latency] = ARGV[ARGV.index('--latency')+1].to_i if ARGV.include?('--latency')
152
+ config[:http_server][:port] = ARGV[ARGV.index('--port')+1].to_i if ARGV.include?('--port')
153
+ config[:http_server][:bind_address] = ARGV[ARGV.index('--addr')+1] if ARGV.include?('--addr')
154
+ config[:http_server][:rack_require] = ARGV[ARGV.index('--server')+1] if ARGV.include?('--server')
155
+ config[:session_conf][:reset_sessions] = true if ARGV.include?('--reset-sessions=true') or ARGV.include?('--reset-sessions')
156
+ config[:daemon][:pid_fn] = File.join(pidpath, "rsence.pid") unless config[:daemon].has_key?(:pid_fn)
157
+ config[:daemon][:log_fn] = File.join(logpath, "rsence") unless config[:daemon].has_key?(:log_fn)
158
+
159
+
160
+ ## Broker configuration
161
+ [ ## POST-requests
162
+ # broker_key # default_uri
163
+ # The default responder for transporter requests.
164
+ [ :x, File.join(config[:base_url],'x') ],
165
+ # The default responder for cookie-enabled "handshake" transporter requests
166
+ [ :hello, File.join(config[:base_url],'hello') ],
167
+ # The default responder for SOAP -requests
168
+ [ :soap, File.join(config[:base_url],'SOAP') ],
169
+ # The default responder for file uploads
170
+ [ :u, File.join(config[:base_url],'U') ],
171
+
172
+ ## GET-requests
173
+ # broker_key # default_uri
174
+ # The default address of built javascript and theme packages
175
+ [ :h, File.join(config[:base_url],'H/') ],
176
+ # The default address of the ticketserve :img -category
177
+ [ :i, File.join(config[:base_url],'i/') ],
178
+ # The default address of the ticketserve :rsrc -category
179
+ [ :d, File.join(config[:base_url],'d/') ],
180
+ # The default address of the ticketserve :file -category
181
+ [ :f, File.join(config[:base_url],'f/') ],
182
+ # The default address of the ticketserve :blobobj -category
183
+ [ :b, File.join(config[:base_url],'b/') ],
184
+ # The default address of the favicon
185
+ [ :favicon, '/favicon.ico' ],
186
+ # The default address of the "empty" iframe of uploader
187
+ [ :uploader_iframe, File.join(config[:base_url],'U/iframe_html') ],
188
+ ].each do |broker_key, default_uri|
189
+ unless config[:broker_urls].has_key?( broker_key )
190
+ config[:broker_urls][broker_key] = default_uri
191
+ end
192
+ end
193
+
194
+ # The default address of the index_html plugin
195
+ unless config[:index_html].has_key?(:respond_address)
196
+ config[:index_html][:respond_address] = File.join(config[:base_url])
197
+ end
198
+
199
+ ## Uses the lib paths as search paths
200
+ lib_paths.each do |lib_path|
201
+ $LOAD_PATH << lib_path
202
+ end
203
+
204
+ ## Legacy:
205
+ LIB_PATHS.each do |lib_path|
206
+ $LOAD_PATH << lib_path
207
+ end
208
+
209
+ @config = config
210
+ end
211
+ attr_reader :config
212
+ end
213
+ @@config = Configuration.new.config
214
+ def self.config
215
+ @@config
216
+ end
217
+
218
+ end
219
+
220
+
@@ -0,0 +1,303 @@
1
+ #--
2
+ ## Riassence Framework
3
+ # Copyright 2008 Riassence Inc.
4
+ # http://riassence.com/
5
+ #
6
+ # You should have received a copy of the GNU General Public License along
7
+ # with this software package. If not, contact licensing@riassence.com
8
+ ##
9
+ #++
10
+
11
+
12
+ require 'rubygems'
13
+ require 'highline/import'
14
+
15
+ require 'randgen'
16
+
17
+ class ConfigWizard
18
+
19
+ # returns a deep copy of source_hash using Marshal
20
+ # (I wish there was a better way)
21
+ def hash_deep_copy(source_hash)
22
+ return Marshal.restore( Marshal.dump(source_hash) )
23
+ end
24
+
25
+ # returns a pound ('#') char, unless @conf and @config values differ
26
+ def cdiff(confkeys)
27
+ conf1 = @conf
28
+ conf2 = @config
29
+ # recurse into config hash
30
+ confkeys.each do |confkey|
31
+ conf1 = conf1[confkey]
32
+ conf2 = conf2[confkey]
33
+ end
34
+ # return '' if the values differ, '#' if they are the same
35
+ #puts "#{conf1.inspect} vs #{conf2.inspect}"
36
+ if conf1 != conf2
37
+ return ''
38
+ else
39
+ return '#'
40
+ end
41
+ end
42
+
43
+ # makes a copy of the default configuration for comparisons
44
+ def initialize( config )
45
+ @config = config
46
+ @conf = {
47
+ :database => hash_deep_copy( config[:database] ),
48
+ :http_server => hash_deep_copy( config[:http_server] )
49
+ }
50
+ end
51
+
52
+ # asks y/n and returns boleans,
53
+ # the default tells if which one is for just enter
54
+ def yesno(default=false)
55
+ if default
56
+ question = "Y/n? "
57
+ else
58
+ question = "y/N? "
59
+ end
60
+ print question
61
+ answer = $stdin.gets.strip.downcase[0]
62
+ answer = answer.chr if answer
63
+ if answer == 'n'
64
+ return false
65
+ elsif answer == 'y'
66
+ return true
67
+ elsif answer == nil
68
+ return default
69
+ else
70
+ return nil
71
+ end
72
+ end
73
+
74
+ # configuration dialog for database connectivity
75
+ def ask_about_mysql
76
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
77
+ puts " MySQL configuration"
78
+ puts
79
+ puts " This feature requires an mysql account with "
80
+ puts " sufficient privileges of creating databases,"
81
+ puts " tables and users. "
82
+ puts
83
+ puts " This account is used for persistent session storage "
84
+ puts " and it is also the default database for plugins."
85
+ puts
86
+ puts " The default rsence account is configured as:"
87
+ puts
88
+ puts " Hostname: #{@conf[:database][:auth_setup][:host].inspect}"
89
+ puts " Username: #{@conf[:database][:auth_setup][:user].inspect}"
90
+ puts " Password: #{@conf[:database][:auth_setup][:pass].inspect}"
91
+ puts " Database: #{@conf[:database][:auth_setup][:db].inspect}"
92
+ puts " Port: #{@conf[:database][:auth_setup][:port].inspect}"
93
+ puts
94
+ print " Correct, "
95
+ is_correct = nil
96
+ is_correct = yesno(true) until is_correct != nil
97
+ unless is_correct
98
+ @conf[:database][:auth_setup][:host] = ask("Hostname (or IP address)?") do |q|
99
+ q.default = @conf[:database][:auth_setup][:host]
100
+ end
101
+ @conf[:database][:auth_setup][:user] = ask("Username?") do |q|
102
+ q.default = @conf[:database][:auth_setup][:user]
103
+ end
104
+ @conf[:database][:auth_setup][:pass] = ask("Password?") do |q|
105
+ q.default = @conf[:database][:auth_setup][:pass]
106
+ end
107
+ @conf[:database][:auth_setup][:db] = ask("Database?") do |q|
108
+ q.default = @conf[:database][:auth_setup][:db]
109
+ end
110
+ @conf[:database][:auth_setup][:port] = ask("Port?") do |q|
111
+ q.default = @conf[:database][:auth_setup][:port]
112
+ end
113
+ end
114
+ puts
115
+ print " Re-edit these settings, "
116
+ re_edit = yesno(false) until re_edit != nil
117
+ if re_edit
118
+ ask_about_mysql
119
+ else
120
+ db_auth = @conf[:database][:auth_setup]
121
+ return "mysql://#{db_auth[:user]}:#{db_auth[:pass]}@#{db_auth[:host]}:#{db_auth[:port]}/#{db_auth[:db]}"
122
+ end
123
+ end
124
+
125
+ # configuration dialog for the web server
126
+ def ask_about_httpd
127
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
128
+ puts " HTTP Server configuration"
129
+ puts
130
+ puts " Riassence Framework runs its HTTP Server as:"
131
+ puts
132
+ puts " Server: #{@conf[:http_server][:rack_require].inspect}"
133
+ puts " Address: #{@conf[:http_server][:bind_address].inspect}"
134
+ puts " Port: #{@conf[:http_server][:port].inspect}"
135
+ puts
136
+ puts
137
+ print " Correct, "
138
+ is_correct = yesno(true) until is_correct != nil
139
+ unless is_correct
140
+ server_type = ''
141
+ until ['mongrel','webrick','thin','ebb'].include?(server_type)
142
+ server_type = ask("Server Type? (valid: mongrel, webrick, thin, ebb)") do |q|
143
+ q.default = @conf[:http_server][:rack_require]
144
+ end
145
+ end
146
+ @conf[:http_server][:rack_require] = server_type
147
+ @conf[:http_server][:bind_address] = ask("Address? (0.0.0.0 binds to all)") do |q|
148
+ q.default = @conf[:http_server][:bind_address]
149
+ end
150
+ @conf[:http_server][:port] = ask("Port number?") do |q|
151
+ q.default = @conf[:http_server][:port]
152
+ end
153
+ end
154
+ end
155
+
156
+ def file_ok?(path)
157
+ return false if path == ''
158
+ if File.exist?(File.split(path)[0])
159
+ if File.directory?(File.split(path)[0])
160
+ if File.writable?(File.split(path)[0])
161
+ if File.exist?(path)
162
+ if File.file?(path)
163
+ return true if File.writable?(path) and File.readable?(path)
164
+ puts " Invalid path; #{path} is not writable or readable."
165
+ return false
166
+ end
167
+ puts " Invalid path; #{path} exists and is not a file."
168
+ return false
169
+ end
170
+ return true
171
+ end
172
+ puts " Invalid path; the directory #{File.split(path)[0]} is not writable."
173
+ return false
174
+ end
175
+ puts " Invalid path; the parent directory #{File.split(path)[0]} is not a directory."
176
+ return false
177
+ end
178
+ puts " Invalid path; the parent directory #{File.split(path)[0]} does not exist."
179
+ return false
180
+ end
181
+
182
+ def ask_about_sqlite
183
+ sqlite_path = File.join(SERVER_PATH,'var','db','rsence_ses.db')
184
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
185
+ puts " SQLite database configuration"
186
+ puts
187
+ puts " SQLite is configured using file names. The default is:"
188
+ puts " #{sqlite_path.inspect}"
189
+ puts
190
+ print " Correct, "
191
+ is_correct = yesno(true) until is_correct != nil
192
+ unless is_correct
193
+ new_sqlite_path = ''
194
+ until file_ok?(new_sqlite_path)
195
+ new_sqlite_path = ask(" Database file path? ") do |q|
196
+ q.default = sqlite_path
197
+ end
198
+ end
199
+ sqlite_path = new_sqlite_path
200
+ end
201
+ return "sqlite://#{sqlite_path}"
202
+ end
203
+
204
+ def ask_about_other_db( other_db_string = '' )
205
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
206
+ puts " All Sequel-compatible database drivers are supported."
207
+ puts
208
+ puts " To configure another database engine, please enter a db url."
209
+ puts " The format is usually: 'engine://username:password@host:port/database_name'"
210
+ puts " For more details, see: http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html"
211
+ puts
212
+ input_db_string = ''
213
+ until input_db_string != ''
214
+ input_db_string = ask(" Database connection string: ") do |q|
215
+ q.default = other_db_string
216
+ end
217
+ end
218
+ other_db_string = input_db_string
219
+ print "Correct, "
220
+ is_correct = yesno(true) until is_correct != nil
221
+ if is_correct
222
+ return other_db_string
223
+ else
224
+ ask_about_other_db( other_db_string )
225
+ end
226
+ end
227
+
228
+ def ask_about_db
229
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
230
+ puts " Session database configuration"
231
+ puts
232
+ puts " Riassence Framework requires a database for persistant"
233
+ puts " session storage. This feature allows the server"
234
+ puts " to be restarted without losing user sessions."
235
+ puts
236
+ puts " The default database engine is SQLite."
237
+ puts
238
+ puts " Select one of the following:"
239
+ puts " 1 - SQLite"
240
+ puts " 2 - MySQL"
241
+ puts " 3 - Other (custom Sequel database url)"
242
+ db_type = ''
243
+ until ['1','2','3'].include?(db_type)
244
+ db_type = ask("Database engine? ") do |q|
245
+ q.default = '1'
246
+ end
247
+ end
248
+ if db_type == '1'
249
+ db_connection_string = ask_about_sqlite
250
+ elsif db_type == '2'
251
+ db_connection_string = ask_about_mysql
252
+ elsif db_type == '3'
253
+ db_connection_string = ask_about_other_db
254
+ end
255
+ puts
256
+ puts " The database connection string is:"
257
+ puts " #{db_connection_string}"
258
+ puts
259
+ print " Correct, "
260
+ db_ok = yesno(true) until db_ok != nil
261
+ if not db_ok
262
+ ask_about_db
263
+ else
264
+ @conf[:database][:ses_db] = db_connection_string
265
+ end
266
+ end
267
+
268
+ def run( local_config_file_path )
269
+ puts
270
+ puts
271
+ puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
272
+ puts " This Riassence Framework instance is not configured."
273
+ puts
274
+ puts " To configure, create a configuration file:"
275
+ puts " #{local_config_file_path}"
276
+ puts
277
+ puts " You may also answer a few simple questions to create"
278
+ puts " a configuration file template."
279
+ puts
280
+ print " Do you want to run the configuration tool, "
281
+ configure_now = yesno(true) until configure_now != nil
282
+ unless configure_now
283
+ puts
284
+ puts " OK. No configuration at this time. Can't continue; exit."
285
+ exit
286
+ end
287
+ ask_about_db
288
+ ask_about_httpd
289
+ puts
290
+ puts "Configuration done!"
291
+ puts
292
+ puts "Writing #{local_config_file_path.inspect}..."
293
+ f = File.open( local_config_file_path, 'w' )
294
+ f.write( YAML.dump( @conf ) )
295
+ f.close
296
+ puts
297
+ puts "Edit #{local_config_file_path} to change the configuration."
298
+ puts
299
+ return @conf
300
+ end
301
+ end
302
+
303
+