You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Mchugh <pm...@empolis.co.uk> on 2002/07/17 14:56:15 UTC

Using Cocoon progamatically from an Existing Tomcat webapp ...

Hi All,

I'm a new-comer to Cocoon and would like to find out if it is possible to use its services from within an existing tomcat webapp, rather than deploying the cocoon servlet in its own webapp.

My own webapp has some servlets and java beans that are hooked up to a database.  

I would like to define a Cocoon pipeline that uses an XSP to access data stored in the ApplicationContext and SessionContext of my own tomcat webapp.

>From this I'd like the pipeline to transform the data from the XSP into an intermediate XML format and then into several different formats: HTML, PDF, RTF, Text etc. 

I would then like to call these pipelines from within my own servlets and re-direct the output to a printer rather than back to the browser.

Is this possible?

>From the Java APIs it looks like it is possible by creating a different type of environment to an HTTPEnvironment: i.e. a FileSavingEnvironment and initiate the pipeline programatically.  Am I on the right track here and if so ... what API calls are used to invoke the pipeline?

Any information gratefully received.

Thanks

Paul







_____________________________________________________________________
This message has been checked for all known viruses by the MessageLabs Virus Scanning Service.

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Using Cocoon progamatically from an Existing Tomcat webapp ...

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Paul Mchugh [mailto:pm@empolis.co.uk]
> 
> Hi All,
> 
> I'm a new-comer to Cocoon and would like to find out if it is possible
to use
> its services from within an existing tomcat webapp, rather than
deploying the
> cocoon servlet in its own webapp.
> 
> My own webapp has some servlets and java beans that are hooked up to a
> database.
> 
> I would like to define a Cocoon pipeline that uses an XSP to access
data
> stored in the ApplicationContext and SessionContext of my own tomcat
webapp.
> 
> From this I'd like the pipeline to transform the data from the XSP
into an
> intermediate XML format and then into several different formats: HTML,
PDF,
> RTF, Text etc.
> 
> I would then like to call these pipelines from within my own servlets
and re-
> direct the output to a printer rather than back to the browser.
> 
> Is this possible?
> 
> From the Java APIs it looks like it is possible by creating a
different type
> of environment to an HTTPEnvironment: i.e. a FileSavingEnvironment and
> initiate the pipeline programatically.  Am I on the right track here
and if so
> ... what API calls are used to invoke the pipeline?

You can do this. See Main.java and CocoonServlet.java for samples on how
to instantiate and access Cocoon.


> Any information gratefully received.

There were some discussions on dev list on how one can easily do tasks
like this (send output to file, printer, etc), but there is no final
decision yet.


Vadim


> Thanks
> 
> Paul


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>