spiderfw 0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +4 -0
- data/Rakefile +74 -0
- data/apps/cas_server/_init.rb +23 -0
- data/apps/cas_server/config/options.rb +9 -0
- data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +353 -0
- data/apps/cas_server/lib/cas.rb +329 -0
- data/apps/cas_server/lib/utils.rb +30 -0
- data/apps/cas_server/models/login_ticket.rb +11 -0
- data/apps/cas_server/models/mixins/consumable.rb +10 -0
- data/apps/cas_server/models/proxy_granting_ticket.rb +12 -0
- data/apps/cas_server/models/proxy_ticket.rb +12 -0
- data/apps/cas_server/models/service_ticket.rb +22 -0
- data/apps/cas_server/models/ticket.rb +20 -0
- data/apps/cas_server/models/ticket_granting_ticket.rb +15 -0
- data/apps/cas_server/views/logout.shtml +3 -0
- data/apps/core/admin/_init.rb +23 -0
- data/apps/core/admin/admin.rb +17 -0
- data/apps/core/admin/controllers/admin_controller.rb +15 -0
- data/apps/core/admin/views/index.shtml +1 -0
- data/apps/core/admin/views/spider_admin.layout.shtml +23 -0
- data/apps/core/admin/widgets/admin_menu/admin_menu.rb +17 -0
- data/apps/core/auth/_init.rb +42 -0
- data/apps/core/auth/controllers/login_controller.rb +94 -0
- data/apps/core/auth/controllers/mixins/auth_helper.rb +114 -0
- data/apps/core/auth/controllers/mixins/http_basic_auth.rb +24 -0
- data/apps/core/auth/controllers/mixins/http_digest_auth.rb +26 -0
- data/apps/core/auth/lib/authenticable.rb +86 -0
- data/apps/core/auth/lib/authenticator.rb +11 -0
- data/apps/core/auth/lib/digest_authenticator.rb +44 -0
- data/apps/core/auth/lib/login_authenticator.rb +27 -0
- data/apps/core/auth/models/digest_user.rb +34 -0
- data/apps/core/auth/models/group.rb +22 -0
- data/apps/core/auth/models/login_user.rb +15 -0
- data/apps/core/auth/models/mixins/access_control.rb +71 -0
- data/apps/core/auth/models/mixins/authentication_tracking.rb +19 -0
- data/apps/core/auth/models/super_user.rb +8 -0
- data/apps/core/auth/models/user.rb +15 -0
- data/apps/core/auth/po/it/spider_auth.po +33 -0
- data/apps/core/auth/po/spider_auth.pot +31 -0
- data/apps/core/auth/views/login.shtml +25 -0
- data/apps/core/components/_init.rb +21 -0
- data/apps/core/components/po/it/spider_components.po +52 -0
- data/apps/core/components/po/spider_components.pot +53 -0
- data/apps/core/components/public/css/admin.css +73 -0
- data/apps/core/components/public/css/crud.css +58 -0
- data/apps/core/components/public/css/img/add.gif +0 -0
- data/apps/core/components/public/css/img/ajax-loader.gif +0 -0
- data/apps/core/components/public/css/img/back.gif +0 -0
- data/apps/core/components/public/css/img/bg_header.png +0 -0
- data/apps/core/components/public/css/img/body_bg.jpg +0 -0
- data/apps/core/components/public/css/img/gray_gradient.gif +0 -0
- data/apps/core/components/public/css/img/li_bg.png +0 -0
- data/apps/core/components/public/css/img/li_bg_active.png +0 -0
- data/apps/core/components/public/css/img/li_bg_hover.png +0 -0
- data/apps/core/components/public/css/img/logo.png +0 -0
- data/apps/core/components/public/css/img/menu_bg.png +0 -0
- data/apps/core/components/public/css/img/menu_bottom.png +0 -0
- data/apps/core/components/public/css/img/menu_top.png +0 -0
- data/apps/core/components/public/css/img/section-bottom.jpg +0 -0
- data/apps/core/components/public/css/list.css +7 -0
- data/apps/core/components/public/css/menu.css +47 -0
- data/apps/core/components/public/css/spider.css +9 -0
- data/apps/core/components/public/css/switcher.css +13 -0
- data/apps/core/components/public/css/table.css +99 -0
- data/apps/core/components/public/js/inheritance.js +71 -0
- data/apps/core/components/public/js/jquery/jquery-1.3.2.js +4376 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +406 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/AUTHORS.txt +30 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/GPL-LICENSE.txt +278 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/MIT-LICENSE.txt +25 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +20 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +32 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +100 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +10 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +10 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +197 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +97 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +10 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +10 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +159 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +780 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +120 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +152 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +4376 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +9 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +2 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +8 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +37 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +62 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +13 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +4 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +13 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +17 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +11 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +245 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +9 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +2 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +8 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +37 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +62 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +13 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +4 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +13 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +17 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +11 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +247 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.blind.js +49 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.bounce.js +78 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.clip.js +54 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.core.js +545 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.drop.js +50 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.explode.js +79 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.fold.js +56 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +48 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +56 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.scale.js +180 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.shake.js +57 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.slide.js +50 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.transfer.js +45 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/jquery-ui-i18n.js +771 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js +20 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js +20 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js +20 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js +20 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js +25 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +9133 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +477 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +519 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.datepicker.js +1636 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +671 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.draggable.js +766 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.droppable.js +282 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +116 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.resizable.js +800 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.selectable.js +257 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +558 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.sortable.js +1019 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +685 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +1 -0
- data/apps/core/components/public/js/jquery/jquery-ui/index.html +367 -0
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +19 -0
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +298 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +27 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +48 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +808 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +13 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +12 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +116 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +10 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +3558 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +10 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +163 -0
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +166 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.form.js +653 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.query-2.1.6.js +224 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.url.js +214 -0
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +187 -0
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +1 -0
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +193 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/changelog.txt +35 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/ajax-loader.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/file.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/folder-closed.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/folder.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/minus.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/plus.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black-line.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default-line.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam-line.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray-line.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red-line.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.async.js +110 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.css +74 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.edit.js +37 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.js +256 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.min.js +15 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.pack.js +16 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.sortable.js +386 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.cookie.js +92 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.js +3534 -0
- data/apps/core/components/public/js/jquery/plugins/treeview/todo +8 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/LICENSE +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/README +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.css +34 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.js +1413 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.min.js +10 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/222222_256x240_icons_icons.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/2e83ff_256x240_icons_icons.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/454545_256x240_icons_icons.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/888888_256x240_icons_icons.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/aaaaaa_40x100_textures_01_flat_0.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cccccc_40x100_textures_03_highlight_soft_75.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cd0a0a_256x240_icons_icons.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/dadada_40x100_textures_02_glass_75.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fbf9ee_40x100_textures_02_glass_55.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fef1ec_40x100_textures_05_inset_soft_95.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_65.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_75.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.accordion.css +9 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.all.css +4 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.allplugins.css +7 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.core.css +37 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.datepicker.css +60 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.dialog.css +13 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.progressbar.css +4 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.resizable.css +13 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.slider.css +13 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.tabs.css +9 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.theme.css +238 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.timepickr.css +44 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.js +2307 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.min.js +10 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/body-bg.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn-hover.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/buttons.psd +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/index.html +326 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.anchorHandler.js +44 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.strings.js +290 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.ui.all.js +518 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.js +255 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.ui.min.js +26 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ff.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ie.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.psd +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/package.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/reset.css +48 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/script_code.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/styles.css +308 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/themeroller_ready_black_200px.gif +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/weather_sun.png +0 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.dropslide.css +26 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.timepickr.css +18 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.dropslide.js +132 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.timepickr.js +217 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/data/testrunner.js +1 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/index.html +34 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testrunner.js +780 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testsuite.css +120 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/styles.css +201 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/test.js +41 -0
- data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/unit/ui.timepickr.js +154 -0
- data/apps/core/components/public/js/list.js +234 -0
- data/apps/core/components/public/js/spider.js +484 -0
- data/apps/core/components/public/widgets/search_table.js +10 -0
- data/apps/core/components/public/widgets/table.js +9 -0
- data/apps/core/components/widgets/admin/admin.rb +75 -0
- data/apps/core/components/widgets/admin/admin.shtml +16 -0
- data/apps/core/components/widgets/confirm/confirm.rb +37 -0
- data/apps/core/components/widgets/confirm/confirm.shtml +9 -0
- data/apps/core/components/widgets/crud/crud.rb +119 -0
- data/apps/core/components/widgets/crud/crud.shtml +59 -0
- data/apps/core/components/widgets/crud/form_table/form_table.rb +13 -0
- data/apps/core/components/widgets/crud/form_table/form_table.shtml +3 -0
- data/apps/core/components/widgets/list/list.rb +294 -0
- data/apps/core/components/widgets/list/list.shtml +38 -0
- data/apps/core/components/widgets/list/plugins/exportable/exportable_list.rb +19 -0
- data/apps/core/components/widgets/list/plugins/exportable/exportable_list.shtml +5 -0
- data/apps/core/components/widgets/menu/menu.rb +20 -0
- data/apps/core/components/widgets/menu/menu.shtml +13 -0
- data/apps/core/components/widgets/search_table/search_table.rb +22 -0
- data/apps/core/components/widgets/search_table/search_table.shtml +11 -0
- data/apps/core/components/widgets/switcher/switcher.rb +68 -0
- data/apps/core/components/widgets/switcher/switcher.shtml +17 -0
- data/apps/core/components/widgets/table/table.rb +153 -0
- data/apps/core/components/widgets/table/table.shtml +41 -0
- data/apps/core/components/widgets/tabs/tabs.rb +38 -0
- data/apps/core/components/widgets/tabs/tabs.shtml +2 -0
- data/apps/core/forms/_init.rb +22 -0
- data/apps/core/forms/po/it/spider_forms.po +36 -0
- data/apps/core/forms/po/spider_forms.pot +37 -0
- data/apps/core/forms/public/date_time.js +23 -0
- data/apps/core/forms/public/form.css +81 -0
- data/apps/core/forms/public/form.js +19 -0
- data/apps/core/forms/public/input.js +30 -0
- data/apps/core/forms/public/search_select.js +123 -0
- data/apps/core/forms/public/select.js +11 -0
- data/apps/core/forms/tags/element_label.erb +1 -0
- data/apps/core/forms/tags/element_row.erb +4 -0
- data/apps/core/forms/tags/row.erb +4 -0
- data/apps/core/forms/widgets/form/form.rb +430 -0
- data/apps/core/forms/widgets/form/form.shtml +47 -0
- data/apps/core/forms/widgets/inputs/checkbox/checkbox.rb +13 -0
- data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +3 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +48 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +4 -0
- data/apps/core/forms/widgets/inputs/hidden/hidden.rb +8 -0
- data/apps/core/forms/widgets/inputs/hidden/hidden.shtml +3 -0
- data/apps/core/forms/widgets/inputs/input/input.rb +105 -0
- data/apps/core/forms/widgets/inputs/input/input.shtml +3 -0
- data/apps/core/forms/widgets/inputs/input/readonly.shtml +6 -0
- data/apps/core/forms/widgets/inputs/password/password.rb +24 -0
- data/apps/core/forms/widgets/inputs/password/password.shtml +5 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +168 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +42 -0
- data/apps/core/forms/widgets/inputs/select/select.rb +126 -0
- data/apps/core/forms/widgets/inputs/select/select.shtml +8 -0
- data/apps/core/forms/widgets/inputs/subform/subform.rb +10 -0
- data/apps/core/forms/widgets/inputs/subform/subform.shtml +5 -0
- data/apps/core/forms/widgets/inputs/text/text.rb +9 -0
- data/apps/core/forms/widgets/inputs/text/text.shtml +3 -0
- data/apps/core/forms/widgets/inputs/text_area/text_area.rb +10 -0
- data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +1 -0
- data/apps/drb_server/_init.rb +8 -0
- data/apps/drb_server/lib/model_server.rb +41 -0
- data/apps/drb_server/script/start_server.rb +19 -0
- data/apps/hippo/_init.rb +10 -0
- data/apps/hippo/models/mixins/hippo_struct.rb +210 -0
- data/apps/hippo/models/security_group.rb +21 -0
- data/apps/hippo/models/security_user.rb +29 -0
- data/apps/messenger/_init.rb +24 -0
- data/apps/messenger/config/options.rb +15 -0
- data/apps/messenger/config/worker.rb +3 -0
- data/apps/messenger/controllers/messenger_controller.rb +80 -0
- data/apps/messenger/controllers/mixins/messenger_controller_mixin.rb +54 -0
- data/apps/messenger/lib/backends/email/smtp.rb +0 -0
- data/apps/messenger/messenger.rb +94 -0
- data/apps/messenger/models/email.rb +22 -0
- data/apps/messenger/models/message.rb +44 -0
- data/apps/messenger/po/it/spider_messenger.po +77 -0
- data/apps/messenger/po/spider_messenger.pot +77 -0
- data/apps/messenger/views/index.shtml +13 -0
- data/apps/messenger/views/list.shtml +5 -0
- data/apps/messenger/views/messenger.layout.shtml +4 -0
- data/apps/messenger/views/queue.shtml +8 -0
- data/apps/messenger/views/tags/sent_messages.shtml +1 -0
- data/apps/soap/_init.rb +16 -0
- data/apps/soap/controllers/soap_controller.rb +334 -0
- data/apps/soap/doc/examples/example.rb +28 -0
- data/apps/soap/lib/soap.rb +217 -0
- data/apps/sso/_init.rb +16 -0
- data/apps/sso/config/options.rb +13 -0
- data/apps/sso/controllers/mixins/saml2_mixin.rb +149 -0
- data/apps/sso/lib/saml2/backend.rb +16 -0
- data/apps/sso/lib/saml2/lasso_backend.rb +88 -0
- data/apps/sso/lib/saml2.rb +112 -0
- data/apps/sso/views/saml2_post.shtml +19 -0
- data/apps/webdav/_init.rb +15 -0
- data/apps/webdav/controllers/webdav_controller.rb +862 -0
- data/apps/webdav/lib/locking.rb +193 -0
- data/apps/webdav/lib/vfs/abstract.rb +78 -0
- data/apps/webdav/lib/vfs/local.rb +126 -0
- data/apps/webdav/lib/vfs/mapped.rb +235 -0
- data/apps/webdav/lib/vfs/properties.rb +41 -0
- data/apps/worker/_init.rb +13 -0
- data/apps/worker/cmd.rb +65 -0
- data/apps/worker/config/options.rb +9 -0
- data/apps/worker/lib/runner.rb +43 -0
- data/apps/worker/lib/task.rb +9 -0
- data/apps/worker/models/job.rb +20 -0
- data/apps/worker/worker.rb +168 -0
- data/bin/spider +9 -0
- data/blueprints/app/_init.rb +10 -0
- data/blueprints/app/controllers/__APP___controller.rb +14 -0
- data/blueprints/app/views/__APP__.layout.shtml +8 -0
- data/blueprints/app/views/index.shtml +3 -0
- data/blueprints/install/config/config.yml +14 -0
- data/blueprints/install/init.rb +3 -0
- data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_messenger.mo +0 -0
- data/lib/spiderfw/app.rb +186 -0
- data/lib/spiderfw/autoload.rb +12 -0
- data/lib/spiderfw/cache/template_cache.rb +136 -0
- data/lib/spiderfw/cmd/cmd.rb +72 -0
- data/lib/spiderfw/cmd/commands/cert.rb +427 -0
- data/lib/spiderfw/cmd/commands/console.rb +27 -0
- data/lib/spiderfw/cmd/commands/init.rb +52 -0
- data/lib/spiderfw/cmd/commands/model.rb +131 -0
- data/lib/spiderfw/cmd/commands/setup.rb +54 -0
- data/lib/spiderfw/cmd/commands/test.rb +61 -0
- data/lib/spiderfw/cmd/commands/webserver.rb +93 -0
- data/lib/spiderfw/config/configurable.rb +38 -0
- data/lib/spiderfw/config/configuration.rb +281 -0
- data/lib/spiderfw/config/options/spider.rb +122 -0
- data/lib/spiderfw/controller/app_controller.rb +14 -0
- data/lib/spiderfw/controller/controller.rb +321 -0
- data/lib/spiderfw/controller/controller_exceptions.rb +27 -0
- data/lib/spiderfw/controller/controller_io.rb +26 -0
- data/lib/spiderfw/controller/controller_mixin.rb +12 -0
- data/lib/spiderfw/controller/cookie.rb +20 -0
- data/lib/spiderfw/controller/cookies.rb +17 -0
- data/lib/spiderfw/controller/dispatcher.rb +269 -0
- data/lib/spiderfw/controller/first_responder.rb +59 -0
- data/lib/spiderfw/controller/formats/html.rb +90 -0
- data/lib/spiderfw/controller/helpers/widget_helper.rb +73 -0
- data/lib/spiderfw/controller/home_controller.rb +26 -0
- data/lib/spiderfw/controller/http_controller.rb +112 -0
- data/lib/spiderfw/controller/mixins/http_mixin.rb +228 -0
- data/lib/spiderfw/controller/mixins/static_content.rb +90 -0
- data/lib/spiderfw/controller/mixins/visual.rb +489 -0
- data/lib/spiderfw/controller/page_controller.rb +39 -0
- data/lib/spiderfw/controller/request.rb +48 -0
- data/lib/spiderfw/controller/response.rb +50 -0
- data/lib/spiderfw/controller/router.rb +9 -0
- data/lib/spiderfw/controller/scene.rb +27 -0
- data/lib/spiderfw/controller/session/file_session.rb +83 -0
- data/lib/spiderfw/controller/session/flash_hash.rb +56 -0
- data/lib/spiderfw/controller/session/memory_session.rb +62 -0
- data/lib/spiderfw/controller/session/transient_hash.rb +18 -0
- data/lib/spiderfw/controller/session.rb +106 -0
- data/lib/spiderfw/controller/spider_controller.rb +20 -0
- data/lib/spiderfw/create.rb +64 -0
- data/lib/spiderfw/env.rb +17 -0
- data/lib/spiderfw/exceptions.rb +2 -0
- data/lib/spiderfw/home.rb +26 -0
- data/lib/spiderfw/http/adapters/cgi.rb +62 -0
- data/lib/spiderfw/http/adapters/cgi_io.rb +27 -0
- data/lib/spiderfw/http/adapters/fcgi.rb +62 -0
- data/lib/spiderfw/http/adapters/mongrel.rb +207 -0
- data/lib/spiderfw/http/adapters/rack.rb +152 -0
- data/lib/spiderfw/http/adapters/thin.rb +38 -0
- data/lib/spiderfw/http/adapters/webrick.rb +176 -0
- data/lib/spiderfw/http/http.rb +297 -0
- data/lib/spiderfw/http/server.rb +40 -0
- data/lib/spiderfw/i18n/cldr.rb +114 -0
- data/lib/spiderfw/i18n/gettext.rb +8 -0
- data/lib/spiderfw/i18n/i18n.rb +120 -0
- data/lib/spiderfw/i18n/provider.rb +12 -0
- data/lib/spiderfw/i18n/rails.rb +89 -0
- data/lib/spiderfw/i18n/shtml_parser.rb +41 -0
- data/lib/spiderfw/model/active_record.rb +335 -0
- data/lib/spiderfw/model/base_model.rb +2068 -0
- data/lib/spiderfw/model/condition.rb +416 -0
- data/lib/spiderfw/model/data_type.rb +75 -0
- data/lib/spiderfw/model/datatypes/binary.rb +10 -0
- data/lib/spiderfw/model/datatypes/bool.rb +10 -0
- data/lib/spiderfw/model/datatypes/decimal.rb +22 -0
- data/lib/spiderfw/model/datatypes/email.rb +13 -0
- data/lib/spiderfw/model/datatypes/password.rb +63 -0
- data/lib/spiderfw/model/datatypes/serialized_object.rb +32 -0
- data/lib/spiderfw/model/datatypes/text.rb +10 -0
- data/lib/spiderfw/model/datatypes/uuid.rb +29 -0
- data/lib/spiderfw/model/datatypes.rb +19 -0
- data/lib/spiderfw/model/element.rb +250 -0
- data/lib/spiderfw/model/extended_models/managed.rb +43 -0
- data/lib/spiderfw/model/identity_mapper.rb +89 -0
- data/lib/spiderfw/model/inline_model.rb +37 -0
- data/lib/spiderfw/model/mappers/db_mapper.rb +1126 -0
- data/lib/spiderfw/model/mappers/hash_mapper.rb +114 -0
- data/lib/spiderfw/model/mappers/mapper.rb +926 -0
- data/lib/spiderfw/model/mappers/mappers.rb +7 -0
- data/lib/spiderfw/model/mappers/proxy_mapper.rb +25 -0
- data/lib/spiderfw/model/mappers/vfs/flat_file.rb +31 -0
- data/lib/spiderfw/model/mixins/converted.rb +110 -0
- data/lib/spiderfw/model/mixins/list.rb +135 -0
- data/lib/spiderfw/model/mixins/mixins.rb +7 -0
- data/lib/spiderfw/model/mixins/state_machine.rb +81 -0
- data/lib/spiderfw/model/mixins/synchronized.rb +88 -0
- data/lib/spiderfw/model/mixins/tree.rb +296 -0
- data/lib/spiderfw/model/mixins/versioned.rb +147 -0
- data/lib/spiderfw/model/model.rb +226 -0
- data/lib/spiderfw/model/model_hash.rb +50 -0
- data/lib/spiderfw/model/proxy_model.rb +37 -0
- data/lib/spiderfw/model/query.rb +147 -0
- data/lib/spiderfw/model/query_funcs.rb +99 -0
- data/lib/spiderfw/model/query_set.rb +700 -0
- data/lib/spiderfw/model/request.rb +80 -0
- data/lib/spiderfw/model/storage/base_storage.rb +110 -0
- data/lib/spiderfw/model/storage/db/adapters/mssql.rb +129 -0
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +436 -0
- data/lib/spiderfw/model/storage/db/adapters/oci8.rb +533 -0
- data/lib/spiderfw/model/storage/db/adapters/sqlite.rb +163 -0
- data/lib/spiderfw/model/storage/db/connectors/odbc.rb +213 -0
- data/lib/spiderfw/model/storage/db/db.rb +13 -0
- data/lib/spiderfw/model/storage/db/db_connection_pool.rb +126 -0
- data/lib/spiderfw/model/storage/db/db_connector.rb +9 -0
- data/lib/spiderfw/model/storage/db/db_schema.rb +233 -0
- data/lib/spiderfw/model/storage/db/db_storage.rb +872 -0
- data/lib/spiderfw/model/storage/db/dialects/no_total_rows.rb +18 -0
- data/lib/spiderfw/model/storage/db/reflector.rb +36 -0
- data/lib/spiderfw/model/storage/null_storage.rb +18 -0
- data/lib/spiderfw/model/storage/schema.rb +19 -0
- data/lib/spiderfw/model/storage.rb +72 -0
- data/lib/spiderfw/model/sync.rb +94 -0
- data/lib/spiderfw/model/type.rb +13 -0
- data/lib/spiderfw/model/unit_of_work.rb +75 -0
- data/lib/spiderfw/requires.rb +21 -0
- data/lib/spiderfw/resource.rb +18 -0
- data/lib/spiderfw/setup/setup_task.rb +44 -0
- data/lib/spiderfw/tag/tag.rb +28 -0
- data/lib/spiderfw/templates/blocks/attr_if.rb +32 -0
- data/lib/spiderfw/templates/blocks/comment.rb +38 -0
- data/lib/spiderfw/templates/blocks/debugger.rb +16 -0
- data/lib/spiderfw/templates/blocks/each.rb +51 -0
- data/lib/spiderfw/templates/blocks/html.rb +70 -0
- data/lib/spiderfw/templates/blocks/if.rb +35 -0
- data/lib/spiderfw/templates/blocks/pass.rb +16 -0
- data/lib/spiderfw/templates/blocks/render.rb +23 -0
- data/lib/spiderfw/templates/blocks/run.rb +30 -0
- data/lib/spiderfw/templates/blocks/tag.rb +21 -0
- data/lib/spiderfw/templates/blocks/tag_if.rb +29 -0
- data/lib/spiderfw/templates/blocks/text.rb +43 -0
- data/lib/spiderfw/templates/blocks/widget.rb +58 -0
- data/lib/spiderfw/templates/blocks/yield.rb +18 -0
- data/lib/spiderfw/templates/layout.rb +44 -0
- data/lib/spiderfw/templates/resources/less.rb +14 -0
- data/lib/spiderfw/templates/template.rb +625 -0
- data/lib/spiderfw/templates/template_blocks.rb +185 -0
- data/lib/spiderfw/utils/annotations.rb +201 -0
- data/lib/spiderfw/utils/fork.rb +75 -0
- data/lib/spiderfw/utils/hash_comparison.rb +8 -0
- data/lib/spiderfw/utils/inflector.rb +42 -0
- data/lib/spiderfw/utils/logger.rb +92 -0
- data/lib/spiderfw/utils/monkey/class.rb +59 -0
- data/lib/spiderfw/utils/monkey/date_time.rb +34 -0
- data/lib/spiderfw/utils/monkey/debugger.rb +25 -0
- data/lib/spiderfw/utils/monkey/exception.rb +23 -0
- data/lib/spiderfw/utils/monkey/kernel.rb +12 -0
- data/lib/spiderfw/utils/monkey/module.rb +12 -0
- data/lib/spiderfw/utils/monkey/symbol.rb +7 -0
- data/lib/spiderfw/utils/monkey/time.rb +17 -0
- data/lib/spiderfw/utils/multi_level_hash.rb +33 -0
- data/lib/spiderfw/utils/periodic_runner.rb +50 -0
- data/lib/spiderfw/utils/rails.rb +78 -0
- data/lib/spiderfw/utils/rails_app.rb +53 -0
- data/lib/spiderfw/utils/sanitizer.rb +178 -0
- data/lib/spiderfw/utils/setup_task.rb +35 -0
- data/lib/spiderfw/utils/shared_store/file_shared_store.rb +73 -0
- data/lib/spiderfw/utils/shared_store/memory_shared_store.rb +46 -0
- data/lib/spiderfw/utils/shared_store.rb +47 -0
- data/lib/spiderfw/utils/test_case.rb +24 -0
- data/lib/spiderfw/utils/thread_out.rb +24 -0
- data/lib/spiderfw/version.rb +3 -0
- data/lib/spiderfw/widget/rest_model.rb +20 -0
- data/lib/spiderfw/widget/widget.rb +671 -0
- data/lib/spiderfw/widget/widget_attributes.rb +54 -0
- data/lib/spiderfw/widget/widget_plugin.rb +37 -0
- data/lib/spiderfw.rb +509 -0
- data/spider.gemspec +43 -0
- data/views/errors/404.shtml +6 -0
- data/views/errors/error.layout.shtml +70 -0
- data/views/errors/error_generic.shtml +6 -0
- metadata +800 -0
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
require 'spiderfw/controller/page_controller'
|
|
2
|
+
require 'spiderfw/templates/template'
|
|
3
|
+
require 'spiderfw/controller/mixins/visual'
|
|
4
|
+
require 'spiderfw/widget/widget_attributes'
|
|
5
|
+
require 'spiderfw/controller/mixins/http_mixin'
|
|
6
|
+
require 'spiderfw/widget/widget_plugin'
|
|
7
|
+
|
|
8
|
+
module Spider
|
|
9
|
+
|
|
10
|
+
class Widget < PageController
|
|
11
|
+
include HTTPMixin
|
|
12
|
+
|
|
13
|
+
attr_accessor :parent
|
|
14
|
+
attr_accessor :request, :scene, :widgets, :template, :id, :id_path, :containing_template, :is_target, :target_mode
|
|
15
|
+
attr_reader :attributes, :widget_attributes, :css_classes, :widgets_runtime_content
|
|
16
|
+
attr_accessor :active
|
|
17
|
+
|
|
18
|
+
@@common_attributes = {
|
|
19
|
+
:id => {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class << self
|
|
23
|
+
attr_reader :attributes, :scene_attributes
|
|
24
|
+
cattr_reader :tag_name, :plugins
|
|
25
|
+
|
|
26
|
+
def inherited(subclass)
|
|
27
|
+
subclass.instance_variable_set(:@attributes, attributes.clone)
|
|
28
|
+
subclass.instance_variable_set(:@scene_attributes, @scene_attributes.clone) if @scene_attributes
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def attribute(name, params={})
|
|
32
|
+
# TODO: implement, this is just a placeholder
|
|
33
|
+
@attributes ||= @@common_attributes.clone
|
|
34
|
+
@attributes[name] = params
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def attributes
|
|
38
|
+
@attributes ||= @@common_attributes.clone
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def attribute?(name)
|
|
42
|
+
@attributes[name.to_sym]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def i_attribute(name, params={})
|
|
46
|
+
params[:instance_attr] = true
|
|
47
|
+
params[:set_var] = true
|
|
48
|
+
attribute(name, params)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def is_attribute(name, params={})
|
|
52
|
+
params[:instance_attr] = true
|
|
53
|
+
i_attribute(name, params)
|
|
54
|
+
attr_to_scene(name)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def i_attr_accessor(name, params={})
|
|
58
|
+
params[:instance_attr] = true
|
|
59
|
+
i_attribute(name, params)
|
|
60
|
+
attr_accessor(name)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def is_attr_accessor(name, params={})
|
|
64
|
+
params[:instance_attr] = true
|
|
65
|
+
is_attribute(name, params)
|
|
66
|
+
attr_accessor(name)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def attr_to_scene(*names)
|
|
70
|
+
@scene_attributes ||= []
|
|
71
|
+
names.each{ |name| @scene_attributes << name }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def tag(name)
|
|
75
|
+
self.app.register_tag(name, self)
|
|
76
|
+
@tag_name ||= name
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def register_tag(name)
|
|
80
|
+
Spider::Template.register(name, self)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def scene_elements(*list)
|
|
84
|
+
@scene_elements ||= []
|
|
85
|
+
@scene_elements += list
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def get_scene_elements
|
|
89
|
+
@scene_elements
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def template_path_parent(val=nil)
|
|
93
|
+
# FIXME: damn! find a better way!
|
|
94
|
+
@template_path_parent = val if val
|
|
95
|
+
return @template_path_parent || app.path+'/widgets'
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def template_path
|
|
99
|
+
p = template_path_parent+'/'+Inflector.underscore(self.to_s.split('::')[-1])
|
|
100
|
+
return p+'/templates' if (File.exist?(p+'/templates'))
|
|
101
|
+
return p
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def default_template
|
|
105
|
+
Spider::Inflector.underscore(self.name).split('/')[-1]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def relative_url
|
|
109
|
+
template_path[template_path_parent.length+1..-1]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def route_url
|
|
113
|
+
Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping('/'+self.app.route_url+'/w/'+relative_url)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def pub_url
|
|
117
|
+
return self.app.pub_url
|
|
118
|
+
w = self
|
|
119
|
+
# FIXME! this is a quick hack to make extended templates work
|
|
120
|
+
# but what we need is a better method to handle asset ownership
|
|
121
|
+
#
|
|
122
|
+
# Is it needed anymore?
|
|
123
|
+
# w = w.superclass while w.superclass != Spider::Widget && w.superclass.subclass_of?(Spider::Widget)
|
|
124
|
+
w.route_url+'/pub'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def pub_path
|
|
128
|
+
self.app.pub_path
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def runtime_content_tags
|
|
132
|
+
['sp:attribute']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def parse_content_xml(xml)
|
|
136
|
+
return ["", []] if !xml || xml.strip.empty?
|
|
137
|
+
return parse_content(Hpricot(xml))
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Parses widget content at compile time.
|
|
141
|
+
# Must return a pair consisting of:
|
|
142
|
+
# - runtime content XML
|
|
143
|
+
# - an array of overrides (as Hpricot nodes)
|
|
144
|
+
def parse_content(doc)
|
|
145
|
+
overrides = []
|
|
146
|
+
plugins = []
|
|
147
|
+
to_del = []
|
|
148
|
+
doc.root.each_child do |child|
|
|
149
|
+
if child.respond_to?(:name)
|
|
150
|
+
namespace, short_name = child.name.split(':', 2)
|
|
151
|
+
if (namespace == 'tpl' && (Spider::Template.override_tags.include?(short_name) || self.override_tags.include?(child.name)))
|
|
152
|
+
overrides << child unless child.is_a?(Hpricot::BogusETag)
|
|
153
|
+
end
|
|
154
|
+
if (child.name == 'sp:plugin')
|
|
155
|
+
plugins << child
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
overrides.each do |ovr|
|
|
160
|
+
parse_override(ovr)
|
|
161
|
+
end
|
|
162
|
+
Hpricot::Elements[*overrides].remove
|
|
163
|
+
plugins.each do |plugin|
|
|
164
|
+
name = plugin['name']
|
|
165
|
+
mod = self.plugin(name)
|
|
166
|
+
next unless mod
|
|
167
|
+
overrides += mod.get_overrides
|
|
168
|
+
end
|
|
169
|
+
return [doc.to_s, overrides]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# This method is called on each override node found. The widget must return the node,
|
|
173
|
+
# modifying it if needed.
|
|
174
|
+
def parse_override(el)
|
|
175
|
+
return el
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# An array of custom tags that will be processed at compile time by the widget.
|
|
179
|
+
def override_tags
|
|
180
|
+
return []
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def add_plugin(name, mod)
|
|
184
|
+
@plugins ||= {}
|
|
185
|
+
@plugins[name] = mod
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def plugin(name)
|
|
189
|
+
return nil unless @plugins
|
|
190
|
+
@plugins[name]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
i_attribute :use_template
|
|
196
|
+
attribute :"sp:target-only"
|
|
197
|
+
attribute :class
|
|
198
|
+
|
|
199
|
+
def initialize(request, response, scene=nil)
|
|
200
|
+
super
|
|
201
|
+
@widgets = {}
|
|
202
|
+
@attributes = WidgetAttributes.new(self)
|
|
203
|
+
@id_path = []
|
|
204
|
+
@widget_attributes = {}
|
|
205
|
+
locale = @request.locale.language
|
|
206
|
+
include_js = [
|
|
207
|
+
'/js/jquery/jquery-1.3.2.js', '/js/inheritance.js', '/js/spider.js', '/js/jquery/plugins/jquery.query-2.1.6.js',
|
|
208
|
+
'/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js', #'/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.min.js'
|
|
209
|
+
"/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-#{locale}.js", '/js/jquery/plugins/jquery.form.js'
|
|
210
|
+
]
|
|
211
|
+
include_css = [
|
|
212
|
+
'/css/spider.css', '/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css',
|
|
213
|
+
]
|
|
214
|
+
@assets = []
|
|
215
|
+
include_js.each{ |js| @assets << {:type => :js, :src => Spider::Components.pub_url+js, :path => Spider::Components.pub_path+js}}
|
|
216
|
+
include_css.each{ |css| @assets << {:type => :css, :src => Spider::Components.pub_url+css, :path => Spider::Components.pub_path+css}}
|
|
217
|
+
|
|
218
|
+
@use_template ||= self.class.default_template
|
|
219
|
+
@css_classes = []
|
|
220
|
+
@widgets_runtime_content = {}
|
|
221
|
+
@widget_procs = {}
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def full_id
|
|
225
|
+
@id_path.join('-')
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def local_id
|
|
229
|
+
@id_path.last
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def attributes=(hash)
|
|
233
|
+
hash = {} unless hash
|
|
234
|
+
hash.each do |k, v|
|
|
235
|
+
@attributes[k] = v
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def route_widget
|
|
240
|
+
return nil
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
def widget_target=(target)
|
|
244
|
+
@widget_target = target
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
def widget_request_path
|
|
248
|
+
p = @request.path
|
|
249
|
+
i = p.index(@_action) if @_action && !@_action.empty?
|
|
250
|
+
p = p[0..i-2] if i
|
|
251
|
+
p = p.sub(/\/+$/, '')
|
|
252
|
+
return p
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
def before(action='')
|
|
256
|
+
Spider.logger.debug("Widget #{self} before(#{action})")
|
|
257
|
+
widget_init(action)
|
|
258
|
+
init_widgets unless @init_widgets_done
|
|
259
|
+
super
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def widget_before(action='')
|
|
263
|
+
return unless active?
|
|
264
|
+
Spider.logger.debug("Widget #{self} widget_before(#{action})")
|
|
265
|
+
widget_init(action)
|
|
266
|
+
prepare
|
|
267
|
+
@before_done = true
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
def active?
|
|
272
|
+
return @active unless @active.nil?
|
|
273
|
+
@active = (!@request.params['_wt'] || @target_mode)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def before_done?
|
|
277
|
+
@before_done
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Loads the template and sets the widget attributes
|
|
281
|
+
def widget_init(action='')
|
|
282
|
+
action ||= ''
|
|
283
|
+
if (@request.params['_wa'] && @request.params['_wa'][full_id])
|
|
284
|
+
action = @request.params['_wa'][full_id]
|
|
285
|
+
end
|
|
286
|
+
@_action = action
|
|
287
|
+
@_action_local, @_action_rest = action.split('/', 2)
|
|
288
|
+
unless @template
|
|
289
|
+
@template = load_template(@use_template)
|
|
290
|
+
end
|
|
291
|
+
@id ||= @attributes[:id]
|
|
292
|
+
@template.id_path = @id_path
|
|
293
|
+
@template.mode = :widget
|
|
294
|
+
required_groups = {}
|
|
295
|
+
self.class.attributes.each do |k, params|
|
|
296
|
+
if (params[:required])
|
|
297
|
+
if (params[:required] == true && !@attributes[k])
|
|
298
|
+
raise ArgumentError, "Attribute #{k} is required by widget #{self}"
|
|
299
|
+
else
|
|
300
|
+
if (!@attributes[k] && required_groups[params[:required]] != false)
|
|
301
|
+
required_groups[params[:required]] ||= []
|
|
302
|
+
required_groups[params[:required]] << k
|
|
303
|
+
else
|
|
304
|
+
required_groups[params[:required]] = false
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
required_groups.each do |group_name, attributes|
|
|
310
|
+
next if attributes == false
|
|
311
|
+
raise ArgumentError, "Widget #{self} requires attribute #{attributes.join(' or ')} to be set"
|
|
312
|
+
end
|
|
313
|
+
if (@attributes[:class])
|
|
314
|
+
@css_classes += @attributes[:class].split(/\s+/)
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Recursively instantiates the subwidgets.
|
|
319
|
+
def prepare(action='')
|
|
320
|
+
init_widgets unless @init_widgets_done
|
|
321
|
+
set_widget_attributes
|
|
322
|
+
prepare_widgets
|
|
323
|
+
@template.assets.each do |res|
|
|
324
|
+
res = res.clone
|
|
325
|
+
@assets << res
|
|
326
|
+
end
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Instantiates this widget's own subwidgets.
|
|
330
|
+
def init_widgets
|
|
331
|
+
if (self.class.scene_attributes)
|
|
332
|
+
self.class.scene_attributes.each do |name|
|
|
333
|
+
@scene[name] = instance_variable_get("@#{name}")
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
template.request = @request
|
|
337
|
+
template.response = @response
|
|
338
|
+
@template.init(@scene)
|
|
339
|
+
@template.widgets.each do |name, w|
|
|
340
|
+
add_widget(w)
|
|
341
|
+
end
|
|
342
|
+
@widgets.each do |id, w|
|
|
343
|
+
w.parent = self
|
|
344
|
+
end
|
|
345
|
+
@init_widgets_done = true
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
def set_widget_attributes
|
|
349
|
+
@widget_attributes.each do |w_id, a|
|
|
350
|
+
w_id_parts = w_id.to_s.split('.', 2)
|
|
351
|
+
if (w_id_parts[1])
|
|
352
|
+
w_id = w_id_parts[0]
|
|
353
|
+
sub_w = w_id_parts[1]
|
|
354
|
+
end
|
|
355
|
+
w_id = w_id.to_sym
|
|
356
|
+
if (@widgets[w_id])
|
|
357
|
+
if (sub_w)
|
|
358
|
+
@widgets[w_id].widget_attributes[sub_w] = a
|
|
359
|
+
else
|
|
360
|
+
# FIXME: what if there are a 'name' and a 'value' attributes?
|
|
361
|
+
if (a[:name] && a[:value])
|
|
362
|
+
@widgets[w_id].attributes[a[:name].to_sym] = a[:value]
|
|
363
|
+
else
|
|
364
|
+
a.each{ |key, value| @widgets[w_id].attributes[key] = value}
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# Runs widget_before on all subwidgets.
|
|
372
|
+
def prepare_widgets
|
|
373
|
+
r = route_widget
|
|
374
|
+
@widgets.each do |id, w|
|
|
375
|
+
if (r && r[0].to_sym == id)
|
|
376
|
+
act = r[1]
|
|
377
|
+
end
|
|
378
|
+
act ||= ''
|
|
379
|
+
w.widget_before(act)
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def run(action='')
|
|
385
|
+
@widgets.each do |wname, w|
|
|
386
|
+
w.run
|
|
387
|
+
end
|
|
388
|
+
if (@parent)
|
|
389
|
+
@parent.after_widget(@id.to_sym)
|
|
390
|
+
end
|
|
391
|
+
@did_run = true
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
def did_run?
|
|
395
|
+
@did_run
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
def run?
|
|
399
|
+
@is_target || (!@target_mode && !attributes[:"sp:target_only"])
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
def init_widget_done?
|
|
403
|
+
@init_widget_done
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def index
|
|
407
|
+
run
|
|
408
|
+
render
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
def render
|
|
412
|
+
prepare_scene(@scene)
|
|
413
|
+
@template.render(@scene) unless @target_mode && !@is_target
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
def execute(action='', *params)
|
|
417
|
+
Spider.logger.debug("Widget #{self} executing #{action}")
|
|
418
|
+
widget_execute = @request.params['_we']
|
|
419
|
+
if (@is_target)
|
|
420
|
+
if (widget_execute)
|
|
421
|
+
super(widget_execute, *params)
|
|
422
|
+
else
|
|
423
|
+
run
|
|
424
|
+
render
|
|
425
|
+
end
|
|
426
|
+
elsif (@widget_target)
|
|
427
|
+
first, rest = @widget_target.split('/', 2)
|
|
428
|
+
@_widget = find_widget(first)
|
|
429
|
+
@_widget.target_mode = true
|
|
430
|
+
@_widget.widget_target = rest
|
|
431
|
+
@_widget.is_target = true unless rest
|
|
432
|
+
@_widget.set_action(widget_execute)
|
|
433
|
+
@_widget.before(rest, *params)
|
|
434
|
+
@_widget.execute(rest, *params)
|
|
435
|
+
else
|
|
436
|
+
super
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
def try_rescue(exc)
|
|
441
|
+
if (exc.is_a?(NotFound))
|
|
442
|
+
error("Widget path not found: #{exc.path}")
|
|
443
|
+
else
|
|
444
|
+
raise exc
|
|
445
|
+
end
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
def params
|
|
449
|
+
p = @request.params['_w']
|
|
450
|
+
return {} unless p
|
|
451
|
+
@id_path.each do |id|
|
|
452
|
+
p = p[id.to_s]
|
|
453
|
+
return {} unless p
|
|
454
|
+
end
|
|
455
|
+
return p
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
def session(container=@request.session, klass=Hash)
|
|
459
|
+
s = (container['_w'] ||= klass.new)
|
|
460
|
+
@id_path[0..-2].each{ |id| s = (s[id] ||= klass.new) }
|
|
461
|
+
s = (s[@id_path[-1]] ||= klass.new)
|
|
462
|
+
return s
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
def flash
|
|
466
|
+
s = session(@request.session.flash, Spider::FlashHash)
|
|
467
|
+
return s
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
def transient_session
|
|
471
|
+
return session(@request.session.transient, Spider::TransientHash)
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
def create_widget(klass, id, *params)
|
|
475
|
+
obj = klass.new(*params)
|
|
476
|
+
obj.id = id
|
|
477
|
+
add_widget(obj)
|
|
478
|
+
return obj
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
def add_widget(widget)
|
|
482
|
+
widget.id_path = @id_path + [widget.id]
|
|
483
|
+
widget.parent = self
|
|
484
|
+
widget.active = true if @is_target || @active
|
|
485
|
+
@widgets[widget.id.to_sym] = widget
|
|
486
|
+
if (@widgets_runtime_content[widget.id.to_sym])
|
|
487
|
+
@widgets_runtime_content[widget.id.to_sym].each do |content|
|
|
488
|
+
if (content[:widget])
|
|
489
|
+
first, rest = content[:widget].split('/', 2)
|
|
490
|
+
content[:widget] = rest
|
|
491
|
+
widget.widgets_runtime_content[first.to_sym] ||= []
|
|
492
|
+
widget.widgets_runtime_content[first.to_sym] << content
|
|
493
|
+
else
|
|
494
|
+
next if (content[:params] && !check_subwidget_conditions(widget, content[:params]))
|
|
495
|
+
widget.parse_runtime_content_xml(content[:xml])
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
end
|
|
499
|
+
if (@widget_procs[widget.id.to_sym])
|
|
500
|
+
@widget_procs[widget.id.to_sym].each do |wp|
|
|
501
|
+
if (wp[:target])
|
|
502
|
+
widget.with_widget(wp[:target], &wp[:proc])
|
|
503
|
+
else
|
|
504
|
+
widget.instance_eval(&wp[:proc])
|
|
505
|
+
end
|
|
506
|
+
end
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
def check_subwidget_conditions
|
|
511
|
+
return false
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def parse_runtime_content_xml(xml, src_path=nil)
|
|
516
|
+
parse_runtime_content(Hpricot(xml), src_path)
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
def parse_runtime_content(doc, src_path=nil)
|
|
520
|
+
# doc.search('sp:plugin').each do |plugin|
|
|
521
|
+
# name = plugin['name']
|
|
522
|
+
# mod = self.class.plugin(name)
|
|
523
|
+
# next unless mod
|
|
524
|
+
# (class <<self; self; end).instance_eval do
|
|
525
|
+
# debugger
|
|
526
|
+
# include mod
|
|
527
|
+
# end
|
|
528
|
+
# shadow = (class <<self; self; end)
|
|
529
|
+
#
|
|
530
|
+
# debugger
|
|
531
|
+
# a = 3
|
|
532
|
+
# end
|
|
533
|
+
attributes = doc.search('sp:attribute')
|
|
534
|
+
attributes.each do |a|
|
|
535
|
+
name = a.attributes['name'].to_sym
|
|
536
|
+
kvs = a.children_of_type('sp:value')
|
|
537
|
+
if (kvs.length > 0)
|
|
538
|
+
value = {}
|
|
539
|
+
kvs.each do |kv|
|
|
540
|
+
key = kv.attributes['key']
|
|
541
|
+
val = kv.innerText
|
|
542
|
+
value[key] = val
|
|
543
|
+
end
|
|
544
|
+
else
|
|
545
|
+
value = a.attributes['value']
|
|
546
|
+
end
|
|
547
|
+
if (w = a.attributes['widget'])
|
|
548
|
+
@widget_attributes[w] = {:name => name, :value => value}
|
|
549
|
+
else
|
|
550
|
+
@attributes[name] = value
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
attributes.remove
|
|
554
|
+
doc.search('sp:runtime-content').each do |cont|
|
|
555
|
+
w = cont.attributes['widget']
|
|
556
|
+
first, rest = w.split('/', 2)
|
|
557
|
+
params = nil
|
|
558
|
+
if (first =~ /(.+)\[(.+)\]/)
|
|
559
|
+
params = {}
|
|
560
|
+
parts = $2.split(',')
|
|
561
|
+
parts.each do |p|
|
|
562
|
+
key, val = p.split('=')
|
|
563
|
+
params[key] = val
|
|
564
|
+
end
|
|
565
|
+
end
|
|
566
|
+
if (w)
|
|
567
|
+
@widgets_runtime_content[first.to_sym] ||= []
|
|
568
|
+
@widgets_runtime_content[first.to_sym] << {
|
|
569
|
+
:widget => rest,
|
|
570
|
+
:xml => "<sp:widget-content>#{cont.innerHTML}</sp:widget-content>",
|
|
571
|
+
:params => params
|
|
572
|
+
}
|
|
573
|
+
end
|
|
574
|
+
end
|
|
575
|
+
doc.search('sp:runtime-content').remove
|
|
576
|
+
doc.search('sp:use-template').each do |templ|
|
|
577
|
+
if (templ.attributes['app'])
|
|
578
|
+
owner = Spider.apps_by_path[templ.attributes['app']]
|
|
579
|
+
else
|
|
580
|
+
owner = self
|
|
581
|
+
end
|
|
582
|
+
@template = load_template(templ.attributes['src'], nil, owner)
|
|
583
|
+
end
|
|
584
|
+
return doc
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
def assets
|
|
589
|
+
res = @assets.clone + widget_assets
|
|
590
|
+
return res
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
def widget_assets
|
|
594
|
+
res = []
|
|
595
|
+
@widgets.each do |id, w|
|
|
596
|
+
res += w.assets
|
|
597
|
+
end
|
|
598
|
+
return res
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
def owner_controller
|
|
603
|
+
w = self
|
|
604
|
+
while (w.is_a?(Widget) && w.template && w.template.owner)
|
|
605
|
+
return nil unless w.containing_template
|
|
606
|
+
w = w.containing_template.owner
|
|
607
|
+
end
|
|
608
|
+
return w
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
def prepare_scene(scene)
|
|
612
|
+
scene = super
|
|
613
|
+
if (self.class.scene_attributes) # Repeat for new instance variables
|
|
614
|
+
self.class.scene_attributes.each do |name|
|
|
615
|
+
@scene[name] = instance_variable_get("@#{name}")
|
|
616
|
+
end
|
|
617
|
+
end
|
|
618
|
+
# FIXME: owner_controller should be (almost) always defined
|
|
619
|
+
scene.controller[:request_path] = owner_controller.request_path if owner_controller
|
|
620
|
+
scene.widget[:request_path] = widget_request_path
|
|
621
|
+
scene.widget[:target_only] = attributes[:"sp:target-only"]
|
|
622
|
+
scene.widget[:is_target] = @is_target
|
|
623
|
+
scene.widget[:is_running] = run?
|
|
624
|
+
if (@parent && @parent.respond_to?(:scene) && @parent.scene)
|
|
625
|
+
scene._parent = @parent.scene
|
|
626
|
+
end
|
|
627
|
+
scene.extend(WidgetScene)
|
|
628
|
+
return scene
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
def css_class
|
|
632
|
+
return @css_class if @css_class
|
|
633
|
+
supers = self.class.ancestors.select{ |c| c != Spider::Widget && c.subclass_of?(Spider::Widget)}
|
|
634
|
+
@css_class = Inflector.underscore(supers.join('/')).gsub('_', '-').gsub('/', ' ').split(' ').uniq.join(' ')
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
def css_model_class(model)
|
|
638
|
+
"model-#{model.name.gsub('::', '-')}"
|
|
639
|
+
end
|
|
640
|
+
|
|
641
|
+
def inspect
|
|
642
|
+
super + ", id: #{@id}"
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
def to_s
|
|
646
|
+
super + ", id: #{@id}"
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
def find_widget(name)
|
|
650
|
+
@widgets[name.to_sym] || super
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
# FIXME: is the same in template. Refactor out.
|
|
654
|
+
def with_widget(path, &proc)
|
|
655
|
+
first, rest = path.split('/', 2)
|
|
656
|
+
@widget_procs[first.to_sym] ||= []
|
|
657
|
+
@widget_procs[first.to_sym] << {:target => rest, :proc => proc }
|
|
658
|
+
end
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
module WidgetScene
|
|
664
|
+
|
|
665
|
+
def widget_action(name, *params)
|
|
666
|
+
"#{self[:request][:path]}?_wt=#{self[:widget][:id_path].join('/')}&_we=#{name}"+(params.map{|p| "&_wp[]=#{p}"}).join('')
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
end
|
|
670
|
+
|
|
671
|
+
end
|