cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [RT] Fixing the CLI
Date Mon, 24 Feb 2003 15:43:24 GMT
Nicola Ken Barozzi wrote:
> 
>>>> Lastly, things like different views should be accessible via
>>>> parameters.  The CLI sends in the Request Parameters, so it
>>>> should be able to acess the results from the different views
>>>> via the Request Parameters. 
> 
> 
> I don't get it. Could you please explain to me again?

All environments pass in a Request object, a Context object, and
a Response object.

The Request object would be the perfect place to store the results
of alternate views.  That way the CLI environment would be able to
query the Request object that was modified by Cocoon for the results
of a view.

All is done in one pass.  In the live web environment this feature
wouldn't be as useful, mainly because we haven't identified a need
to work with multiple views of the same resource in that environment.

I think the next thing that needs to be done to enable all this
for real is to relegate Cocoon to merely preparing the Response
objects and not committing them (by writing the response out).
That way the CLI can do its job properly, and the web will still
work.

Then again, this does present some other issues in regards to large
pages.  If the page is held in memory until it is done, then Cocoon
takes up too many resources.  One possibility is add a "Listener"
support to Cocoon.

A ResponseListener would provide a meaningful way to receive event
notification for different stages of the resource generation.  Of
course, that also means you need a way of canceling the generation
of a resource as well.  Something along these lines might work:

ResponseListener
{
     // returns false if response needs cancelation
     boolean responseCodeChanged( int code );

     // returns extension for mimetype--or null if no change
     String mimeTypeChanged( String mimeType );

     // Not sure the value to pass in, but you can listen
     // for these events and interpret them as they arrive.
     void viewResults( String viewName, Object results );
}

In the web environment, the DefaultResponseListener would be used,
and in the CLI environment, a specialized one would be used.


Mime
View raw message