You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by florent andré <fl...@4sengines.com> on 2010/10/15 00:38:22 UTC

2.2 Bean "heritance"

Hi all,

Newbie to 2.2 and not a star in spring, so maybe this question is non
sense.

The case :

- I have a module "Main" where is defined an input-module (AnInput) in a
"bean way"

- I have a module "Specific" that depend on the "Main" and would like to
use AnInput is his sitemap.

I have to redeclare the input-module in the "Specific" module ? Or there
is a way to use the "main" one ?

I would prefer the second one is possible.

Thanks for your lights.

++


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


Re: 2.2 Bean "heritance"

Posted by Andre Juffer <an...@oulu.fi>.
  I am not sure if I understand your question.

You have two beans 'Main' and 'Specific', each to be configured by 
Spring. Specific depends on Main. For you Java lasses, you something like

public class Specific()
{
...
}

public class Main() {
     ...
     private Specific specific;

     public void setMain(Specific specific)
     {
          this.specific = specific;
     }
}

and your bean configuration looks like

<bean id="com.foo.bar.Main" class="com.foo.bar.MainImpl">
</bean>

<bean id="com.foo.bar.Specific" class="com.foo.bar.SpecificImpl">
<property name="main" ref="com.foo.bar.Main" />
</bean>

Is you question whether or not you would need to include your bean 
configuration as local to a particular block or global to all blocks? My 
answer would be 'local' if these beans are required for particular 
blocks only. Otherwise take one of the blocks and include your beans as 
'global' and they will be the same to all blocks in your webapp.


On 10/15/2010 01:38 AM, florent andré wrote:
> Hi all,
>
> Newbie to 2.2 and not a star in spring, so maybe this question is non
> sense.
>
> The case :
>
> - I have a module "Main" where is defined an input-module (AnInput) in a
> "bean way"
>
> - I have a module "Specific" that depend on the "Main" and would like to
> use AnInput is his sitemap.
>
> I have to redeclare the input-module in the "Specific" module ? Or there
> is a way to use the "main" one ?
>
> I would prefer the second one is possible.
>
> Thanks for your lights.
>
> ++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com


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


Re: 2.2 Bean "heritance"

Posted by Andre Juffer <an...@oulu.fi>.
  I forgot to include the following link:

http://cocoon.apache.org/2.2/core-modules/core/2.2/1263_1_1.html


On 10/15/2010 01:38 AM, florent andré wrote:
> Hi all,
>
> Newbie to 2.2 and not a star in spring, so maybe this question is non
> sense.
>
> The case :
>
> - I have a module "Main" where is defined an input-module (AnInput) in a
> "bean way"
>
> - I have a module "Specific" that depend on the "Main" and would like to
> use AnInput is his sitemap.
>
> I have to redeclare the input-module in the "Specific" module ? Or there
> is a way to use the "main" one ?
>
> I would prefer the second one is possible.
>
> Thanks for your lights.
>
> ++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com


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