From: Chris W. <la...@us...> - 2004-11-28 06:37:57
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10995 Modified Files: Architecture.pod Log Message: inline some examples; update the request/response registration Index: Architecture.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Architecture.pod,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Architecture.pod 26 Sep 2004 19:56:26 -0000 1.8 --- Architecture.pod 28 Nov 2004 06:33:06 -0000 1.9 *************** *** 138,147 **** So normally it looks something like this: ! [% INCLUDE examples/arch_create_context | indent 4 %] Once it's created the C<CTX> symbol can be imported and used anywhere, like this: ! [% INCLUDE examples/arch_import_context | indent 4 %] =head1 ADAPTER --- 138,155 ---- So normally it looks something like this: ! my $ctx = OpenInteract2::Context->create({ ! website_dir => $website_dir ! }); Once it's created the C<CTX> symbol can be imported and used anywhere, like this: ! use OpenInteract2::Context qw( CTX ); ! ! sub foo { ! my ( $self ) = @_; ! my $login_info = CTX->lookup_login_config; ! ... ! } =head1 ADAPTER *************** *** 205,214 **** Here's one where we do it inside the adapter for a CGI process: ! my $ctx = OpenInteract2::Context->create( ! { website_dir => $website_dir }); $ctx->assign_request_type( 'cgi' ); $ctx->assign_response_type( 'cgi' ); ! The currently available adapter types are: =over 4 --- 213,224 ---- Here's one where we do it inside the adapter for a CGI process: ! my $ctx = OpenInteract2::Context->create({ ! website_dir => $website_dir ! }); $ctx->assign_request_type( 'cgi' ); $ctx->assign_response_type( 'cgi' ); ! The currently available adapter types, all listed in the 'request' and ! 'response' server configuration keys, are: =over 4 *************** *** 237,252 **** =back ! You can add a new request/response type through the ! C<register_factory_type> for both L<OpenInteract2::Request> and ! L<OpenInteract2::Response>: - # Register a 'fastcgi' request/response type OpenInteract2::Request->register_factory_type( fastcgi => 'OpenInteract2::Request::FastCGI' ); OpenInteract2::Response->register_factory_type( fastcgi => 'OpenInteract2::Response::FastCGI' ); ! Now all calls to 'assign_request_type' and 'assign_response_type' will ! have 'fastcgi' available. =item * --- 247,272 ---- =back ! You can add a new request/response type in two ways. The easiest is ! just to add the request/response type and class to the server ! configuration: ! ! [request] ! ... ! fastcgi = OpenInteract2::Request::FastCGI ! ! [response] ! ... ! fastcgi = OpenInteract2::Response::FastCGI ! ! You can also programmatically register the adapters in your server startup : OpenInteract2::Request->register_factory_type( fastcgi => 'OpenInteract2::Request::FastCGI' ); + OpenInteract2::Response->register_factory_type( fastcgi => 'OpenInteract2::Response::FastCGI' ); ! No matter which you choose, all calls to 'assign_request_type' and ! 'assign_response_type' will have 'fastcgi' available. =item * *************** *** 368,371 **** --- 388,394 ---- in what form the request is coming in or how the adapter handles it. + If you're running a web server the typical user request is coming over + HTTP from a browser, feed reader, bot or some other client. + =head2 Step 2: Adapter Creates Request/Response Objects *************** *** 464,467 **** --- 487,494 ---- the action. + If any observers are registered with the action they receive a + 'filter' observation. Any of these observers can modify the content + we've just generated. + If the cache is activated for this method we'll cache the content. In any case we return the content, finishing the flow for the action and |