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,926 @@
|
|
1
|
+
module Spider; module Model
|
2
|
+
|
3
|
+
# The Mapper connects a BaseModel to a Storage; it fetches data from the Storage and converts it to objects,
|
4
|
+
# and vice versa.
|
5
|
+
# It is not usually called directly; the BaseModel provides methods for interacting with the mapper.
|
6
|
+
# Its methods may be overridden with BaseModel#with_mapper, though.
|
7
|
+
|
8
|
+
class Mapper
|
9
|
+
attr_reader :model
|
10
|
+
attr_accessor :storage
|
11
|
+
# Mapper type (:db, :hash, etc.)
|
12
|
+
attr_reader :type
|
13
|
+
|
14
|
+
# Returns whether this Mapper can write to the storage.
|
15
|
+
def self.write?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
# Takes a BaseModel class and a storage instance.
|
20
|
+
def initialize(model, storage)
|
21
|
+
@model = model
|
22
|
+
@storage = storage
|
23
|
+
@raw_data = {}
|
24
|
+
@options = {}
|
25
|
+
@no_map_elements = {}
|
26
|
+
@sequences = []
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
# Configuration methods
|
31
|
+
|
32
|
+
# Sets that the given elements will not be processed.
|
33
|
+
def no_map(*els)
|
34
|
+
els.each{ |el| @no_map_elements[el] = true }
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns whether the given element can be handled by the mapper.
|
38
|
+
def mapped?(element)
|
39
|
+
element = element.name if (element.is_a? Element)
|
40
|
+
element = @model.elements[element]
|
41
|
+
return false if (element.attributes[:unmapped])
|
42
|
+
return false if (element.attributes[:computed_from])
|
43
|
+
return false if @no_map_elements[element.name]
|
44
|
+
return true
|
45
|
+
end
|
46
|
+
|
47
|
+
# Utility methods
|
48
|
+
|
49
|
+
# An array of mapped elements.
|
50
|
+
def map_elements # :nodoc:
|
51
|
+
@model.elements_array.select{ |el| !@no_map_elements[el.name] }
|
52
|
+
end
|
53
|
+
|
54
|
+
# Calls the given action. Used by UnitOfWork tasks.
|
55
|
+
def execute_action(action, object) # :nodoc:
|
56
|
+
case action
|
57
|
+
when :save
|
58
|
+
save(object)
|
59
|
+
when :keys
|
60
|
+
# do nothing; keys will be set by save
|
61
|
+
else
|
62
|
+
raise MapperError, "#{action} action not implemented"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Converts hashes and arrays to QuerySets and BaseModel instances.
|
67
|
+
def normalize(obj)
|
68
|
+
obj.no_autoload do
|
69
|
+
@model.elements.select{ |n, el|
|
70
|
+
mapped?(el) && el.model? && obj.element_has_value?(el)
|
71
|
+
}.each do |name, element|
|
72
|
+
val = obj.get(name)
|
73
|
+
next if (val.is_a?(BaseModel) || val.is_a?(QuerySet))
|
74
|
+
if (val.is_a? Array)
|
75
|
+
val.each_index { |i| val[i] = Spider::Model.get(element.model, val[i]) unless val[i].is_a?(BaseModel) || val.is_a?(QuerySet) }
|
76
|
+
obj.set(name, QuerySet.new(element.model, val))
|
77
|
+
else
|
78
|
+
val = Spider::Model.get(element.model, val)
|
79
|
+
obj.set(name, val)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
#############################################################
|
86
|
+
# Info #
|
87
|
+
#############################################################
|
88
|
+
|
89
|
+
# Returns true if information to find the given element is accessible to the mapper.
|
90
|
+
# (see for example DbMapper#have_references?)
|
91
|
+
def have_references?(element)
|
92
|
+
raise MapperError, "Unimplemented"
|
93
|
+
end
|
94
|
+
|
95
|
+
# Returns true if information to find the given element is accessible to the mapper, or to an integrated model's mapper.
|
96
|
+
# (see for example DbMapper#someone_have_references?)
|
97
|
+
def someone_have_references?(element)
|
98
|
+
raise MapperError, "Unimplemented"
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
##############################################################
|
103
|
+
# Save (insert and update) #
|
104
|
+
##############################################################
|
105
|
+
|
106
|
+
# This method is called before a save operation, normalizing and preparing the object.
|
107
|
+
# 'mode' can be :insert or :update.
|
108
|
+
# This method is well suited for being overridden, to add custom preprocessing of the object; just
|
109
|
+
# remember to call #super, or use #before_insert and #before_update instead.
|
110
|
+
def before_save(obj, mode)
|
111
|
+
normalize(obj)
|
112
|
+
if (mode == :insert)
|
113
|
+
before_insert(obj)
|
114
|
+
elsif (mode == :update)
|
115
|
+
before_update(obj)
|
116
|
+
end
|
117
|
+
@model.elements_array.each do |el|
|
118
|
+
if (el.attributes[:set_before_save])
|
119
|
+
set_data = el.attributes[:set_before_save]
|
120
|
+
if (el.model? && set_data.is_a?(Hash))
|
121
|
+
if (obj.element_has_value?(el))
|
122
|
+
set_data.each{ |k, v| obj.get(el).set(k, v) }
|
123
|
+
else
|
124
|
+
obj.set(el, el.model.new(set_data))
|
125
|
+
end
|
126
|
+
else
|
127
|
+
obj.set(el, set_data)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
raise RequiredError.new(el) if (el.required? && obj.element_modified?(el) && !obj.element_has_value?(el))
|
131
|
+
if (el.unique? && !el.integrated? && obj.element_modified?(el))
|
132
|
+
existent = @model.where(el.name => obj.get(el))
|
133
|
+
if (mode == :insert && existent.length > 0) || (mode == :update && existent.length > 1)
|
134
|
+
raise NotUniqueError.new(el)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
if (@model.extended_models)
|
139
|
+
@model.extended_models.each do |m, el|
|
140
|
+
obj.instantiate_element(el) unless obj.get(el)
|
141
|
+
unless sub = obj.get(el)
|
142
|
+
raise "Object #{obj} is missing its superclass object for model #{m} (element #{el.name})"
|
143
|
+
end
|
144
|
+
sub.save if (obj.element_modified?(el) || !obj.primary_keys_set?) && sub.mapper.class.write?
|
145
|
+
end
|
146
|
+
end
|
147
|
+
@model.elements_array.select{ |el| el.attributes[:integrated_model] }.each do |el|
|
148
|
+
sub_obj = obj.get(el)
|
149
|
+
sub_obj.save if sub_obj && sub_obj.modified? && obj.element_modified?(el) && obj.get(el).mapper.class.write?
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Hook to provide custom preprocessing. The default implementation does nothing.
|
154
|
+
def before_insert(obj)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Hook to provide custom preprocessing. The default implementation does nothing.
|
158
|
+
def before_update(obj)
|
159
|
+
end
|
160
|
+
|
161
|
+
# Hook to provide custom preprocessing. Will be passed a QuerySet. The default implementation does nothing.
|
162
|
+
def before_delete(objects)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Called after a succesful save. 'mode' can be :insert or :update.
|
166
|
+
def after_save(obj, mode)
|
167
|
+
obj.reset_modified_elements
|
168
|
+
save_associations(obj, mode)
|
169
|
+
|
170
|
+
end
|
171
|
+
|
172
|
+
# Hook called after a succesful save: the object is not in save mode.
|
173
|
+
def save_done(obj, mode)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Hook to provide custom preprocessing. Will be passed a QuerySet. The default implementation does nothing.
|
177
|
+
def after_delete(objects)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Saves the object to the storage.
|
181
|
+
def save(obj, request=nil)
|
182
|
+
prev_autoload = obj.autoload?
|
183
|
+
obj.save_mode
|
184
|
+
storage.in_transaction
|
185
|
+
if (@model.extended_models && !@model.extended_models.empty?)
|
186
|
+
is_insert = false
|
187
|
+
# Load local primary keys if they exist
|
188
|
+
# FIXME: load without cloning?
|
189
|
+
check_obj = obj.clone
|
190
|
+
@model.elements_array.select{ |el| el.attributes[:local_pk] }.each do |local_pk|
|
191
|
+
check_obj.get(local_pk)
|
192
|
+
end
|
193
|
+
@model.elements_array.select{ |el| el.attributes[:local_pk]}.each do |local_pk|
|
194
|
+
if (!check_obj.element_has_value?(local_pk))
|
195
|
+
is_insert = true
|
196
|
+
break
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
save_mode = (!is_insert && obj.primary_keys_set?) ? :update : :insert
|
201
|
+
before_save(obj, save_mode)
|
202
|
+
# @model.elements_array.select{ |el| el.attributes[:integrated_model] }.each do |el|
|
203
|
+
# obj.get(el).save if obj.element_modified?(el)
|
204
|
+
# end
|
205
|
+
if (save_mode == :update)
|
206
|
+
do_update(obj)
|
207
|
+
else
|
208
|
+
do_insert(obj)
|
209
|
+
end
|
210
|
+
after_save(obj, save_mode)
|
211
|
+
storage.commit_or_continue
|
212
|
+
obj.autoload = prev_autoload
|
213
|
+
unless @doing_save_done
|
214
|
+
@doing_save_done = true
|
215
|
+
save_done(obj, save_mode)
|
216
|
+
end
|
217
|
+
@doing_save_done = false
|
218
|
+
end
|
219
|
+
|
220
|
+
# Elements that are associated to this one externally.
|
221
|
+
def association_elements
|
222
|
+
@model.elements_array.select{ |el| mapped?(el) && !el.integrated? && !have_references?(el) }
|
223
|
+
end
|
224
|
+
|
225
|
+
# Saves object associations.
|
226
|
+
def save_associations(obj, mode)
|
227
|
+
association_elements.select{ |el| obj.element_has_value?(el) }.each do |el|
|
228
|
+
save_element_associations(obj, el, mode)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
# Deletes all associations from the given object to the element.
|
233
|
+
def delete_element_associations(obj, element, associated=nil)
|
234
|
+
if (element.attributes[:junction])
|
235
|
+
condition = {element.attributes[:reverse] => obj.primary_keys}
|
236
|
+
condition[element.attributes[:junction_their_element]] = associated if associated
|
237
|
+
element.mapper.delete(condition)
|
238
|
+
else
|
239
|
+
if (element.multiple?)
|
240
|
+
condition = Condition.and
|
241
|
+
if (associated)
|
242
|
+
condition = associated.keys_to_condition
|
243
|
+
else
|
244
|
+
condition[element.reverse] = obj
|
245
|
+
end
|
246
|
+
# associated.each do |child|
|
247
|
+
# condition_row = Condition.or
|
248
|
+
# element.model.primary_keys.each{ |el| condition_row.set(el.name, '<>', child.get(el))}
|
249
|
+
# condition << condition_row
|
250
|
+
# end
|
251
|
+
if (element.owned?)
|
252
|
+
element.mapper.delete(condition)
|
253
|
+
else
|
254
|
+
element.mapper.bulk_update({element.reverse => nil}, condition)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# Saves the associations from the given object to the element.
|
261
|
+
def save_element_associations(obj, element, mode)
|
262
|
+
our_element = element.attributes[:reverse]
|
263
|
+
val = obj.get(element)
|
264
|
+
if (element.attributes[:junction])
|
265
|
+
their_element = element.attributes[:junction_their_element]
|
266
|
+
if (val.model != element.model) # dereferenced junction
|
267
|
+
unless (mode == :insert)
|
268
|
+
current = obj.get_new
|
269
|
+
current_val = current.get(element)
|
270
|
+
condition = Condition.and
|
271
|
+
current_val.each do |row|
|
272
|
+
next if val.include?(row)
|
273
|
+
condition_row = Condition.or
|
274
|
+
condition_row[their_element] = row
|
275
|
+
condition << condition_row
|
276
|
+
end
|
277
|
+
unless condition.empty?
|
278
|
+
condition[our_element] = obj
|
279
|
+
element.model.mapper.delete(condition)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
val.each do |row|
|
283
|
+
next if current_val && current_val.include?(row)
|
284
|
+
junction = element.model.new({ our_element => obj, their_element => row })
|
285
|
+
junction.insert
|
286
|
+
end
|
287
|
+
else
|
288
|
+
unless mode == :insert
|
289
|
+
condition = Condition.and
|
290
|
+
condition[our_element] = obj
|
291
|
+
raise "Can't save without a junction id" unless element.attributes[:junction_id]
|
292
|
+
val.each do |row|
|
293
|
+
next unless row_id = row.get(element.attributes[:junction_id])
|
294
|
+
condition.set(:id, '<>', row_id)
|
295
|
+
end
|
296
|
+
element.model.mapper.delete(condition)
|
297
|
+
end
|
298
|
+
val.set(our_element, obj)
|
299
|
+
val.save
|
300
|
+
end
|
301
|
+
else
|
302
|
+
if (element.multiple?)
|
303
|
+
condition = Condition.and
|
304
|
+
condition[our_element] = obj
|
305
|
+
val.each do |row|
|
306
|
+
condition_row = Condition.or
|
307
|
+
element.model.primary_keys.each{ |el| condition_row.set(el.name, '<>', row.get(el))}
|
308
|
+
condition << condition_row
|
309
|
+
end
|
310
|
+
if (element.owned?)
|
311
|
+
element.mapper.delete(condition)
|
312
|
+
else
|
313
|
+
element.mapper.bulk_update({our_element => nil}, condition)
|
314
|
+
end
|
315
|
+
end
|
316
|
+
val.set(our_element, obj)
|
317
|
+
val.save
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Saves the given object and all objects reachable from it.
|
322
|
+
def save_all(root)
|
323
|
+
uow = UnitOfWork.new
|
324
|
+
uow.add(root)
|
325
|
+
uow.run()
|
326
|
+
end
|
327
|
+
|
328
|
+
# Inserts the object in the storage.
|
329
|
+
def insert(obj)
|
330
|
+
prev_autoload = obj.save_mode()
|
331
|
+
storage.in_transaction
|
332
|
+
before_save(obj, :insert)
|
333
|
+
do_insert(obj)
|
334
|
+
after_save(obj, :insert)
|
335
|
+
storage.commit_or_continue
|
336
|
+
obj.autoload = prev_autoload
|
337
|
+
end
|
338
|
+
|
339
|
+
# Updates the object in the storage.
|
340
|
+
def update(obj)
|
341
|
+
prev_autoload = obj.save_mode()
|
342
|
+
storage.in_transaction
|
343
|
+
before_save(obj, :update)
|
344
|
+
do_update(obj)
|
345
|
+
after_save(obj, :update)
|
346
|
+
storage.commit_or_continue
|
347
|
+
obj.autoload = prev_autoload
|
348
|
+
end
|
349
|
+
|
350
|
+
# FIXME: remove?
|
351
|
+
def bulk_update(values, conditon) # :nodoc:
|
352
|
+
end
|
353
|
+
|
354
|
+
# Deletes an object, or objects according to a condition.
|
355
|
+
# Will not delete with null condition (i.e. all objects) unless force is true
|
356
|
+
def delete(obj_or_condition, force=false)
|
357
|
+
|
358
|
+
def prepare_delete_condition(obj)
|
359
|
+
condition = Condition.and
|
360
|
+
@model.primary_keys.each do |key|
|
361
|
+
condition[key.name] = map_condition_value(key.type, obj.get(key))
|
362
|
+
end
|
363
|
+
return condition
|
364
|
+
end
|
365
|
+
|
366
|
+
curr = nil
|
367
|
+
if (obj_or_condition.is_a?(BaseModel))
|
368
|
+
condition = prepare_delete_condition(obj_or_condition)
|
369
|
+
curr = QuerySet.new(@model, obj_or_condition)
|
370
|
+
elsif (obj_or_condition.is_a?(QuerySet))
|
371
|
+
qs = obj_or_condition
|
372
|
+
condition = Condition.or
|
373
|
+
qs.each{ |obj| condition << prepare_delete_condition(obj) }
|
374
|
+
else
|
375
|
+
condition = obj_or_condition.is_a?(Condition) ? obj_or_condition : Condition.new(obj_or_condition)
|
376
|
+
end
|
377
|
+
Spider::Logger.debug("Deleting with condition:")
|
378
|
+
Spider::Logger.debug(condition)
|
379
|
+
prepare_query_condition(condition)
|
380
|
+
cascade = @model.elements_array.select{ |el| !el.integrated? && el.attributes[:delete_cascade] }
|
381
|
+
assocs = association_elements.select do |el|
|
382
|
+
!storage.supports?(:delete_cascade) || !schema.cascade?(el.name) # TODO: implement
|
383
|
+
end
|
384
|
+
curr = @model.where(condition) unless curr
|
385
|
+
before_delete(curr)
|
386
|
+
vals = []
|
387
|
+
started_transaction = false
|
388
|
+
unless cascade.empty? && assocs.empty?
|
389
|
+
storage.in_transaction
|
390
|
+
started_transaction = true
|
391
|
+
curr.each do |curr_obj|
|
392
|
+
obj_vals = {}
|
393
|
+
cascade.each do |el|
|
394
|
+
obj_vals[el] = curr_obj.get(el)
|
395
|
+
end
|
396
|
+
vals << obj_vals
|
397
|
+
assocs.each do |el|
|
398
|
+
delete_element_associations(curr_obj, el)
|
399
|
+
end
|
400
|
+
end
|
401
|
+
end
|
402
|
+
do_delete(condition, force)
|
403
|
+
vals.each do |obj_vals|
|
404
|
+
obj_vals.each do |el, val|
|
405
|
+
el.model.mapper.delete(val)
|
406
|
+
end
|
407
|
+
end
|
408
|
+
after_delete(curr)
|
409
|
+
storage.commit_or_continue if started_transaction
|
410
|
+
end
|
411
|
+
|
412
|
+
# Deletes all objects from the storage.
|
413
|
+
def delete_all!
|
414
|
+
all = @model.all
|
415
|
+
#all.fetch_window = 100
|
416
|
+
delete(all, true)
|
417
|
+
end
|
418
|
+
|
419
|
+
# Actual interaction with the storage. May be implemented by subclasses.
|
420
|
+
def do_delete(obj, force=false)
|
421
|
+
raise MapperError, "Unimplemented"
|
422
|
+
end
|
423
|
+
|
424
|
+
# Actual interaction with the storage. May be implemented by subclasses.
|
425
|
+
def do_insert(obj)
|
426
|
+
raise MapperError, "Unimplemented"
|
427
|
+
end
|
428
|
+
|
429
|
+
# Actual interaction with the storage. May be implemented by subclasses.
|
430
|
+
def do_update(obj)
|
431
|
+
raise MapperError, "Unimplemented"
|
432
|
+
end
|
433
|
+
|
434
|
+
# Actual interaction with the storage. May be implemented by subclasses.
|
435
|
+
def lock(obj=nil, mode=:exclusive)
|
436
|
+
raise MapperError, "Unimplemented"
|
437
|
+
end
|
438
|
+
|
439
|
+
# Actual interaction with the storage. May be implemented by subclasses.
|
440
|
+
def sequence_next(name)
|
441
|
+
raise MapperError, "Unimplemented"
|
442
|
+
end
|
443
|
+
|
444
|
+
##############################################################
|
445
|
+
# Load (and find) #
|
446
|
+
##############################################################
|
447
|
+
|
448
|
+
# Loads an element. Other elements may be loaded as well, according to lazy groups.
|
449
|
+
def load_element(objects, element)
|
450
|
+
load(objects, Query.new(nil, [element.name]))
|
451
|
+
end
|
452
|
+
|
453
|
+
# Loads only the given element, ignoring lazy groups.
|
454
|
+
def load_element!(objects, element)
|
455
|
+
load(objects, Query.new(nil, [element.name]), :no_expand_request => true)
|
456
|
+
end
|
457
|
+
|
458
|
+
# Loads elements of given objects according to query.request.
|
459
|
+
def load(objects, query, options={})
|
460
|
+
objects = queryset_siblings(objects) unless objects.is_a?(QuerySet)
|
461
|
+
request = query.request
|
462
|
+
condition = Condition.or
|
463
|
+
objects.each_current do |obj|
|
464
|
+
condition << obj.keys_to_condition if obj.primary_keys_set?
|
465
|
+
end
|
466
|
+
return find(Query.new(condition, request), objects, options)
|
467
|
+
end
|
468
|
+
|
469
|
+
# Finds objects according to a query, merging the results into a query_set if given.
|
470
|
+
def find(query, query_set=nil, options={})
|
471
|
+
set = nil
|
472
|
+
Spider::Model.with_identity_mapper do |im|
|
473
|
+
# im.put(query_set)
|
474
|
+
# FIXME!!! probably need to update loaded elements, but it's extremely slow
|
475
|
+
query_set.update_loaded_elements if query_set
|
476
|
+
set = query_set || QuerySet.new(@model)
|
477
|
+
was_loaded = set.loaded
|
478
|
+
set.loaded = true
|
479
|
+
set.index_by(*@model.primary_keys)
|
480
|
+
set.last_query = query
|
481
|
+
if (query.request.with_superclass? && @model.superclass < BaseModel)
|
482
|
+
return find_with_superclass(query, set, options)
|
483
|
+
end
|
484
|
+
|
485
|
+
if (@model.attributes[:condition])
|
486
|
+
query.condition = Condition.and(query.condition, @model.attributes[:condition])
|
487
|
+
end
|
488
|
+
keys_loaded = true
|
489
|
+
@model.primary_keys.each do |key|
|
490
|
+
unless set.element_loaded?(key)
|
491
|
+
keys_loaded = false
|
492
|
+
break
|
493
|
+
end
|
494
|
+
end
|
495
|
+
do_fetch = true
|
496
|
+
if (keys_loaded)
|
497
|
+
do_fetch = false
|
498
|
+
query.request.each_key do |key|
|
499
|
+
if (have_references?(key))
|
500
|
+
do_fetch = true
|
501
|
+
break
|
502
|
+
end
|
503
|
+
end
|
504
|
+
end
|
505
|
+
if (do_fetch)
|
506
|
+
@model.primary_keys.each{ |key| query.request[key] = true}
|
507
|
+
expand_request(query.request, set) unless options[:no_expand_request]
|
508
|
+
query = prepare_query(query, query_set)
|
509
|
+
query.request.total_rows = true unless query.request.total_rows == false
|
510
|
+
result = fetch(query)
|
511
|
+
if !result || result.empty?
|
512
|
+
set.each_current do |obj|
|
513
|
+
query.request.keys.each do |element_name|
|
514
|
+
el = @model.elements[element_name]
|
515
|
+
next if el.integrated? || @model.extended_models[el.model]
|
516
|
+
obj.set_loaded_value(element_name, nil)
|
517
|
+
end
|
518
|
+
end
|
519
|
+
return set
|
520
|
+
end
|
521
|
+
set.total_rows = result.total_rows if (!was_loaded)
|
522
|
+
result.each do |row|
|
523
|
+
obj = map(query.request, row, @model) # set.model ?!?
|
524
|
+
next unless obj
|
525
|
+
merge_object(set, obj)
|
526
|
+
@raw_data[obj.object_id] = row
|
527
|
+
end
|
528
|
+
end
|
529
|
+
set = get_external(set, query)
|
530
|
+
# delay_put = true if (@model.primary_keys.select{ |k| @model.elements[k.name].integrated? }.length > 0)
|
531
|
+
|
532
|
+
|
533
|
+
# if (delay_put)
|
534
|
+
# set.no_autoload(false) do
|
535
|
+
# set.each_index do |i|
|
536
|
+
# set[i].primary_keys_set?
|
537
|
+
# set[i] = im.put(set[i], true)
|
538
|
+
# end
|
539
|
+
# end
|
540
|
+
# end
|
541
|
+
end
|
542
|
+
return set
|
543
|
+
end
|
544
|
+
|
545
|
+
|
546
|
+
def merge_object(set, obj) # :nodoc:
|
547
|
+
search = {}
|
548
|
+
@model.primary_keys.each{ |k| search[k.name] = obj.get(k.name) }
|
549
|
+
obj_res = set.find(search) # FIXME: find a better way
|
550
|
+
if (obj_res && obj_res[0])
|
551
|
+
obj_res[0].merge!(obj)
|
552
|
+
obj.loaded_elements.each{ |name, bool| set.element_loaded(name) }
|
553
|
+
else
|
554
|
+
set << obj
|
555
|
+
end
|
556
|
+
end
|
557
|
+
|
558
|
+
def find_with_superclass(query, set=nil, options={}) # :nodoc:
|
559
|
+
q = query.clone
|
560
|
+
polym_request = Request.new
|
561
|
+
polym_condition = Condition.new
|
562
|
+
query.request.keys.each do |el_name|
|
563
|
+
if (!@model.superclass.has_element?(el_name))
|
564
|
+
polym_request[el_name] = true
|
565
|
+
query.request.delete(el_name)
|
566
|
+
end
|
567
|
+
end
|
568
|
+
q.with_polymorph(@model, polym_request)
|
569
|
+
res = @model.superclass.mapper.find(q)
|
570
|
+
res.change_model(@model)
|
571
|
+
res.each do |obj|
|
572
|
+
merge_object(set, obj)
|
573
|
+
end
|
574
|
+
return set
|
575
|
+
end
|
576
|
+
|
577
|
+
# Does a count query on the storage for given condition
|
578
|
+
def count(condition)
|
579
|
+
query = Query.new(condition)
|
580
|
+
result = fetch(query)
|
581
|
+
return result.length
|
582
|
+
end
|
583
|
+
|
584
|
+
# Actual interaction with the storage. Should be implemented by subclasses.
|
585
|
+
def fetch(query)
|
586
|
+
raise MapperError, "Unimplemented"
|
587
|
+
end
|
588
|
+
|
589
|
+
|
590
|
+
# Transforms a Storage result into an object. Should be implemented by subclasses.
|
591
|
+
def map(request, result, obj)
|
592
|
+
raise MapperError, "Unimplemented"
|
593
|
+
end
|
594
|
+
|
595
|
+
# Loads external elements, according to query, and merges them into an object or a QuerySet
|
596
|
+
def get_external(objects, query)
|
597
|
+
objects = queryset_siblings(objects) unless objects.is_a?(QuerySet)
|
598
|
+
return objects if objects.length < 1
|
599
|
+
got_external = {}
|
600
|
+
get_integrated = {}
|
601
|
+
query.request.each_key do |element_name|
|
602
|
+
element = @model.elements[element_name]
|
603
|
+
next unless element && (mapped?(element) || element.attributes[:element_query])
|
604
|
+
next if objects.element_loaded?(element_name)
|
605
|
+
next unless element.reverse # FIXME
|
606
|
+
if element.integrated?
|
607
|
+
get_integrated[element.integrated_from] ||= Request.new
|
608
|
+
get_integrated[element.integrated_from][element.integrated_from_element] = query.request[element_name]
|
609
|
+
elsif element.model?
|
610
|
+
next if query.request[element_name] == true && someone_have_references?(element)
|
611
|
+
sub_query = Query.new
|
612
|
+
sub_query.request = ( query.request[element_name].class == Request ) ? query.request[element_name] : nil
|
613
|
+
sub_query.condition = element.attributes[:condition] if element.attributes[:condition]
|
614
|
+
got_external[element] = true
|
615
|
+
objects = get_external_element(element, sub_query, objects)
|
616
|
+
end
|
617
|
+
# no furter attempts to try; set as loaded
|
618
|
+
objects.element_loaded(element_name)
|
619
|
+
end
|
620
|
+
get_integrated.each do |integrated, request|
|
621
|
+
next if got_external[integrated]
|
622
|
+
next if objects.element_loaded?(integrated.name)
|
623
|
+
sub_query = Query.new(nil, request)
|
624
|
+
objects = get_external_element(integrated, sub_query, objects)
|
625
|
+
objects.element_loaded(integrated)
|
626
|
+
end
|
627
|
+
return objects
|
628
|
+
end
|
629
|
+
|
630
|
+
# Loads an external element, according to query, and merges the result into an object or QuerySet.
|
631
|
+
def get_external_element(element, query, objects)
|
632
|
+
Spider::Logger.debug("Getting external element #{element.name} for #{@model}")
|
633
|
+
return load_element(objects, element) if (have_references?(element))
|
634
|
+
return nil if objects.empty?
|
635
|
+
index_by = []
|
636
|
+
@model.primary_keys.each{ |key| index_by << :"#{element.attributes[:reverse]}.#{key.name}" }
|
637
|
+
result = objects.element_queryset(element).index_by(*index_by)
|
638
|
+
@model.primary_keys.each{ |key| result.request[key.name] = true }
|
639
|
+
result.request[element.attributes[:reverse]] = true
|
640
|
+
result.load
|
641
|
+
return associate_external(element, objects, result)
|
642
|
+
end
|
643
|
+
|
644
|
+
# Given the results of a query for an element, and a set of objects, associates
|
645
|
+
# the result with the corresponding objects.
|
646
|
+
def associate_external(element, objects, result)
|
647
|
+
# result.reindex
|
648
|
+
objects.element_loaded(element.name)
|
649
|
+
objects.each_current do |obj|
|
650
|
+
search_params = {}
|
651
|
+
@model.primary_keys.each do |key|
|
652
|
+
field = @schema.field(key.name)
|
653
|
+
search_params[:"#{element.attributes[:reverse]}.#{key.name}"] = obj.get(key)
|
654
|
+
end
|
655
|
+
sub_res = result.find(search_params)
|
656
|
+
sub_res.each do |sub_obj|
|
657
|
+
sub_obj.set_loaded_value(element.attributes[:reverse], obj)
|
658
|
+
end
|
659
|
+
sub_res = sub_res[0] if !element.multiple?
|
660
|
+
sub_res.loadable = false if sub_res.respond_to?(:loadable=)
|
661
|
+
obj.set_loaded_value(element, sub_res)
|
662
|
+
end
|
663
|
+
return objects
|
664
|
+
end
|
665
|
+
|
666
|
+
# Returns the siblings, if any, of the object, in its ancestor QuerySet.
|
667
|
+
def queryset_siblings(obj)
|
668
|
+
return QuerySet.new(@model, obj) unless obj._parent
|
669
|
+
orig_obj = obj
|
670
|
+
path = []
|
671
|
+
seen = {obj => true}
|
672
|
+
while (obj._parent && !seen[obj._parent])
|
673
|
+
path.unshift(obj._parent_element) if (obj._parent_element) # otherwise it's a query set
|
674
|
+
obj = obj._parent
|
675
|
+
seen[obj] = true
|
676
|
+
end
|
677
|
+
res = path.empty? ? obj : obj.all_children(path)
|
678
|
+
raise RuntimeError, "Broken object path" if (obj && !path.empty? && res.length < 1)
|
679
|
+
res = QuerySet.new(@model, res) unless res.is_a?(QuerySet)
|
680
|
+
return res
|
681
|
+
end
|
682
|
+
|
683
|
+
|
684
|
+
# Converts a value from the storage to a value for the object.
|
685
|
+
def map_back_value(type, value)
|
686
|
+
raise MapperError, "Unimplemented"
|
687
|
+
end
|
688
|
+
|
689
|
+
|
690
|
+
##############################################################
|
691
|
+
# Strategy #
|
692
|
+
##############################################################
|
693
|
+
|
694
|
+
def prepare_query(query, obj=nil)
|
695
|
+
if (query.request.polymorphs?)
|
696
|
+
conds = split_condition_polymorphs(query.condition, query.request.polymorphs.keys)
|
697
|
+
conds.each{ |polym, c| query.condition << c }
|
698
|
+
end
|
699
|
+
prepare_query_request(query.request, obj)
|
700
|
+
prepare_query_condition(query.condition)
|
701
|
+
return query
|
702
|
+
end
|
703
|
+
|
704
|
+
def split_condition_polymorphs(condition, polymorphs)
|
705
|
+
conditions = {}
|
706
|
+
return conditions if condition.polymorph && polymorphs.include?(condition.polymorph)
|
707
|
+
model = condition.polymorph ? condition.polymorph : @model
|
708
|
+
condition.each_with_comparison do |el, val, comp|
|
709
|
+
if (!model.has_element?(el))
|
710
|
+
polymorphs.each do |polym|
|
711
|
+
if (polym.has_element?(el))
|
712
|
+
conditions[polym] ||= Condition.new
|
713
|
+
conditions[polym].polymorph = polym
|
714
|
+
conditions[polym].set(el, comp, val)
|
715
|
+
condition.delete(el)
|
716
|
+
end
|
717
|
+
end
|
718
|
+
end
|
719
|
+
end
|
720
|
+
condition.subconditions.each do |sub|
|
721
|
+
res = split_condition_polymorphs(sub, polymorphs)
|
722
|
+
polymorphs.each do |polym|
|
723
|
+
next unless res[polym]
|
724
|
+
if (!conditions[polym])
|
725
|
+
conditions[polym] = res[polym]
|
726
|
+
else
|
727
|
+
conditions[polym] << res[polym]
|
728
|
+
end
|
729
|
+
end
|
730
|
+
end
|
731
|
+
return conditions
|
732
|
+
end
|
733
|
+
|
734
|
+
|
735
|
+
# Normalizes a request.
|
736
|
+
def prepare_query_request(request, obj=nil)
|
737
|
+
@model.primary_keys.each do |key|
|
738
|
+
request[key] = true
|
739
|
+
end
|
740
|
+
request.each do |k, v|
|
741
|
+
next unless element = @model.elements[k]
|
742
|
+
if (element.integrated?)
|
743
|
+
integrated_from = element.integrated_from
|
744
|
+
integrated_from_element = element.integrated_from_element
|
745
|
+
request.request("#{integrated_from.name}.#{integrated_from_element}")
|
746
|
+
end
|
747
|
+
end
|
748
|
+
end
|
749
|
+
|
750
|
+
# Adds lazy groups to request.
|
751
|
+
def expand_request(request, obj=nil)
|
752
|
+
lazy_groups = []
|
753
|
+
request.each do |k, v|
|
754
|
+
unless element = @model.elements[k]
|
755
|
+
request.delete(k)
|
756
|
+
next
|
757
|
+
end
|
758
|
+
grps = element.lazy_groups
|
759
|
+
lazy_groups += grps if grps
|
760
|
+
end
|
761
|
+
lazy_groups.uniq!
|
762
|
+
@model.elements.each do |name, element|
|
763
|
+
next if (obj && obj.element_loaded?(name))
|
764
|
+
if (element.lazy_groups && (lazy_groups - element.lazy_groups).length < lazy_groups.length)
|
765
|
+
if (element.attributes[:lazy_check_owner])
|
766
|
+
next unless have_references?(name)
|
767
|
+
end
|
768
|
+
request.request(name)
|
769
|
+
end
|
770
|
+
end
|
771
|
+
end
|
772
|
+
|
773
|
+
# Preprocessing of the condition
|
774
|
+
#--
|
775
|
+
# FIXME: better name, move somewhere else
|
776
|
+
def prepare_query_condition(condition)
|
777
|
+
model = condition.polymorph ? condition.polymorph : @model
|
778
|
+
condition.simplify
|
779
|
+
condition.each_with_comparison do |k, v, c|
|
780
|
+
raise MapperError, "Condition for nonexistent element #{k} on model #{model}" unless element = model.elements[k]
|
781
|
+
if (element.integrated?)
|
782
|
+
condition.delete(k)
|
783
|
+
integrated_from = element.integrated_from
|
784
|
+
integrated_from_element = element.integrated_from_element
|
785
|
+
condition.set("#{integrated_from.name}.#{integrated_from_element}", c, v)
|
786
|
+
elsif (element.junction? && !v.is_a?(BaseModel) && !v.is_a?(Hash)) # conditions on junction id don't make sense
|
787
|
+
condition.delete(k)
|
788
|
+
condition.set("#{k}.#{element.attributes[:junction_their_element]}", c, v)
|
789
|
+
end
|
790
|
+
if (element.type < Spider::DataType && !v.is_a?(element.type))
|
791
|
+
condition.delete(k)
|
792
|
+
condition.set(k, c, element.type.from_value(v))
|
793
|
+
elsif element.type == DateTime && v && !v.is_a?(Date)
|
794
|
+
condition.delete(k)
|
795
|
+
condition.set(k, c, DateTime.parse(v))
|
796
|
+
end
|
797
|
+
|
798
|
+
end
|
799
|
+
condition.subconditions.each do |sub|
|
800
|
+
prepare_query_condition(sub)
|
801
|
+
end
|
802
|
+
return condition
|
803
|
+
end
|
804
|
+
|
805
|
+
# Returns task dependecies for the UnitOfWork. May be implemented by subclasses.
|
806
|
+
def get_dependencies(obj, action)
|
807
|
+
return []
|
808
|
+
end
|
809
|
+
|
810
|
+
|
811
|
+
end
|
812
|
+
|
813
|
+
##############################################################
|
814
|
+
# MapperTask #
|
815
|
+
##############################################################
|
816
|
+
|
817
|
+
# The MapperTask is used by the UnitOfWork.
|
818
|
+
class MapperTask
|
819
|
+
attr_reader :dependencies, :object, :action
|
820
|
+
|
821
|
+
def initialize(object, action)
|
822
|
+
@object = object
|
823
|
+
@action = action
|
824
|
+
@dependencies = []
|
825
|
+
end
|
826
|
+
|
827
|
+
def <<(task)
|
828
|
+
@dependencies << task
|
829
|
+
end
|
830
|
+
|
831
|
+
def execute()
|
832
|
+
Spider::Logger.debug "Executing #{@action} on #{@object}"
|
833
|
+
@object.mapper.execute_action(@action, @object)
|
834
|
+
end
|
835
|
+
|
836
|
+
def eql?(task)
|
837
|
+
return false unless task.class == self.class
|
838
|
+
return false unless (task.object == self.object && task.action == self.action)
|
839
|
+
return true
|
840
|
+
end
|
841
|
+
|
842
|
+
def hash
|
843
|
+
return @object.hash + @action.hash
|
844
|
+
end
|
845
|
+
|
846
|
+
def ===(task)
|
847
|
+
return eql?(task)
|
848
|
+
end
|
849
|
+
|
850
|
+
# def to_s
|
851
|
+
# "#{@action} on #{@object} (#{object.class})\n"
|
852
|
+
# end
|
853
|
+
|
854
|
+
def inspect
|
855
|
+
if (@action && @object)
|
856
|
+
str = "#{@action} on #{@object} (#{object.class})\n"
|
857
|
+
if (@dependencies.length > 0)
|
858
|
+
str += "-dependencies:\n"
|
859
|
+
@dependencies.each do |dep|
|
860
|
+
str += "---#{dep.action} on #{dep.object}\n"
|
861
|
+
end
|
862
|
+
end
|
863
|
+
else
|
864
|
+
str = "Root Task"
|
865
|
+
end
|
866
|
+
return str
|
867
|
+
end
|
868
|
+
|
869
|
+
end
|
870
|
+
|
871
|
+
##############################################################
|
872
|
+
# Aggregates #
|
873
|
+
##############################################################
|
874
|
+
|
875
|
+
def max(element, condition=nil)
|
876
|
+
raise "Unimplemented"
|
877
|
+
end
|
878
|
+
|
879
|
+
|
880
|
+
##############################################################
|
881
|
+
# Exceptions #
|
882
|
+
##############################################################
|
883
|
+
|
884
|
+
# Generic Mapper error.
|
885
|
+
|
886
|
+
class MapperError < RuntimeError; end
|
887
|
+
|
888
|
+
# Generic Mapper error regarding an element.
|
889
|
+
|
890
|
+
class MapperElementError < MapperError
|
891
|
+
def initialize(element)
|
892
|
+
@element = element
|
893
|
+
end
|
894
|
+
def element
|
895
|
+
@element
|
896
|
+
end
|
897
|
+
def self.create_subclass(msg)
|
898
|
+
e = Class.new(self)
|
899
|
+
e.msg = msg
|
900
|
+
return e
|
901
|
+
end
|
902
|
+
def self.msg=(msg)
|
903
|
+
@msg = msg
|
904
|
+
end
|
905
|
+
def self.msg
|
906
|
+
@msg
|
907
|
+
end
|
908
|
+
def message
|
909
|
+
_(self.class.msg) % @element.label
|
910
|
+
end
|
911
|
+
def to_s
|
912
|
+
self.class.name.to_s + " " + message
|
913
|
+
end
|
914
|
+
end
|
915
|
+
|
916
|
+
# A required element has no value
|
917
|
+
|
918
|
+
RequiredError = MapperElementError.create_subclass(_("Element %s is required"))
|
919
|
+
|
920
|
+
# An uniqueness constraint has been violated.
|
921
|
+
|
922
|
+
NotUniqueError = MapperElementError.create_subclass(_("Another item with the same %s is already present"))
|
923
|
+
|
924
|
+
|
925
|
+
|
926
|
+
end; end
|