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,296 @@
|
|
1
|
+
module Spider; module Model
|
2
|
+
|
3
|
+
module Tree
|
4
|
+
|
5
|
+
def self.included(model)
|
6
|
+
model.extend(ClassMethods)
|
7
|
+
model.mapper_include(MapperMethods)
|
8
|
+
end
|
9
|
+
|
10
|
+
def tree_all(element)
|
11
|
+
element = self.class.elements[element] unless element.is_a?(Element)
|
12
|
+
left_el = element.attributes[:tree_left]
|
13
|
+
right_el = element.attributes[:tree_right]
|
14
|
+
left = get(left_el)
|
15
|
+
right = get(right_el)
|
16
|
+
return nil unless (left && right)
|
17
|
+
c = Condition.and
|
18
|
+
c[left_el] = (left..right)
|
19
|
+
q = Query.new(c)
|
20
|
+
q.order_by(left_el)
|
21
|
+
res = element.model.find(q)
|
22
|
+
right_stack = []
|
23
|
+
res.each do |obj|
|
24
|
+
if (right_stack.length > 0)
|
25
|
+
right_stack.pop while (right_stack[right_stack.length-1] < obj.get(right_el))
|
26
|
+
obj.set(element.attributes[:tree_depth], right_stack.length)
|
27
|
+
end
|
28
|
+
right_stack << obj.get(right_el)
|
29
|
+
end
|
30
|
+
return res
|
31
|
+
end
|
32
|
+
|
33
|
+
module ClassMethods
|
34
|
+
|
35
|
+
def tree(name, attributes={})
|
36
|
+
attributes[:association] = :tree
|
37
|
+
attributes[:multiple] = true
|
38
|
+
attributes[:reverse] ||= :"#{name}_parent"
|
39
|
+
attributes[:tree_left] ||= :"#{name}_left"
|
40
|
+
attributes[:tree_right] ||= :"#{name}_right"
|
41
|
+
attributes[:tree_depth] ||= :"#{name}_depth"
|
42
|
+
choice(attributes[:reverse], self, :association => :tree_parent)
|
43
|
+
element(name, self, attributes)
|
44
|
+
element(attributes[:tree_left], Fixnum, :hidden => true)
|
45
|
+
element(attributes[:tree_right], Fixnum, :hidden => true)
|
46
|
+
element(attributes[:tree_depth], Fixnum, :unmapped => true, :hidden => true)
|
47
|
+
# sequence(name)
|
48
|
+
qs_module ||= Module.new
|
49
|
+
|
50
|
+
qs_module.module_eval do
|
51
|
+
|
52
|
+
define_method("#{name}_roots") do
|
53
|
+
qs = self.clone
|
54
|
+
qs.condition[attributes[:reverse]] = nil
|
55
|
+
qs
|
56
|
+
end
|
57
|
+
|
58
|
+
define_method("#{name}_leafs") do
|
59
|
+
qs = self.clone
|
60
|
+
qs.condition[attributes[:tree_left]] = QueryFuncs::Expression.new(":#{attributes[:tree_right]} - 1")
|
61
|
+
qs
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
@elements[name].attributes[:queryset_module] = qs_module
|
67
|
+
|
68
|
+
def extend_queryset(qs)
|
69
|
+
super
|
70
|
+
@elements.each do |name, el|
|
71
|
+
qs_module = el.attributes[:queryset_module]
|
72
|
+
qs.extend(qs_module) if qs_module
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
(class << self; self; end).instance_eval do
|
77
|
+
|
78
|
+
define_method("#{name}_roots") do
|
79
|
+
QuerySet.autoloading(self).send("#{name}_roots")
|
80
|
+
end
|
81
|
+
|
82
|
+
define_method("#{name}_leafs") do
|
83
|
+
QuerySet.autoloading(self).send("#{name}_leafs")
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
define_method("#{name}_all") do
|
88
|
+
qs = QuerySet.new(self)
|
89
|
+
self.send("#{name}_roots").each do |root|
|
90
|
+
qs += root.tree_all(name)
|
91
|
+
end
|
92
|
+
return qs
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
define_method("#{name}_leaf?") do
|
98
|
+
element = self.class.elements[name]
|
99
|
+
left_el = element.attributes[:tree_left]
|
100
|
+
right_el = element.attributes[:tree_right]
|
101
|
+
left = get(left_el)
|
102
|
+
right = get(right_el)
|
103
|
+
return left == (right - 1)
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
define_method("#{name}_all") do
|
108
|
+
tree_all(name)
|
109
|
+
end
|
110
|
+
|
111
|
+
define_method(attributes[:tree_depth]) do
|
112
|
+
ivar = :"@#{ attributes[:tree_depth] }"
|
113
|
+
return instance_variable_get(ivar)
|
114
|
+
end
|
115
|
+
|
116
|
+
define_method("#{name}_path") do
|
117
|
+
element = self.class.elements[name]
|
118
|
+
left_el = element.attributes[:tree_left]
|
119
|
+
right_el = element.attributes[:tree_right]
|
120
|
+
left = get(left_el)
|
121
|
+
right = get(right_el)
|
122
|
+
return nil unless (left && right)
|
123
|
+
c = Condition.and
|
124
|
+
c.set(tree_left, '<', left)
|
125
|
+
c.set(tree_right, '>', right)
|
126
|
+
q = Query.new(c)
|
127
|
+
q.order_by(left_el)
|
128
|
+
return element.model.find(q)
|
129
|
+
end
|
130
|
+
|
131
|
+
define_method("#{name}_append_first") do |new_child|
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
define_method("#{name}_append_after") do |new_child, child|
|
136
|
+
element = self.class.elements[name]
|
137
|
+
left_el = element.attributes[:tree_left]
|
138
|
+
right_el = element.attributes[:tree_right]
|
139
|
+
parent_el = element.attributes[:reverse]
|
140
|
+
if (child.get(left_el))
|
141
|
+
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
module MapperMethods
|
150
|
+
|
151
|
+
def before_save(obj, mode)
|
152
|
+
@model.elements_array.select{ |el| el.attributes[:association] == :tree }.each do |el|
|
153
|
+
if (mode == :update)
|
154
|
+
tree_remove(el, obj)
|
155
|
+
end
|
156
|
+
parent = obj.get(el.attributes[:reverse])
|
157
|
+
if (parent)
|
158
|
+
tree_insert_node_under(el, obj, parent)
|
159
|
+
else
|
160
|
+
tree_insert_node(el, obj)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
super
|
164
|
+
end
|
165
|
+
|
166
|
+
def before_delete(objects)
|
167
|
+
@model.elements_array.select{ |el| el.attributes[:association] == :tree }.each do |el|
|
168
|
+
objects.each{ |obj| tree_remove(el, obj) }
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# def after_save(obj, mode)
|
173
|
+
# super
|
174
|
+
# debugger
|
175
|
+
# @model.elements_array.select{ |el| el.attributes[:association] == :tree }.each do |el|
|
176
|
+
# debugger
|
177
|
+
# left_el = el.attributes[:tree_left]
|
178
|
+
# left = obj.get(left_el)
|
179
|
+
# if (!left)
|
180
|
+
# left = sequence_next(el.name)
|
181
|
+
# obj.set(left_el, left)
|
182
|
+
# end
|
183
|
+
# parent = obj.get(el.attributes[:reverse])
|
184
|
+
# rebuild_from = parent ? parent : obj
|
185
|
+
# tree_rebuild(el, rebuild_from, left)
|
186
|
+
# end
|
187
|
+
# end
|
188
|
+
|
189
|
+
def tree_rebuild(tree_el, obj, left)
|
190
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
191
|
+
right = left + 1
|
192
|
+
children = obj.get(tree_el)
|
193
|
+
if (children)
|
194
|
+
children.each do |child|
|
195
|
+
right = child.mapper.tree_rebuild(tree_el, child, right)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
obj.set(left_el, left)
|
199
|
+
obj.set(right_el, right)
|
200
|
+
do_update(obj)
|
201
|
+
return right + 1
|
202
|
+
end
|
203
|
+
|
204
|
+
def tree_insert_node(tree_el, obj, left=nil)
|
205
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
206
|
+
left = max(right_el) + 1 unless left
|
207
|
+
right = tree_assign_values(tree_el, obj, left)
|
208
|
+
diff = right-left+1
|
209
|
+
condition = Condition.new.set(right_el, '>=', left)
|
210
|
+
bulk_update({right_el => QueryFuncs::Expression.new(":#{right_el}+#{diff}")}, condition)
|
211
|
+
condition = Condition.new.set(left_el, '>=', left)
|
212
|
+
bulk_update({left_el => QueryFuncs::Expression.new(":#{left_el}+#{diff}")}, condition)
|
213
|
+
end
|
214
|
+
|
215
|
+
def tree_assign_values(tree_el, obj, left)
|
216
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
217
|
+
cur = left+1
|
218
|
+
obj.get(tree_el).each do |child|
|
219
|
+
cur = tree_assign_values(tree_el, child, cur)
|
220
|
+
end
|
221
|
+
obj.set(left_el, left)
|
222
|
+
obj.set(right_el, cur)
|
223
|
+
end
|
224
|
+
|
225
|
+
def tree_insert_node_under(tree_el, obj, parent)
|
226
|
+
obj.set(tree_el.attributes[:reverse], parent)
|
227
|
+
tree_insert_node(tree_el, obj, parent.get(tree_el.attributes[:tree_right]))
|
228
|
+
end
|
229
|
+
|
230
|
+
def tree_insert_node_first(tree_el, obj, parent)
|
231
|
+
obj.set(tree_el.attributes[:reverse], parent)
|
232
|
+
tree_insert_node(tree_el, obj, parent.get(tree_el.attributes[:tree_left])+1)
|
233
|
+
end
|
234
|
+
|
235
|
+
def tree_insert_node_left(tree_el, obj, sibling)
|
236
|
+
obj.set(tree_el.attributes[:reverse], sibling.get(tree_el.attributes[:reverse]))
|
237
|
+
tree_insert_node(tree_el, obj, sibling.get(tree_el.attributes[:tree_left]))
|
238
|
+
end
|
239
|
+
|
240
|
+
def tree_insert_node_right(tree_el, obj, sibling)
|
241
|
+
obj.set(tree_el.attributes[:reverse], sibling.get(tree_el.attributes[:reverse]))
|
242
|
+
tree_insert_node(tree_el, obj, sibling.get(tree_el.attributes[:tree_right]))
|
243
|
+
end
|
244
|
+
|
245
|
+
def tree_remove(tree_el, obj)
|
246
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
247
|
+
left = obj.get(left_el); right = obj.get(right_el)
|
248
|
+
return unless left && right
|
249
|
+
diff = right-left+1
|
250
|
+
condition = Condition.new.set(left_el, '>', right)
|
251
|
+
bulk_update({left_el => QueryFuncs::Expression.new(":#{left_el} - #{diff}")}, condition)
|
252
|
+
condition = Condition.new.set(right_el, '>', right)
|
253
|
+
bulk_update({right_el => QueryFuncs::Expression.new(":#{right_el} - #{diff}")}, condition)
|
254
|
+
def unset_tree_vals(obj, tree_el)
|
255
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
256
|
+
obj.set(left_el, nil); obj.set(right_el, nil)
|
257
|
+
obj.get(tree_el).each do |sub|
|
258
|
+
unset_tree_vals(sub, tree_el)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
unset_tree_vals(obj, tree_el)
|
262
|
+
end
|
263
|
+
|
264
|
+
def tree_delete(tree_el, obj)
|
265
|
+
tree_remove(tree_el, obj)
|
266
|
+
def delete_children(obj, tree_el)
|
267
|
+
obj.get(tree_el).each do |child|
|
268
|
+
delete_children(child, tree_el)
|
269
|
+
end
|
270
|
+
obj.delete
|
271
|
+
end
|
272
|
+
delete_children(obj, tree_el)
|
273
|
+
end
|
274
|
+
|
275
|
+
def tree_move_up_children(tree_el, obj)
|
276
|
+
left_el = tree_el.attributes[:tree_left]; right_el = tree_el.attributes[:tree_right]
|
277
|
+
left = obj.get(left_el); right = obj.get(right_el)
|
278
|
+
bulk_update({
|
279
|
+
:left_el => QueryFuncs::Expression.new(":#{left_el} - 1"),
|
280
|
+
:right_el => QueryFuncs::Expression.new(":#{right_el} - 1")
|
281
|
+
}, Condition.new.set(left_el, 'between', [left, right]))
|
282
|
+
condition = Condition.new.set(right_el, '>', right)
|
283
|
+
bulk_update({:right_el => QueryFuncs::Expression.new(":#{right_el} - 2")}, condition)
|
284
|
+
condition = Condition.new.set(left_el, '>', right)
|
285
|
+
bulk_update({:left_el => QueryFuncs::Expression.new(":#{left_el} - 2")}, condition)
|
286
|
+
end
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
|
296
|
+
end; end
|
@@ -0,0 +1,147 @@
|
|
1
|
+
require 'digest/sha1'
|
2
|
+
|
3
|
+
module Spider; module Model
|
4
|
+
|
5
|
+
module Versioned
|
6
|
+
|
7
|
+
def self.included(model)
|
8
|
+
|
9
|
+
model.extend(ClassMethods)
|
10
|
+
model.mapper_include(Mapper)
|
11
|
+
vmod = Class.new(model)
|
12
|
+
vmod.primary_keys.each do |pk|
|
13
|
+
vmod.element_attributes(pk.name, :primary_key => false)
|
14
|
+
end
|
15
|
+
model.const_set("Versioned", vmod)
|
16
|
+
model.set_version_model(nil, vmod)
|
17
|
+
model.element(:sha1, String, :length => 40)
|
18
|
+
end
|
19
|
+
|
20
|
+
module ClassMethods
|
21
|
+
|
22
|
+
def versioning(branch=nil)
|
23
|
+
@version_models ||= {}
|
24
|
+
@version_elements ||= {}
|
25
|
+
unless @version_models[branch]
|
26
|
+
vmod = Class.new(self)
|
27
|
+
vmod_name = "Versioned"
|
28
|
+
vmod_name += Spider::Inflector.camelize(branch) if branch
|
29
|
+
const_set(vmod_name.to_sym, vmod)
|
30
|
+
@version_models[branch] = vmod
|
31
|
+
end
|
32
|
+
vmod = @version_models[branch]
|
33
|
+
vmod.primary_keys.each do |pk|
|
34
|
+
vmod.delete_element(pk.name)
|
35
|
+
end
|
36
|
+
vmod.elements_array.each do |el|
|
37
|
+
el.attributes[:autoincrement] = false
|
38
|
+
end
|
39
|
+
vmod.element(:sha1, String, :primary_key => true, :length => 40)
|
40
|
+
vmod.element(self.short_name.to_sym, self, :add_multiple_reverse => :history)
|
41
|
+
vmod.element(:version_date, DateTime)
|
42
|
+
self.elements_array.each do |el|
|
43
|
+
elh = dump_element(el)
|
44
|
+
next if el.integrated?
|
45
|
+
next unless elh
|
46
|
+
# elh[:attributes][:primary_key] = false
|
47
|
+
# debugger if elh[:attributes][:junction]
|
48
|
+
# vmod.send(elh[:method], elh[:name], elh[:type], elh[:attributes])
|
49
|
+
if (el.model?)
|
50
|
+
if (self.mapper.have_references?(el) && el.model < Spider::Model::Versioned)
|
51
|
+
vname = "#{el.name}_versioned".to_sym
|
52
|
+
@version_elements[el.name] = vname
|
53
|
+
vmod.send(elh[:method], vname, el.model.version_model)
|
54
|
+
elsif (el.attributes[:junction] && el.type < Spider::Model::Versioned)
|
55
|
+
# el.attributes[:association_type].module_eval{ include Spider::Model::Versioned }
|
56
|
+
# el.attributes[:association_type].versioning(branch)
|
57
|
+
# elh[:attributes].
|
58
|
+
# debugger
|
59
|
+
# elh[:attributes][:has_single_reverse] = (el.attributes[:reverse] && !el.type.elements[el.attributes[:reverse]].multiple?)
|
60
|
+
junction = el.attributes[:association_type]
|
61
|
+
unless junction < Spider::Model::Versioned && junction.version_model
|
62
|
+
junction.module_eval{ include Spider::Model::Versioned }
|
63
|
+
junction.versioning(branch)
|
64
|
+
end
|
65
|
+
elh[:attributes][:through] = junction.version_model
|
66
|
+
elh[:attributes][:junction_our_name] = "#{elh[:attributes][:reverse]}_versioned".to_sym
|
67
|
+
elh[:attributes][:junction_their_element] = "#{elh[:attributes][:junction_their_element]}_versioned".to_sym
|
68
|
+
vname = "#{elh[:name]}_versioned".to_sym
|
69
|
+
vmod.send(elh[:method], vname, el.type.version_model, elh[:attributes])
|
70
|
+
@version_elements[el.name] = vname
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def version_element(el=nil)
|
77
|
+
return :sha1 unless el
|
78
|
+
el = el.name if el.respond_to?(:name)
|
79
|
+
@version_elements[el]
|
80
|
+
end
|
81
|
+
|
82
|
+
def version_model(branch=nil)
|
83
|
+
@version_models ||= {}
|
84
|
+
@version_models[branch]
|
85
|
+
end
|
86
|
+
|
87
|
+
def set_version_model(branch, model)
|
88
|
+
@version_models ||= {}
|
89
|
+
@version_models[branch] = model
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
module Mapper
|
95
|
+
|
96
|
+
def save_done(obj, mode)
|
97
|
+
obj.set(obj.class.version_element, obj.version_sha1)
|
98
|
+
obj.reset_modified_elements
|
99
|
+
obj.set_modified(:sha1 => true)
|
100
|
+
obj.mapper.do_update(obj)
|
101
|
+
super
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
def version_sha1
|
107
|
+
yaml = self.to_yaml(:except => [:sha1])
|
108
|
+
sha1 = Digest::SHA1.hexdigest(yaml)
|
109
|
+
end
|
110
|
+
|
111
|
+
def save_version
|
112
|
+
mod = self.class
|
113
|
+
vmod = mod.version_model
|
114
|
+
vobj = vmod.new()
|
115
|
+
vobj.set(mod.elements[:history].reverse, self)
|
116
|
+
ve = mod.version_element
|
117
|
+
unless self.get(ve)
|
118
|
+
self.set(ve, self.version_sha1)
|
119
|
+
self.mapper.do_update(self)
|
120
|
+
end
|
121
|
+
mod.elements_array.each do |el|
|
122
|
+
vobj.set(el.name, self.get(el))
|
123
|
+
vel = mod.version_element(el)
|
124
|
+
if (vel)
|
125
|
+
if (mod.mapper.have_references?(el))
|
126
|
+
el_sha1 = self.get(el).get(el.model.version_element)
|
127
|
+
vobj.set(vel, el_sha1)
|
128
|
+
else
|
129
|
+
cond = Spider::Model::Condition.and
|
130
|
+
cond[el.reverse] = self
|
131
|
+
ass = el.model.find(cond)
|
132
|
+
ass.each do |row|
|
133
|
+
row.save_version
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
vobj.set(:version_date, DateTime.now)
|
139
|
+
begin
|
140
|
+
vobj.mapper.do_insert(vobj)
|
141
|
+
rescue Spider::Model::Storage::DuplicateKey
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
end; end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
require 'spiderfw/model/datatypes'
|
2
|
+
require 'spiderfw/model/unit_of_work'
|
3
|
+
require 'spiderfw/model/identity_mapper'
|
4
|
+
|
5
|
+
module Spider
|
6
|
+
|
7
|
+
module Model
|
8
|
+
|
9
|
+
@base_types = [
|
10
|
+
String, Spider::DataTypes::Text, Fixnum, Float, BigDecimal, Date, DateTime, Spider::DataTypes::Bool
|
11
|
+
]
|
12
|
+
|
13
|
+
# Base types are:
|
14
|
+
#
|
15
|
+
# String, Spider::DataTypes::Text, Fixnum, Float, BigDecimal, Date, DateTime, Spider::DataTypes::Bool.
|
16
|
+
#
|
17
|
+
# These types must be handled by all mappers.
|
18
|
+
def self.base_types
|
19
|
+
@base_types
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns the base type corresponding to class. Will walk superclasses and DataType info until
|
23
|
+
# a base type is found.
|
24
|
+
def self.base_type(klass)
|
25
|
+
k = klass
|
26
|
+
while (k && !base_types.include?(k))
|
27
|
+
k = simplify_type(k)
|
28
|
+
end
|
29
|
+
return k
|
30
|
+
end
|
31
|
+
|
32
|
+
# TODO: remove?
|
33
|
+
def self.ruby_type(klass) #:nodoc:
|
34
|
+
map_types = {
|
35
|
+
Spider::DataTypes::Text => String,
|
36
|
+
Spider::DataTypes::Bool => FalseClass,
|
37
|
+
Spider::DataTypes::Binary => String
|
38
|
+
}
|
39
|
+
return map_types[klass] if map_types[klass]
|
40
|
+
return klass
|
41
|
+
end
|
42
|
+
|
43
|
+
# An iteration in the search for base type.
|
44
|
+
def self.simplify_type(klass) #:nodoc:
|
45
|
+
map_types = {
|
46
|
+
|
47
|
+
}
|
48
|
+
return klass if base_types.include?(klass)
|
49
|
+
return t if t = map_types[klass]
|
50
|
+
return klass.maps_to if (klass.subclass_of?(Spider::DataType) && klass.maps_to)
|
51
|
+
return klass.superclass if klass.superclass
|
52
|
+
return nil
|
53
|
+
end
|
54
|
+
|
55
|
+
# FIXME: Tread global variables are no good in no-threaded mode
|
56
|
+
def self.unit_of_work #:nodoc:
|
57
|
+
Thread.current[:unit_of_work]
|
58
|
+
end
|
59
|
+
|
60
|
+
# Returns the identity-mapped object
|
61
|
+
def self.get(model, val)
|
62
|
+
if (!val.is_a?(Hash))
|
63
|
+
if (model.primary_keys.length == 1)
|
64
|
+
val = {model.primary_keys[0].name => val}
|
65
|
+
else
|
66
|
+
raise ModelException, "Can't get without primary keys"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
if identity_mapper
|
70
|
+
return identity_mapper.get(model, val)
|
71
|
+
else
|
72
|
+
return model.new(val)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Puts an object into the IdentityMapper
|
77
|
+
def self.put(obj, check=false)
|
78
|
+
if (identity_mapper)
|
79
|
+
return identity_mapper.put(obj, check)
|
80
|
+
else
|
81
|
+
return obj
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# FIXME: no good
|
86
|
+
def self.identity_mapper #:nodoc:
|
87
|
+
Thread.current[:identity_mapper]
|
88
|
+
end
|
89
|
+
|
90
|
+
# FIXME: no good
|
91
|
+
def self.identity_mapper=(im) #:nodoc:
|
92
|
+
Thread.current[:identity_mapper] = im
|
93
|
+
end
|
94
|
+
|
95
|
+
# Creates a new unit of work with the proc
|
96
|
+
def self.with_unit_of_work(&proc) #:nodoc: TODO: test
|
97
|
+
return if unit_of_work
|
98
|
+
UnitOfWork.new(&proc)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Executes the block in the context of the main IdentityMapper.
|
102
|
+
def self.with_identity_mapper(&proc)
|
103
|
+
if identity_mapper
|
104
|
+
yield identity_mapper
|
105
|
+
else
|
106
|
+
IdentityMapper.new do |im|
|
107
|
+
yield im
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Syncs the schema with the storage.
|
113
|
+
#--
|
114
|
+
# FIXME: this is clearly db specific. Move somewhere else.
|
115
|
+
def self.sync_schema(model_or_app, force=false, options={}) #:nodoc:
|
116
|
+
models = []
|
117
|
+
mod = const_get_full(model_or_app)
|
118
|
+
if (mod.is_a?(Module) && mod.include?(Spider::App))
|
119
|
+
mod.models.each { |m| models << m }
|
120
|
+
elsif (mod.subclass_of?(Spider::Model::BaseModel))
|
121
|
+
models << mod
|
122
|
+
end
|
123
|
+
storages = []
|
124
|
+
tables = []
|
125
|
+
models.each do |m|
|
126
|
+
unless (options[:no_sync])
|
127
|
+
Spider::Logger.debug("SYNCING #{m}")
|
128
|
+
m.mapper.sync_schema(force, options) if m.mapper.respond_to?(:sync_schema)
|
129
|
+
end
|
130
|
+
if (options[:drop_tables] && m.mapper.respond_to?(:schema))
|
131
|
+
storages << m.mapper.storage unless storages.include?(m.mapper.storage)
|
132
|
+
tables += m.mapper.schema.get_schemas.keys
|
133
|
+
end
|
134
|
+
end
|
135
|
+
if (options[:drop_tables])
|
136
|
+
dt = options[:drop_tables]
|
137
|
+
tables.flatten
|
138
|
+
storage_tables = {}
|
139
|
+
storages.each do |s|
|
140
|
+
s.list_tables.each do |t|
|
141
|
+
storage_tables[t] = s
|
142
|
+
end
|
143
|
+
end
|
144
|
+
tables_to_drop = []
|
145
|
+
storage_tables.each do |table_name, storage|
|
146
|
+
if !tables.include?(table_name) && (dt == true || table_name.index(dt) == 0)
|
147
|
+
tables_to_drop << table_name
|
148
|
+
end
|
149
|
+
end
|
150
|
+
raise Spider::Model::Mappers::SchemaSyncUnsafeConversion.new(tables_to_drop) unless tables_to_drop.empty?
|
151
|
+
tables_to_drop.each{ |t| storage.drop_table(t) }
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Load YAML data
|
156
|
+
def self.load_fixtures(file)
|
157
|
+
if (file =~ /\.([^\.]+)$/)
|
158
|
+
extension = $1
|
159
|
+
else
|
160
|
+
raise ArgumentError, "Can't determine type of fixtures file #{file}"
|
161
|
+
end
|
162
|
+
data = {}
|
163
|
+
case extension
|
164
|
+
when 'yml'
|
165
|
+
require 'yaml'
|
166
|
+
data = YAML.load_file(file)
|
167
|
+
end
|
168
|
+
# Ruby 1.9: steps are not needed with ordered hashes
|
169
|
+
data = [data] unless data.is_a?(Array)
|
170
|
+
data.each do |step|
|
171
|
+
step.each do |mod_name, mod_data|
|
172
|
+
mod = const_get_full(mod_name)
|
173
|
+
mod_data.each do |row|
|
174
|
+
obj = mod.new(row)
|
175
|
+
obj.insert
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Generic Model error.
|
182
|
+
|
183
|
+
class ModelException < RuntimeError
|
184
|
+
end
|
185
|
+
|
186
|
+
# Error raised when data can't be accepted.
|
187
|
+
|
188
|
+
class FormatError < ::FormatError
|
189
|
+
attr_reader :element, :value
|
190
|
+
|
191
|
+
# Takes an Element, the value, and a message.
|
192
|
+
# The message should be a format specification; it will be %'d with the value.
|
193
|
+
# error = FormatError.new(my_element, 3, "Element value %s is wrong.")
|
194
|
+
# error.to_s => "Element value 3 is wrong."
|
195
|
+
def initialize(element, value, message)
|
196
|
+
@element = element
|
197
|
+
@message = message
|
198
|
+
@value = value
|
199
|
+
super(message)
|
200
|
+
end
|
201
|
+
|
202
|
+
|
203
|
+
def to_s
|
204
|
+
@message % @value
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
|
212
|
+
end
|
213
|
+
|
214
|
+
require 'spiderfw/model/base_model'
|
215
|
+
require 'spiderfw/model/mixins/mixins'
|
216
|
+
require 'spiderfw/model/extended_models/managed'
|
217
|
+
require 'spiderfw/model/inline_model'
|
218
|
+
require 'spiderfw/model/storage'
|
219
|
+
require 'spiderfw/model/request'
|
220
|
+
require 'spiderfw/model/condition'
|
221
|
+
require 'spiderfw/model/query'
|
222
|
+
require 'spiderfw/model/query_set'
|
223
|
+
require 'spiderfw/model/unit_of_work'
|
224
|
+
require 'spiderfw/model/proxy_model'
|
225
|
+
require 'spiderfw/model/mixins/tree'
|
226
|
+
require 'spiderfw/model/mixins/list'
|