Marchiori Carlo wrote:

Hello Upayavira,

I mean you must supply Request, Response, Session
implementations which have methods to support cookies, context path,
servlet path, pathinfo, etc... which are meaningful only
in a servlet enviroment. So Cocoon is biased for this environment.


Yes. Cocoon is biased for this environment.

Of course I can implement Request and Response interfaces
that hide the underlying non-servlet enviroment while still looking like web request and web response,
and this I'm going to do.


You don't _need_ to implement those interfaces - you can use the CommandLine ones that are used within the CocoonBean. It depends whether you want to create your own environment, or use the existing CocoonBean which is intended to isolate you from the complexities of the Cocoon core, including such things as the environment and these various interfaces.

With the CocoonBean, you can do something as simple as:

CocoonBean cocoon = new CocoonBean();
listener = new OutputStreamListener(System.out);
BeanConfigurator.configure(xconf, cocoon, destDir, uriGroup, listener);
cocoon.initialize();
cocoon.processURI("/site/page.html", System.out);
cocoon.dispose();

This should send the page referenced as /site/page.html to the standard output.

[Note - this code isn't tested - I've probably missed something]

So, with this, there's no worrying about cookies, sessions, environments, etc.

Regards, Upayavira

Thanks,
Carlo.




-----Messaggio originale-----
Da: Upayavira [mailto:[EMAIL PROTECTED]
Inviato: luned� 5 aprile 2004 11.17
A: [EMAIL PROTECTED]
Oggetto: Re: Cocoon without a web Container


Cocoon is available outside of a container environment. It has been specifically coded to be so. Whilst it is clearly mainly focussed upon an HTTP servlet environment, other environments are present, and can be coded.


The one you are probably looking for is the CocoonBean. This was exctracted from the original Command Line Interface (CLI) for generating off-line sites, but it can be embedded within Java applications.

Check out the code for the CLI, which uses the bean, within the Cocoon source, in src/java/org/apache/cocoon/Main.java. Hopefully you'll get an idea of how it works from there.

Regards, Upayavira

Marchiori Carlo wrote:



I would like to use Cocoon outside a web
environment. I think most of the Cocoon
heart is indipendent from such an enviroment.

Only, I see the method debug of the org.apache.cocoon.Cocoon
class explicitly uses web session and request objects.
Maybe that should be removed.


In my opinion protocol should be known only
by the component which sets up the invocation context,
which is outside of Cocoon, and eventually
by generators and serializers which may look up
protocol objects in the object model.

Is there anybody out there interested in using Cocoon out of a web environment?

My target would be to use Cocoon in a general
integration environment.

Thanks,
Carlo.

------------------------------------------------------------


---------


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to