You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hendrik <ca...@gmail.com> on 2005/06/02 13:01:42 UTC

Cocoon integrate in a MVC2 environment?

Hi!

I evaluate cocoon for a big web application which based on the MVC2
(http://de.wikipedia.org/wiki/MVC#MVC_2) and I have one question:

It is posible cocoon to integrate in an existing MVC2 environment. It
means that cocoon  addressed by a own controller.

I hope somebody has a answer.

Regards, 
   Hendrik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon integrate in a MVC2 environment?

Posted by Hendrik <ca...@gmail.com>.
2005/6/2, Reinhard Poetz <re...@apache.org>:
> I'd try to refactor the custom controller and make it independant from having to
> be a servlet. Then I would write a wrapper action (Cocoon action) that accesses
> the custom controller and the action could call the required pipelines.
> 
> If you want to go the other way, the Cocoon bean seems to be the best bet. The
> only problem I see is, how you can pass your model to the view layer. I've never
> used the bean so far. Maybe you should ask this on dev@cocoon.

..thanks for your tips, I think I will take a closer look at the cocoon bean..

Regards,
 Hendrik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon integrate in a MVC2 environment?

Posted by Reinhard Poetz <re...@apache.org>.
Hendrik wrote:
> 2005/6/2, Reinhard Poetz <re...@apache.org>:
> 
>>Probably yes. 
> 
> 
> Ok, I have read many articles about cocoon and "Probably yes" was my
> first cognition :-), but after the first steps with cocoon I have the
> sense that I must build my complete web application with cocoon
> although I only need the great publishing functions of cocoon.
> 
> 
>>You will need to write some "glue" code. In order to get more
>>precise answers, you'll have to tell use more about the existing environment.
> 
> 
> The existing environment has one central servlet and many controllers.
> The presentation of the database content is handled by JSPs and
> taglibs. My wish is that controllers for the publishing stuff use
> cocoon to allow a better separation of content, style and logic. But
> how can I address cocoon from a controller?
> 
> Perhaps is the CocoonBean a solution?

I'd try to refactor the custom controller and make it independant from having to 
be a servlet. Then I would write a wrapper action (Cocoon action) that accesses 
the custom controller and the action could call the required pipelines.

If you want to go the other way, the Cocoon bean seems to be the best bet. The 
only problem I see is, how you can pass your model to the view layer. I've never 
used the bean so far. Maybe you should ask this on dev@cocoon.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon integrate in a MVC2 environment?

Posted by Hendrik <ca...@gmail.com>.
2005/6/2, Bertrand Delacretaz <bd...@apache.org>:
> Le 2 juin 05, à 14:54, Hendrik a écrit :
> > ...how can I address cocoon from a controller?..
> 
> Note that if you only want to use Cocoon's publishing features, you
> could do the opposite: put Cocoon in front of your app, have your app
> output XML (serialized objects in whatever format) and use the Cocoon
> pipelines to do the presentation.
> 
> You'll need to use something like the HttpProxyGenerator so that
> request parameters are correctly relayed to the backend, and some
> assembly might be required depending on the interactions between your
> client and current application. But it's certainly worth trying.

Thanks for the proposal. 

But this fails, because my web app is to large for such design
changes. I need a minimal invasive solution which only concerns some
publishing output.

Regards,
  Hendrik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon integrate in a MVC2 environment?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 2 juin 05, à 14:54, Hendrik a écrit :
> ...how can I address cocoon from a controller?..

Note that if you only want to use Cocoon's publishing features, you 
could do the opposite: put Cocoon in front of your app, have your app 
output XML (serialized objects in whatever format) and use the Cocoon 
pipelines to do the presentation.

You'll need to use something like the HttpProxyGenerator so that 
request parameters are correctly relayed to the backend, and some 
assembly might be required depending on the interactions between your 
client and current application. But it's certainly worth trying.

-Bertrand

Re: Cocoon integrate in a MVC2 environment?

Posted by Hendrik <ca...@gmail.com>.
2005/6/2, Reinhard Poetz <re...@apache.org>:
> Probably yes. 

Ok, I have read many articles about cocoon and "Probably yes" was my
first cognition :-), but after the first steps with cocoon I have the
sense that I must build my complete web application with cocoon
although I only need the great publishing functions of cocoon.

> You will need to write some "glue" code. In order to get more
> precise answers, you'll have to tell use more about the existing environment.

The existing environment has one central servlet and many controllers.
The presentation of the database content is handled by JSPs and
taglibs. My wish is that controllers for the publishing stuff use
cocoon to allow a better separation of content, style and logic. But
how can I address cocoon from a controller?

Perhaps is the CocoonBean a solution?

Thanks and regards,
  Hendrik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon integrate in a MVC2 environment?

Posted by Reinhard Poetz <re...@apache.org>.
Hendrik wrote:
> Hi!
> 
> I evaluate cocoon for a big web application which based on the MVC2
> (http://de.wikipedia.org/wiki/MVC#MVC_2) and I have one question:
> 
> It is posible cocoon to integrate in an existing MVC2 environment. It
> means that cocoon  addressed by a own controller.
> 
> I hope somebody has a answer.

Probably yes. You will need to write some "glue" code. In order to get more 
precise answers, you'll have to tell use more about the existing environment.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org