You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Magnus Haraldsen Amundsen <Ma...@computas.com> on 2008/04/10 21:58:57 UTC

Cocoon 2.2 - Cocoon Forms 1.0 block: Replacing Avalon's ServiceManager interface with Spring 2

Hi,

I'm looking into the Cocoon Forms 1.0 block (with Cocoon 2.2) and it seems very nice. But I see that the Java API example at http://cocoon.apache.org/2.2/blocks/forms/1.0/498_1_1.html use Avalon's ServiceManager interface. However, at the "New in 2.2" page it says that "Cocoon 2.2 doesn't use an Avalon-based component manager any more but uses Spring 2 instead.". 

How do I replace the Avalon ServiceManager interface in the Cocoon Forms 1.0 block Java API sample with Spring 2? 

A small code example on this would be great, since I don't know Avalon or Spring 2.

Best regards,

Magnus

IMPORTANT NOTICE:
This message may contain confidential information. 
If you have received this e-mail in error, do not use, copy or 
distribute it. Do not open any attachments. Delete it immediately from
your system and notify the sender promptly by e-mail that you 
have done so. Thank you.


Re: Cocoon 2.2 - Cocoon Forms 1.0 block: Replacing Avalon's ServiceManager interface with Spring 2

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Vadim Gritsenko pisze:
> On Apr 10, 2008, at 3:58 PM, Magnus Haraldsen Amundsen wrote:
>> I'm looking into the Cocoon Forms 1.0 block (with Cocoon 2.2) and it 
>> seems very nice. But I see that the Java API example at 
>> http://cocoon.apache.org/2.2/blocks/forms/1.0/498_1_1.html use 
>> Avalon's ServiceManager interface. However, at the "New in 2.2" page 
>> it says that "Cocoon 2.2 doesn't use an Avalon-based component manager 
>> any more but uses Spring 2 instead.".
>>
> Cocoon 2.2 internally uses Spring, but it still provides backward 
> compatibility (as far as it's possible) with Cocoon 2.1, so it 
> implements Avalon functionality and provides an implementation of 
> Avalon's ServiceManager. Because of this CForms 1.0 can continue to use 
> ServiceManager.
> 
> I should also mention that there is CForms version 1.1 which does not 
> use ServiceManager anymore and is migrated to Spring.
> 
> Links to CForms 1.0 and 1.1:
> http://svn.apache.org/repos/asf/cocoon/branches/cocoon-forms-1.0.0/
> http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-forms/

I would add that we have already Spring implementation for Apples, see[1]. This way, Controllers can 
be just Spring beans so Dependency Injection can be used instead of ServletManager from Avalon.

Magnus, since you said you don't know Spring or Avalon I think you will have hard times using Java 
code in Cocoon. I would say that you don't need to be a master of Spring to use Cocoon but some 
basics are highly recommended.

In this particular case I would advise you to take a look at apples block samples[2][3] and figure 
out how to migrate them to Spring with help of people from this list. This way you would learn 
basics and could contribute migrated samples to community so others could benefit.

[1] 
http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-apples/cocoon-apples-impl/src/main/java/org/apache/cocoon/components/flow/apples/SpringApplesProcessor.java?view=markup
[2] http://cocoon.zones.apache.org/demos/trunk/cocoon-apples-sample/
[3] http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-apples/cocoon-apples-sample/

-- 
Grzegorz Kossakowski

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


Re: Cocoon 2.2 - Cocoon Forms 1.0 block: Replacing Avalon's ServiceManager interface with Spring 2

Posted by Vadim Gritsenko <va...@reverycodes.com>.
On Apr 10, 2008, at 3:58 PM, Magnus Haraldsen Amundsen wrote:
> I'm looking into the Cocoon Forms 1.0 block (with Cocoon 2.2) and it  
> seems very nice. But I see that the Java API example at http://cocoon.apache.org/2.2/blocks/forms/1.0/498_1_1.html 
>  use Avalon's ServiceManager interface. However, at the "New in 2.2"  
> page it says that "Cocoon 2.2 doesn't use an Avalon-based component  
> manager any more but uses Spring 2 instead.".
>
Cocoon 2.2 internally uses Spring, but it still provides backward  
compatibility (as far as it's possible) with Cocoon 2.1, so it  
implements Avalon functionality and provides an implementation of  
Avalon's ServiceManager. Because of this CForms 1.0 can continue to  
use ServiceManager.

I should also mention that there is CForms version 1.1 which does not  
use ServiceManager anymore and is migrated to Spring.

Links to CForms 1.0 and 1.1:
http://svn.apache.org/repos/asf/cocoon/branches/cocoon-forms-1.0.0/
http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-forms/


Vadim

> How do I replace the Avalon ServiceManager interface in the Cocoon  
> Forms 1.0 block Java API sample with Spring 2?
>
> A small code example on this would be great, since I don't know  
> Avalon or Spring 2.
>
> Best regards,
>
> Magnus

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