rtml 1.2.2 → 2.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (584) hide show
  1. data/History.txt +2 -2
  2. data/Manifest.txt +199 -389
  3. data/PostInstall.txt +6 -1
  4. data/README.rdoc +111 -26
  5. data/Rakefile +29 -33
  6. data/app_generators/rtml/USAGE +2 -2
  7. data/app_generators/rtml/rtml_generator.rb +2 -2
  8. data/app_generators/rtml/templates/rtml_template.rb +26 -0
  9. data/bin/rtml +2 -2
  10. data/builtin/controllers/rtml_controller.rb +58 -0
  11. data/builtin/models/rtml/document.rb +150 -0
  12. data/builtin/models/rtml/dom/element.rb +196 -0
  13. data/builtin/models/rtml/dom/frontend_element.rb +48 -0
  14. data/builtin/models/rtml/dom/property.rb +71 -0
  15. data/builtin/models/rtml/dom/screen_element.rb +14 -0
  16. data/builtin/models/rtml/instruction.rb +52 -0
  17. data/builtin/models/rtml/instruction/follow_class_methods.rb +101 -0
  18. data/builtin/models/rtml/state.rb +20 -0
  19. data/builtin/models/rtml/state/variable_mapping.rb +13 -0
  20. data/builtin/models/rtml/view.rb +5 -0
  21. data/builtin/rtml_helpers/rtml/get_state.rb +23 -0
  22. data/builtin/rtml_helpers/rtml/rescue_action.rb +25 -0
  23. data/builtin/views/rtml/rescue_action_in_public.rtml.erb +1 -0
  24. data/builtin/views/rtml/rescue_action_locally.rtml.erb +29 -0
  25. data/builtin/widgets/default_document.rb +25 -0
  26. data/builtin/widgets/document_variable_processing.rb +133 -0
  27. data/builtin/widgets/element_builder.rb +148 -0
  28. data/builtin/widgets/event_listener.rb +41 -0
  29. data/builtin/widgets/frontend.rb +71 -0
  30. data/builtin/widgets/highlevel_variable_processing.rb +130 -0
  31. data/builtin/widgets/screen_variable_processing.rb +63 -0
  32. data/builtin/widgets/screen_variants.rb +110 -0
  33. data/builtin/widgets/screens.rb +73 -0
  34. data/builtin/widgets/shorthand.rb +49 -0
  35. data/builtin/widgets/static_content.rb +51 -0
  36. data/builtin/widgets/subroutine.rb +54 -0
  37. data/generators/rtml_widget/USAGE +19 -0
  38. data/generators/rtml_widget/rtml_widget_generator.rb +59 -0
  39. data/generators/rtml_widget/templates/default_widget.erb +10 -0
  40. data/generators/rtml_widget/templates/default_widget.feature.erb +11 -0
  41. data/generators/rtml_widget/templates/default_widget_spec.erb +13 -0
  42. data/generators/rtml_widget/templates/default_widget_test.erb +13 -0
  43. data/lib/extensions/action_controller/response.rb +30 -0
  44. data/lib/extensions/action_controller/routing/route_set.rb +42 -0
  45. data/lib/extensions/active_support/test_case.rb +3 -0
  46. data/lib/extensions/hpricot/doc.rb +5 -0
  47. data/lib/extensions/hpricot/elem.rb +5 -0
  48. data/lib/extensions/string.rb +35 -0
  49. data/lib/rtml.rb +88 -2
  50. data/lib/rtml/configuration.rb +40 -0
  51. data/lib/rtml/controller/before_filters.rb +51 -0
  52. data/lib/rtml/controller/cache_helpers.rb +26 -0
  53. data/lib/rtml/controller/class_methods/rtml_action_helpers.rb +18 -0
  54. data/lib/rtml/controller/document_generator.rb +60 -0
  55. data/lib/rtml/controller/render_helpers.rb +29 -0
  56. data/lib/rtml/controller/rtml_helpers.rb +37 -0
  57. data/lib/rtml/controller/state.rb +73 -0
  58. data/lib/rtml/controller/template_helpers.rb +21 -0
  59. data/lib/rtml/controller/url_helpers.rb +9 -0
  60. data/lib/rtml/dependencies.rb +27 -0
  61. data/lib/rtml/dsl.rb +81 -0
  62. data/lib/rtml/environment.rb +28 -0
  63. data/lib/rtml/errors/invalid_format.rb +4 -0
  64. data/lib/rtml/errors/invalid_operation.rb +4 -0
  65. data/lib/rtml/errors/invalid_option_error.rb +4 -0
  66. data/lib/rtml/errors/missing_document_error.rb +4 -0
  67. data/lib/rtml/errors/missing_variable_error.rb +4 -0
  68. data/lib/rtml/errors/multiple_roots_error.rb +4 -0
  69. data/lib/rtml/errors/processing_error.rb +4 -0
  70. data/lib/rtml/errors/rules_violation_error.rb +4 -0
  71. data/lib/rtml/errors/screen_not_found.rb +4 -0
  72. data/lib/rtml/errors/screen_variant_error.rb +4 -0
  73. data/lib/rtml/errors/sti_type_error.rb +4 -0
  74. data/lib/rtml/errors/subprocessing_not_supported.rb +4 -0
  75. data/lib/rtml/errors/unknown_rtml_action.rb +4 -0
  76. data/lib/rtml/high_level/managed_variable.rb +72 -0
  77. data/lib/rtml/high_level/subroutine.rb +22 -0
  78. data/lib/rtml/high_level/variable_manager.rb +35 -0
  79. data/lib/rtml/inherited_instance_variables.rb +25 -0
  80. data/lib/rtml/init.rb +82 -0
  81. data/lib/rtml/reverse_engineering/crawler.rb +58 -0
  82. data/lib/rtml/reverse_engineering/simulator.rb +269 -0
  83. data/lib/rtml/reverse_engineering/simulator/casting.rb +9 -0
  84. data/lib/rtml/reverse_engineering/simulator/snapshot.rb +18 -0
  85. data/lib/rtml/reverse_engineering/simulator/variable_lookup.rb +32 -0
  86. data/lib/rtml/reverse_engineering/simulator/variable_value.rb +105 -0
  87. data/lib/rtml/rules/dom_ruleset.rb +166 -0
  88. data/lib/rtml/rules/dom_tag.rb +43 -0
  89. data/lib/rtml/rules/dom_validation.rb +162 -0
  90. data/{app_generators/rtml/templates/rtml/lib/rtml → lib/rtml/rules}/tml_param_parser.rb +14 -15
  91. data/lib/rtml/test/spec.rb +14 -0
  92. data/lib/rtml/tmlized_conditions.rb +37 -0
  93. data/lib/rtml/version.rb +10 -0
  94. data/lib/rtml/widget.rb +150 -0
  95. data/lib/rtml/widget_core/class_methods.rb +193 -0
  96. data/lib/rtml/widget_core/gui_configuration.rb +94 -0
  97. data/lib/rtml/widget_core/widget_accessor_class_methods.rb +12 -0
  98. data/lib/rtml/widget_core/widget_accessor_instance_methods.rb +19 -0
  99. data/lib/rtml/widget_core/widget_proxy.rb +70 -0
  100. data/lib/rtml/widgets.rb +112 -0
  101. data/lib/rtml_routes.rb +3 -0
  102. data/rails/init.rb +6 -0
  103. data/rails_generators/rtml/USAGE +19 -0
  104. data/rails_generators/rtml/rtml_generator.rb +64 -0
  105. data/rails_generators/rtml/templates/config/initializers/rtml.rb +13 -0
  106. data/rails_generators/rtml/templates/config/tml_dom_ruleset.rb +81 -0
  107. data/rails_generators/rtml/templates/db/migrate/20100108163703_create_rtml_dom_elements.rb +16 -0
  108. data/rails_generators/rtml/templates/db/migrate/20100108163827_create_rtml_dom_properties.rb +16 -0
  109. data/rails_generators/rtml/templates/db/migrate/20100108165127_create_rtml_documents.rb +15 -0
  110. data/rails_generators/rtml/templates/db/migrate/20100110060124_create_rtml_instructions.rb +15 -0
  111. data/rails_generators/rtml/templates/db/migrate/20100110071920_add_parent_id_to_rtml_instructions.rb +9 -0
  112. data/rails_generators/rtml/templates/db/migrate/20100113131401_add_options_to_properties.rb +9 -0
  113. data/rails_generators/rtml/templates/db/migrate/20100127173146_add_parent_type_to_rtml_dom_elements.rb +9 -0
  114. data/rails_generators/rtml/templates/db/migrate/20100208114234_create_rtml_states.rb +20 -0
  115. data/rails_generators/rtml/templates/db/migrate/20100303021609_add_x_and_y_to_rtml_instructions.rb +12 -0
  116. data/rails_generators/rtml/templates/doc/io_tml-application-development-guidelines.pdf +0 -0
  117. data/rails_generators/rtml/templates/lib/tasks/rtml.rake +65 -0
  118. data/rails_generators/rtml_action/USAGE +15 -0
  119. data/rails_generators/rtml_action/rtml_action_generator.rb +51 -0
  120. data/rails_generators/rtml_action/templates/action.erb +12 -0
  121. data/rails_generators/rtml_action/templates/view.erb +2 -0
  122. data/rails_generators/widget/USAGE +19 -0
  123. data/rails_generators/widget/templates/default_widget.erb +10 -0
  124. data/rails_generators/widget/templates/default_widget.feature.erb +11 -0
  125. data/rails_generators/widget/templates/default_widget_spec.erb +13 -0
  126. data/rails_generators/widget/templates/default_widget_test.erb +13 -0
  127. data/rails_generators/widget/widget_generator.rb +48 -0
  128. data/script/console +5 -2
  129. data/script/server +3 -0
  130. data/spec/controllers/inherited_controller_spec.rb +19 -0
  131. data/spec/controllers/rtml_controller_spec.rb +94 -0
  132. data/spec/lib/extensions/hpricot/doc_spec.rb +6 -0
  133. data/spec/lib/extensions/hpricot/elem_spec.rb +6 -0
  134. data/spec/lib/extensions/string_spec.rb +5 -0
  135. data/spec/lib/rtml/extensions_spec.rb +12 -0
  136. data/spec/lib/rtml/reverse_engineering/crawler_spec.rb +24 -0
  137. data/spec/lib/rtml/reverse_engineering/simulator/variable_value_spec.rb +120 -0
  138. data/spec/lib/rtml/reverse_engineering/simulator_spec.rb +96 -0
  139. data/spec/lib/rtml/routes_spec.rb +51 -0
  140. data/spec/lib/rtml/rules/dom_ruleset_spec.rb +54 -0
  141. data/spec/lib/rtml/rules/dom_validation_spec.rb +112 -0
  142. data/spec/lib/rtml/widget_core/generic_widget_consumer_spec.rb +28 -0
  143. data/spec/lib/rtml/widget_core/gui_configuration_spec.rb +109 -0
  144. data/spec/lib/rtml/widget_core/widget_proxy_spec.rb +31 -0
  145. data/spec/lib/rtml/widget_spec.rb +57 -0
  146. data/spec/lib/rtml/widgets_spec.rb +7 -0
  147. data/spec/models/rtml/document_spec.rb +97 -0
  148. data/spec/models/rtml/dom/element_spec.rb +14 -0
  149. data/spec/models/rtml/dom/frontend_element_spec.rb +22 -0
  150. data/spec/models/rtml/dom/property_spec.rb +28 -0
  151. data/spec/models/rtml/dom/screen_element_spec.rb +11 -0
  152. data/spec/models/rtml/instruction_spec.rb +45 -0
  153. data/spec/models/rtml/state/variable_mapping_spec.rb +9 -0
  154. data/spec/models/rtml/state_spec.rb +8 -0
  155. data/spec/rcov.opts +3 -0
  156. data/spec/spec.opts +5 -0
  157. data/spec/spec_helper.rb +45 -0
  158. data/spec/support/app/controllers/application_controller.rb +2 -0
  159. data/spec/support/app/controllers/inherited_controller.rb +8 -0
  160. data/spec/support/app/rtml_helpers/inherited/index.rb +10 -0
  161. data/spec/support/app/rtml_helpers/rtml/index.rb +14 -0
  162. data/spec/support/app/views/README.txt +6 -0
  163. data/spec/support/app/views/layouts/layout.rtml.erb +3 -0
  164. data/spec/support/app/views/magcard/_partial.erb +1 -0
  165. data/spec/support/app/views/magcard/main.rtml.erb +1 -0
  166. data/spec/support/app/views/rtml/index.html.erb +9 -0
  167. data/spec/support/app/views/rtml/index/main.rtml.erb +1 -0
  168. data/spec/support/config/database.yml +17 -0
  169. data/spec/support/config/environment.rb +1 -0
  170. data/{app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css → spec/support/config/environments/development.rb} +0 -0
  171. data/spec/support/config/initializers/rtml.rb +6 -0
  172. data/spec/support/config/routes.rb +3 -0
  173. data/spec/support/config/tml_dom_ruleset.rb +82 -0
  174. data/spec/support/db/rtml_test_db.sqlite3 +0 -0
  175. data/spec/support/db/schema.rb +14 -0
  176. data/spec/support/lib/rtml/widgets/test_widget1.rb +15 -0
  177. data/spec/support/lib/rtml/widgets/test_widget2.rb +4 -0
  178. data/spec/support/rails.rb +22 -0
  179. data/spec/support/raw_tml/valid_document.tml +108 -0
  180. data/spec/support/rspec/example_groups.rb +3 -0
  181. data/spec/support/rspec/matchers.rb +53 -0
  182. data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/.specification +61 -0
  183. data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/lib/init_rtml_working_copy.rb +1 -0
  184. data/spec/support/vendor/gems/rtml-bootstrapper-2.0.0/rtml.gemspec +11 -0
  185. data/spec/widgets/document_variable_processing_spec.rb +84 -0
  186. data/spec/widgets/element_builder_spec.rb +124 -0
  187. data/spec/widgets/event_listener_spec.rb +51 -0
  188. data/spec/widgets/frontend_spec.rb +59 -0
  189. data/spec/widgets/highlevel_variable_processing_spec.rb +149 -0
  190. data/spec/widgets/screen_variable_processing_spec.rb +57 -0
  191. data/spec/widgets/screen_variants_spec.rb +97 -0
  192. data/spec/widgets/screens_spec.rb +55 -0
  193. data/spec/widgets/static_content_spec.rb +43 -0
  194. data/spec/widgets/subroutine_spec.rb +109 -0
  195. data/tasks/db.rake +6 -0
  196. data/tasks/rspec.rake +20 -0
  197. data/tasks/rtml.rake +5 -0
  198. data/test/test_generator_helper.rb +22 -0
  199. data/test/test_helper.rb +1 -1
  200. data/test/test_rtml_action_generator.rb +65 -0
  201. data/test/test_rtml_generator.rb +24 -4
  202. data/test/test_rtml_widget_generator.rb +47 -0
  203. data/test/test_widget_generator.rb +49 -0
  204. data/update.rb +19 -0
  205. metadata +343 -428
  206. data/app_generators/rtml/templates/rails_template.rb +0 -36
  207. data/app_generators/rtml/templates/rtml/MIT-LICENSE +0 -20
  208. data/app_generators/rtml/templates/rtml/README +0 -109
  209. data/app_generators/rtml/templates/rtml/Rakefile +0 -38
  210. data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +0 -70
  211. data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +0 -9
  212. data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +0 -158
  213. data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +0 -252
  214. data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +0 -418
  215. data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +0 -72
  216. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +0 -56
  217. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +0 -19
  218. data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +0 -82
  219. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +0 -2
  220. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +0 -10
  221. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +0 -20
  222. data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +0 -33
  223. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +0 -2
  224. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +0 -23
  225. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +0 -23
  226. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +0 -11
  227. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +0 -384
  228. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +0 -191
  229. data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +0 -152
  230. data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +0 -74
  231. data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +0 -9
  232. data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +0 -43
  233. data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +0 -83
  234. data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +0 -14
  235. data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +0 -14
  236. data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +0 -21
  237. data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +0 -18
  238. data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +0 -25
  239. data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +0 -21
  240. data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +0 -26
  241. data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +0 -12
  242. data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +0 -8
  243. data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +0 -68
  244. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +0 -15
  245. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +0 -108
  246. data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +0 -106
  247. data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +0 -8
  248. data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +0 -4
  249. data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +0 -10
  250. data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +0 -13
  251. data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +0 -12
  252. data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +0 -8
  253. data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +0 -3
  254. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +0 -24
  255. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +0 -8
  256. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +0 -24
  257. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +0 -3
  258. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +0 -3
  259. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +0 -17
  260. data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +0 -11
  261. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +0 -15
  262. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +0 -5
  263. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +0 -15
  264. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +0 -2
  265. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +0 -5
  266. data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +0 -4
  267. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +0 -2
  268. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +0 -760
  269. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +0 -4
  270. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +0 -8
  271. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +0 -9
  272. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +0 -9
  273. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +0 -11
  274. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +0 -20
  275. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +0 -8
  276. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +0 -9
  277. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +0 -8
  278. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +0 -8
  279. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +0 -1
  280. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +0 -2
  281. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +0 -19
  282. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +0 -1
  283. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +0 -3
  284. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +0 -1
  285. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +0 -4
  286. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +0 -31
  287. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +0 -40
  288. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +0 -1
  289. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +0 -1
  290. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +0 -1
  291. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +0 -10
  292. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +0 -1
  293. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +0 -1
  294. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +0 -1
  295. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +0 -2
  296. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +0 -3
  297. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +0 -2
  298. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +0 -2
  299. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +0 -1
  300. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +0 -1
  301. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +0 -29
  302. data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +0 -3
  303. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +0 -167
  304. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +0 -12
  305. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +0 -8
  306. data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +0 -14
  307. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +0 -7
  308. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +0 -26
  309. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +0 -9
  310. data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +0 -42
  311. data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +0 -303
  312. data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +0 -46
  313. data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +0 -22
  314. data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +0 -49
  315. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +0 -10
  316. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +0 -3
  317. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +0 -2
  318. data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +0 -4
  319. data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +0 -11
  320. data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +0 -7
  321. data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +0 -11
  322. data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +0 -5
  323. data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +0 -4
  324. data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +0 -4
  325. data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +0 -10
  326. data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +0 -8
  327. data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +0 -8
  328. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +0 -12
  329. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +0 -8
  330. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +0 -10
  331. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +0 -8
  332. data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +0 -9
  333. data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +0 -6
  334. data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +0 -8
  335. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +0 -8
  336. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +0 -8
  337. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +0 -5
  338. data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +0 -5
  339. data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +0 -1
  340. data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +0 -1
  341. data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +0 -1
  342. data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +0 -7
  343. data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +0 -1
  344. data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +0 -1
  345. data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +0 -10
  346. data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +0 -30
  347. data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +0 -90
  348. data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +0 -66
  349. data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +0 -123
  350. data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +0 -365
  351. data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +0 -65
  352. data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +0 -33
  353. data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +0 -39
  354. data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +0 -66
  355. data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +0 -49
  356. data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +0 -15
  357. data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +0 -16
  358. data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +0 -24
  359. data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +0 -23
  360. data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +0 -20
  361. data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +0 -17
  362. data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +0 -19
  363. data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +0 -14
  364. data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +0 -10
  365. data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +0 -10
  366. data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +0 -10
  367. data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +0 -16
  368. data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +0 -16
  369. data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +0 -16
  370. data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +0 -11
  371. data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +0 -31
  372. data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +0 -25
  373. data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +0 -49
  374. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +0 -20
  375. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +0 -3
  376. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +0 -37
  377. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +0 -12
  378. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +0 -11
  379. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +0 -2
  380. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +0 -24
  381. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +0 -3
  382. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +0 -16
  383. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +0 -15
  384. data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +0 -2
  385. data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +0 -8
  386. data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +0 -45
  387. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +0 -7
  388. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +0 -10
  389. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +0 -2
  390. data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +0 -11
  391. data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +0 -8
  392. data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +0 -66
  393. data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +0 -57
  394. data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +0 -27
  395. data/app_generators/rtml/templates/rtml/init.rb +0 -40
  396. data/app_generators/rtml/templates/rtml/install.rb +0 -18
  397. data/app_generators/rtml/templates/rtml/lib/environment.rb +0 -61
  398. data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +0 -9
  399. data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +0 -34
  400. data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +0 -74
  401. data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +0 -24
  402. data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +0 -13
  403. data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +0 -25
  404. data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +0 -15
  405. data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +0 -10
  406. data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +0 -28
  407. data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +0 -20
  408. data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +0 -19
  409. data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +0 -16
  410. data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +0 -37
  411. data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +0 -23
  412. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +0 -20
  413. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +0 -36
  414. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +0 -44
  415. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +0 -25
  416. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +0 -30
  417. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +0 -43
  418. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +0 -45
  419. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +0 -87
  420. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +0 -26
  421. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +0 -25
  422. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +0 -29
  423. data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +0 -24
  424. data/app_generators/rtml/templates/rtml/lib/rtml.rb +0 -77
  425. data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +0 -12
  426. data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +0 -11
  427. data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +0 -13
  428. data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +0 -30
  429. data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +0 -59
  430. data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +0 -188
  431. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +0 -91
  432. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +0 -63
  433. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +0 -70
  434. data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +0 -73
  435. data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +0 -55
  436. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +0 -318
  437. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +0 -79
  438. data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +0 -83
  439. data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +0 -123
  440. data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +0 -59
  441. data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +0 -7
  442. data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +0 -11
  443. data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +0 -3
  444. data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +0 -8
  445. data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +0 -12
  446. data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +0 -75
  447. data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +0 -9
  448. data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +0 -79
  449. data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +0 -106
  450. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +0 -10
  451. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +0 -18
  452. data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +0 -21
  453. data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +0 -32
  454. data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +0 -195
  455. data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +0 -18
  456. data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +0 -17
  457. data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +0 -30
  458. data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +0 -35
  459. data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +0 -21
  460. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +0 -59
  461. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +0 -193
  462. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +0 -23
  463. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +0 -28
  464. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +0 -47
  465. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +0 -181
  466. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +0 -28
  467. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +0 -33
  468. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +0 -17
  469. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +0 -71
  470. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +0 -21
  471. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +0 -6
  472. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +0 -10
  473. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +0 -27
  474. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +0 -70
  475. data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +0 -174
  476. data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +0 -48
  477. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +0 -14
  478. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +0 -33
  479. data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +0 -18
  480. data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +0 -51
  481. data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +0 -61
  482. data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +0 -52
  483. data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +0 -97
  484. data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +0 -16
  485. data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +0 -11
  486. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +0 -11
  487. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +0 -59
  488. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +0 -251
  489. data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +0 -213
  490. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/dot.gif +0 -0
  491. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_can.gif +0 -0
  492. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_cand.gif +0 -0
  493. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_en.gif +0 -0
  494. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_end.gif +0 -0
  495. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_i.gif +0 -0
  496. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icd.gif +0 -0
  497. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icl.gif +0 -0
  498. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icr.gif +0 -0
  499. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ics.gif +0 -0
  500. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icsw.gif +0 -0
  501. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icv.gif +0 -0
  502. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int.gif +0 -0
  503. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int2.gif +0 -0
  504. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_men.gif +0 -0
  505. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_mend.gif +0 -0
  506. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_next.gif +0 -0
  507. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_no.gif +0 -0
  508. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_nod.gif +0 -0
  509. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ok.gif +0 -0
  510. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_okd.gif +0 -0
  511. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic1.gif +0 -0
  512. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic2.gif +0 -0
  513. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic3.gif +0 -0
  514. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic4.gif +0 -0
  515. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_top.gif +0 -0
  516. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_txn.gif +0 -0
  517. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yes.gif +0 -0
  518. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yesd.gif +0 -0
  519. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/btmlpa.gif +0 -0
  520. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_dn.gif +0 -0
  521. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_up.gif +0 -0
  522. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/conf.gif +0 -0
  523. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/iccemv.gif +0 -0
  524. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/images.lib +0 -0
  525. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/magcard.gif +0 -0
  526. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_dn.gif +0 -0
  527. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_up.gif +0 -0
  528. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_dn.gif +0 -0
  529. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_up.gif +0 -0
  530. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/top.gif +0 -0
  531. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_dn.gif +0 -0
  532. data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_up.gif +0 -0
  533. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_color.css +0 -37
  534. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +0 -17
  535. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +0 -12
  536. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +0 -37
  537. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +0 -4
  538. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +0 -12
  539. data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +0 -37
  540. data/app_generators/rtml/templates/rtml/reporting/110409 +0 -227
  541. data/app_generators/rtml/templates/rtml/reporting/linecount.rb +0 -42
  542. data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +0 -63
  543. data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +0 -84
  544. data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +0 -30
  545. data/app_generators/rtml/templates/rtml/rules/varns/card.rb +0 -17
  546. data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +0 -31
  547. data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +0 -8
  548. data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +0 -7
  549. data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +0 -6
  550. data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +0 -15
  551. data/app_generators/rtml/templates/rtml/rules/varns/com.rb +0 -9
  552. data/app_generators/rtml/templates/rtml/rules/varns/err.rb +0 -14
  553. data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +0 -13
  554. data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +0 -8
  555. data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +0 -8
  556. data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +0 -15
  557. data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +0 -42
  558. data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +0 -7
  559. data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +0 -4
  560. data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +0 -1
  561. data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +0 -5
  562. data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +0 -5
  563. data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +0 -5
  564. data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +0 -12
  565. data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +0 -21
  566. data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +0 -11
  567. data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +0 -29
  568. data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +0 -78
  569. data/app_generators/rtml/templates/rtml/template.rb +0 -64
  570. data/app_generators/rtml/templates/rtml/test/core/element_test.rb +0 -17
  571. data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +0 -91
  572. data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +0 -53
  573. data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +0 -13
  574. data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +0 -13
  575. data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +0 -20
  576. data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +0 -9
  577. data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +0 -19
  578. data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +0 -20
  579. data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +0 -44
  580. data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +0 -11
  581. data/app_generators/rtml/templates/rtml/uninstall.rb +0 -1
  582. data/app_generators/rtml/templates/rtml/update.rb +0 -57
  583. data/tasks/reglob.rake +0 -28
  584. data/test/test_rtml.rb +0 -11
