IOWA 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +14 -0
- data/README.md +23 -0
- data/RELEASE_NOTES +77 -0
- data/ToDo +21 -0
- data/components/CRUDList/CRUDList.html +13 -0
- data/components/CRUDList/CRUDList.iwa +136 -0
- data/components/Content/Content.html +0 -0
- data/components/Content/Content.iwa +143 -0
- data/components/Content/example/README +9 -0
- data/components/Content/example/cgi/iowa.cgi +10 -0
- data/components/Content/example/demo.rb +30 -0
- data/components/Content/example/doc/index.html +7 -0
- data/components/Content/example/iowa/Content.html +1 -0
- data/components/Content/example/iowa/Content.iwa +1 -0
- data/components/Content/example/iowa/Main.html +6 -0
- data/components/Content/example/iowa/Main.iwa +3 -0
- data/components/Content/example/iowa/_content/body +7 -0
- data/components/Content/example/iowa/_content/body2 +3 -0
- data/components/Content/example/iowa/_content/title +2 -0
- data/components/Content/example/iowa/app.cnf +8 -0
- data/components/Content/example/iowa/app.rb +8 -0
- data/components/Content/example/webrick.rb +38 -0
- data/components/Include/Include.html +1 -0
- data/components/Include/Include.iwa +30 -0
- data/components/Include/readme +5 -0
- data/components/JumpTo/JumpTo.html +8 -0
- data/components/JumpTo/JumpTo.iwa +8 -0
- data/components/JumpTo/readme +6 -0
- data/doc/Architecture.txt +6 -0
- data/doc/History.txt +33 -0
- data/doc/StandardDispatcher.txt +19 -0
- data/examples/blog/README +1 -0
- data/examples/hello_world/README +17 -0
- data/examples/hello_world/htdocs/hello_world_html.html +24 -0
- data/examples/hello_world/htdocs/hello_world_ruby.html +41 -0
- data/examples/hello_world/iowa/HelloWorld.html +14 -0
- data/examples/hello_world/iowa/HelloWorld.iwa +31 -0
- data/examples/hello_world/iowa/Index.html +16 -0
- data/examples/hello_world/iowa/Index.iwa +5 -0
- data/examples/hello_world/iowa/iowa_hello_world.cnf +19 -0
- data/examples/hello_world/iowa/iowa_hello_world.rb +5 -0
- data/examples/hello_world/iowa/mapfile.cnf +6 -0
- data/examples/hw1/iowa/Main.html +1 -0
- data/examples/hw1/iowa/README +9 -0
- data/examples/hw1/iowa/hw.rb +4 -0
- data/examples/hw2/iowa/Main.html +10 -0
- data/examples/hw2/iowa/Main.iwa +7 -0
- data/examples/hw2/iowa/README +16 -0
- data/examples/hw2/iowa/hw.rb +4 -0
- data/examples/hw3/iowa/Main.html +11 -0
- data/examples/hw3/iowa/Main.iwa +7 -0
- data/examples/hw3/iowa/README +22 -0
- data/examples/hw3/iowa/hw.rb +4 -0
- data/examples/hw4/iowa/Greetings.html +10 -0
- data/examples/hw4/iowa/Greetings.iwa +9 -0
- data/examples/hw4/iowa/Main.html +12 -0
- data/examples/hw4/iowa/Main.iwa +10 -0
- data/examples/hw4/iowa/README +28 -0
- data/examples/hw4/iowa/hw.rb +4 -0
- data/examples/hw5/iowa/Footer.html +2 -0
- data/examples/hw5/iowa/Greetings.html +4 -0
- data/examples/hw5/iowa/Greetings.iwa +12 -0
- data/examples/hw5/iowa/Header.html +6 -0
- data/examples/hw5/iowa/Main.html +12 -0
- data/examples/hw5/iowa/Main.iwa +13 -0
- data/examples/hw5/iowa/README +16 -0
- data/examples/hw5/iowa/hw.rb +4 -0
- data/examples/template_server/iowa/Content.iwa +121 -0
- data/examples/template_server/iowa/Content.view +0 -0
- data/examples/template_server/iowa/DBContentDispatcher.rb +112 -0
- data/examples/template_server/iowa/DBContentPage.html +3 -0
- data/examples/template_server/iowa/DBContentPage.iwa +85 -0
- data/examples/template_server/iowa/app.cnf +13 -0
- data/examples/template_server/iowa/app.rb +5 -0
- data/ext/Classifier/classifier.c +256 -0
- data/ext/Classifier/ext_help.h +14 -0
- data/ext/Classifier/extconf.rb +5 -0
- data/ext/Classifier/tst.h +40 -0
- data/ext/Classifier/tst_cleanup.c +24 -0
- data/ext/Classifier/tst_delete.c +146 -0
- data/ext/Classifier/tst_grow_node_free_list.c +38 -0
- data/ext/Classifier/tst_init.c +41 -0
- data/ext/Classifier/tst_insert.c +192 -0
- data/ext/Classifier/tst_search.c +68 -0
- data/ext/http11/README +11 -0
- data/ext/http11/ext_help.h +15 -0
- data/ext/http11/extconf.rb +5 -0
- data/ext/http11/http11.c +534 -0
- data/ext/http11/http11.c.dif +422 -0
- data/ext/http11/http11_parser.c +1243 -0
- data/ext/http11/http11_parser.c.dif +193 -0
- data/ext/http11/http11_parser.h +49 -0
- data/ext/http11/http11_parser.h.dif +20 -0
- data/ext/http11/http11_parser.rl +192 -0
- data/ext/httpmachine/Makefile +149 -0
- data/ext/httpmachine/extconf.rb +33 -0
- data/ext/httpmachine/http.cpp +430 -0
- data/ext/httpmachine/http.h +156 -0
- data/ext/httpmachine/rubyhttp.cpp +165 -0
- data/external/mime-types/LICENCE +18 -0
- data/external/mime-types/README +46 -0
- data/external/mime-types/doc/classes/MIME.html +120 -0
- data/external/mime-types/doc/classes/MIME/InvalidContentType.html +119 -0
- data/external/mime-types/doc/classes/MIME/Type.html +866 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000010.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000011.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000012.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000013.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000014.html +26 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000015.html +33 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000016.html +27 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000017.html +35 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000018.html +34 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000019.html +24 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000020.html +38 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000021.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000022.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000023.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000024.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000025.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000026.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000027.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000028.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000029.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000030.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000031.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.html +459 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000001.html +19 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000002.html +32 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000003.html +21 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000004.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000005.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000006.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000007.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000008.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000009.html +18 -0
- data/external/mime-types/doc/created.rid +1 -0
- data/external/mime-types/doc/files/ChangeLog.html +320 -0
- data/external/mime-types/doc/files/README.html +145 -0
- data/external/mime-types/doc/files/lib/mime/types_rb.html +101 -0
- data/external/mime-types/doc/fr_class_index.html +30 -0
- data/external/mime-types/doc/fr_file_index.html +29 -0
- data/external/mime-types/doc/fr_method_index.html +57 -0
- data/external/mime-types/doc/index.html +24 -0
- data/external/mime-types/doc/rdoc-style.css +208 -0
- data/external/mime-types/lib/mime/types.rb +1558 -0
- data/external/package.rb +672 -0
- data/external/test_support.rb +95 -0
- data/external/tmail/README +7 -0
- data/external/tmail/tmail.rb +4 -0
- data/external/tmail/tmail/address.rb +222 -0
- data/external/tmail/tmail/base64.rb +52 -0
- data/external/tmail/tmail/compat.rb +39 -0
- data/external/tmail/tmail/config.rb +50 -0
- data/external/tmail/tmail/encode.rb +447 -0
- data/external/tmail/tmail/header.rb +895 -0
- data/external/tmail/tmail/info.rb +14 -0
- data/external/tmail/tmail/loader.rb +1 -0
- data/external/tmail/tmail/mail.rb +869 -0
- data/external/tmail/tmail/mailbox.rb +386 -0
- data/external/tmail/tmail/mbox.rb +1 -0
- data/external/tmail/tmail/net.rb +260 -0
- data/external/tmail/tmail/obsolete.rb +123 -0
- data/external/tmail/tmail/parser.rb +1475 -0
- data/external/tmail/tmail/parser.y +372 -0
- data/external/tmail/tmail/port.rb +356 -0
- data/external/tmail/tmail/scanner.rb +17 -0
- data/external/tmail/tmail/scanner_r.rb +243 -0
- data/external/tmail/tmail/stringio.rb +256 -0
- data/external/tmail/tmail/textutils.rb +197 -0
- data/external/tmail/tmail/tmail.rb +1 -0
- data/external/tmail/tmail/utils.rb +23 -0
- data/external/win32-process/README +133 -0
- data/external/win32-process/lib/win32/process.rb +561 -0
- data/external/windows-pr/README +145 -0
- data/external/windows-pr/doc/conversion_guide.txt +25 -0
- data/external/windows-pr/lib/windows/clipboard.rb +72 -0
- data/external/windows-pr/lib/windows/console.rb +323 -0
- data/external/windows-pr/lib/windows/device_io.rb +88 -0
- data/external/windows-pr/lib/windows/directory.rb +80 -0
- data/external/windows-pr/lib/windows/error.rb +313 -0
- data/external/windows-pr/lib/windows/eventlog.rb +120 -0
- data/external/windows-pr/lib/windows/file.rb +349 -0
- data/external/windows-pr/lib/windows/filesystem.rb +16 -0
- data/external/windows-pr/lib/windows/handle.rb +31 -0
- data/external/windows-pr/lib/windows/library.rb +76 -0
- data/external/windows-pr/lib/windows/limits.rb +13 -0
- data/external/windows-pr/lib/windows/memory.rb +117 -0
- data/external/windows-pr/lib/windows/msvcrt/buffer.rb +48 -0
- data/external/windows-pr/lib/windows/msvcrt/file.rb +18 -0
- data/external/windows-pr/lib/windows/msvcrt/string.rb +46 -0
- data/external/windows-pr/lib/windows/national.rb +557 -0
- data/external/windows-pr/lib/windows/path.rb +296 -0
- data/external/windows-pr/lib/windows/pipe.rb +77 -0
- data/external/windows-pr/lib/windows/process.rb +171 -0
- data/external/windows-pr/lib/windows/registry.rb +238 -0
- data/external/windows-pr/lib/windows/security.rb +89 -0
- data/external/windows-pr/lib/windows/service.rb +183 -0
- data/external/windows-pr/lib/windows/shell.rb +88 -0
- data/external/windows-pr/lib/windows/sound.rb +52 -0
- data/external/windows-pr/lib/windows/synchronize.rb +161 -0
- data/external/windows-pr/lib/windows/system_info.rb +70 -0
- data/external/windows-pr/lib/windows/unicode.rb +138 -0
- data/external/windows-pr/lib/windows/window.rb +22 -0
- data/iowa.gemspec +45 -0
- data/microprojects/DiskCache/LICENSE +28 -0
- data/microprojects/DiskCache/README +17 -0
- data/microprojects/DiskCache/external/package.rb +608 -0
- data/microprojects/DiskCache/external/test_support.rb +8 -0
- data/microprojects/DiskCache/setup.rb +22 -0
- data/microprojects/DiskCache/src/iowa/Association.rb +67 -0
- data/microprojects/DiskCache/src/iowa/Constants.rb +159 -0
- data/microprojects/DiskCache/src/iowa/DiskStore.rb +377 -0
- data/microprojects/DiskCache/src/iowa/Hash.rb +63 -0
- data/microprojects/DiskCache/src/iowa/Lockfile.rb +575 -0
- data/microprojects/DiskCache/src/iowa/Mutex.rb +142 -0
- data/microprojects/DiskCache/src/iowa/caches/DiskCache.rb +605 -0
- data/microprojects/DiskCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/DiskCache/test/TC_DiskCache.rb +218 -0
- data/microprojects/LRUCache/LICENSE +28 -0
- data/microprojects/LRUCache/README +13 -0
- data/microprojects/LRUCache/external/package.rb +608 -0
- data/microprojects/LRUCache/external/test_support.rb +8 -0
- data/microprojects/LRUCache/setup.rb +22 -0
- data/microprojects/LRUCache/src/iowa/Association.rb +57 -0
- data/microprojects/LRUCache/src/iowa/Constants.rb +159 -0
- data/microprojects/LRUCache/src/iowa/Hash.rb +63 -0
- data/microprojects/LRUCache/src/iowa/Mutex.rb +129 -0
- data/microprojects/LRUCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/LRUCache/test/TC_LRUCache.rb +65 -0
- data/microprojects/LinkedList/LICENSE +28 -0
- data/microprojects/LinkedList/README +13 -0
- data/microprojects/LinkedList/external/package.rb +608 -0
- data/microprojects/LinkedList/external/test_support.rb +8 -0
- data/microprojects/LinkedList/setup.rb +22 -0
- data/microprojects/LinkedList/src/iowa/LinkedList.rb +165 -0
- data/microprojects/LinkedList/test/TC_LinkedList.rb +42 -0
- data/microprojects/README +8 -0
- data/setup.rb +116 -0
- data/share/iowa/app_skeleton/Main.html +8 -0
- data/share/iowa/app_skeleton/Main.iwa +15 -0
- data/share/iowa/app_skeleton/app.cnf +48 -0
- data/share/iowa/app_skeleton/app.rb +58 -0
- data/share/iowa/app_skeleton/models/model.rb +49 -0
- data/src/ihc.rb +223 -0
- data/src/iowa.cgi +29 -0
- data/src/iowa.rb +637 -0
- data/src/iowa/AbstractCache.rb +96 -0
- data/src/iowa/AcceptLanguage.rb +76 -0
- data/src/iowa/Application.rb +928 -0
- data/src/iowa/ApplicationStats.rb +72 -0
- data/src/iowa/Association.rb +67 -0
- data/src/iowa/BindingsParser.rb +62 -0
- data/src/iowa/Breakpoint.rb +273 -0
- data/src/iowa/CSS.rb +564 -0
- data/src/iowa/Client.rb +192 -0
- data/src/iowa/Component.rb +405 -0
- data/src/iowa/ComponentProxy.rb +26 -0
- data/src/iowa/Config.rb +21 -0
- data/src/iowa/Constants.rb +226 -0
- data/src/iowa/Context.rb +218 -0
- data/src/iowa/ContextLogger.rb +16 -0
- data/src/iowa/DbPool.rb +222 -0
- data/src/iowa/DetachedComponent.rb +18 -0
- data/src/iowa/Dispatcher.rb +27 -0
- data/src/iowa/DynamicElements.rb +471 -0
- data/src/iowa/Element.rb +100 -0
- data/src/iowa/Email.rb +287 -0
- data/src/iowa/Extensions/AllExtensions.rb +4 -0
- data/src/iowa/Extensions/Class.rb +94 -0
- data/src/iowa/Extensions/Date.rb +88 -0
- data/src/iowa/Extensions/DateTime.rb +88 -0
- data/src/iowa/Extensions/Hash.rb +22 -0
- data/src/iowa/Extensions/Kernel.rb +6 -0
- data/src/iowa/Extensions/Numeric.rb +47 -0
- data/src/iowa/Extensions/Object.rb +11 -0
- data/src/iowa/Extensions/String.rb +60 -0
- data/src/iowa/Extensions/Time.rb +89 -0
- data/src/iowa/Extensions/TimeExtensions.rb +6 -0
- data/src/iowa/Form.rb +368 -0
- data/src/iowa/Hash.rb +85 -0
- data/src/iowa/ISAAC.rb +175 -0
- data/src/iowa/ImageSize.rb +279 -0
- data/src/iowa/IowaComponentMixins.rb +7 -0
- data/src/iowa/JSON-lexer.rb +296 -0
- data/src/iowa/JSON-objects.rb +201 -0
- data/src/iowa/KeyValueCoding.rb +91 -0
- data/src/iowa/LinkedList.rb +175 -0
- data/src/iowa/Loader.rb +22 -0
- data/src/iowa/Lockfile.rb +575 -0
- data/src/iowa/Logger.rb +74 -0
- data/src/iowa/Monkey.rb +20 -0
- data/src/iowa/Mutex.rb +142 -0
- data/src/iowa/Policy.rb +70 -0
- data/src/iowa/Pool.rb +243 -0
- data/src/iowa/PrettyException.rb +1091 -0
- data/src/iowa/Request.rb +244 -0
- data/src/iowa/Response.rb +133 -0
- data/src/iowa/Session.rb +354 -0
- data/src/iowa/SessionStats.rb +78 -0
- data/src/iowa/String.rb +65 -0
- data/src/iowa/Tag.rb +101 -0
- data/src/iowa/TemplateParser.rb +236 -0
- data/src/iowa/Util.rb +314 -0
- data/src/iowa/Webcache.rb +122 -0
- data/src/iowa/caches/BiLevelCache.rb +65 -0
- data/src/iowa/caches/ClassLimitedCache.rb +67 -0
- data/src/iowa/caches/DiskCache.rb +609 -0
- data/src/iowa/caches/DiskStore.rb +380 -0
- data/src/iowa/caches/LRUCache-alternative.rb +155 -0
- data/src/iowa/caches/LRUCache.rb +290 -0
- data/src/iowa/caches/SimpleLRUCache.rb +112 -0
- data/src/iowa/dispatchers/StandardDispatcher.rb +396 -0
- data/src/iowa/dispatchers/StandardDispatcherWithClassifier.rb +93 -0
- data/src/iowa/js/iowa_jsonrpc.js +381 -0
- data/src/iowa/js/jsonrpc.js +187 -0
- data/src/iowa/js/jsonrpc_async.js +261 -0
- data/src/iowa/loaders/DiskLoader.rb +50 -0
- data/src/iowa/loggers/Analogger.rb +54 -0
- data/src/iowa/loggers/AsyncLogger.rb +54 -0
- data/src/iowa/loggers/BitBucket.rb +38 -0
- data/src/iowa/loggers/Log4R.rb +13 -0
- data/src/iowa/loggers/Log4rLogger.rb +48 -0
- data/src/iowa/loggers/Logger.rb +29 -0
- data/src/iowa/loggers/RubyLogger.rb +9 -0
- data/src/iowa/pools/DBConnectionPool.rb +53 -0
- data/src/iowa/request/Apache.rb +90 -0
- data/src/iowa/request/EMHybrid.rb +59 -0
- data/src/iowa/request/ENV.rb +80 -0
- data/src/iowa/request/FCGI.rb +68 -0
- data/src/iowa/request/HTTPMachine.rb +75 -0
- data/src/iowa/request/Mongrel.rb +68 -0
- data/src/iowa/request/WEBrick.rb +48 -0
- data/src/iowa/version.rb +3 -0
- data/src/iowa/webrick/HTTPServer.rb +43 -0
- data/src/iowa/webrick/WEBrickServlet.rb +28 -0
- data/src/iowa_fcgi_handler.rb +101 -0
- data/src/iowa_httpmachine.rb +141 -0
- data/src/iowa_hybrid.rb +193 -0
- data/src/iowa_hybrid_cluster.rb +231 -0
- data/src/iowa_mongrel.rb +136 -0
- data/src/iowa_webrick.rb +194 -0
- data/src/iowa_webrick_legacy.rb +104 -0
- data/src/mod_iowa.rb +104 -0
- data/tcss.rb +61 -0
- data/test/README.windows +12 -0
- data/test/TC_AcceptLanguage.rb +61 -0
- data/test/TC_AppConfig.rb +43 -0
- data/test/TC_AppConfig/cgi/iowa.cgi +7 -0
- data/test/TC_AppConfig/doc/index.html +1 -0
- data/test/TC_AppConfig/iowa/Main.html +4 -0
- data/test/TC_AppConfig/iowa/Main.iwa +17 -0
- data/test/TC_AppConfig/iowa/README +1 -0
- data/test/TC_AppConfig/iowa/app.cnf +19 -0
- data/test/TC_AppConfig/iowa/app.rb +8 -0
- data/test/TC_AppConfig/webrick.rb +38 -0
- data/test/TC_Association.rb +29 -0
- data/test/TC_BiLevelCache.rb +71 -0
- data/test/TC_CGI_Adaptor.rb +55 -0
- data/test/TC_CGI_Adaptor/cgi/iowa.cgi +7 -0
- data/test/TC_CGI_Adaptor/doc/index.html +1 -0
- data/test/TC_CGI_Adaptor/iowa/Main.html +8 -0
- data/test/TC_CGI_Adaptor/iowa/Main.iwa +14 -0
- data/test/TC_CGI_Adaptor/iowa/README +1 -0
- data/test/TC_CGI_Adaptor/iowa/app.cnf +8 -0
- data/test/TC_CGI_Adaptor/iowa/app.rb +8 -0
- data/test/TC_CGI_Adaptor/webrick.rb +38 -0
- data/test/TC_CSS.rb +660 -0
- data/test/TC_ClassLimitedCache.rb +89 -0
- data/test/TC_Classifier.rb +80 -0
- data/test/TC_DbPool.rb +127 -0
- data/test/TC_DiskCache.rb +218 -0
- data/test/TC_Hybrid.rb +58 -0
- data/test/TC_Hybrid/doc/thing.txt +1 -0
- data/test/TC_Hybrid/iowa/Main.html +3 -0
- data/test/TC_Hybrid/iowa/Main.iwa +7 -0
- data/test/TC_Hybrid/iowa/NewPage.html +1 -0
- data/test/TC_Hybrid/iowa/NewPage.iwa +5 -0
- data/test/TC_Hybrid/iowa/app.cnf +10 -0
- data/test/TC_Hybrid/iowa/app.rb +5 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.html +1 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.iwa +1 -0
- data/test/TC_IOWAFunctions/doc/index.html +1 -0
- data/test/TC_IOWAFunctions/doc/js/dojo.js +9686 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.html +40 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.iwa +23 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.iwa +19 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.view +22 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.html +9 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.iwa +10 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.html +1 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.iwa +14 -0
- data/test/TC_IOWAFunctions/iowa/Main.html +1 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.html +12 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.iwa +24 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.iwa +7 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.view +1 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.iwa +31 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.view +9 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.iwa +32 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.view +11 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.iwa +44 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.view +18 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.html +1 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.iwa +5 -0
- data/test/TC_IOWAFunctions/iowa/app.cnf +19 -0
- data/test/TC_IOWAFunctions/iowa/app.rb +9 -0
- data/test/TC_IOWAFunctions/iowa/mapfile.cnf +8 -0
- data/test/TC_ISAAC.rb +52 -0
- data/test/TC_ImageSize.rb +84 -0
- data/test/TC_ImageSize/img.bmp +0 -0
- data/test/TC_ImageSize/img.gif +0 -0
- data/test/TC_ImageSize/img.jpg +0 -0
- data/test/TC_ImageSize/img.pcx +0 -0
- data/test/TC_ImageSize/img.pgm +7144 -0
- data/test/TC_ImageSize/img.png +0 -0
- data/test/TC_ImageSize/img.ppm +0 -0
- data/test/TC_ImageSize/img.psd +0 -0
- data/test/TC_ImageSize/img.tiff +0 -0
- data/test/TC_ImageSize/img.xbm +22 -0
- data/test/TC_KeyValueCoding.rb +35 -0
- data/test/TC_LRUCache.rb +296 -0
- data/test/TC_LinkedList.rb +46 -0
- data/test/TC_Lockfile.rb +106 -0
- data/test/TC_Minimal.rb +45 -0
- data/test/TC_Minimal/app.cnf +8 -0
- data/test/TC_Minimal/cgi-bin/iowa.cgi +11 -0
- data/test/TC_Minimal/doc/index.html +1 -0
- data/test/TC_Minimal/iowa/Main.html +1 -0
- data/test/TC_Minimal/iowa/README +1 -0
- data/test/TC_Minimal/iowa/app.rb +3 -0
- data/test/TC_Minimal/webrick.rb +38 -0
- data/test/TC_Mongrel.rb +58 -0
- data/test/TC_Mongrel/doc/thing.txt +1 -0
- data/test/TC_Mongrel/iowa/Main.html +3 -0
- data/test/TC_Mongrel/iowa/Main.iwa +7 -0
- data/test/TC_Mongrel/iowa/NewPage.html +1 -0
- data/test/TC_Mongrel/iowa/NewPage.iwa +5 -0
- data/test/TC_Mongrel/iowa/app.cnf +10 -0
- data/test/TC_Mongrel/iowa/app.rb +5 -0
- data/test/TC_NoSubclass.rb +56 -0
- data/test/TC_NoSubclass/cgi/iowa.cgi +7 -0
- data/test/TC_NoSubclass/doc/index.html +1 -0
- data/test/TC_NoSubclass/iowa/Main.html +8 -0
- data/test/TC_NoSubclass/iowa/Main.iwa +14 -0
- data/test/TC_NoSubclass/iowa/README +1 -0
- data/test/TC_NoSubclass/iowa/app.cnf +8 -0
- data/test/TC_NoSubclass/iowa/app.rb +5 -0
- data/test/TC_NoSubclass/webrick.rb +38 -0
- data/test/TC_Pool.rb +139 -0
- data/test/TC_RenderedCache/doc/thing.txt +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.html +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.iwa +12 -0
- data/test/TC_RenderedCache/iowa/Main.html +3 -0
- data/test/TC_RenderedCache/iowa/Main.iwa +7 -0
- data/test/TC_RenderedCache/iowa/NewPage.html +1 -0
- data/test/TC_RenderedCache/iowa/NewPage.iwa +11 -0
- data/test/TC_RenderedCache/iowa/app.cnf +13 -0
- data/test/TC_RenderedCache/iowa/app.rb +5 -0
- data/test/TC_RenderedCache/iowa/mapfile.map +4 -0
- data/test/TC_ResourceURL.rb +73 -0
- data/test/TC_ResourceURL/iowa/Main.html +2 -0
- data/test/TC_ResourceURL/iowa/Main.iwa +10 -0
- data/test/TC_ResourceURL/iowa/app.cnf +10 -0
- data/test/TC_ResourceURL/iowa/app.rb +5 -0
- data/test/TC_SimpleDetached.rb +41 -0
- data/test/TC_StandardDispatcher.rb +362 -0
- data/test/TC_StandardDispatcherWithClassifier.rb +358 -0
- data/test/TC_String.rb +24 -0
- data/test/TC_Tag.rb +41 -0
- data/test/TC_Webrick.rb +56 -0
- data/test/TC_Webrick/doc/thing.txt +1 -0
- data/test/TC_Webrick/iowa/Main.html +3 -0
- data/test/TC_Webrick/iowa/Main.iwa +7 -0
- data/test/TC_Webrick/iowa/NewPage.html +1 -0
- data/test/TC_Webrick/iowa/NewPage.iwa +5 -0
- data/test/TC_Webrick/iowa/app.cnf +10 -0
- data/test/TC_Webrick/iowa/app.rb +5 -0
- data/test/tc_template.rb +15 -0
- data/test/tests.conf +19 -0
- data/utils/CVS/Entries +3 -0
- data/utils/CVS/Repository +1 -0
- data/utils/CVS/Root +1 -0
- data/utils/QuickCert-1.0.2.tar.gz +0 -0
- data/utils/QuickCert-1.0.2/InstalledFiles +7 -0
- data/utils/QuickCert-1.0.2/MANIFEST +10 -0
- data/utils/QuickCert-1.0.2/Makefile +15 -0
- data/utils/QuickCert-1.0.2/README +56 -0
- data/utils/QuickCert-1.0.2/bin/QuickCert +355 -0
- data/utils/QuickCert-1.0.2/config.save +12 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/README +60 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_c.rb +26 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb +35 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/qc_config +21 -0
- data/utils/QuickCert-1.0.2/lib/QuickCert/defaults.rb +28 -0
- data/utils/QuickCert-1.0.2/setup.rb +1312 -0
- data/utils/iowa_apps +422 -0
- data/utils/smtp_sink.rb +9 -0
- data/utils/startup_template.cnf +27 -0
- data/utils/startup_template.rb +73 -0
- metadata +551 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 6e1a4cbacdd91f5aa3423245bcc0c213083a6bc9
|
|
4
|
+
data.tar.gz: 0c7123a789e8ef431dce5872dc6c1de328060c2c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a2b6f68212cb8f07e43edc3c8dab8298c5aab1ddc26b650b6f01b3949164cbc5c60a02a53c800b2d764af63e471ceaec302e97958150ba465acae82fd707f05b
|
|
7
|
+
data.tar.gz: 1acfedee6923bcdaec33767afff53ef0dbc7e2fba85bf7565672a8bf6daa10db7d589a9995fcdecc0754c46f805a968c50b8dafa9425c2f3a06ec4e5a0dcf205
|
data/CONTRIBUTORS
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
The following people have made code contributions to the development of Iowa.
|
|
2
|
+
|
|
3
|
+
* David Naseby <naseby@ihug.com.au>: Contributed an initial
|
|
4
|
+
implementation of both the webrick support and the inline content
|
|
5
|
+
generation code.
|
|
6
|
+
|
|
7
|
+
* Daniel Berger <djberge@qwest.com>: Daniel contributed a better
|
|
8
|
+
implementation of the Hash::downcase_keys method found in iowa.rb.
|
|
9
|
+
|
|
10
|
+
* Daniel Cremer
|
|
11
|
+
|
|
12
|
+
* Stefan Schmiedl <s@xss.de>: Numerous bugs found, and contributions
|
|
13
|
+
of the component navigation convenience methods, prodeed() and
|
|
14
|
+
proceed_with().
|
data/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# IOWA v1.0.0
|
|
2
|
+
|
|
3
|
+
## History
|
|
4
|
+
|
|
5
|
+
IOWA is a web development framework for Ruby. The name is an acronym for
|
|
6
|
+
Internet Objects for Web Applications. It started life in 2001 as a proof of
|
|
7
|
+
concept idea written by Avi Bryant. In 2002, it was taken over by Kirk Haines
|
|
8
|
+
and developed into a framework suitable for production application use. In the
|
|
9
|
+
intervening years, it is has been used on hundreds of production applications.
|
|
10
|
+
|
|
11
|
+
## What Is It?
|
|
12
|
+
|
|
13
|
+
IOWA is a web development framework that, while providing all of the typical
|
|
14
|
+
tools for request parsing, response generation, and separation of concerns
|
|
15
|
+
between views, controllers, and models, it also provides a facility for
|
|
16
|
+
simplifying the job of state management in an application by making it
|
|
17
|
+
transparent. Applications can set state during one request/response cycle, and
|
|
18
|
+
that state will still exist on the following request/response cycle.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Copyright 2002-2017 Kirk Haines
|
|
23
|
+
Copyright 2001, 2002 Avi Bryant
|
data/RELEASE_NOTES
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
0.99.2.19
|
|
2
|
+
|
|
3
|
+
* Numerous bug fixes, including a major one involving nested Repeats, and association
|
|
4
|
+
caching which wasn't accomodating the nested Repeats.
|
|
5
|
+
|
|
6
|
+
* CSS DSL first release. Implements CSS1, CSS2, CSS3.
|
|
7
|
+
|
|
8
|
+
0.99.2.17
|
|
9
|
+
|
|
10
|
+
* iowa_webrick.rb rejoins the world of the working.
|
|
11
|
+
|
|
12
|
+
* Misc bug fixes revealed by running a new site in production under 0.99.2.16.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
0.99.2.16
|
|
16
|
+
|
|
17
|
+
* More bug fixes.
|
|
18
|
+
|
|
19
|
+
* Better httpmachine support, but depends on the 0.0.6 monorail gem so far, so is EXPERIMENTAL.
|
|
20
|
+
Use the hybrid run mode to use EM (which offers great performance characteristics).
|
|
21
|
+
|
|
22
|
+
* File uploads are BROKEN. Will be fixed for 0.99.2.17
|
|
23
|
+
|
|
24
|
+
* All in all, much closer to stability again.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
0.99.2.14
|
|
28
|
+
|
|
29
|
+
* Okay, 0.99.2.9 was not the last release before 0.99.3.0.
|
|
30
|
+
|
|
31
|
+
* Numerous bug fixes.
|
|
32
|
+
|
|
33
|
+
* Mongrel integration working better.
|
|
34
|
+
|
|
35
|
+
* Hybrid EventMachine/Mongrel support working well.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
0.99.2.9
|
|
39
|
+
|
|
40
|
+
* The last release before 0.99.3.0.
|
|
41
|
+
|
|
42
|
+
* Mongrel support.
|
|
43
|
+
|
|
44
|
+
* EventMachine/HTTPMachine support.
|
|
45
|
+
|
|
46
|
+
* Testing/bug fixes. Install fixes.
|
|
47
|
+
|
|
48
|
+
* Much improved StandardDispatcher.
|
|
49
|
+
|
|
50
|
+
* A custom Mutex class that adds some capabilities and works around issues with the standard Mutex.
|
|
51
|
+
|
|
52
|
+
* A workaround for a Ruby memory leak with Hash.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
0.99.2.8
|
|
56
|
+
|
|
57
|
+
* Fixes more install problems with Win32 platforms.
|
|
58
|
+
|
|
59
|
+
* Bundled win32-process and windows-pr.
|
|
60
|
+
|
|
61
|
+
* Fixed a few misc bugs with iowa_root/root_path.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
0.99.2.7
|
|
65
|
+
|
|
66
|
+
* Fixes some install problems with Win32 platforms.
|
|
67
|
+
|
|
68
|
+
* Adds a simple hello world demo app.
|
|
69
|
+
|
|
70
|
+
* Fixes a few bugs between the new config structure and the webrick code.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
0.99.2.6
|
|
74
|
+
|
|
75
|
+
* Bug fix release. Had a dumb error in setup.rb and a bad little bug
|
|
76
|
+
related to persistence of old session/context information in
|
|
77
|
+
requests which should be looking at current information.
|
data/ToDo
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
* Expand the Policies available so that sessions can be tracked
|
|
2
|
+
via cookies, automatically.
|
|
3
|
+
* Improve the parsing of custom tags so that kludges like:
|
|
4
|
+
|
|
5
|
+
<PageHeader oid="pageHeader"/>
|
|
6
|
+
|
|
7
|
+
are not needed. Really, we shouldn't have to pass an oid
|
|
8
|
+
with an attribute if we aren't actually doing anything with it.
|
|
9
|
+
|
|
10
|
+
<PageHeader/>
|
|
11
|
+
|
|
12
|
+
would be great. This requires a much smarter TemplateParser.
|
|
13
|
+
* On this same note, improve the header so that it handles certain
|
|
14
|
+
kinds of nesting, such as
|
|
15
|
+
|
|
16
|
+
<!-- <PageHeader oid="pageHeader" /> -->
|
|
17
|
+
|
|
18
|
+
Or the use of CDATA sections that wrap IOWA tags. Right now
|
|
19
|
+
both of those cause the parser to get confused.
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<form oid="handleForm" class="IWACL">
|
|
2
|
+
<table class="IWACLtable" border="1">
|
|
3
|
+
<if oid="doHeader?"> <tr>
|
|
4
|
+
<if oid="doOpt1?"><th></th></if><repeat oid="header_list"><th>@column_header</th></repeat><if oid="doOpt2?"><th></th></if>
|
|
5
|
+
</tr></if>
|
|
6
|
+
<repeat oid="record_list"> <tr>
|
|
7
|
+
<if oid="doOpt1?"> <td><input type="submit" oid="do_opt1_button" value="<opt1_label>"></td></if>
|
|
8
|
+
<repeat oid="field_list"><td>@field</td></repeat>
|
|
9
|
+
<if oid="doOpt2?"> <td><input type="submit" oid="do_opt2_button" value="<opt2_label>"></td></if>
|
|
10
|
+
</tr>
|
|
11
|
+
</repeat>
|
|
12
|
+
</table>
|
|
13
|
+
</form>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
class CRUDList < Iowa::Component
|
|
2
|
+
#TODO:
|
|
3
|
+
# - Address the internal caching.
|
|
4
|
+
# - Address the butt-ugly method of manipulating appearance.
|
|
5
|
+
# - See what sort of helpers Iowa might be able to provide.
|
|
6
|
+
|
|
7
|
+
attr_binding :records, :order, :alias, :header, :opt1_button, :opt2_button
|
|
8
|
+
attr_accessor :column_header, :record, :field
|
|
9
|
+
|
|
10
|
+
def awake
|
|
11
|
+
@@cache ||= PageStore.new(initial_cache_size)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def initial_cache_size
|
|
15
|
+
30
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def setup
|
|
19
|
+
@record_order = []
|
|
20
|
+
if self.records.kind_of?(Array) and self.records.length > 0
|
|
21
|
+
if self.order
|
|
22
|
+
@record_order = self.order.collect {|r| r.to_s}
|
|
23
|
+
#elsif self.records.kind_of?(Array) and self.records[0].length > 0
|
|
24
|
+
else
|
|
25
|
+
self.records[0].class.all_fields.each do |f|
|
|
26
|
+
@record_order << f.name
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
key = ''
|
|
32
|
+
|
|
33
|
+
key << @record_order.join('|')
|
|
34
|
+
key << "_#{opt1_label}"
|
|
35
|
+
key << "_#{opt2_label}"
|
|
36
|
+
unless @@cache.include?(key)
|
|
37
|
+
my_content = content
|
|
38
|
+
@@cache[key] = TemplateParser.new(my_content,self.class.template.raw_bindings).root
|
|
39
|
+
end
|
|
40
|
+
@template = @@cache[key]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def opt1_label
|
|
44
|
+
if self.opt1_button and self.opt1_button.has_key?(:label)
|
|
45
|
+
self.opt1_button[:label].to_s
|
|
46
|
+
else
|
|
47
|
+
'Edit'
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def opt2_label
|
|
52
|
+
if self.opt2_button and self.opt2_button.has_key?(:label)
|
|
53
|
+
self.opt2_button[:label].to_s
|
|
54
|
+
else
|
|
55
|
+
'Delete'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def content
|
|
60
|
+
raw_template = self.class.template.raw_template
|
|
61
|
+
raw_template.sub(/<opt1_label>/,opt1_label).sub(/<opt2_label>/,opt2_label)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Override for special tasks.
|
|
65
|
+
def handleForm
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Override for special tasks.
|
|
69
|
+
def do_opt1_button(&block)
|
|
70
|
+
self.opt1_button[:proc].call(@record,block)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def do_opt2_button(&block)
|
|
74
|
+
self.opt2_button[:proc].call(@record,block)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def doHeader?
|
|
78
|
+
self.header
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def doOpt1?
|
|
82
|
+
self.opt1_button.kind_of?(Hash) and self.opt1_button[:proc] != nil
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def doOpt2?
|
|
86
|
+
self.opt2_button.kind_of?(Hash) and self.opt2_button[:proc] != nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def headers
|
|
90
|
+
@record_order.collect {|r|
|
|
91
|
+
n = r
|
|
92
|
+
if self.alias.respond_to?(:has_key?) and self.alias.has_key?(n.to_sym)
|
|
93
|
+
n = self.alias[n.to_sym].to_s
|
|
94
|
+
end
|
|
95
|
+
n.gsub(/\./,':')
|
|
96
|
+
}
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def records_list
|
|
100
|
+
self.records.kind_of?(Array) ? self.records : []
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def fields
|
|
104
|
+
r = []
|
|
105
|
+
@record_order.each do |f|
|
|
106
|
+
unless /\./.match(f)
|
|
107
|
+
r << @record.__send__(f)
|
|
108
|
+
else
|
|
109
|
+
keys = f.split('.')
|
|
110
|
+
last_key = keys.pop
|
|
111
|
+
current = @record
|
|
112
|
+
keys.each {|k| current = current.__send__(k)}
|
|
113
|
+
r << current.__send__(last_key)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
r
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
<?
|
|
122
|
+
header_list {
|
|
123
|
+
item = column_header
|
|
124
|
+
list = headers
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
record_list {
|
|
128
|
+
item = record
|
|
129
|
+
list = records_list
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
field_list {
|
|
133
|
+
item = field
|
|
134
|
+
list = fields
|
|
135
|
+
}
|
|
136
|
+
?>
|
|
File without changes
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
require 'thread'
|
|
2
|
+
class Content < Iowa::DetachedComponent
|
|
3
|
+
|
|
4
|
+
# This component displays no content of its own. Rather, it retrieves content
|
|
5
|
+
# from some content repository, called a library. The retrieveed content is
|
|
6
|
+
# treated like an IOWA template and is parsed with the TemplateParser.
|
|
7
|
+
# The parsed template is ccahed, and is used as the template for the component.
|
|
8
|
+
# Because the template content is parsed with the TemplateParser, that content
|
|
9
|
+
# may also have Content tags in it. There is no limit to the depth of embedding
|
|
10
|
+
# which will be traversed.
|
|
11
|
+
|
|
12
|
+
@mutex = Mutex.new
|
|
13
|
+
|
|
14
|
+
attr_accessor :content, :predecessors
|
|
15
|
+
|
|
16
|
+
def Content.default_cache_size; 100; end
|
|
17
|
+
def Content.default_cache_ttl; nil; end
|
|
18
|
+
|
|
19
|
+
class ConfObj_ < Hash
|
|
20
|
+
def library; @library; end
|
|
21
|
+
def library=(val); self[val] ||= {}; @library = val; end
|
|
22
|
+
|
|
23
|
+
def query; self[@library][:query]; end
|
|
24
|
+
def query=(val); self[@library][:query] = val; end
|
|
25
|
+
def retrieve; self[@library][:retrieve]; end
|
|
26
|
+
def retrieve=(val); self[@library][:retrieve] = val; end
|
|
27
|
+
|
|
28
|
+
def cache; self[@library][:cache]; end
|
|
29
|
+
def cache=(args)
|
|
30
|
+
#self[@library][:cache] = Util.get_cache(args,{Cmaxsize => Content.default_cache_size, Cttl => Content.default_cache_ttl})
|
|
31
|
+
self[@library][:cache] = Util.get_cache(args)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
@confobj = ConfObj_.new
|
|
36
|
+
|
|
37
|
+
# The Content component can serev content from multiple libraries
|
|
38
|
+
# at he same time. To set or reference a configuration item for
|
|
39
|
+
# a given library, pass it's name as an argument to Content.config.
|
|
40
|
+
# i.e. Content.config('generaldb').cache = Hash.new
|
|
41
|
+
#
|
|
42
|
+
def Content.config(library = C_default)
|
|
43
|
+
if block_given?
|
|
44
|
+
@mutex.synchronize do
|
|
45
|
+
begin
|
|
46
|
+
oldlib = @confobj.library
|
|
47
|
+
@confobj.library = library
|
|
48
|
+
yield @confobj
|
|
49
|
+
ensure
|
|
50
|
+
@confobj.library = oldlib
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
else
|
|
54
|
+
@confobj.library = library
|
|
55
|
+
@confobj
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Default cache is a basic LRUCache.
|
|
60
|
+
Content.config.cache = [:LRUCache, {:maxsize => 100}]
|
|
61
|
+
|
|
62
|
+
# Default query mechanism is flatfile based, looking in
|
|
63
|
+
# #{Iowa.app.root_path}/_content
|
|
64
|
+
Content.config.query = Proc.new do |name, attributes|
|
|
65
|
+
File.stat(File.join(Iowa.app.root_path,C_content,name)).mtime
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
Content.config.retrieve = Proc.new do |name, attributes|
|
|
69
|
+
r = {}
|
|
70
|
+
name.gsub!(/[\\\/]/,File::SEPARATOR)
|
|
71
|
+
filename = File.join(Iowa.app.root_path,C_content,name)
|
|
72
|
+
# Race condition here....
|
|
73
|
+
r[Cchecksum] = r[Clast_modification] = File.stat(filename).mtime
|
|
74
|
+
r[Clabel] = name
|
|
75
|
+
r[Ctitle],r[Cbody] =File.read(filename).split(/\n/,2)
|
|
76
|
+
r
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def initialize(*args)
|
|
80
|
+
super(*args)
|
|
81
|
+
@dataname = @bindings.has_key?('id') ? getBinding('id') : @name
|
|
82
|
+
@predecessors = {@dataname => true}
|
|
83
|
+
if @parent.respond_to?(:predecessors)
|
|
84
|
+
@predecessors.merge! @parent.predecessors
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def setup
|
|
89
|
+
parsed_template = nil
|
|
90
|
+
library = @attributes[Clibrary] || C_default
|
|
91
|
+
Content.config(library) do |content_config|
|
|
92
|
+
cache_entry = content_config.cache[@dataname]
|
|
93
|
+
|
|
94
|
+
if !cache_entry or (cache_entry and cache_entry[0] != content_config.query.call(@dataname, @attributes, session)) or session.context.request.params.has_key?(Crefresh) or @attributes[Crefresh] =~ /(true|enabled)/
|
|
95
|
+
|
|
96
|
+
cobj = content_config.retrieve.call(@dataname, @attributes, session)
|
|
97
|
+
my_content = generate_wrapped_content(cobj)
|
|
98
|
+
parsed_template = TemplateParser.new(my_content,{},self.class).root
|
|
99
|
+
content_config.cache[@dataname] = [cobj[Cchecksum], parsed_template]
|
|
100
|
+
else
|
|
101
|
+
parsed_template = cache_entry[1]
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# This prevents infinite loops.
|
|
106
|
+
if @parent.respond_to?(:predecessors) and @parent.predecessors[@dataname]
|
|
107
|
+
@template = TemplateParser.new(C_empty,{}).root
|
|
108
|
+
else
|
|
109
|
+
@template = parsed_template
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def generate_wrapped_content(content)
|
|
114
|
+
_container = true
|
|
115
|
+
_title = false
|
|
116
|
+
_content = true
|
|
117
|
+
_container = false if @attributes['showcontainer'] =~ /^\s*(disabled|0|false)\s*$/
|
|
118
|
+
_title = false if @attributes['showtitle'] =~ /^\s*(disabled|0|false)\s*$/
|
|
119
|
+
_content = false if @attributes['showcontent'] =~ /^\s*(disabled|0|false)\s*$/
|
|
120
|
+
r = ''
|
|
121
|
+
r << "<div class=\"#{@attributes['class']||container_ctnt}\">" if _container
|
|
122
|
+
r << "<div class=\"#{@attributes['titleclass']||title_ctnt}\">#{content[Ctitle]}</div>" if _title
|
|
123
|
+
r << "<div class=\"#{@attributes['contentclass']||content_ctnt}\">#{content[Cbody]}</div>" if _content
|
|
124
|
+
r << "</div>" if _container
|
|
125
|
+
r
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def container_ctnt
|
|
129
|
+
#"#{@dataname}_container_ctnt"
|
|
130
|
+
"container_ctnt"
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def title_ctnt
|
|
134
|
+
#"#{@dataname}_title_ctnt"
|
|
135
|
+
"title_ctnt"
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def content_ctnt
|
|
139
|
+
#"#{@dataname}_content_ctnt"
|
|
140
|
+
"content_ctnt"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
end
|