wee 0.10.0 → 2.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.
- data/README.rdoc +127 -0
- data/Rakefile +11 -32
- data/doc/rdoc/classes/Array.html +28 -24
- data/doc/rdoc/classes/Hash.html +28 -24
- data/doc/rdoc/classes/Object.html +37 -84
- data/doc/rdoc/classes/String.html +89 -21
- data/doc/rdoc/classes/Struct.html +32 -82
- data/doc/rdoc/classes/Wee.html +285 -86
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +111 -48
- data/doc/rdoc/classes/Wee/{Context.html → AnswerDecoration/Answer.html} +61 -51
- data/doc/rdoc/classes/Wee/Application.html +161 -322
- data/doc/rdoc/classes/Wee/Application/SessionCache.html +162 -0
- data/doc/rdoc/classes/Wee/Brush.html +147 -62
- data/doc/rdoc/classes/{Enumerable.html → Wee/Brush/ActionInputTag.html} +68 -41
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +150 -100
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +132 -46
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +63 -41
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +184 -78
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +48 -65
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +83 -37
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +334 -310
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +74 -54
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +64 -74
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +109 -86
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +205 -45
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +96 -34
- data/doc/rdoc/classes/Wee/Brush/Page.html +129 -67
- data/doc/rdoc/classes/Wee/{Utils/LRUCache.html → Brush/PasswordInputTag.html} +65 -38
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +132 -78
- data/doc/rdoc/classes/Wee/Brush/{RadioButtonTag/RadioGroup.html → RadioGroup.html} +91 -53
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +301 -127
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +59 -44
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +94 -57
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +181 -121
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +94 -32
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +257 -71
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/CallAnswerMixin.html +289 -0
- data/doc/rdoc/classes/Wee/CallbackMixin.html +233 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +179 -155
- data/doc/rdoc/classes/Wee/Callbacks.html +262 -0
- data/doc/rdoc/classes/Wee/Component.html +228 -779
- data/doc/rdoc/classes/Wee/Decoration.html +144 -159
- data/doc/rdoc/classes/Wee/DecorationMixin.html +340 -0
- data/doc/rdoc/classes/Wee/Delegate.html +119 -76
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +64 -47
- data/doc/rdoc/classes/Wee/ErrorResponse.html +59 -62
- data/doc/rdoc/classes/Wee/FormDecoration.html +51 -37
- data/doc/rdoc/classes/Wee/GenericResponse.html +60 -35
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +1000 -602
- data/doc/rdoc/classes/Wee/HtmlDocument.html +288 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +227 -126
- data/doc/rdoc/classes/Wee/IdGenerator.html +60 -31
- data/doc/rdoc/classes/Wee/IdGenerator/Secure.html +282 -0
- data/doc/rdoc/classes/Wee/{SimpleIdGenerator.html → IdGenerator/Sequential.html} +76 -49
- data/doc/rdoc/classes/Wee/JQuery.html +221 -0
- data/doc/rdoc/classes/Wee/LRUCache.html +514 -0
- data/doc/rdoc/classes/Wee/LRUCache/Item.html +158 -0
- data/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +187 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +88 -59
- data/doc/rdoc/classes/Wee/Presenter.html +124 -704
- data/doc/rdoc/classes/Wee/RedirectResponse.html +64 -33
- data/doc/rdoc/classes/Wee/RefreshResponse.html +59 -44
- data/doc/rdoc/classes/Wee/Renderer.html +234 -54
- data/doc/rdoc/classes/Wee/Request.html +151 -286
- data/doc/rdoc/classes/Wee/Response.html +29 -212
- data/doc/rdoc/classes/Wee/Session.html +585 -360
- data/doc/rdoc/classes/Wee/{StateHolder.html → Session/AbortCallbackProcessing.html} +67 -40
- data/doc/rdoc/classes/Wee/Session/MutexSerializer.html +166 -0
- data/doc/rdoc/classes/{Cache/Strategy/LFU/Item.html → Wee/Session/Page.html} +26 -27
- data/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +219 -0
- data/doc/rdoc/classes/Wee/State.html +307 -0
- data/doc/rdoc/classes/{Cache/Strategy/LRU/Item.html → Wee/State/Snapshot.html} +26 -27
- data/doc/rdoc/classes/{Cache/Strategy/Unbounded/Item.html → Wee/State/SnapshotIVars.html} +26 -27
- data/doc/rdoc/classes/Wee/StructSnapshotMixin.html +183 -0
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +101 -35
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README_rdoc.html +243 -0
- data/doc/rdoc/files/lib/wee/application_rb.html +22 -30
- data/doc/rdoc/files/lib/wee/{page_rb.html → call_answer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/callback_rb.html +12 -29
- data/doc/rdoc/files/lib/wee/component_rb.html +22 -27
- data/doc/rdoc/files/lib/wee/decoration_rb.html +19 -20
- data/doc/rdoc/files/lib/wee/{idgen_rb.html → html_brushes_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/html_canvas_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{abstractsession_rb.html → html_document_rb.html} +17 -25
- data/doc/rdoc/files/lib/wee/html_writer_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{webrick_rb.html → id_generator_rb.html} +19 -25
- data/doc/rdoc/files/lib/wee/{core/page_rb.html → jquery/jquery_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/{state_registry_rb.html → jquery_rb.html} +17 -27
- data/doc/rdoc/files/lib/{cache/cache_rb.html → wee/lru_cache_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/presenter_rb.html +12 -34
- data/doc/rdoc/files/lib/wee/{holder_rb.html → renderer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/request_rb.html +18 -32
- data/doc/rdoc/files/lib/wee/response_rb.html +17 -24
- data/doc/rdoc/files/lib/wee/session_rb.html +21 -23
- data/doc/rdoc/files/lib/wee/state_rb.html +90 -0
- data/doc/rdoc/files/lib/wee_rb.html +48 -40
- data/doc/rdoc/fr_class_index.html +111 -75
- data/doc/rdoc/fr_file_index.html +46 -76
- data/doc/rdoc/fr_method_index.html +473 -480
- data/doc/rdoc/index.html +6 -9
- data/doc/rdoc/rdoc-style.css +210 -119
- data/examples/ObjectSpaceBrowser.rb +33 -23
- data/examples/ajax.rb +71 -0
- data/examples/continuations.rb +28 -0
- data/examples/demo.rb +92 -36
- data/examples/demo/calculator.rb +63 -0
- data/examples/demo/calendar.rb +42 -55
- data/examples/demo/counter.rb +38 -0
- data/{lib/wee/examples → examples/demo}/editable_counter.rb +11 -6
- data/examples/demo/example.rb +28 -24
- data/examples/demo/file_upload.rb +19 -0
- data/{lib/wee/components → examples/demo}/messagebox.rb +3 -3
- data/examples/demo/radio.rb +33 -0
- data/{lib/wee/examples → examples/demo}/window.rb +15 -10
- data/examples/hw.rb +3 -4
- data/{lib/wee/components → examples}/pager.rb +14 -14
- data/lib/wee.rb +48 -25
- data/lib/wee/application.rb +69 -131
- data/lib/wee/call_answer.rb +118 -0
- data/lib/wee/callback.rb +88 -0
- data/lib/wee/component.rb +141 -0
- data/lib/wee/decoration.rb +242 -0
- data/lib/wee/html_brushes.rb +725 -0
- data/lib/wee/html_canvas.rb +241 -0
- data/lib/wee/html_document.rb +45 -0
- data/lib/wee/html_writer.rb +71 -0
- data/lib/wee/id_generator.rb +70 -0
- data/lib/wee/jquery.rb +1 -0
- data/lib/wee/jquery/jquery.rb +17 -0
- data/lib/wee/jquery/public/jquery-1.3.2.min.js +19 -0
- data/lib/wee/jquery/public/wee-jquery.js +19 -0
- data/lib/wee/lru_cache.rb +89 -0
- data/lib/wee/presenter.rb +43 -0
- data/lib/wee/renderer.rb +65 -0
- data/lib/wee/request.rb +37 -113
- data/lib/wee/response.rb +43 -70
- data/lib/wee/session.rb +304 -113
- data/lib/wee/state.rb +85 -0
- data/test/component_spec.rb +17 -0
- data/wee.gemspec +4 -3
- metadata +249 -452
- data/ChangeLog +0 -657
- data/INSTALL +0 -17
- data/README +0 -272
- data/TODO +0 -142
- data/benchmark/Centrino1300/result.2000.counter.action +0 -45
- data/benchmark/Centrino1300/result.2000.counter.render +0 -43
- data/benchmark/Centrino1300/result.2000.filehandler +0 -43
- data/benchmark/Centrino600/result.2000.counter.action +0 -47
- data/benchmark/Centrino600/result.2000.counter.render +0 -45
- data/benchmark/Centrino600/result.2000.filehandler +0 -43
- data/benchmark/Makefile +0 -53
- data/benchmark/counter.rb +0 -77
- data/benchmark/filehandler.rb +0 -6
- data/benchmark/report_req.rb +0 -12
- data/bin/wee +0 -100
- data/doc/rdoc/classes/ActionView.html +0 -107
- data/doc/rdoc/classes/ActionView/Base.html +0 -133
- data/doc/rdoc/classes/Cache.html +0 -126
- data/doc/rdoc/classes/Cache/StorageCache.html +0 -320
- data/doc/rdoc/classes/Cache/Strategy.html +0 -128
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +0 -269
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +0 -225
- data/doc/rdoc/classes/LiteralMethod.html +0 -196
- data/doc/rdoc/classes/Main.html +0 -289
- data/doc/rdoc/classes/OgApplication.html +0 -126
- data/doc/rdoc/classes/OgScaffolder.html +0 -827
- data/doc/rdoc/classes/OgScaffolder/Editor.html +0 -565
- data/doc/rdoc/classes/OgSession.html +0 -172
- data/doc/rdoc/classes/Recipe.html +0 -113
- data/doc/rdoc/classes/Wee/AbstractSession.html +0 -502
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/ActionMixin.html +0 -146
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +0 -154
- data/doc/rdoc/classes/Wee/Brush/AssignMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/CallbackMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +0 -158
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +0 -146
- data/doc/rdoc/classes/Wee/Callback.html +0 -231
- data/doc/rdoc/classes/Wee/CallbackStream.html +0 -227
- data/doc/rdoc/classes/Wee/Canvas.html +0 -235
- data/doc/rdoc/classes/Wee/CanvasMixin.html +0 -225
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +0 -153
- data/doc/rdoc/classes/Wee/ComponentDispatcher.html +0 -289
- data/doc/rdoc/classes/Wee/ComponentRunner.html +0 -321
- data/doc/rdoc/classes/Wee/ErrorPage.html +0 -175
- data/doc/rdoc/classes/Wee/Examples.html +0 -114
- data/doc/rdoc/classes/Wee/Examples/Calculator.html +0 -319
- data/doc/rdoc/classes/Wee/Examples/Counter.html +0 -289
- data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +0 -210
- data/doc/rdoc/classes/Wee/Examples/Window.html +0 -346
- data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +0 -227
- data/doc/rdoc/classes/Wee/Helper.html +0 -148
- data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +0 -1230
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +0 -198
- data/doc/rdoc/classes/Wee/LoginDecoration.html +0 -261
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +0 -181
- data/doc/rdoc/classes/Wee/MessageBox.html +0 -180
- data/doc/rdoc/classes/Wee/MethodCallback.html +0 -193
- data/doc/rdoc/classes/Wee/Nitro.html +0 -114
- data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +0 -345
- data/doc/rdoc/classes/Wee/Nitro/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +0 -178
- data/doc/rdoc/classes/Wee/Page.html +0 -115
- data/doc/rdoc/classes/Wee/PagelessApplication.html +0 -154
- data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +0 -296
- data/doc/rdoc/classes/Wee/PagelessRequest.html +0 -208
- data/doc/rdoc/classes/Wee/PagelessSession.html +0 -359
- data/doc/rdoc/classes/Wee/Pager.html +0 -534
- data/doc/rdoc/classes/Wee/Rails.html +0 -114
- data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +0 -342
- data/doc/rdoc/classes/Wee/Rails/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +0 -177
- data/doc/rdoc/classes/Wee/RenderingContext.html +0 -283
- data/doc/rdoc/classes/Wee/RequestHandler.html +0 -341
- data/doc/rdoc/classes/Wee/Snapshot.html +0 -211
- data/doc/rdoc/classes/Wee/StateRegistry.html +0 -434
- data/doc/rdoc/classes/Wee/StateRegistry/Snapshot.html +0 -320
- data/doc/rdoc/classes/Wee/StateRegistry/WithObject.html +0 -153
- data/doc/rdoc/classes/Wee/Utils.html +0 -300
- data/doc/rdoc/classes/Wee/ValueHolder.html +0 -220
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +0 -368
- data/doc/rdoc/files/INSTALL.html +0 -130
- data/doc/rdoc/files/README.html +0 -471
- data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/component_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/pager_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/continuation_rb.html +0 -116
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/core/component_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/core/componentrunner_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +0 -133
- data/doc/rdoc/files/lib/wee/core/idgen_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +0 -112
- data/doc/rdoc/files/lib/wee/core/renderer_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +0 -113
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core_rb.html +0 -124
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/examples/counter_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/examples/window_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +0 -109
- data/doc/rdoc/files/lib/wee/pageless_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/rendering/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/snapshot_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/stuff_rb.html +0 -144
- data/doc/rdoc/files/lib/wee/template_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils_rb.html +0 -110
- data/examples/ajax/ajax.js +0 -444
- data/examples/ajax/ajax.rb +0 -31
- data/examples/cc.rb +0 -74
- data/examples/dispatcher.rb +0 -37
- data/examples/draw.rb +0 -94
- data/examples/live-update.rb +0 -45
- data/examples/nitro/run.rb +0 -42
- data/examples/og-test.rb +0 -60
- data/examples/radio.rb +0 -44
- data/examples/test.rb +0 -39
- data/install.rb +0 -14
- data/lib/cache/cache.rb +0 -167
- data/lib/wee/abstractsession.rb +0 -96
- data/lib/wee/adaptors/fastcgi.rb +0 -76
- data/lib/wee/adaptors/nitro.rb +0 -155
- data/lib/wee/adaptors/rails.rb +0 -154
- data/lib/wee/adaptors/webrick.rb +0 -89
- data/lib/wee/components.rb +0 -7
- data/lib/wee/components/component_dispatcher.rb +0 -46
- data/lib/wee/components/form_decoration.rb +0 -7
- data/lib/wee/components/login_decoration.rb +0 -35
- data/lib/wee/components/page_decoration.rb +0 -14
- data/lib/wee/components/wrapper_decoration.rb +0 -7
- data/lib/wee/continuation.rb +0 -5
- data/lib/wee/continuation/core/component.rb +0 -56
- data/lib/wee/continuation/session.rb +0 -64
- data/lib/wee/core.rb +0 -16
- data/lib/wee/core/callback.rb +0 -121
- data/lib/wee/core/component.rb +0 -356
- data/lib/wee/core/componentrunner.rb +0 -73
- data/lib/wee/core/context.rb +0 -27
- data/lib/wee/core/decoration.rb +0 -138
- data/lib/wee/core/idgen.rb +0 -5
- data/lib/wee/core/page.rb +0 -1
- data/lib/wee/core/presenter.rb +0 -100
- data/lib/wee/core/renderer.rb +0 -23
- data/lib/wee/core/snapshot.rb +0 -21
- data/lib/wee/core/valueholder.rb +0 -19
- data/lib/wee/core_ext.rb +0 -122
- data/lib/wee/databases/og.rb +0 -4
- data/lib/wee/databases/og/application.rb +0 -3
- data/lib/wee/databases/og/old_scaffolder.rb +0 -98
- data/lib/wee/databases/og/scaffolder.rb +0 -255
- data/lib/wee/databases/og/session.rb +0 -9
- data/lib/wee/examples/calculator.rb +0 -70
- data/lib/wee/examples/counter.rb +0 -33
- data/lib/wee/idgen/md5.rb +0 -21
- data/lib/wee/idgen/sequential.rb +0 -11
- data/lib/wee/pageless.rb +0 -3
- data/lib/wee/pageless/application.rb +0 -13
- data/lib/wee/pageless/request.rb +0 -27
- data/lib/wee/pageless/session.rb +0 -74
- data/lib/wee/renderer/html/brushes.rb +0 -667
- data/lib/wee/renderer/html/canvas.rb +0 -265
- data/lib/wee/renderer/html/writer.rb +0 -80
- data/lib/wee/requesthandler.rb +0 -81
- data/lib/wee/skeleton/og/README +0 -38
- data/lib/wee/skeleton/og/components/main.rb +0 -20
- data/lib/wee/skeleton/og/conf/db.rb +0 -8
- data/lib/wee/skeleton/og/models/recipe.rb +0 -5
- data/lib/wee/skeleton/og/run.rb +0 -23
- data/lib/wee/skeleton/simple/README +0 -32
- data/lib/wee/skeleton/simple/components/main.rb +0 -25
- data/lib/wee/skeleton/simple/run.rb +0 -12
- data/lib/wee/snapshot_ext.rb +0 -41
- data/lib/wee/template.rb +0 -42
- data/lib/wee/utils.rb +0 -5
- data/lib/wee/utils/autoreload.rb +0 -56
- data/lib/wee/utils/cache.rb +0 -7
- data/lib/wee/utils/helper.rb +0 -51
data/doc/rdoc/files/INSTALL.html
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>File: INSTALL</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="fileHeader">
|
|
50
|
-
<h1>INSTALL</h1>
|
|
51
|
-
<table class="header-table">
|
|
52
|
-
<tr class="top-aligned-row">
|
|
53
|
-
<td><strong>Path:</strong></td>
|
|
54
|
-
<td>INSTALL
|
|
55
|
-
</td>
|
|
56
|
-
</tr>
|
|
57
|
-
<tr class="top-aligned-row">
|
|
58
|
-
<td><strong>Last Update:</strong></td>
|
|
59
|
-
<td>Mon Jul 11 23:54:42 CEST 2005</td>
|
|
60
|
-
</tr>
|
|
61
|
-
</table>
|
|
62
|
-
</div>
|
|
63
|
-
<!-- banner header -->
|
|
64
|
-
|
|
65
|
-
<div id="bodyContent">
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<div id="contextContent">
|
|
70
|
-
|
|
71
|
-
<div id="description">
|
|
72
|
-
<h1>Installation without Rubygems</h1>
|
|
73
|
-
<p>
|
|
74
|
-
Simply run:
|
|
75
|
-
</p>
|
|
76
|
-
<pre>
|
|
77
|
-
ruby install.rb
|
|
78
|
-
</pre>
|
|
79
|
-
<h1>Installation with Rubygems</h1>
|
|
80
|
-
<ol>
|
|
81
|
-
<li>Download and Install RubyGems: <a
|
|
82
|
-
href="http://rubygems.rubyforge.org">rubygems.rubyforge.org</a>
|
|
83
|
-
|
|
84
|
-
</li>
|
|
85
|
-
<li>Install <a href="../classes/Wee.html">Wee</a>:
|
|
86
|
-
|
|
87
|
-
<pre>
|
|
88
|
-
gem install wee
|
|
89
|
-
</pre>
|
|
90
|
-
</li>
|
|
91
|
-
<li>Set environment variable (required to load RubyGems):
|
|
92
|
-
|
|
93
|
-
<pre>
|
|
94
|
-
export RUBYOPT=-rubygems
|
|
95
|
-
</pre>
|
|
96
|
-
</li>
|
|
97
|
-
</ol>
|
|
98
|
-
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<!-- if includes -->
|
|
109
|
-
|
|
110
|
-
<div id="section">
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<!-- if method_list -->
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<div id="validator-badges">
|
|
126
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
</body>
|
|
130
|
-
</html>
|
data/doc/rdoc/files/README.html
DELETED
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
-
<!DOCTYPE html
|
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
-
|
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
-
<head>
|
|
8
|
-
<title>File: README</title>
|
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
-
<script type="text/javascript">
|
|
13
|
-
// <![CDATA[
|
|
14
|
-
|
|
15
|
-
function popupCode( url ) {
|
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function toggleCode( id ) {
|
|
20
|
-
if ( document.getElementById )
|
|
21
|
-
elem = document.getElementById( id );
|
|
22
|
-
else if ( document.all )
|
|
23
|
-
elem = eval( "document.all." + id );
|
|
24
|
-
else
|
|
25
|
-
return false;
|
|
26
|
-
|
|
27
|
-
elemStyle = elem.style;
|
|
28
|
-
|
|
29
|
-
if ( elemStyle.display != "block" ) {
|
|
30
|
-
elemStyle.display = "block"
|
|
31
|
-
} else {
|
|
32
|
-
elemStyle.display = "none"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Make codeblocks hidden by default
|
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
-
|
|
41
|
-
// ]]>
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
</head>
|
|
45
|
-
<body>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<div id="fileHeader">
|
|
50
|
-
<h1>README</h1>
|
|
51
|
-
<table class="header-table">
|
|
52
|
-
<tr class="top-aligned-row">
|
|
53
|
-
<td><strong>Path:</strong></td>
|
|
54
|
-
<td>README
|
|
55
|
-
</td>
|
|
56
|
-
</tr>
|
|
57
|
-
<tr class="top-aligned-row">
|
|
58
|
-
<td><strong>Last Update:</strong></td>
|
|
59
|
-
<td>Mon Jul 11 23:54:42 CEST 2005</td>
|
|
60
|
-
</tr>
|
|
61
|
-
</table>
|
|
62
|
-
</div>
|
|
63
|
-
<!-- banner header -->
|
|
64
|
-
|
|
65
|
-
<div id="bodyContent">
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<div id="contextContent">
|
|
70
|
-
|
|
71
|
-
<div id="description">
|
|
72
|
-
<h1><a href="../classes/Wee.html">Wee</a> Web Framework</h1>
|
|
73
|
-
<h2>Copyright and License</h2>
|
|
74
|
-
<p>
|
|
75
|
-
Copyright © 2004, 2005 by Michael Neumann (mneumann@ntecs.de).
|
|
76
|
-
</p>
|
|
77
|
-
<p>
|
|
78
|
-
Released under the same terms of license as Ruby. Some files under
|
|
79
|
-
directory <tt>examples/</tt> might be copyrighted by third parties and
|
|
80
|
-
licensed under different terms.
|
|
81
|
-
</p>
|
|
82
|
-
<h2>Status and Bugs</h2>
|
|
83
|
-
<p>
|
|
84
|
-
<a href="../classes/Wee.html">Wee</a> is now considered pretty stable (if
|
|
85
|
-
you don’t use continuations). Nevertheless I wouldn’t use it
|
|
86
|
-
yet for mission-critical applications ;-)
|
|
87
|
-
</p>
|
|
88
|
-
<p>
|
|
89
|
-
Known Bugs:
|
|
90
|
-
</p>
|
|
91
|
-
<ul>
|
|
92
|
-
<li>Using continuations might leak memory, at least they did in the past. The
|
|
93
|
-
latest memory stress-test has not showed up any memory problems, but since
|
|
94
|
-
I haven’t changed anything at the continuation implementation, I
|
|
95
|
-
can’t say for sure whether the problem has been fixed or not.
|
|
96
|
-
|
|
97
|
-
</li>
|
|
98
|
-
</ul>
|
|
99
|
-
<h2>Introduction</h2>
|
|
100
|
-
<p>
|
|
101
|
-
<a href="../classes/Wee.html">Wee</a> is a light-weight, very high-level
|
|
102
|
-
and modern web-framework that makes <b>W</b>eb <b>e</b>ngineering
|
|
103
|
-
<b>e</b>asy. It mainly inherits many ideas and features from <a
|
|
104
|
-
href="http://beta4.com/seaside2">Seaside2</a>, but was written from scratch
|
|
105
|
-
without ever looking at the Seaside (or any other) sources. All code was
|
|
106
|
-
developed from ideas and lots of discussions with Avi Bryant.
|
|
107
|
-
</p>
|
|
108
|
-
<h2>Features</h2>
|
|
109
|
-
<h3>Reusable components</h3>
|
|
110
|
-
<p>
|
|
111
|
-
<a href="../classes/Wee.html">Wee</a> has <em>real</em> components, which
|
|
112
|
-
are like widgets in a GUI. Once written, you can use them everywhere. They
|
|
113
|
-
are completely independent and do not interfere with other components.
|
|
114
|
-
Components encapsulate state, a view and actions. Of course you can use an
|
|
115
|
-
external model or use templates for rendering.
|
|
116
|
-
</p>
|
|
117
|
-
<h3>Backtracking</h3>
|
|
118
|
-
<p>
|
|
119
|
-
See the <em>What is backtracking?</em> section below. In short,
|
|
120
|
-
backtracking lets the browser’s back and forward-button play well
|
|
121
|
-
together with your application.
|
|
122
|
-
</p>
|
|
123
|
-
<h3>Clean and concise</h3>
|
|
124
|
-
<p>
|
|
125
|
-
<a href="../classes/Wee.html">Wee</a> is well thought out, is written in
|
|
126
|
-
<b>and</b> supports clean and concise code. Furthermore I think most parts
|
|
127
|
-
are now very well documented.
|
|
128
|
-
</p>
|
|
129
|
-
<h3>Abstract core</h3>
|
|
130
|
-
<p>
|
|
131
|
-
The core of <a href="../classes/Wee.html">Wee</a> is completely independent
|
|
132
|
-
of both HTTP and HTML. That means, with little effort, you should be able
|
|
133
|
-
to render other formats than HTML and use other communication protocols
|
|
134
|
-
like SOAP, XML-RPC, Email, GUI or Console.
|
|
135
|
-
</p>
|
|
136
|
-
<h3>Templating-independent</h3>
|
|
137
|
-
<p>
|
|
138
|
-
<a href="../classes/Wee.html">Wee</a> does not depend on a special
|
|
139
|
-
templating-engine. You can use a different templating engine for each
|
|
140
|
-
component if you want.
|
|
141
|
-
</p>
|
|
142
|
-
<h3>Powerful programmatic HTML generation</h3>
|
|
143
|
-
<p>
|
|
144
|
-
<a href="../classes/Wee.html">Wee</a> ships with an easy to use and very
|
|
145
|
-
powerful programmatic html-generation library. For example you can create a
|
|
146
|
-
select list easily with this piece of code:
|
|
147
|
-
</p>
|
|
148
|
-
<pre>
|
|
149
|
-
# select an object from these items
|
|
150
|
-
items = [1, 2, 3, 4]
|
|
151
|
-
|
|
152
|
-
# the labels shown to the user
|
|
153
|
-
labels = items.map {|i| i.to_s}
|
|
154
|
-
|
|
155
|
-
# render it
|
|
156
|
-
r.select_list(items).labels(labels).callback {|choosen| p choosen}
|
|
157
|
-
|
|
158
|
-
# render a multi-select list, with objects 2 and 4 selected
|
|
159
|
-
r.select_list(items).multi.labels(labels).selected([2,4])
|
|
160
|
-
</pre>
|
|
161
|
-
<p>
|
|
162
|
-
The callback is called with the selected objects from the <em>items</em>
|
|
163
|
-
array. Items can be any object, e.g. whole components:
|
|
164
|
-
</p>
|
|
165
|
-
<pre>
|
|
166
|
-
labels = ["msg1", "msg2"]
|
|
167
|
-
items = labels.collect {|m| MessageBox.new(m)}
|
|
168
|
-
r.select_list(items).labels(labels).callback {|choosen| call choosen.first}
|
|
169
|
-
</pre>
|
|
170
|
-
<h3>Optional use of Continuations</h3>
|
|
171
|
-
<p>
|
|
172
|
-
<b>IMPORTANT:</b> <em>The current implementation of continuations in Ruby
|
|
173
|
-
(or their use in <a href="../classes/Wee.html">Wee</a>) might lead to
|
|
174
|
-
memory leaks, if you use continuations. Furthermore, if you use
|
|
175
|
-
continuations, it’s no longer possible to store the session state to
|
|
176
|
-
disk.</em>
|
|
177
|
-
</p>
|
|
178
|
-
<p>
|
|
179
|
-
Continuation-based frameworks are also known as <em>modal</em> frameworks.
|
|
180
|
-
You can write code like the one shown below (taken from one of Avi’s
|
|
181
|
-
emails) where each method displays a new page:
|
|
182
|
-
</p>
|
|
183
|
-
<pre>
|
|
184
|
-
def checkout
|
|
185
|
-
billing = getAddress("Billing Address")
|
|
186
|
-
if useSeparateShippingAddress()
|
|
187
|
-
shipping = getAddress("Shipping Address")
|
|
188
|
-
else
|
|
189
|
-
shipping = billing
|
|
190
|
-
end
|
|
191
|
-
payment = getPaymentInfo()
|
|
192
|
-
showConfirmation(billing, shipping, payment)
|
|
193
|
-
end
|
|
194
|
-
</pre>
|
|
195
|
-
<p>
|
|
196
|
-
Try to implement the same in a non-continuation based framework and show me
|
|
197
|
-
your code… ;-)
|
|
198
|
-
</p>
|
|
199
|
-
<p>
|
|
200
|
-
To enable continuations, you have to require:
|
|
201
|
-
</p>
|
|
202
|
-
<pre>
|
|
203
|
-
require 'wee/continuation'
|
|
204
|
-
</pre>
|
|
205
|
-
<h3>Fully Marshallable (drops Continuation support)</h3>
|
|
206
|
-
<p>
|
|
207
|
-
If you don’t need continuations, <a
|
|
208
|
-
href="../classes/Wee.html">Wee</a> can be made fully marshallable. It is
|
|
209
|
-
not yet fully marshallable (it was in the past), but it can be made, if
|
|
210
|
-
required.
|
|
211
|
-
</p>
|
|
212
|
-
<h2>Observations and Limitations</h2>
|
|
213
|
-
<ul>
|
|
214
|
-
<li>Using continuations (might) lead to memory leaks!
|
|
215
|
-
|
|
216
|
-
</li>
|
|
217
|
-
<li>When using continuations for cross-component calls, it’s impossible
|
|
218
|
-
to store a session to disk (at least in Ruby). This problem is partly
|
|
219
|
-
addressed by checkpointing provided by operating systems like <a
|
|
220
|
-
href="http://www.dragonflybsd.org">DragonFly</a>. But with this approach
|
|
221
|
-
it’s still impossible to store sessions <em>selectively</em> to disk.
|
|
222
|
-
|
|
223
|
-
</li>
|
|
224
|
-
<li>When using continuations, each session runs in it’s own
|
|
225
|
-
(light-weigth) thread. This is not the case if you don’t use
|
|
226
|
-
continuations.
|
|
227
|
-
|
|
228
|
-
</li>
|
|
229
|
-
<li>Only one action callback can be invoked per request (a former version of <a
|
|
230
|
-
href="../classes/Wee.html">Wee</a> was able to invoke multiple callback,
|
|
231
|
-
and answer even from multiple components at the same time, but this was
|
|
232
|
-
removed, due to the unreliability of continuations in Ruby).
|
|
233
|
-
|
|
234
|
-
</li>
|
|
235
|
-
<li>Components are thread-safe, as a fresh components-tree is created for each
|
|
236
|
-
session and requests inside a session are serialized.
|
|
237
|
-
|
|
238
|
-
</li>
|
|
239
|
-
</ul>
|
|
240
|
-
<h2>What is backtracking?</h2>
|
|
241
|
-
<p>
|
|
242
|
-
If you want, you can make the back-button of your browser work correctly
|
|
243
|
-
together with your web-application. Imagine you have a simple counter
|
|
244
|
-
application, which shows the current count and two links <em>inc</em> and
|
|
245
|
-
<em>dec</em> with which you can increase or decrease the current count.
|
|
246
|
-
Starting with an inital count of 0, you increase the counter up to 8, then
|
|
247
|
-
click three times the back button of your browser (now displays 5) and
|
|
248
|
-
finally decrease by one, then the counter really shows the expected 4,
|
|
249
|
-
instead of 7 (as clicking the back button does usually not send a HTTP
|
|
250
|
-
request, and the last state of your application was 8).
|
|
251
|
-
</p>
|
|
252
|
-
<p>
|
|
253
|
-
Only individual objects are backtracked, those of which you explicitly take
|
|
254
|
-
a snapshot, not the whole component. That’s the easiest (from an
|
|
255
|
-
application programmers perspective) and most flexible way. And its fast
|
|
256
|
-
and uses less memory.
|
|
257
|
-
</p>
|
|
258
|
-
<p>
|
|
259
|
-
You can decide yourself whether you want infinite backtracking or only
|
|
260
|
-
backtracking up to n pages, with whatever replacement strategy you want,
|
|
261
|
-
least recently used (LRU), least frequently used (LFU) etc.
|
|
262
|
-
</p>
|
|
263
|
-
<h2>Decorations</h2>
|
|
264
|
-
<p>
|
|
265
|
-
Decorations are used to modify the look and behaviour of a component,
|
|
266
|
-
without modifying the components tree. A component can have more than one
|
|
267
|
-
decoration. This is implemented as a linked list of decorations
|
|
268
|
-
(Wee::Decoration#owner points to the next decoration). <a
|
|
269
|
-
href="../classes/Wee/Component.html#M000332">Wee::Component#decoration</a>
|
|
270
|
-
points to the first decoration in the chain or to the component itself, if
|
|
271
|
-
no decorations were specified. We actually use a <a
|
|
272
|
-
href="../classes/Wee/ValueHolder.html">Wee::ValueHolder</a> for the
|
|
273
|
-
<tt>@decoration</tt> instance variable of class <a
|
|
274
|
-
href="../classes/Wee/Component.html">Wee::Component</a> to be able to
|
|
275
|
-
easily backtrack it (required if you want to "undo" component
|
|
276
|
-
calls).
|
|
277
|
-
</p>
|
|
278
|
-
<h2>The anatomy of a request/response cycle</h2>
|
|
279
|
-
<p>
|
|
280
|
-
The request/response cycle in <a href="../classes/Wee.html">Wee</a> is
|
|
281
|
-
actually split into two separate phases or steps. Depending on the
|
|
282
|
-
point-of-view (given that a page is rendered and the user clicks on a link
|
|
283
|
-
or button), the first phase is to invoke an action (a
|
|
284
|
-
"callback"). Then in the second phase, a new page is rendered and
|
|
285
|
-
sent back to the user. So the two steps are:
|
|
286
|
-
</p>
|
|
287
|
-
<ol>
|
|
288
|
-
<li>invoke callbacks (action phase)
|
|
289
|
-
|
|
290
|
-
</li>
|
|
291
|
-
<li>render new page and display (render phase)
|
|
292
|
-
|
|
293
|
-
</li>
|
|
294
|
-
</ol>
|
|
295
|
-
<p>
|
|
296
|
-
These two phases repeat permanently. Which tasks are performed in each of
|
|
297
|
-
them, is briefly listed below:
|
|
298
|
-
</p>
|
|
299
|
-
<p>
|
|
300
|
-
<b>Action:</b>
|
|
301
|
-
</p>
|
|
302
|
-
<ol>
|
|
303
|
-
<li>restore snapshot (if not up-to-date)
|
|
304
|
-
|
|
305
|
-
</li>
|
|
306
|
-
<li>invoke actions
|
|
307
|
-
|
|
308
|
-
</li>
|
|
309
|
-
<li>backtrack state
|
|
310
|
-
|
|
311
|
-
</li>
|
|
312
|
-
<li>update url -> redirect to render phase (not yet)
|
|
313
|
-
|
|
314
|
-
</li>
|
|
315
|
-
</ol>
|
|
316
|
-
<p>
|
|
317
|
-
<b>Render:</b>
|
|
318
|
-
</p>
|
|
319
|
-
<ol>
|
|
320
|
-
<li>restore snapshot (if not up-to-date)
|
|
321
|
-
|
|
322
|
-
</li>
|
|
323
|
-
<li>render
|
|
324
|
-
|
|
325
|
-
</li>
|
|
326
|
-
</ol>
|
|
327
|
-
<p>
|
|
328
|
-
For each session there is at most one request handled at the same time.
|
|
329
|
-
That means, that there is either one action request or one render request
|
|
330
|
-
handled. Why? Because we have only one components tree, which we update on
|
|
331
|
-
action requests. As <a href="../classes/Wee.html">Wee</a> allows to go back
|
|
332
|
-
in time, we have to restore this components tree to a certain point in time
|
|
333
|
-
before we can handle an action or render request. This disallows to handle
|
|
334
|
-
e.g. two render requests simultaneous.
|
|
335
|
-
</p>
|
|
336
|
-
<h3>Action Phase (Invoking Callbacks)</h3>
|
|
337
|
-
<p>
|
|
338
|
-
Possible sources for callbacks are links (anchors) and all kinds of
|
|
339
|
-
form-elements like submit buttons, input-fields etc. There are two
|
|
340
|
-
different kinds of callbacks:
|
|
341
|
-
</p>
|
|
342
|
-
<ul>
|
|
343
|
-
<li>Input callbacks (input-fields)
|
|
344
|
-
|
|
345
|
-
</li>
|
|
346
|
-
<li>Action callbacks (anchor, submit-button)
|
|
347
|
-
|
|
348
|
-
</li>
|
|
349
|
-
</ul>
|
|
350
|
-
<p>
|
|
351
|
-
The distinction between input and action callbacks is important, as action
|
|
352
|
-
callbacks might depend on values of input-fields being assigned to instance
|
|
353
|
-
variables of the controlling component. Hence, <a
|
|
354
|
-
href="../classes/Wee.html">Wee</a> first invokes all input callbacks before
|
|
355
|
-
any action callback is triggered.
|
|
356
|
-
</p>
|
|
357
|
-
<p>
|
|
358
|
-
There are two methods related to callback processing:
|
|
359
|
-
</p>
|
|
360
|
-
<ul>
|
|
361
|
-
<li><a
|
|
362
|
-
href="../classes/Wee/Component.html#M000327">Wee::Component#process_callbacks_chain</a>
|
|
363
|
-
|
|
364
|
-
</li>
|
|
365
|
-
<li><a
|
|
366
|
-
href="../classes/Wee/Presenter.html#M000380">Wee::Presenter#process_callbacks</a>
|
|
367
|
-
|
|
368
|
-
</li>
|
|
369
|
-
</ul>
|
|
370
|
-
<p>
|
|
371
|
-
Note that each <a href="../classes/Wee/Component.html">Wee::Component</a>
|
|
372
|
-
is also a <a href="../classes/Wee/Presenter.html">Wee::Presenter</a>,
|
|
373
|
-
whereas a <a href="../classes/Wee/Decoration.html">Wee::Decoration</a> is
|
|
374
|
-
not a Component (but a Presenter)!
|
|
375
|
-
</p>
|
|
376
|
-
<p>
|
|
377
|
-
Method <em>process_callbacks_chain</em> invokes <em>process_callbacks</em>
|
|
378
|
-
for it’s first decoration, or if the component has no decorations,
|
|
379
|
-
the method is called for the component itself. As such,
|
|
380
|
-
<em>process_callbacks_chain</em> is important to avoid entering an infinite
|
|
381
|
-
loop (a method calling itself). What decorations are, is discussed
|
|
382
|
-
elsewhere.
|
|
383
|
-
</p>
|
|
384
|
-
<p>
|
|
385
|
-
There are two "process_callbacks" tree traversals. The first
|
|
386
|
-
invokes all input callbacks, the second the action callback.
|
|
387
|
-
</p>
|
|
388
|
-
<h3>Rendering Phase</h3>
|
|
389
|
-
<p>
|
|
390
|
-
The rendering phase is assumed to be side-effect free! So, you as a
|
|
391
|
-
programmer should take care to meet this assumption.
|
|
392
|
-
</p>
|
|
393
|
-
<p>
|
|
394
|
-
Similar as in the callback-step, there are two methods related to rendering
|
|
395
|
-
a page:
|
|
396
|
-
</p>
|
|
397
|
-
<ul>
|
|
398
|
-
<li><a
|
|
399
|
-
href="../classes/Wee/Component.html#M000325">Wee::Component#do_render_chain</a>
|
|
400
|
-
|
|
401
|
-
</li>
|
|
402
|
-
<li><a
|
|
403
|
-
href="../classes/Wee/Presenter.html#M000375">Wee::Presenter#do_render</a>
|
|
404
|
-
|
|
405
|
-
</li>
|
|
406
|
-
</ul>
|
|
407
|
-
<p>
|
|
408
|
-
Method <em>Component#do_render_chain</em> starts rendering the decoration
|
|
409
|
-
chain by calling <em>Presenter#do_render</em> for the first decoration of
|
|
410
|
-
the component or for the component itself if no decorations were specified.
|
|
411
|
-
Method <em>Presenter#do_render</em> then generates the desired output which
|
|
412
|
-
gets sent to the user. Note that method <em>do_render</em> might call other
|
|
413
|
-
components’ <em>do_render_chain</em> methods to display those
|
|
414
|
-
components "inside" itself (usually a component does this for
|
|
415
|
-
it’s child components, but this has to be implemented by the
|
|
416
|
-
programmer).
|
|
417
|
-
</p>
|
|
418
|
-
<h3>Further Reads</h3>
|
|
419
|
-
<p>
|
|
420
|
-
In this order:
|
|
421
|
-
</p>
|
|
422
|
-
<ul>
|
|
423
|
-
<li><a href="../classes/Wee/Presenter.html">Wee::Presenter</a>
|
|
424
|
-
|
|
425
|
-
</li>
|
|
426
|
-
<li><a href="../classes/Wee/Component.html">Wee::Component</a>
|
|
427
|
-
|
|
428
|
-
</li>
|
|
429
|
-
<li><a href="../classes/Wee/Decoration.html">Wee::Decoration</a>
|
|
430
|
-
|
|
431
|
-
</li>
|
|
432
|
-
<li><a href="../classes/Wee/Delegate.html">Wee::Delegate</a>
|
|
433
|
-
|
|
434
|
-
</li>
|
|
435
|
-
<li><a href="../classes/Wee/AnswerDecoration.html">Wee::AnswerDecoration</a>
|
|
436
|
-
|
|
437
|
-
</li>
|
|
438
|
-
</ul>
|
|
439
|
-
|
|
440
|
-
</div>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
</div>
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
</div>
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
<!-- if includes -->
|
|
450
|
-
|
|
451
|
-
<div id="section">
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
<!-- if method_list -->
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
</div>
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
<div id="validator-badges">
|
|
467
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
468
|
-
</div>
|
|
469
|
-
|
|
470
|
-
</body>
|
|
471
|
-
</html>
|