You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Othman Haddad <oh...@neomalogic.com> on 2002/06/27 17:07:43 UTC

using cocoon pipelines without servlet

hi everybody,
i've got 2 questions that could help me a lot:
1) can i extract the cocoon pipeling mecanism from cocoon without using as a
servlet? (i'm already using turbine and have a lot of code, and what just to
use the interesting pipelining of cocoon)!

2) can i use a java object in the cocoon pipeline?

thanks

Re: using cocoon pipelines without servlet

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Othman Haddad wrote:
> 
> hi everybody,
> i've got 2 questions that could help me a lot:
> 1) can i extract the cocoon pipeling mecanism from cocoon without using 
> as a servlet? (i'm already using turbine and have a lot of code, and 
> what just to use the interesting pipelining of cocoon)!

It is possible, there is not a prebuilt solution for this ATM.
These are three ways that come to mind to me ATM:

1. use Cocoon as a Servlet 2.3 filter. In this way it can 
preprocess-postprocess the Turbine stuff. There is a filter for this in 
the Cocoon scratchpad IIRC.

2. Call Cocoon as you would for any other servlet.

3. Create an Enviromnent that calls Cocoon as a big service.

Option 3 is the best IMHO but it also takes more time to do.
If you send it to us, I will surely commit it :-)

For an example on how to do it, look at the commandline Environment and 
how it's used.

> 2) can i use a java object in the cocoon pipeline?

Sure, but since a Cocoon pipeline is XML, you must wrap it in a Cocoon 
pipeline component, which can be a Generator, Transformer, Serializer or 
Action, Matcher, etc...

It just depends on what you need this java object to do or to be.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
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>