rtml 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +396 -0
- data/PostInstall.txt +2 -0
- data/README.rdoc +42 -0
- data/Rakefile +33 -0
- data/app_generators/rtml/USAGE +5 -0
- data/app_generators/rtml/rtml_generator.rb +78 -0
- data/app_generators/rtml/templates/rails_template.rb +36 -0
- data/app_generators/rtml/templates/rtml/MIT-LICENSE +20 -0
- data/app_generators/rtml/templates/rtml/README +109 -0
- data/app_generators/rtml/templates/rtml/Rakefile +38 -0
- data/app_generators/rtml/templates/rtml/app/controllers/beryl_controller.rb +70 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/magcard_demo_controller.rb +9 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/oe/btmlpa_controller.rb +158 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/rtml_app_controller.rb +252 -0
- data/app_generators/rtml/templates/rtml/app/controllers/rtml/tml_app_controller.rb +418 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_helper.rb +72 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/auth_result.rb +56 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/common.rb +19 -0
- data/app_generators/rtml/templates/rtml/app/helpers/beryl_tml_helpers/index.rb +82 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/authorized.rb +10 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/common.rb +20 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/magcard_demo_tml_helpers/index.rb +33 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/auth_result.rb +23 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/common.rb +23 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/dynamic.rb +11 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/icc.rb +384 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/index.rb +191 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/oe/btmlpa_tml_helpers/receipt.rb +152 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_helper.rb +74 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/rtml_app_tml_helpers/common.rb +9 -0
- data/app_generators/rtml/templates/rtml/app/helpers/rtml/tml_app_helper.rb +43 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card.rb +83 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_avs.rb +14 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_cvv.rb +14 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_parser.rb +21 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/card_pin.rb +18 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/emv_card_data.rb +25 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/mag_card_data.rb +21 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/reference_code.rb +26 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/state.rb +12 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/terminal.rb +8 -0
- data/app_generators/rtml/templates/rtml/app/models/rtml/transaction.rb +68 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/another_rcpt.rtml.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt.rtml.erb +108 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/auth_result/receipt_single_column.rtml.erb +106 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/about.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/admin.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/construction.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/idle.rtml.erb +13 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/main_menu.rtml.erb +12 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_credit.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/beryl/index/menu_debit.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/beryl_mono.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/magcard_demo_mono.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i5100.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/oe/btmlpa_i8550.rtml.erb +17 -0
- data/app_generators/rtml/templates/rtml/app/views/layouts/rtml/uml.html.erb +11 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/authorized/main.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/_error.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/enter_amount.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/magcard_demo/index/main.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/dynamic/response.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/icc.rtml.erb +760 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_enter_amount.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_about.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_duplicate.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_examples.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_logo.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_other.rtml.erb +20 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_refund.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_reversal.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/_menu_sale_cashback.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/about.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/assert.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/card_nmb.rtml.erb +19 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/compl_txn.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/confirm_rev.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/duplicate_na.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/error_scr.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.bak +31 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/main_menu.rtml.erb +40 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/print_pf.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rd_sale_disp.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_refund.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/read_scb.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/reject_trans.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/remove_card.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/rev_bad.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/scb_check_f.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/sign_check.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/subm_err.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/to_man_entry.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/trans_abrt.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/index/void_trans.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/_receipt.rtml.erb +29 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/oe/btmlpa/receipt/error_paper.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_development.html.erb +167 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_header.html.erb +12 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/_default_production.html.erb +8 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/rtml_app/charts.html.erb +14 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/do_tml_redirect.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/get_terminal_info.rtml.erb +26 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_in_public.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/app/views/rtml/tml_app/rescue_action_locally.rtml.erb +42 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/common.rb +303 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/force.rb +46 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/return.rb +22 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/sale.rb +49 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_confirmation.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_agreement.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_footer.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/_receipt_header.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/ask_cashback.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/card_imprint.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/check_cb.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/conf_debit.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confirm_sale.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/confrm_force.rtml.erb +4 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/cvv_skipped.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/disp_avs.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/do_avs_zip.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_amount.rtml.erb +12 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_card.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cashbk.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_cvv2.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/enter_expiry.rtml.erb +9 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check1.rtml.erb +6 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/fraud_check2.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_aprvl.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_avs_zip.rtml.erb +8 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frc_bad_aprv.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/frd_chk_fail.rtml.erb +5 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/invalid_exp.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/no_entr_crd.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/remove_card.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/swipe_card.rtml.erb +7 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_abort.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/trans_reject.rtml.erb +1 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/views/void_ref.rtml.erb +10 -0
- data/app_generators/rtml/templates/rtml/components/rtml/features/void.rb +30 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/card_parser_widget.rb +90 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/display_widget.rb +66 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/element_builder_widget.rb +123 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/emv_support_widget.rb +365 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/form_submit_widget.rb +65 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_transaction_variables_widget.rb +33 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/get_variable_widget.rb +39 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/receipt_widget.rb +66 -0
- data/app_generators/rtml/templates/rtml/components/rtml/widgets/screen_builder_widget.rb +49 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132217_create_rtml_states.rb +15 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132401_create_rtml_terminals.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825132530_create_rtml_transactions.rb +24 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134118_create_rtml_cards.rb +23 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134622_create_rtml_emv_card_data.rb +20 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825134629_create_rtml_mag_card_data.rb +17 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090825135838_create_rtml_card_parsers.rb +19 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090826103509_create_reference_codes.rb +14 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915030044_add_batch_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031155_add_additional_data_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20090915031156_add_hidden_data_to_rtml_transactions.rb +10 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016133313_create_rtml_card_avs.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135800_create_rtml_card_cvvs.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135810_create_rtml_card_pins.rb +16 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20091016135820_reverse_card_transaction_relationship.rb +11 -0
- data/app_generators/rtml/templates/rtml/db/migrate/20100127115105_convert_rtml_migrations_to_rails_migrations.rb +31 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/USAGE +25 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/rtml_controller_generator.rb +49 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/common_tml_helper.rb +20 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/controller.rb +3 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_color.css +37 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/css_mono.css +12 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/functional_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_color.rtml.erb +24 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/layout_mono.rtml.erb +3 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/tml_helper.rb +16 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.html.erb +15 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_controller/templates/view.rtml.erb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/USAGE +8 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/rtml_document_generator.rb +45 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/controller.rb +7 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/functional_test.rb +10 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/helper.rb +2 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_document/templates/view.rtml.erb +11 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/USAGE +8 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/rtml_widget_generator.rb +66 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget.rb +57 -0
- data/app_generators/rtml/templates/rtml/generators/rtml_widget/templates/basic_widget_no_help.rb +27 -0
- data/app_generators/rtml/templates/rtml/init.rb +40 -0
- data/app_generators/rtml/templates/rtml/install.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/environment.rb +61 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/request.rb +9 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_controller/routing/route_set.rb +34 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/base.rb +74 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/action_view/partial_template.rb +24 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/active_record.rb +13 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/active_support/dependencies.rb +25 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/array.rb +15 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/attr_boolean.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/hash.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/nil_class.rb +20 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/rake.rb +19 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/regexp.rb +16 -0
- data/app_generators/rtml/templates/rtml/lib/extensions/string.rb +37 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins.rb +23 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/MIT-LICENSE +20 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/README +36 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/Rakefile +44 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/init.rb +25 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/action_controller/filters/before_render_filter.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render.rb +43 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/before_render_instance.rb +45 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_chain_has_many_types_of_filters.rb +87 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/lib/filter_has_before_render.rb +26 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/tasks/before_render_tasks.rake +25 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/before_render_test.rb +29 -0
- data/app_generators/rtml/templates/rtml/lib/other_plugins/before_render/test/test_helper.rb +24 -0
- data/app_generators/rtml/templates/rtml/lib/rtml.rb +77 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/constants.rb +12 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/beryl/version.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/common/renderable.rb +13 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/include.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/layout.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/next.rb +188 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen.rb +91 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/iterators.rb +63 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/next_screen_methods.rb +70 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/screen/variable_methods.rb +73 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/support/importer.rb +55 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document.rb +318 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/screen_methods.rb +79 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/tml_document/variable_methods.rb +83 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/core/variable.rb +123 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/browser_emulator.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_controller_test_case.rb +7 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/rtml_core_unit_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/debug/unit_test.rb +3 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/delegation.rb +8 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/doc.rb +12 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/element.rb +75 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/errors/widget_accessor_failure.rb +9 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_handler.rb +79 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/event_processor.rb +106 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/defaults_processor.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/events/processors/key_processor.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/feature.rb +32 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/feature_config.rb +195 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/array_of_feature_instances.rb +17 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_class_methods.rb +30 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/features/controller_instance_methods.rb +35 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/controller_helpers/menu_helpers.rb +193 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/action_view_wrapper.rb +23 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/event_helpers.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/layout_helpers.rb +47 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support.rb +181 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/widget_support/class_methods.rb +28 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/core_helpers/yield_helpers.rb +33 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/proxy_helpers/feature_helpers.rb +17 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/render_helper.rb +71 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/terminal_helpers.rb +21 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers.rb +6 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/tml_validation_assertions.rb +10 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/test_helpers/variable_assertions.rb +27 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/form_helpers.rb +70 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/helpers/view_helpers/rtml_form_builder.rb +174 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/oe/btmlpa_constants.rb +48 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/method_missing_methods.rb +14 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/rtml_interface.rb +33 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/proxying/sandbox.rb +18 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/text_utils.rb +51 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/tml_param_parser.rb +95 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_rule_parser.rb +61 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/dom_tag.rb +52 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/predefined_variable_rule_parser.rb +97 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/validation/tml_validator.rb +16 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/version.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property.rb +11 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/property_accessors.rb +59 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget.rb +251 -0
- data/app_generators/rtml/templates/rtml/lib/rtml/widgets/widget_class_methods.rb +213 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/dot.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_can.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_cand.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_en.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_end.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_i.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icl.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icr.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ics.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icsw.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_icv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_int2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_men.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_mend.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_next.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_no.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_nod.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_ok.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_okd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic1.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic2.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic3.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_pic4.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_txn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yes.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/btmlpa/nbg_yesd.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/btmlpa.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/can_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/conf.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/iccemv.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/images.lib +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/magcard.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/no_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/ok_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/top.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_dn.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/images/rtml/oe/examples/yes_up.gif +0 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_color.css +37 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/beryl_mono.css +17 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/charts.css +0 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i5100.css +12 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/i8550.css +37 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/btmlpa/receipt.css +4 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i5100.css +12 -0
- data/app_generators/rtml/templates/rtml/public/stylesheets/rtml/oe/examples/i8550.css +37 -0
- data/app_generators/rtml/templates/rtml/reporting/110409 +227 -0
- data/app_generators/rtml/templates/rtml/reporting/linecount.rb +42 -0
- data/app_generators/rtml/templates/rtml/rules/predefined_tml_variables.rb +63 -0
- data/app_generators/rtml/templates/rtml/rules/tml_document_structure.rb +84 -0
- data/app_generators/rtml/templates/rtml/rules/varns/audio.rb +30 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card.rb +17 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/emv.rb +31 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/mag.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/parser.rb +7 -0
- data/app_generators/rtml/templates/rtml/rules/varns/card/pin.rb +6 -0
- data/app_generators/rtml/templates/rtml/rules/varns/cfgm.rb +15 -0
- data/app_generators/rtml/templates/rtml/rules/varns/com.rb +9 -0
- data/app_generators/rtml/templates/rtml/rules/varns/err.rb +14 -0
- data/app_generators/rtml/templates/rtml/rules/varns/gma/event.rb +13 -0
- data/app_generators/rtml/templates/rtml/rules/varns/gprs.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/imager.rb +8 -0
- data/app_generators/rtml/templates/rtml/rules/varns/ip.rb +15 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr.rb +42 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/3rdparty.rb +7 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/backlight.rb +4 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/cache.rb +1 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connect.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/connection.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oebr/offline.rb +5 -0
- data/app_generators/rtml/templates/rtml/rules/varns/oegw.rb +12 -0
- data/app_generators/rtml/templates/rtml/rules/varns/payment.rb +21 -0
- data/app_generators/rtml/templates/rtml/rules/varns/ppp.rb +11 -0
- data/app_generators/rtml/templates/rtml/rules/varns/terminal.rb +29 -0
- data/app_generators/rtml/templates/rtml/tasks/rtml_tasks.rake +78 -0
- data/app_generators/rtml/templates/rtml/template.rb +64 -0
- data/app_generators/rtml/templates/rtml/test/core/element_test.rb +17 -0
- data/app_generators/rtml/templates/rtml/test/core/screen_test.rb +91 -0
- data/app_generators/rtml/templates/rtml/test/core/tml_document_test.rb +53 -0
- data/app_generators/rtml/templates/rtml/test/functional/beryl_controller_test.rb +13 -0
- data/app_generators/rtml/templates/rtml/test/functional/btmlpa_controller_test.rb +13 -0
- data/app_generators/rtml/templates/rtml/test/functional/magcard_demo_controller_test.rb +20 -0
- data/app_generators/rtml/templates/rtml/test/functional/rtml_app_controller_test.rb +9 -0
- data/app_generators/rtml/templates/rtml/test/functional/rtml_routing_test.rb +19 -0
- data/app_generators/rtml/templates/rtml/test/functional/tml_controller_params_test.rb +20 -0
- data/app_generators/rtml/templates/rtml/test/rtml_test_helper.rb +44 -0
- data/app_generators/rtml/templates/rtml/test/validation/predefined_variable_rule_parser_test.rb +11 -0
- data/app_generators/rtml/templates/rtml/uninstall.rb +1 -0
- data/app_generators/rtml/templates/rtml/update.rb +57 -0
- data/bin/rtml +36 -0
- data/lib/rtml.rb +4 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/tasks/reglob.rake +28 -0
- data/test/test_generator_helper.rb +29 -0
- data/test/test_helper.rb +3 -0
- data/test/test_rtml.rb +11 -0
- data/test/test_rtml_generator.rb +43 -0
- metadata +516 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
class Rtml::Errors::WidgetAccessorFailure < RuntimeError
|
2
|
+
def initialize(widget_alias, widget_name, container_class)
|
3
|
+
@widget_alias, @widget_name, @container_class = widget_alias, widget_name, container_class
|
4
|
+
end
|
5
|
+
|
6
|
+
def message
|
7
|
+
"Warning: Widget Alias #{@widget_alias.inspect} in class #{@widget_name} for Widget #{@container_class.name} overrides an existing method or object."
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module Rtml::Events
|
2
|
+
class EventHandler
|
3
|
+
# It's a little faster when we only have to const_get these things once.
|
4
|
+
@@all_event_processors = []
|
5
|
+
Rtml::Events::Processors.constants.each do |konst_name|
|
6
|
+
konst = Rtml::Events::Processors.const_get konst_name
|
7
|
+
@@all_event_processors << konst if konst.respond_to? :is_event_processor?
|
8
|
+
end
|
9
|
+
|
10
|
+
# The array of event processors associated with this handler.
|
11
|
+
attr_reader :event_processors
|
12
|
+
|
13
|
+
# The array of instantiated event processors.
|
14
|
+
attr_reader :processor_instances
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@event_processors = []
|
18
|
+
@processor_instances = []
|
19
|
+
add_all_event_processors
|
20
|
+
end
|
21
|
+
|
22
|
+
# Adds all EventProcessor objects which are members of the Events::Processors module
|
23
|
+
# to the event_processors array for this event handler.
|
24
|
+
def add_all_event_processors
|
25
|
+
@@all_event_processors.each do |konst|
|
26
|
+
add_event_processor konst
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Adds the specified class to the list of event processors.
|
31
|
+
def add_event_processor(klass)
|
32
|
+
event_processors << klass unless event_processor_registered?(klass)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Removes all instances of the specified class from the event processors list.
|
36
|
+
def remove_event_processor(klass)
|
37
|
+
event_processors.delete klass
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns true if the specified class has already been instantiated and added to the
|
41
|
+
# array of event processors.
|
42
|
+
def event_processor_registered?(klass)
|
43
|
+
event_processors.include? klass
|
44
|
+
end
|
45
|
+
|
46
|
+
# Registers a screen or URL with a specified event. Raises an error if the event
|
47
|
+
# is not a valid TML event type.
|
48
|
+
def register(event_source, target)
|
49
|
+
found = false
|
50
|
+
event_processors.each do |processor|
|
51
|
+
if processor.accepts_event_source? event_source
|
52
|
+
processor_instances << processor.new(event_source, target)
|
53
|
+
found = true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
raise "Could not find suitable event processor for event source #{event_source.inspect}" unless found
|
57
|
+
end
|
58
|
+
|
59
|
+
# Unregisters a specified event so that no action will occur when this event is fired.
|
60
|
+
# Raises an error if the event is not a valid TML event type.
|
61
|
+
def unregister(event_source)
|
62
|
+
found = false
|
63
|
+
event_processors.each do |processor|
|
64
|
+
if processor.accepts_event_source? event_source
|
65
|
+
processor_instances.select { |i| i.kind_of? processor and i.event_source == event_source }.each do |i|
|
66
|
+
processor_instances.delete i
|
67
|
+
found = true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
raise "Could not find suitable event processor for event source #{event_source.inspect}" unless found
|
72
|
+
end
|
73
|
+
|
74
|
+
# Applies all event processors to the specified parent object
|
75
|
+
def process_event_handling_for(parent)
|
76
|
+
processor_instances.each { |ep| ep.process parent }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
module Rtml::Events
|
2
|
+
# Parent class of all RTML event processors.
|
3
|
+
class EventProcessor
|
4
|
+
include Rtml::Core
|
5
|
+
include Rtml::Widgets
|
6
|
+
|
7
|
+
# A Symbol or String representing the actual event to be triggered,
|
8
|
+
# i.e. :menu, :cancel, and so on.
|
9
|
+
attr_reader :event_source
|
10
|
+
|
11
|
+
# The destination screen when this event has been triggered
|
12
|
+
attr_reader :target
|
13
|
+
|
14
|
+
def initialize(event_source, target)
|
15
|
+
@event_source, @target = event_source, target
|
16
|
+
end
|
17
|
+
|
18
|
+
# Must always return true.
|
19
|
+
def self.is_event_processor?; true; end
|
20
|
+
|
21
|
+
# Returns all event sources which can be associated with this event processor.
|
22
|
+
# An event source is a Symbol or a String representing the TML-level event that
|
23
|
+
# is fired -- for instance, a KeyEventProcessor might have event sources including
|
24
|
+
# :menu, :cancel, :f1, '00', and so on. Consult the TML development guidelines for
|
25
|
+
# more information on these types.
|
26
|
+
def self.acceptable_event_sources
|
27
|
+
@acceptable_event_sources ||= []
|
28
|
+
end
|
29
|
+
|
30
|
+
# Adds the specified event source(s) to the list of acceptable sources.
|
31
|
+
def self.accepts_event_source(*sources)
|
32
|
+
sources.each { |source| acceptable_event_sources << source }
|
33
|
+
end
|
34
|
+
|
35
|
+
# Removes the specified event source(s) from the list of acceptable sources.
|
36
|
+
def self.rejects_event_source(*sources)
|
37
|
+
sources.each { |source| acceptable_event_sources.delete source }
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns true if the specified event source is accepted by this processor.
|
41
|
+
def self.accepts_event_source?(source)
|
42
|
+
acceptable_event_sources.collect { |i| i.to_s }.include? source.to_s
|
43
|
+
end
|
44
|
+
|
45
|
+
# Simply wraps the specified block in a condition, so you don't have to type
|
46
|
+
# quite as much. Equates to:
|
47
|
+
#
|
48
|
+
# if parent_object.kind_of? parent_type
|
49
|
+
# [block]
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
def for_parent_type(parent_type, parent_object, &block)
|
53
|
+
yield if parent_object.kind_of? parent_type
|
54
|
+
end
|
55
|
+
|
56
|
+
# Applies the registered events and their associated screens to the
|
57
|
+
# object in question. This method is expected to be overridden by your
|
58
|
+
# subclass.
|
59
|
+
def apply_to(parent)
|
60
|
+
raise "Override this method."
|
61
|
+
end
|
62
|
+
|
63
|
+
# Validates that the object argument is of an accepted type.
|
64
|
+
# The default accepted types are TMLDocument, Screen and Widget.
|
65
|
+
def validate(parent)
|
66
|
+
unless self.class.instance_variable_get("@acceptable_parents").include? parent.class
|
67
|
+
raise "Argument (#{parent.class}) must be one of [#{self.class.instance_variable_get("@acceptable_parents").join(", ")}]"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Validates and then applies self to the specified parent object.
|
72
|
+
def process(parent)
|
73
|
+
validate(parent)
|
74
|
+
apply_to(parent)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Returns true if the specified object's class is in the list of acceptable arguments for
|
78
|
+
# #apply_to.
|
79
|
+
def accepts?(parent)
|
80
|
+
self.class.accepts? parent.class
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns true if the specified class is in the list of acceptable arguments for
|
84
|
+
# #apply_to.
|
85
|
+
def self.accepts?(klass)
|
86
|
+
acceptable_parents.include? klass
|
87
|
+
end
|
88
|
+
|
89
|
+
# Causes the default apply_to implementation to raise an error if this object
|
90
|
+
# type is given.
|
91
|
+
def self.rejects_parent(*klasses)
|
92
|
+
klasses.each { |klass| acceptable_parents.delete klass }
|
93
|
+
end
|
94
|
+
|
95
|
+
# Causes the default apply_to implementation to allow this object type to be
|
96
|
+
# specified.
|
97
|
+
def self.accept_parent(*klasses)
|
98
|
+
klasses.each { |klass| acceptable_parents << klass }
|
99
|
+
end
|
100
|
+
|
101
|
+
# Returns the classes of potential parent objects this processor can be applied to.
|
102
|
+
def self.acceptable_parents
|
103
|
+
@acceptable_parents ||= [ TMLDocument, Screen, Widget ]
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Rtml::Events::Processors
|
2
|
+
# Finds all of the filenames in the ./processors/ directory, camelizes
|
3
|
+
# the filenames and then constantizes them. This causes Rails to take
|
4
|
+
# care of the autoloading.
|
5
|
+
path = File.join(File.dirname(__FILE__), "processors", "")
|
6
|
+
Dir.glob(File.join(path, "*.rb")).each do |file|
|
7
|
+
camel = File.basename(file).sub(/(.*)\.rb$/, '\1').camelize
|
8
|
+
"Rtml::Events::Processors::#{camel}".constantize
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Rtml::Events::Processors
|
2
|
+
# Processes the MENU and CANCEL buttons for TMLDocument and Screen
|
3
|
+
# as well as the default ERROR screen for TMLDocument.
|
4
|
+
class DefaultsProcessor < Rtml::Events::EventProcessor
|
5
|
+
accepts_event_source :menu, :cancel, :error
|
6
|
+
rejects_parent Rtml::Widgets::Widget
|
7
|
+
|
8
|
+
def apply_to(parent)
|
9
|
+
for_parent_type TMLDocument, parent do
|
10
|
+
parent["on_#{event_source}"] = target
|
11
|
+
end
|
12
|
+
|
13
|
+
for_parent_type Screen, parent do
|
14
|
+
parent[event_source] = target
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Rtml::Events::Processors
|
2
|
+
# Processes all possible button press events at the Screen level.
|
3
|
+
# Possible event sources are:
|
4
|
+
#
|
5
|
+
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 00, f1, f2, f3, f4, f5,
|
6
|
+
# f6, f7, f8, f9, down, up, stop, enter
|
7
|
+
#
|
8
|
+
# Note that while "menu" and "cancel" are technically button
|
9
|
+
# events, these are handled by the DefaultsProcessor.
|
10
|
+
class KeyProcessor < Rtml::Events::EventProcessor
|
11
|
+
0.upto(9) { |i| accepts_event_source(i, "f#{i}") } # 0..9, f0..f9
|
12
|
+
accepts_event_source '00', :down, :up, :stop, :enter
|
13
|
+
|
14
|
+
rejects_parent Widget, TMLDocument
|
15
|
+
|
16
|
+
def apply_to(parent)
|
17
|
+
# parent is a screen
|
18
|
+
parent.next_screen target, :key => event_source
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Rtml::Feature
|
2
|
+
attr_accessor :document
|
3
|
+
alias rtml_document document
|
4
|
+
|
5
|
+
[ :entry_point ].each { |m| eval("def #{m}; self.class.#{m}; end", binding, __FILE__, __LINE__) }
|
6
|
+
|
7
|
+
def config; self.class.config; end
|
8
|
+
def self.config; @config; end
|
9
|
+
def self.config=(a); @config = a; end
|
10
|
+
|
11
|
+
def add_to(document)
|
12
|
+
self.document = document
|
13
|
+
to_tml
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_tml
|
17
|
+
raise "Expected Feature#to_tml to be overridden"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.entry_point(id = nil)
|
21
|
+
unless id
|
22
|
+
raise "Expected #{self.name} to define an entry_point" unless @entry_point
|
23
|
+
return @entry_point
|
24
|
+
end
|
25
|
+
@entry_point = id
|
26
|
+
end
|
27
|
+
|
28
|
+
protected
|
29
|
+
def restart_app
|
30
|
+
document.default_screen
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
class Rtml::FeatureConfig
|
2
|
+
@@num_feature_configs = 0
|
3
|
+
|
4
|
+
attr_reader :feature_class, :feature_config_id
|
5
|
+
|
6
|
+
def root
|
7
|
+
@parent.nil? ? self : @parent.root
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(feature = nil, parent = nil)
|
11
|
+
@parent = parent
|
12
|
+
@feature_config_id = (@@num_feature_configs += 1)
|
13
|
+
if feature.nil? then Rtml::Features.each { |f| add_subfeature(f) }
|
14
|
+
else
|
15
|
+
@feature_class = feature
|
16
|
+
if feature and not feature.ancestors.include? Rtml::Feature and false
|
17
|
+
config = self
|
18
|
+
@feature_class = Class.new(Feature) do
|
19
|
+
@name = "#{feature.name.titleize}"
|
20
|
+
def self.name; @name; end
|
21
|
+
entry_point("feat_menu_#{config.feature_config_id}".underscore)
|
22
|
+
|
23
|
+
def add_to(document)
|
24
|
+
content = config.to_menu(document)
|
25
|
+
|
26
|
+
document.screen entry_point do |scr|
|
27
|
+
scr.on config.events unless config.events.empty?
|
28
|
+
scr.display content
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
feature.constants.each do |konst_name|
|
34
|
+
konst = feature.const_get(konst_name)
|
35
|
+
#if konst.respond_to? :entry_point # it's a Feature
|
36
|
+
add_subfeature(konst)
|
37
|
+
#end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
@feature_class.config = self
|
41
|
+
@feature_class.configure if @feature_class.respond_to? :configure
|
42
|
+
end
|
43
|
+
|
44
|
+
defaults
|
45
|
+
end
|
46
|
+
|
47
|
+
def events(rtml_document, *items)
|
48
|
+
opts = items.extract_options!
|
49
|
+
create_menu_items(rtml_document)
|
50
|
+
values = (subfeatures.values || []).select { |v| v.menu }
|
51
|
+
items = values.collect { |a| a.entry_point } if items.empty?
|
52
|
+
items = opts[:only] if opts[:only]
|
53
|
+
items = items - (opts[:except] || [])
|
54
|
+
|
55
|
+
events = HashWithIndifferentAccess.new
|
56
|
+
count = 0
|
57
|
+
rtml_document.controller.render_menu_items(*items) do |item, default|
|
58
|
+
count += 1
|
59
|
+
events[count] = item[:next_screen]
|
60
|
+
default
|
61
|
+
end
|
62
|
+
|
63
|
+
events
|
64
|
+
end
|
65
|
+
|
66
|
+
def to_menu(rtml_document, *items, &block)
|
67
|
+
opts = items.extract_options!
|
68
|
+
create_menu_items(rtml_document, &block)
|
69
|
+
values = (subfeatures.values || []).select { |v| v.menu }
|
70
|
+
|
71
|
+
items = values.collect { |a| a.entry_point } if items.empty?
|
72
|
+
items = opts[:only] if opts[:only]
|
73
|
+
items = items - (opts[:except] || [])
|
74
|
+
|
75
|
+
ret = "<table width='100%'>"
|
76
|
+
count = 0
|
77
|
+
ret.concat(rtml_document.controller.render_menu_items(*items) do |item, default|
|
78
|
+
count += 1
|
79
|
+
"<tr><td align='left'>#{count}. </td><td align='left'>#{default}</td></tr>"
|
80
|
+
end)
|
81
|
+
ret.concat "</table>"
|
82
|
+
|
83
|
+
ret
|
84
|
+
end
|
85
|
+
|
86
|
+
def entry_point
|
87
|
+
feature_class.nil? ? nil : feature_class.entry_point
|
88
|
+
end
|
89
|
+
|
90
|
+
def to_instances
|
91
|
+
return @instances if @instances
|
92
|
+
r = ([to_instance] + subfeatures.collect { |name,config| config.to_instances }) - [nil]
|
93
|
+
@instances = Rtml::Features::ArrayOfFeatureInstances.new(r)
|
94
|
+
end
|
95
|
+
|
96
|
+
def to_instance
|
97
|
+
return nil unless enabled and feature_class
|
98
|
+
feature_class.new
|
99
|
+
end
|
100
|
+
|
101
|
+
def subfeatures
|
102
|
+
@subfeatures ||= ActiveSupport::OrderedHash.new#{}.with_indifferent_access
|
103
|
+
end
|
104
|
+
|
105
|
+
def add_subfeature(feature)
|
106
|
+
fname = File.basename(feature.name.underscore)
|
107
|
+
|
108
|
+
subfeatures[fname] = self.class.new(feature, self)
|
109
|
+
eval "def self.#{fname}; subfeatures[#{fname.inspect}]; end", binding, __FILE__, __LINE__
|
110
|
+
end
|
111
|
+
|
112
|
+
def option(*options)
|
113
|
+
options.each do |option|
|
114
|
+
if option.kind_of? Hash
|
115
|
+
option(*option.keys)
|
116
|
+
option.each do |key, value|
|
117
|
+
unless self.options.keys.include? key
|
118
|
+
self.set_option(key, value)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
elsif option.kind_of? Array
|
122
|
+
self.option(*option)
|
123
|
+
else
|
124
|
+
eval "def self.#{option}=(a); set_option(#{option.inspect}, a); end", binding, __FILE__, __LINE__
|
125
|
+
eval "def self.#{option}; get_option(#{option.inspect}); end", binding, __FILE__, __LINE__
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def self.option(*options)
|
131
|
+
options.each do |option|
|
132
|
+
if option.kind_of? Hash
|
133
|
+
self.option(*option.keys)
|
134
|
+
option.each do |key, value|
|
135
|
+
configure { |config| config.send("#{key}=", value) }
|
136
|
+
end
|
137
|
+
elsif option.kind_of? Array
|
138
|
+
self.option(*option)
|
139
|
+
else
|
140
|
+
eval "def #{option}=(a); set_option(#{option.inspect}, a); end", binding, __FILE__, __LINE__
|
141
|
+
eval "def #{option}; get_option(#{option.inspect}); end", binding, __FILE__, __LINE__
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def options
|
147
|
+
@options ||= {}.with_indifferent_access
|
148
|
+
end
|
149
|
+
|
150
|
+
def set_option(option_name, value)
|
151
|
+
options[option_name] = value
|
152
|
+
end
|
153
|
+
|
154
|
+
def get_option(option_name)
|
155
|
+
options[option_name]
|
156
|
+
end
|
157
|
+
|
158
|
+
def self.configure_blocks
|
159
|
+
@configure_blocks ||= []
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.configure(&block)
|
163
|
+
raise ArgumentError.new("Expected a block") unless block_given?
|
164
|
+
configure_blocks << block
|
165
|
+
end
|
166
|
+
|
167
|
+
option :caption, :enabled, :order, :image, :menu
|
168
|
+
|
169
|
+
protected
|
170
|
+
def create_menu_items(rtml_document, &block) #:nodoc:
|
171
|
+
create_menu_item(rtml_document, &block)
|
172
|
+
subfeatures.each { |name,config| config.create_menu_items(rtml_document, &block) }
|
173
|
+
end
|
174
|
+
|
175
|
+
def create_menu_item(rtml_document, &block) #:nodoc:
|
176
|
+
return '' if feature_class.nil?
|
177
|
+
rtml_document.controller.menu_item feature_class.entry_point,
|
178
|
+
:label => caption,
|
179
|
+
:position => order,
|
180
|
+
:image => image,
|
181
|
+
&block
|
182
|
+
end
|
183
|
+
|
184
|
+
private
|
185
|
+
def defaults
|
186
|
+
set_option :enabled, true
|
187
|
+
set_option :menu, true
|
188
|
+
set_option :order, @feature_config_id
|
189
|
+
|
190
|
+
if feature_class
|
191
|
+
set_option :caption, File.basename(feature_class.name.underscore).titleize
|
192
|
+
self.class.configure_blocks.each { |block| block.call(self) }
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|