spiderfw 0.5
Sign up to get free protection for your applications and to get access to all the features.
- 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,625 @@
|
|
1
|
+
require 'hpricot'
|
2
|
+
require 'spiderfw/templates/template_blocks'
|
3
|
+
require 'spiderfw/cache/template_cache'
|
4
|
+
begin
|
5
|
+
require 'less'
|
6
|
+
require 'spiderfw/templates/assets/less'
|
7
|
+
rescue LoadError
|
8
|
+
end
|
9
|
+
|
10
|
+
Spider.register_resource_type(:css, :extensions => ['css'], :path => 'public')
|
11
|
+
Spider.register_resource_type(:js, :extensions => ['js'], :path => 'public')
|
12
|
+
|
13
|
+
|
14
|
+
module Spider
|
15
|
+
|
16
|
+
module TemplateAssets; end
|
17
|
+
|
18
|
+
# This class manages SHTML templates.
|
19
|
+
|
20
|
+
class Template
|
21
|
+
include Logger
|
22
|
+
|
23
|
+
attr_accessor :_action, :_action_to, :_widget_action
|
24
|
+
attr_accessor :widgets, :compiled, :id_path
|
25
|
+
attr_accessor :request, :response, :owner, :owner_class, :definer_class
|
26
|
+
attr_accessor :mode # :widget, ...
|
27
|
+
attr_reader :overrides, :path, :subtemplates, :widgets
|
28
|
+
|
29
|
+
@@registered = {}
|
30
|
+
@@widget_plugins = {}
|
31
|
+
@@namespaces = {}
|
32
|
+
@@cache = TemplateCache.new(Spider.paths[:var]+'/cache/templates')
|
33
|
+
@@overrides = ['content', 'override', 'override-content', 'override-attr', 'append-attr',
|
34
|
+
'append', 'prepend', 'delete', 'before', 'after']
|
35
|
+
|
36
|
+
@@asset_types = {
|
37
|
+
:css => {},
|
38
|
+
:js => {},
|
39
|
+
:less => {:processor => :Less}
|
40
|
+
}
|
41
|
+
|
42
|
+
class << self
|
43
|
+
|
44
|
+
# Returns the class TemplateCache instance
|
45
|
+
def cache
|
46
|
+
@@cache
|
47
|
+
end
|
48
|
+
|
49
|
+
# Sets allowed blocks
|
50
|
+
def allow_blocks(*tags) # :nodoc:
|
51
|
+
@allowed_blocks = tags
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns allowed blocks
|
55
|
+
def allowed_blocks # :nodoc:
|
56
|
+
@allowed_blocks
|
57
|
+
end
|
58
|
+
|
59
|
+
def asset_types # :nodoc:
|
60
|
+
@@asset_types
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns a new instance, loading path.
|
64
|
+
def load(path)
|
65
|
+
raise RuntimeError, "Template #{path} does not exist" unless File.exist?(path)
|
66
|
+
template = self.new(path)
|
67
|
+
template.load(path)
|
68
|
+
return template
|
69
|
+
end
|
70
|
+
|
71
|
+
# Registers a tag
|
72
|
+
def register(tag, symbol_or_class)
|
73
|
+
@@registered[tag] = symbol_or_class
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns an hash of registered tags.
|
77
|
+
def registered
|
78
|
+
@@registered
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks if the tag is registered.
|
82
|
+
def registered?(tag)
|
83
|
+
return true if @@registered[tag]
|
84
|
+
ns, tag = tag.split(':')
|
85
|
+
if (tag) # that is, if there is a ns
|
86
|
+
return false unless @@namespaces[ns]
|
87
|
+
return @@namespaces[ns].has_tag?(tag)
|
88
|
+
end
|
89
|
+
return false
|
90
|
+
end
|
91
|
+
|
92
|
+
# Registers a namespace (mod should probably be a Spider::App, and must respond to
|
93
|
+
# get_tag and has_tag? methods).
|
94
|
+
def register_namespace(ns, mod)
|
95
|
+
@@namespaces[ns] = mod
|
96
|
+
end
|
97
|
+
|
98
|
+
# Returns the Class registered for the given tag.
|
99
|
+
def get_registered_class(name)
|
100
|
+
if (@@registered[name])
|
101
|
+
klass = @@registered[name]
|
102
|
+
else
|
103
|
+
ns, tag = name.split(':')
|
104
|
+
klass = @@namespaces[ns].get_tag(tag) if (tag && @@namespaces[ns])
|
105
|
+
end
|
106
|
+
return nil unless klass
|
107
|
+
klass = const_get_full(klass) if klass.is_a?(Symbol)
|
108
|
+
return klass
|
109
|
+
end
|
110
|
+
|
111
|
+
# Returns the view path (see #Spider::find_asset)
|
112
|
+
def real_path(path, cur_path=nil, owner_classes=nil, search_paths=[])
|
113
|
+
Spider.find_resource_path(:views, path, cur_path, owner_classes, search_paths)
|
114
|
+
end
|
115
|
+
|
116
|
+
def find_resource(path, cur_path=nil, owner_classes=nil, search_paths=[])
|
117
|
+
Spider.find_resource(:views, path, cur_path, owner_classes, search_paths)
|
118
|
+
end
|
119
|
+
|
120
|
+
# An array of possible override tags.
|
121
|
+
# Overrides may be used when placing a widget in a template, or when including another template.
|
122
|
+
# All except tpl:content may have the _search_ attribute, that is a CSS or XPath expression specifing
|
123
|
+
# the nodes to override. If the _search_ attribute is missing, the override will be applied to the
|
124
|
+
# root node.
|
125
|
+
#
|
126
|
+
# Example:
|
127
|
+
# <div class="my_widget_template">
|
128
|
+
# <div class="a">aaa</div>
|
129
|
+
# <div class="b">bbb</div>
|
130
|
+
# </div>
|
131
|
+
#
|
132
|
+
# and
|
133
|
+
#
|
134
|
+
# <div class="my_template">
|
135
|
+
# <my:widget id="my_widget_instance">
|
136
|
+
# <tpl:override search=".b">bbb and a c</tpl:override>
|
137
|
+
# </my:widget>
|
138
|
+
# </div>
|
139
|
+
#
|
140
|
+
# will result in the widget using the template
|
141
|
+
# <div class="my_widget_template">
|
142
|
+
# <div class="a">aaa</div>
|
143
|
+
# <div class="b">bbb and c</div>
|
144
|
+
# </div>
|
145
|
+
#
|
146
|
+
# The tags are in the _tpl_ namespace.
|
147
|
+
# *<tpl:content [name='...'] />* overrides the content of the found element.
|
148
|
+
# If name is given, will override the named content found in the
|
149
|
+
# original template.
|
150
|
+
# *<tpl:override />* replaces the found nodes with given content
|
151
|
+
# *<tpl:override-attr name='...' value='...' />* overrides the given attribute
|
152
|
+
# *<tpl:append />* appends the given content to the container
|
153
|
+
# *<tpl:prepend />* prepends the given content
|
154
|
+
# *<tpl:delete />* removes the found nodes
|
155
|
+
# *<tpl:before />* inserts the given content before the found nodes
|
156
|
+
# *<tpl:after />* inserts the given content after the found nodes
|
157
|
+
def override_tags
|
158
|
+
@@overrides
|
159
|
+
end
|
160
|
+
|
161
|
+
end
|
162
|
+
|
163
|
+
# Returns the class override_tags
|
164
|
+
def override_tags
|
165
|
+
@@overrides
|
166
|
+
end
|
167
|
+
|
168
|
+
def initialize(path=nil)
|
169
|
+
@path = path
|
170
|
+
@widgets = {}
|
171
|
+
@subtemplates = {}
|
172
|
+
@subtemplate_owners = {}
|
173
|
+
@id_path = []
|
174
|
+
@assets = []
|
175
|
+
@content = {}
|
176
|
+
@dependencies = []
|
177
|
+
@overrides = []
|
178
|
+
@widgets_overrides = {}
|
179
|
+
@widget_procs = {}
|
180
|
+
end
|
181
|
+
|
182
|
+
# Sets the scene.
|
183
|
+
def bind(scene)
|
184
|
+
@scene = scene
|
185
|
+
return self
|
186
|
+
end
|
187
|
+
|
188
|
+
|
189
|
+
# Loads the compiled template (from cache if available).
|
190
|
+
def load(path=nil)
|
191
|
+
@path = real_path(path) if path
|
192
|
+
# debug("TEMPLATE LOADING #{@path}")
|
193
|
+
cache_path = @path.sub(Spider.paths[:root], 'ROOT').sub(Spider.paths[:spider], 'SPIDER')
|
194
|
+
@compiled = self.class.cache.fetch(cache_path) do
|
195
|
+
compile(:mode => @mode)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Recompiles the template; returns a CompiledTemplate.
|
200
|
+
def compile(options={})
|
201
|
+
compiled = CompiledTemplate.new
|
202
|
+
compiled.source_path = @path
|
203
|
+
root = get_el(@path)
|
204
|
+
el = process_tags(root)
|
205
|
+
@overrides.each{ |o| apply_override(root, o) } if (@overrides)
|
206
|
+
root.search('tpl:placeholder').remove # remove empty placeholders
|
207
|
+
res = root.children_of_type('tpl:asset')
|
208
|
+
res_init = ""
|
209
|
+
res.each do |r|
|
210
|
+
r.set_attribute('class', 'to_delete')
|
211
|
+
pr = parse_asset(r.attributes['type'], r.attributes['src'], r.attributes)
|
212
|
+
assets << pr
|
213
|
+
res_init += "@assets << {
|
214
|
+
:type => :#{pr[:type]},
|
215
|
+
:src => '#{pr[:src]}',
|
216
|
+
:path => '#{pr[:path]}',
|
217
|
+
:if => '#{pr[:if]}'
|
218
|
+
}\n"
|
219
|
+
end
|
220
|
+
root.search('.to_delete').remove
|
221
|
+
root_block = TemplateBlocks.parse_element(root, self.class.allowed_blocks, self)
|
222
|
+
options[:root] = true
|
223
|
+
options[:owner] = @owner
|
224
|
+
options[:owner_class] = @owner_class || @owner.class
|
225
|
+
options[:template_path] = @path
|
226
|
+
compiled.block = root_block.compile(options)
|
227
|
+
subtemplates.each do |id, sub|
|
228
|
+
sub.owner_class = @subtemplate_owners[id]
|
229
|
+
compiled.subtemplates[id] = sub.compile(options.merge({:mode => :widget})) # FIXME! :mode => :widget is wrong,
|
230
|
+
# it's just a quick kludge
|
231
|
+
end
|
232
|
+
compiled.block.init_code = res_init + compiled.block.init_code
|
233
|
+
compiled.devel_info["source.xml"] = root.to_html
|
234
|
+
return compiled
|
235
|
+
end
|
236
|
+
|
237
|
+
# Processes an asset. Returns an hash with :type, :src, :path.
|
238
|
+
def parse_asset(type, src, attributes={})
|
239
|
+
# FIXME: use Spider.find_asset ?
|
240
|
+
ass = {:type => type}
|
241
|
+
if (attributes['app'])
|
242
|
+
owner_class = Spider.apps_by_path[attributes['app']]
|
243
|
+
else
|
244
|
+
owner_class = (@owner ? @owner.class : @owner_class )
|
245
|
+
end
|
246
|
+
res = Spider.find_resource(type.to_sym, src, @path, [owner_class, @definer_class])
|
247
|
+
controller = nil
|
248
|
+
if (res && res.definer)
|
249
|
+
controller = res.definer.controller
|
250
|
+
elsif (owner_class < Spider::Controller)
|
251
|
+
controller = owner_class
|
252
|
+
end
|
253
|
+
ass[:path] = res.path if res
|
254
|
+
if controller.respond_to?(:pub_url)
|
255
|
+
ass[:src] = controller.pub_url + '/' + src
|
256
|
+
else
|
257
|
+
ass[:src] = src
|
258
|
+
end
|
259
|
+
ass_info = self.class.asset_types[type]
|
260
|
+
if (ass_info && ass_info[:processor])
|
261
|
+
processor = TemplateAssets.const_get(ass_info[:processor])
|
262
|
+
ass = processor.process(ass)
|
263
|
+
end
|
264
|
+
if attributes['sp:if']
|
265
|
+
ass[:if] = Spider::TemplateBlocks::Block.vars_to_scene(attributes['sp:if']).gsub("'", "\\'")
|
266
|
+
end
|
267
|
+
return ass
|
268
|
+
end
|
269
|
+
|
270
|
+
# Returns the root node of the template at given path.
|
271
|
+
# Will apply overrides and process extends and inclusions.
|
272
|
+
def get_el(path=nil)
|
273
|
+
path ||= @path
|
274
|
+
doc = open(path){ |f| Hpricot.XML(f) }
|
275
|
+
root = doc.root
|
276
|
+
overrides = []
|
277
|
+
override_tags.each do |tag|
|
278
|
+
overrides += root.children_of_type('tpl:'+tag)
|
279
|
+
end
|
280
|
+
overrides.each{ |o| o.set_attribute('class', 'to_delete') }
|
281
|
+
root.search('.to_delete').remove
|
282
|
+
add_overrides overrides
|
283
|
+
if (root.name == 'tpl:extend')
|
284
|
+
ext_src = root.attributes['src']
|
285
|
+
ext_app = root.attributes['app']
|
286
|
+
ext_widget = root.attributes['widget']
|
287
|
+
if ext_widget
|
288
|
+
ext_widget = Spider::Template.get_registered_class(ext_widget)
|
289
|
+
ext_src ||= ext_widget.default_template
|
290
|
+
ext_owner = ext_widget
|
291
|
+
elsif ext_app
|
292
|
+
ext_app = Spider.apps_by_path[ext_app]
|
293
|
+
ext_owner = ext_widget
|
294
|
+
end
|
295
|
+
ext_search_paths = nil
|
296
|
+
if (ext_owner && ext_owner.respond_to?(:template_paths))
|
297
|
+
ext_search_paths = ext_owner.template_paths
|
298
|
+
end
|
299
|
+
ext = self.class.real_path(ext_src, @path, ext_owner, ext_search_paths)
|
300
|
+
assets = root.children_of_type('tpl:asset')
|
301
|
+
@dependencies << ext
|
302
|
+
tpl = Template.new(ext)
|
303
|
+
root = get_el(ext)
|
304
|
+
if (assets && !assets.empty?)
|
305
|
+
assets.each do |ass|
|
306
|
+
root.innerHTML += ass.to_html
|
307
|
+
end
|
308
|
+
end
|
309
|
+
else
|
310
|
+
root.search('tpl:include').each do |incl|
|
311
|
+
src = real_path(incl.attributes['src'])
|
312
|
+
@dependencies << src
|
313
|
+
incl_el = self.get_el(src)
|
314
|
+
assets = incl_el.children_of_type('tpl:asset')
|
315
|
+
assets_html = ""
|
316
|
+
assets.each{ |ass| assets_html += ass.to_html }
|
317
|
+
incl.swap(assets_html+self.get_el(src).to_html)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
return root
|
321
|
+
end
|
322
|
+
|
323
|
+
def process_tags(el)
|
324
|
+
block = TemplateBlocks.get_block_type(el, true)
|
325
|
+
raise "Bad html in #{@path} at '#{el}', can't parse" if (el == Hpricot::BogusETag)
|
326
|
+
if (block == :Tag)
|
327
|
+
sp_attributes = {}
|
328
|
+
# FIXME: should use blocks instead
|
329
|
+
el.attributes.each do |key, value|
|
330
|
+
if (key[0..1] == 'sp')
|
331
|
+
sp_attributes[key] = value
|
332
|
+
el.raw_attributes.delete(key)
|
333
|
+
end
|
334
|
+
end
|
335
|
+
klass = Spider::Template.get_registered_class(el.name)
|
336
|
+
tag = klass.new(el)
|
337
|
+
res = process_tags(Hpricot(tag.render).root)
|
338
|
+
sp_attributes.each{ |key, value| res.raw_attributes[key] = value }
|
339
|
+
return res
|
340
|
+
else
|
341
|
+
el.each_child do |child|
|
342
|
+
next if child.is_a?(Hpricot::Text) || child.is_a?(Hpricot::Comment)
|
343
|
+
el.replace_child(child, process_tags(child))
|
344
|
+
end
|
345
|
+
end
|
346
|
+
return el
|
347
|
+
end
|
348
|
+
|
349
|
+
# The full path of a template mentioned in this one.
|
350
|
+
def real_path(path)
|
351
|
+
self.class.real_path(path, File.dirname(@path), [@owner.class, @definer_class])
|
352
|
+
end
|
353
|
+
|
354
|
+
|
355
|
+
def loaded?
|
356
|
+
@compiled ? true : false
|
357
|
+
end
|
358
|
+
|
359
|
+
# Adds a widget instance to the template.
|
360
|
+
# This method is usually not called directly; widgets are added during the template
|
361
|
+
# init phase.
|
362
|
+
def add_widget(id, widget, attributes=nil, content=nil, template=nil)
|
363
|
+
@widgets[id.to_sym] ||= widget
|
364
|
+
widget.id = id
|
365
|
+
widget.id_path = @id_path + [id]
|
366
|
+
if (attributes) # don't use merge to trigger custom []=(k, v) method
|
367
|
+
attributes.each{ |k, v| widget.attributes[k] = v }
|
368
|
+
end
|
369
|
+
widget.containing_template = self
|
370
|
+
widget.template = template if template
|
371
|
+
widget.parent = @owner
|
372
|
+
widget.parse_runtime_content_xml(content, @path) if content
|
373
|
+
if (@widget_procs[id.to_sym])
|
374
|
+
@widget_procs[id.to_sym].each do |wp|
|
375
|
+
apply_widget_proc(widget, wp)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
def find_widget(path)
|
381
|
+
return @widgets[path.to_sym]
|
382
|
+
end
|
383
|
+
|
384
|
+
# Does the init phase (evals the template's compiled _init.rb_).
|
385
|
+
def init(scene)
|
386
|
+
# Spider::Logger.debug("Template #{@path} INIT")
|
387
|
+
load unless loaded?
|
388
|
+
# debug("Template #{@path} init")
|
389
|
+
# debug(@compiled.init_code)
|
390
|
+
@scene = scene
|
391
|
+
instance_eval(@compiled.init_code, @compiled.cache_path+'/init.rb')
|
392
|
+
@init_done = true
|
393
|
+
end
|
394
|
+
|
395
|
+
|
396
|
+
def init_done?
|
397
|
+
@init_done
|
398
|
+
end
|
399
|
+
|
400
|
+
# Calls the before method of all widget instances.
|
401
|
+
def do_widgets_before
|
402
|
+
@widgets.each do |id, w|
|
403
|
+
act = (@_action_to == id) ? @_action : ''
|
404
|
+
w.widget_before(act) unless w.before_done?
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
# Calls the run method on all widget instances.
|
409
|
+
def run_widgets
|
410
|
+
@widgets.each do |id, w|
|
411
|
+
w.run unless w.did_run?
|
412
|
+
end
|
413
|
+
|
414
|
+
end
|
415
|
+
|
416
|
+
# Does #do_widgets_before and then #run_widgets.
|
417
|
+
def exec
|
418
|
+
do_widgets_before
|
419
|
+
run_widgets
|
420
|
+
end
|
421
|
+
|
422
|
+
# Does the render phase.
|
423
|
+
# Will execute the following steps (if needed):
|
424
|
+
# - load
|
425
|
+
# - init
|
426
|
+
# - exec
|
427
|
+
# - eval the template's compiled run code.
|
428
|
+
def render(scene=nil)
|
429
|
+
scene ||= @scene
|
430
|
+
load unless loaded?
|
431
|
+
init(scene) unless init_done?
|
432
|
+
exec
|
433
|
+
@content.merge!(@widgets)
|
434
|
+
# if Spider.conf.get('template.safe')
|
435
|
+
# debug("RENDERING IN SAFE MODE!")
|
436
|
+
# debug(@compiled.run_code)
|
437
|
+
# # FIXME: must send header before safe mode
|
438
|
+
# current_thread = Thread.current
|
439
|
+
# t = Thread.new {
|
440
|
+
# Thread.current[:stdout] = current_thread[:stdout]
|
441
|
+
# $SAFE = 4
|
442
|
+
# scene.instance_eval("def __run_template\n"+@compiled.run_code+"end\n", @compiled.cache_path+'/run.rb')
|
443
|
+
# scene.__run_template
|
444
|
+
# scene.__run_template do |widget|
|
445
|
+
# @content[widget].run
|
446
|
+
# end
|
447
|
+
# }
|
448
|
+
# t.join
|
449
|
+
# else
|
450
|
+
scene.instance_eval("def __run_template\n"+@compiled.run_code+"end\n", @compiled.cache_path+'/run.rb', 0)
|
451
|
+
scene.__run_template do |widget|
|
452
|
+
@content[widget].render if @content[widget]
|
453
|
+
end
|
454
|
+
# end
|
455
|
+
end
|
456
|
+
|
457
|
+
# Alias for #render.
|
458
|
+
def run
|
459
|
+
render(@scene)
|
460
|
+
end
|
461
|
+
|
462
|
+
|
463
|
+
def inspect
|
464
|
+
self.class.to_s
|
465
|
+
end
|
466
|
+
|
467
|
+
def add_subtemplate(id, template, owner) # :nodoc:
|
468
|
+
@subtemplates[id] = template
|
469
|
+
@subtemplate_owners[id] = owner
|
470
|
+
end
|
471
|
+
|
472
|
+
|
473
|
+
def load_subtemplate(id) # :nodoc:
|
474
|
+
load unless loaded?
|
475
|
+
return nil unless @compiled.subtemplates[id]
|
476
|
+
t = Template.new
|
477
|
+
t.compiled = @compiled.subtemplates[id]
|
478
|
+
return t
|
479
|
+
end
|
480
|
+
|
481
|
+
def add_overrides(overrides)
|
482
|
+
overrides.each do |ov|
|
483
|
+
w = ov.attributes['widget']
|
484
|
+
if (w)
|
485
|
+
first, rest = w.split('/', 2)
|
486
|
+
if (rest)
|
487
|
+
ov.raw_attributes['widget'] = rest
|
488
|
+
else
|
489
|
+
ov.raw_attributes.delete('widget')
|
490
|
+
end
|
491
|
+
# debugger
|
492
|
+
@widgets_overrides[first] ||= []
|
493
|
+
@widgets_overrides[first] << ov
|
494
|
+
else
|
495
|
+
@overrides << ov
|
496
|
+
end
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
def overrides_for(widget_id)
|
501
|
+
# debugger
|
502
|
+
@widgets_overrides[widget_id] || []
|
503
|
+
end
|
504
|
+
|
505
|
+
# Applies an override to an (Hpricot) element.
|
506
|
+
def apply_override(el, override)
|
507
|
+
search_string = override.attributes['search']
|
508
|
+
override.name = 'tpl:override-content' if override.name == 'tpl:inline-override'
|
509
|
+
if (search_string)
|
510
|
+
# # Fix Hpricot bug!
|
511
|
+
# search_string.gsub!(/nth-child\((\d+)\)/) do |match|
|
512
|
+
# "nth-child(#{$1.to_i-2})"
|
513
|
+
# end
|
514
|
+
found = el.parent.search(search_string)
|
515
|
+
elsif (override.name == 'tpl:content')
|
516
|
+
found = el.search("tpl:placeholder[@name='#{override.attributes['name']}']")
|
517
|
+
else
|
518
|
+
found = [el]
|
519
|
+
end
|
520
|
+
if (override.name == 'tpl:delete')
|
521
|
+
found.remove
|
522
|
+
else
|
523
|
+
found.each do |f|
|
524
|
+
if (override.name == 'tpl:override-content')
|
525
|
+
overridden = f.innerHTML
|
526
|
+
f.innerHTML = override.innerHTML
|
527
|
+
f.search('tpl:overridden').each{ |o| o.swap(overridden) }
|
528
|
+
elsif (override.name == 'tpl:override' || override.name == 'tpl:content')
|
529
|
+
overridden = f.to_html
|
530
|
+
parent = f.parent
|
531
|
+
f.swap(override.innerHTML)
|
532
|
+
parent.search('tpl:overridden').each{ |o| o.swap(overridden) }
|
533
|
+
elsif (override.name == 'tpl:override-attr')
|
534
|
+
f.set_attribute(override.attributes["name"], override.attributes["value"])
|
535
|
+
elsif (override.name == 'tpl:append-attr')
|
536
|
+
f.set_attribute(override.attributes["name"], \
|
537
|
+
(f.attributes[override.attributes["name"]] || '')+override.attributes["value"])
|
538
|
+
elsif (override.name == 'tpl:append')
|
539
|
+
f.innerHTML += override.innerHTML
|
540
|
+
elsif (override.name == 'tpl:prepend')
|
541
|
+
f.innerHTML = override.innerHTML + f.innerHTML
|
542
|
+
elsif (override.name == 'tpl:before')
|
543
|
+
f.before(override.innerHTML)
|
544
|
+
elsif (override.name == 'tpl:after')
|
545
|
+
f.after(override.innerHTML)
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
end
|
550
|
+
|
551
|
+
# Template assets.
|
552
|
+
def assets
|
553
|
+
res = []
|
554
|
+
@assets.each do |ass|
|
555
|
+
# FIXME: is this the best place to check if? Maybe it's better to do it when printing resources?
|
556
|
+
res << ass unless !ass[:if].empty? && !@scene.instance_eval(ass[:if])
|
557
|
+
end
|
558
|
+
return res
|
559
|
+
end
|
560
|
+
|
561
|
+
# Assets for the template and contained widgets.
|
562
|
+
def all_assets
|
563
|
+
res = assets
|
564
|
+
seen = {}
|
565
|
+
@widgets.each do |id, w|
|
566
|
+
# next if seen[w.class]
|
567
|
+
seen[w.class] = true
|
568
|
+
res += w.assets
|
569
|
+
end
|
570
|
+
return res
|
571
|
+
end
|
572
|
+
|
573
|
+
def with_widget(path, &proc)
|
574
|
+
first, rest = path.split('/', 2)
|
575
|
+
@widget_procs[first.to_sym] ||= []
|
576
|
+
wp = {:target => rest, :proc => proc }
|
577
|
+
@widget_procs[first.to_sym] << wp
|
578
|
+
if (@widgets[first.to_sym])
|
579
|
+
apply_widget_proc(@widgets[first.to_sym], wp)
|
580
|
+
end
|
581
|
+
end
|
582
|
+
|
583
|
+
def apply_widget_proc(widget, wp)
|
584
|
+
if (wp[:target])
|
585
|
+
widget.with_widget(wp[:target], &wp[:proc])
|
586
|
+
else
|
587
|
+
widget.instance_eval(wp[:proc])
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
|
592
|
+
end
|
593
|
+
|
594
|
+
# Class holding compiled template code.
|
595
|
+
|
596
|
+
class CompiledTemplate
|
597
|
+
attr_accessor :block, :source_path, :cache_path, :subtemplates, :devel_info
|
598
|
+
|
599
|
+
|
600
|
+
def initialize()
|
601
|
+
@subtemplates = {}
|
602
|
+
@subtemplate_owners = {}
|
603
|
+
@devel_info = {}
|
604
|
+
end
|
605
|
+
|
606
|
+
def init_code
|
607
|
+
@block.init_code
|
608
|
+
end
|
609
|
+
|
610
|
+
def run_code
|
611
|
+
@block.run_code
|
612
|
+
end
|
613
|
+
|
614
|
+
def collect_mtimes
|
615
|
+
mtimes = {@source_path => File.mtime(@source_path)}
|
616
|
+
@subtemplates.each{ |id, sub| mtimes.merge(sub.collect_mtimes)}
|
617
|
+
return mtimes
|
618
|
+
end
|
619
|
+
|
620
|
+
end
|
621
|
+
|
622
|
+
class TemplateCompileError < RuntimeError
|
623
|
+
end
|
624
|
+
|
625
|
+
end
|