@@ -1,252 +0,0 @@
1
- class Rtml::RtmlAppController < Rtml::TmlAppController
2
- include Rtml::Helpers::ControllerHelpers::MenuHelpers
3
-
4
- prepend_before_filter :force_rtml, :only => :uml
5
- before_render :render_tml
6
- around_filter :process_action_with_view_paths
7
- hide_action :rtml_interface, :tml_document, :rtml_document, :tml_document=, :rtml_document=
8
-
9
- # For creating UML diagrams of TML screens for the given action. Must be in this same controller.
10
- def uml
11
- helper = response.template
12
-
13
- include_view_paths_for params[:id]
14
- self.rtml_interface.fire_action(params[:id], self)
15
- @screens = tml_document.screens
16
- url = []
17
- @screens.each do |scr|
18
- map = {}
19
- left = nil
20
- scr.every_possible_variant do |cond, dest|
21
- left = helper.uml_for_screen(scr)
22
- right = helper.uml_for_screen(@screens.find(dest) || helper.format_for_uml(dest))
23
- if cond == :default and not map[right] then cond = ""
24
- else
25
- cond = unless cond =~ /key=/ then cond.to_s.gsub(/(^|\s)..=['"]([^'"]*)['"]/, '\1\2')
26
- else cond.to_s.gsub(/['"]/, '').gsub(/key=/, 'on key ')
27
- end
28
- end
29
- if map[right] then map[right] << " | #{cond}"
30
- else map[right] = cond
31
- end
32
- end
33
- # we use the map to merge multiple conditions in order to point to a destination only once
34
- map.each { |right, cond| url << "[#{left}]-#{cond}>[#{right}]" }
35
- end
36
- tml_document.reset!
37
-
38
- data = helper.get_uml_image_data(url)
39
- send_data data, :disposition => 'inline', :type => 'image/png', :file_name => "#{params[:id]}.png"
40
- end
41
-
42
- def self.inherited(base) #:nodoc:
43
- super
44
- # TODO: It may be important to leave base.controller_path in the view paths in order to
45
- # handle overriding the tml_app views. Need to figure out if this is necessary or not.
46
- # base.append_view_path(File.join("vendor", "plugins", "rtml", "app/views", base.controller_path))
47
- base.send :include, "#{base.controller_path}_tml_helpers".camelize.constantize rescue nil
48
- end
49
-
50
- def self.rtml_interface #:nodoc:
51
- if self.superclass.respond_to? :rtml_interface
52
- @rtml_interface ||= Class.new(self.superclass.rtml_interface.class).new
53
- else
54
- @rtml_interface ||= Class.new(Rtml::Proxying::RtmlInterface).new
55
- end
56
- @rtml_interface
57
- end
58
-
59
- def self.add_rtml_actions(*actions) #:nodoc:
60
- actions.flatten.each do |action|
61
- raise ArgumentError.new("Action must be Symbol or String") unless action.kind_of? Symbol or action.kind_of? String
62
- line = __LINE__ + 1
63
- eval %Q`
64
- def #{action}
65
- set_rtml unless template_exists?(default_template_name)
66
- if request.format == :rtml
67
- self.rtml_interface.fire_action(#{action.inspect}, self)
68
- end
69
- end
70
- `, binding, __FILE__, line
71
- end
72
- end
73
-
74
- def rtml_interface #:nodoc:
75
- self.class.rtml_interface
76
- end
77
-
78
- # Returns the TML document that is being constructed for this request.
79
- def tml_document
80
- @tml_document ||= Rtml::Core::TMLDocument.new(response.template)
81
- end
82
-
83
- # Overwrites the TML document, if any, with the specified target.
84
- # The specified target document becomes the "active" target, and will
85
- # be rendered in place of this one.
86
- def tml_document=(target)
87
- @tml_document = target
88
- end
89
-
90
- alias rtml_document= tml_document=
91
- alias rtml_document tml_document
92
-
93
- protected
94
- include Rtml
95
- include Rtml::Core
96
- extend Rtml::TmlAppHelper
97
- extend Rtml::Helpers::ControllerHelpers
98
-
99
- # Adds the specified action's view paths to this action's view paths,
100
- # which would allow you to render views and partials from the specified
101
- # action. Note that if two actions specify the same view, the view path
102
- # that is encountered first takes precedence. (This should be the current
103
- # action, which is ideal, BUT it's Rails core functionality that I'm not
104
- # going to vouch for. Basically, keep the names unique or use at your own
105
- # risk.)
106
- def include_view_paths_for(action)
107
- add_instance_view_paths(action)
108
- end
109
-
110
- # Used for modifying the template files to be found in
111
- # controller/action/screen_name.erb (instead of the Rails default
112
- # controller/action.erb).
113
- def default_template_name(action_name = self.action_name,
114
- ext = response.template.template_format,
115
- klass = self.class) #:nodoc:
116
- s = super
117
- return s if s
118
- if action_name =~ /\//
119
- return s
120
- else
121
- return super("#{params[:action]}/#{action_name}", ext, klass)
122
- end
123
- end
124
-
125
- # We need the default rescue_action functionality, but we first
126
- # need to reset the TML document that's being generated, or else
127
- # we'll end up with a TML document that half represents what the
128
- # user was constructing, half represents the error being reported,
129
- # and is completely invalid TML!
130
- def rescue_action(*a)
131
- tml_document.reset!
132
- super
133
- end
134
-
135
-
136
- private
137
- # Adds default action-specific view paths to this controller, then
138
- # calls the action, and finally removes the view paths.
139
- def process_action_with_view_paths
140
- include_view_paths_for params[:action]
141
- yield
142
- remove_instance_view_paths
143
- end
144
-
145
- # Adds all registered view paths for the specified action to the
146
- # controller for this action. This is called by the around_filter
147
- # before the action is called.
148
- def add_instance_view_paths(action)
149
- controller = self
150
- @paths_to_delete = []
151
- (controller.class.view_paths_for_actions.select do |a|
152
- a[0].to_s.length == 0 || a[0].to_s == action.to_s
153
- end).each do |a|
154
- path = a[1]
155
- add_instance_view_path path
156
- end
157
- end
158
-
159
- # Adds the specified view path to the controller's view paths
160
- # and also adds it to the list of paths to be deleted at the end
161
- # of this action (so that they are not permanent in production).
162
- def add_instance_view_path(path)
163
- unless controller.class.view_paths.include? path
164
- @paths_to_delete << path
165
- controller.prepend_view_path path
166
- end
167
- end
168
-
169
- # Removes all view paths that were not a part of the action-unspecific
170
- # (global) array for this controller. This is called by the around_filter
171
- # after content has been rendered.
172
- def remove_instance_view_paths
173
- controller = self
174
- @paths_to_delete.each do |path|
175
- controller.view_paths.delete path
176
- end
177
- end
178
-
179
- def render_tml
180
- headers_filter
181
- return unless tml_document.modified? and not performed? and response.redirected_to.nil?
182
-
183
- # The reason I don't check against request.format here is because I want to handle things like respond_to,
184
- # which might look something like
185
- # respond_to do |format|
186
- # format.rtml
187
- # format.html
188
- # format.json { render :json => obj.to_json }
189
- # format.xml { render :xml => obj.to_xml }
190
- # end
191
- #
192
- # respond_to does not set request.format; it sets response.template.template_format. So that's what I need
193
- # to check. Note that pretty much everywhere else, request.format should be checked, because pretty much
194
- # everywhere else we want to know what the client is ASKING for.
195
- #
196
- if response.template.template_format == :rtml
197
- tml = tml_document.to_tml
198
- ### HACK!
199
- # Having problems with the browser restarting the app when the visiting the full link with an anchor.
200
- # Strange, it only happens once. But this should work around it.
201
- tml.gsub!(/(["'])#{Regexp::escape url_for(:action => params[:action], :only_path => true)}\#/, '\1#')
202
- logger.debug tml if self.class.rtml_debug_config[:dump_tml]
203
- render_without_before_render_filter :text => tml
204
- end
205
- end
206
-
207
- # Another method for forcing the user into an RTML format. See Rtml::TmlAppController#force_format
208
- # and use with care. What this does, essentially, is check to see whether there are any RTML
209
- # templates available, and if so, forces the user into RTML format. Only used in very rare
210
- # circumstances, obviously, because this will ignore things like what browser is actually
211
- # requesting the document. If you call this method, and the user is using Firefox or IE,
212
- # tough luck: an RTML template exists, you've told RTML to use it unconditionally.
213
- # No effect if no RTML ERB template exists. So for instance, if you are building a TML document
214
- # via the tml_helpers, none of the above will happen.
215
- def set_rtml
216
- if self.class.action_methods.include? params[:action]
217
- unless template_exists? default_template_name(params[:action]) and not tml_document.screen_defined? params[:action]
218
- force_format :rtml
219
- end
220
- end
221
- end
222
-
223
- def force_rtml #:nodoc:
224
- force_format :rtml
225
- end
226
-
227
- # Declare the specified action to require the specified path. This is used
228
- # in the around_filter when constructing the default view paths for an action.
229
- #
230
- # If action is nil, this path will be added to all actions. (This may be useful
231
- # if you want to add a view path to all instances of this controller without
232
- # affecting the view paths of any other controllers.)
233
- def self.append_view_path_for_action(action, path)
234
- view_paths_for_actions << [ action.to_s, path ]
235
- end
236
-
237
- # Return the array of default paths. First argument is action name; second
238
- # argument is the path itself.
239
- def self.view_paths_for_actions
240
- if @view_paths_for_actions.nil?
241
- if self.superclass.respond_to? :view_paths_for_actions
242
- @view_paths_for_actions = self.superclass.view_paths_for_actions.collect { |arr| arr.dup }
243
- else
244
- @view_paths_for_actions = []
245
- end
246
- end
247
- @view_paths_for_actions
248
- end
249
-
250
- public
251
- tml_helper :all
252
- end
@@ -1,418 +0,0 @@
1
- module Rtml
2
- class TmlAppController < ApplicationController
3
- include Rtml::Helpers::RenderHelper
4
- include Rtml::Helpers::TerminalHelpers
5
-
6
- #It's sad, but we have to skip the authenticity token, because OEGW doesn't support cookies
7
- # and therefore has no clue what a Session object is. The Session is used to make sure
8
- # authenticity tokens are valid and to generate new ones -- so what happens is, since
9
- # the terminal doesn't maintain a session cookie, every request is considered a new "session"
10
- # and the previous "session" token is invalidated. So POST data can't be processed because
11
- # Rails thinks it's all fake! Until OpenEstate supports session cookies, it has to be disabled.
12
- # FIXME: When session cookies are supported, re-enable authenticity verification. Or override
13
- # Rails authenticity checking with something a little more TML-friendly...
14
- skip_before_filter :verify_authenticity_token
15
-
16
- before_filter :format_filter
17
- #before_filter :headers_filter
18
- before_filter :load_state
19
-
20
- hide_action :embedded_app, :url_for
21
-
22
- # 080609:
23
- # save_state changed to a before_render filter because the user is more likely to change it
24
- # in the TML helper than they are in the View, and after much research I had to take sides
25
- # (RTML documents do a lot of render_or_redirect-ing, which halts the filter chain).
26
- before_render :save_state
27
- #after_filter :save_state
28
-
29
- append_view_path File.join(PLUGIN_BASE, "app", "views", "rtml", "tml_app")
30
-
31
- # Action reserved for retrieving TML state data. See
32
- # app/views/rtml/tml_app/get_terminal_info.rtml.erb for customization.
33
- # You can also override this view within your controller's views, if needed.
34
- #
35
- # Note that this file should be either a straight TML template (using ERB of course)
36
- # or "document-level" RTML (essentially breaking the MVC rules and running the TML
37
- # generation in the View). If you don't know what any of that means, then don't touch it.
38
- def get_terminal_info
39
- end
40
-
41
- # Action reserved for redirect_to directives. This functionality will be removed
42
- # when Incendo supports HTTP redirects, but until then, the only way to do it
43
- # is in the terminal-side TML. See app/views/rtml/tml_app/do_tml_redirect.rtml.erb
44
- # for customization.
45
- # You can also override this view within your controller's views, if needed.
46
- #
47
- # Note that this file should be either a straight TML template (using ERB of course)
48
- # or "document-level" RTML (essentially breaking the MVC rules and running the TML
49
- # generation in the View). If you don't know what any of that means, then don't touch it.
50
- def do_tml_redirect
51
- end
52
-
53
- def url_for(options = {})
54
- super(options.reverse_merge(:format => params[:format]))
55
- end
56
-
57
- class << self
58
- # Allows you to provide an expiration timeout. This must be done with a block so that it
59
- # can be evaluated only when the expiration headers are being sent.
60
- #
61
- # Example:
62
- # expires_at { 7.days.from_now }
63
- # expires_at { |controller| controller.current_user.id == 1 ? Time.now : 3.days.from_now }
64
- #
65
- def expires_at(&block)
66
- @expires_at_block = block if block_given?
67
- return @expires_at_block
68
- end
69
- public :expires_at
70
- end
71
-
72
- # Allows you to provide an expiration timeout. This must be done with a block so that it
73
- # can be evaluated only when the expiration headers are being sent.
74
- #
75
- # Example:
76
- # expires_at { 7.days.from_now }
77
- # expires_at { |controller| controller.current_user.id == 1 ? Time.now : 3.days.from_now }
78
- #
79
- def expires_at(&block)
80
- @expires_at_block ||= self.class.expires_at
81
- @expires_at_block = block if block_given?
82
- return @expires_at_block
83
- end
84
-
85
- protected
86
- # Overrides the set of defaults for when a Web browser (as opposed to a terminal browser)
87
- # connects and requests this RTML resource.
88
- #
89
- # Example:
90
- # class MyAppController < Rtml::RtmlAppController
91
- # rtml_debug do |config|
92
- # config[:model] = 5100
93
- # end
94
- # end
95
- #
96
- def self.rtml_debug(&blk)
97
- yield self.rtml_debug_config
98
- end
99
-
100
- # Returns the hash of RTML debug options, for use when a Web browser (and not a terminal
101
- # browser) requests this RTML resource.
102
- def self.rtml_debug_config
103
- @rtml_debug_config ||= HashWithIndifferentAccess.new({
104
- :datetime_start => Date.parse('2006/01/01'),
105
- :os => '03.27',
106
- :itid => '111111111',
107
- :model => 8550,
108
- :datetime => Time.now,
109
- :part_number => 'I8550_BROWSER',
110
- :dump_tml => false
111
- })
112
- end
113
-
114
- # Provides a tml_redirect method because Incendo won't understand the "Location"
115
- # header that redirect_to produces. (Groupe has agreed to implement this missing
116
- # functionality in an upcoming release.) This new redirect_to method will render the
117
- # do_tml_redirect action instead, which results in a TML-based redirect.
118
- # This is only done for the MicroBrowser. Any other browser gets the standard
119
- # Rails functionality unless it passed in the .rtml extension to this request.
120
- def redirect_to(a,&b)
121
- if request.is_terminal? or params[:format] == 'rtml'
122
- if a.kind_of? Hash
123
- @redirect_to = url_for(a.merge(:only_path => true))
124
- else
125
- @redirect_to = url_for(:action => a)
126
- end
127
- render :action => 'do_tml_redirect'
128
- else
129
- super
130
- end
131
- end
132
-
133
- # Forces the user to use the specified format, regardless of what was requested by the
134
- # browser or detected by RTML. You should be very careful with this, because it can have
135
- # unintended consequences such as feeding TML to a browser expecting HTML. In fact, it's
136
- # generally better to leave the format handling for the RTML Core to worry about. You
137
- # have been warned.
138
- def force_format(fmt)
139
- fmt = params[:format] || 'html' if fmt.nil?
140
- request.format = fmt
141
- format_filter
142
- #headers_filter
143
- end
144
-
145
- # Allows you to toggle whether or not form data sent from a terminal via TMLPOST data should
146
- # be available directly via the params object, or whether it should be isolated in params[:tml].
147
- # For example, the "user_name" parameter would be stored in params[:user_name] if collect_params
148
- # is false, or params[:tml][:user_name] if collect_params is true. By default, params are
149
- # stored directly in the params hash (in other words, the default is "false") -- but if you
150
- # call this method with no arguments, it will be set to TRUE.
151
- #
152
- # Example:
153
- # class MyTmlController < Rtml::TmlAppController
154
- # collect_params # => true
155
- # collect_params false
156
- # collect_params true
157
- # . . .
158
- # end
159
- def self.collect_params(tf = true)
160
- self.class_eval { def collect_params?; tf; end }
161
- end
162
-
163
- # Returns the terminal state hash. Raises an error if the state is not available (but this
164
- # shouldn't happen unless you forgot to run rake rtml:setup). Note that you only need to run
165
- # rake rtml:setup if you plan to actually make use of the state hash.
166
- def state
167
- @terminal_state.nil? ? (raise "State not available; run rake rtml:setup to enable it") :
168
- @terminal_state#.state
169
- end
170
-
171
- # If true, TML params will be segregated into params[:tml]
172
- # If false, default functionality is assumed, and params will be stored directly within the
173
- # params hash. While you can override this if you wish, you're probably better off using
174
- # the #collect_params method within your controller.
175
- def collect_params?(); false; end
176
-
177
- # This method is responsible for making view inheritance possible.
178
- def default_template_name(action_name = self.action_name,
179
- ext = response.template.template_format,
180
- klass = self.class) #:nodoc:
181
- if action_name && klass == self.class
182
- action_name = action_name.to_s
183
- if action_name.include?('/') && template_path_includes_controller?(action_name)
184
- action_name = strip_out_controller(action_name)
185
- end
186
- end
187
- if !klass.superclass.method_defined?(:controller_path)
188
- return "#{self.controller_path}/#{action_name}"
189
- end
190
- template_name = "#{klass.controller_path}/#{action_name}"
191
- if template_exists? template_name, ext
192
- return template_name
193
- else
194
- return default_template_name(action_name, ext, klass.superclass)
195
- end
196
- end
197
-
198
- # Checks to see if a template with the specified name and optional format exists.
199
- unless ActionController::Base.private_instance_methods.include? 'template_exists?'
200
- def template_exists?(template_name, fmt = response.template.template_format) #:nodoc:
201
- self.view_paths.find_template(template_name, fmt)
202
- rescue ActionView::MissingTemplate, Errno::ENOENT
203
- false
204
- end
205
- end
206
-
207
- # If a catastrophic error would otherwise result in a 500 Internal Server Error
208
- # and the application server is running in PRODUCTION mode,
209
- # this method will be called instead, and the terminal user will instead see a
210
- # pretty error message. It's something generic like "Contact an administrator",
211
- # and it can be overridden by creating a "rescue_action_in_public.rtml.erb" file
212
- # somewhere in your view path. You can find the original at
213
- # app/views/rtml/tml_app/rescue_action_in_public.rtml.erb.
214
- #
215
- # Note that this file should be either a straight TML template (using ERB of course)
216
- # or "document-level" RTML (essentially breaking the MVC rules and running the TML
217
- # generation in the View).
218
- def rescue_action_in_public(exception) #:nodoc:
219
- if request.is_terminal? or params[:error_mode] == 'rtml'
220
- @exception = exception
221
- render :action => 'rescue_action_in_public'
222
- else
223
- super
224
- end
225
- end
226
-
227
- # If a catastrophic error would otherwise result in a 500 Internal Server Error
228
- # and the application server is running in DEVELOPMENT mode,
229
- # this method will be called instead, and the terminal user will instead see a
230
- # detailed error report like the default ones that Rails generates for your
231
- # Web browser.
232
- # If you need to tweak the message, it can be overridden by creating a
233
- # "rescue_action_locally.rtml.erb" file
234
- # somewhere in your view path. You can find the original at
235
- # app/views/rtml/tml_app/rescue_action_locally.rtml.erb.
236
- #
237
- # Note that this file should be either a straight TML template (using ERB of course)
238
- # or "document-level" RTML (essentially breaking the MVC rules and running the TML
239
- # generation in the View).
240
- def rescue_action_locally(exception) #:nodoc:
241
- if request.is_terminal? or params[:error_mode] == 'rtml'
242
- @exception = exception
243
- #if self.respond_to? :rtml_interface and rtml_interface
244
- #rtml_interface.instance_variable_set("@exception", exception)
245
- #end
246
- render :action => 'rescue_action_locally'
247
- else
248
- super
249
- end
250
- end
251
-
252
-
253
- private
254
- # If params[:format] is specified as 'tml', it is changed to 'rtml' and the method returns.
255
- # If it is set to any
256
- # other non-nil value, nothing happens. If it is nil, then the following happens:
257
- # If a template of the requested format exists, the method returns as no further action is
258
- # necessary. (The matching template will be rendered unless you intervene.)
259
- # If the requested format is 'tml', or the client is a terminal, the format is forced to 'rtml'.
260
- # If the client is not a terminal and the requested format is not 'tml', nothing happens.
261
- #
262
- # This method also defines a singleton method for the request object called is_terminal? which
263
- # returns true if the client for this request is a terminal (as opposed to a browser). Note that
264
- # the is_terminal? method always tells the "truth" -- even if the browser is emulating a terminal
265
- # for this request, it will still return false for a browser.
266
- def format_filter
267
- def request.is_terminal?
268
- self.user_agent and (self.user_agent['OE MicroBrowser'] || self.user_agent['IO Browser'])
269
- end
270
-
271
- params[:format] = 'rtml' if params[:format] == 'tml'
272
- return if params[:format] # Client-specified formats trump anything automatically assigned
273
- return if template_exists? default_template_name(action_name, request.format)
274
-
275
- fmt = request.format#response.template.template_format.to_s
276
- fmt = 'rtml' if fmt == 'tml' or request.is_terminal?
277
- request.format = fmt
278
- # response.template.template_format = fmt # params[:format] = fmt
279
- end
280
-
281
- # Sets the content-type to XML instead of TML for anything but OEGW. This makes it viewable
282
- # in a user's browser as an XML document. Also rebuilds the ETag header to be compatible with
283
- # OpenEstate/Incendo Online. (Default Rails ETags are 1 character too long. Painful debugging,
284
- # that.)
285
- def headers_filter
286
- if [:rtml, :tml].include? request.format.to_sym
287
- headers['content-type'] = 'text/xml' unless request.is_terminal?
288
- headers['content-type'] = 'text/tml' if request.is_terminal?
289
- headers['Cache-Control'] = 'no-cache ' # trailing space is important!
290
- headers['ETag'] = "W/\"329-#{Time.now.to_i}#{rand(9999)}\" "
291
- headers['Expires'] =
292
- if expires_at
293
- expires_at.call(self)
294
- else
295
- Time.at(0) # always expired
296
- end.strftime("%a, %d %b %Y %H:%M:%S GMT")
297
- end
298
- end
299
-
300
- # Loads the terminal's (or browser's) state hash from the database.
301
- # TODO: Use Rails.cache for the state whenever possible.
302
- def load_state
303
- if params[:tml]
304
- term_params = params[:tml][:terminal]
305
- else
306
- term_params = params[:terminal]
307
- end
308
- fail = false # if true, the get_terminal_info TML page will be rendered.
309
- repost = false # if true, the terminal data is out of date and needs to be refreshed.
310
-
311
- headers = request.headers
312
- unless request.is_terminal?
313
- # Build some fake data if the user is viewing with a browser, for debugging
314
- # Otherwise, user would just always see get_terminal_info. Epic debugfail.
315
- p = params[:browser] || {}
316
- headers = Rtml::Debug::BrowserEmulator.new(headers.merge(self.class.rtml_debug_config.merge(p)))
317
- repost = true # always use current browser details. This enables debug configuration override.
318
- end
319
-
320
- itid = headers['ITID'] || headers['HTTP_ITID']
321
- itsn = headers['ITSN'] || headers['HTTP_ITSN']
322
- itpn = headers['ITPN'] || headers['HTTP_ITPN']
323
-
324
- if itid && itsn && itpn or not request.is_terminal?
325
- signature = "#{itsn}:#{itpn}:#{itid}"
326
- @terminal_state = Rtml::State.find_by_signature(signature)
327
- if @terminal_state.nil?
328
- logger.debug "Terminal state for signature '#{signature}' not found; creating"
329
- @terminal_state = Rtml::State.new(:signature => signature,
330
- :terminal => Terminal.new(:itid => itid))
331
- @terminal_state.state ||= HashWithIndifferentAccess.new
332
- logger.debug "Saving empty state"
333
- @terminal_state.save!
334
- end
335
-
336
- if @terminal_state.state.empty?
337
- logger.debug "Terminal state needs populated."
338
- repost = true
339
- elsif @terminal_state.created_at < 1.day.ago
340
- logger.debug "Terminal state is outdated (#{@terminal_state.created_at} < #{1.day.ago}) and will be repopulated."
341
- repost = true
342
- end
343
-
344
- if repost
345
- p = term_params
346
- p = headers if headers.kind_of? Rtml::Debug::BrowserEmulator
347
-
348
- if p
349
- logger.debug "Found terminal information in headers."
350
- @terminal_state.state.merge! p
351
- @terminal_state.state[:signature] = @terminal_state.signature
352
- @terminal_state.created_at = Time.now
353
- # State is saved as a part of the before_render filter.
354
- # @terminal_state.save!
355
-
356
- if term_params
357
- # FIXME: First I need to remember what this was designed to do (dumb me and no comments),
358
- # and then I need to make it work. Whatever it was, it was causing an infinite loop when
359
- # redirect_to resulted in reposting state data.
360
- #
361
- #params.delete :terminal
362
- #params[:tml].delete :terminal if params[:tml]
363
- #redirect_to params
364
- end
365
- return true
366
- else
367
- logger.debug "Could not find terminal information in headers; triggering a data post"
368
- logger.debug "term_params: #{term_params.inspect}"
369
- logger.debug "params: #{params.inspect}"
370
- fail = true
371
- end
372
- end
373
- else
374
- raise "Could not find TID header!" unless itid
375
- raise "Could not find SN header!" unless itsn
376
- raise "Could not find PN header!" unless itpn
377
- raise "Unknown error -- something to do with the TID/SN/PN headers!"
378
- end
379
- return true unless fail
380
-
381
- unless request.post? # don't want to interfere with POSTing
382
- force_format :rtml
383
- # FIXME: It may be preferable to use redirect_to instead of render
384
- # because if the terminal hits an error in get_terminal_info (or
385
- # more likely, after it posts the data get_terminal_info is asking
386
- # for), the user is going to be somewhat confused by an error message
387
- # blaming HIS action, not the get_terminal_info action.
388
- # However, also need to be sure that when the user hits get_terminal_info,
389
- # he'll be sent back to the current action.
390
- #redirect_to :action => 'get_terminal_info'
391
-
392
- render :action => 'get_terminal_info'
393
- headers_filter
394
- return false
395
- end
396
-
397
- # If we get an ActiveRecord error, it's probably because RTML state has not been initialized.
398
- # Fail silently. Then, if the user tries to access state, they'll get the "rake first"
399
- # error via the #rtml_state method (above).
400
- rescue ActiveRecord::StatementInvalid
401
- true
402
- end
403
-
404
- # Saves the terminal's (or browser's) state hash to the database.
405
- # TODO: Use Rails.cache for the state (as opposed to the database) whenever possible.
406
- def save_state
407
- if @terminal_state
408
- begin
409
- @terminal_state.save
410
- rescue #save_state
411
- logger.error $!
412
- logger.error $!.backtrace.join("\n\t")
413
- end
414
- end
415
- true
416
- end
417
- end
418
- end