cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphaël Piéroni <raphael.pier...@aql.fr>
Subject Re: [cocoon 2.2] Spring configuration of transformers
Date Wed, 12 Sep 2007 09:11:35 GMT
Grzegorz Kossakowski a écrit :
> Raphaël Piéroni pisze:
>   
>>>  
>>>       
>>>> And this transformer have to access the database (DAO w/ transaction)
>>>> that is defined with spring.
>>>> But i can't manage to link the 2 information.
>>>>     
>>>>         
>>> Is this transformer a Spring bean? Do you want to inject Spring bean
>>> (a DAO) into some property of
>>> transformer?
>>>   
>>>       
>> Yup i try to inject the service wrapper arround the DAOs (with
>> transaction - spring aop) in a field transformer/generator
>>     
>
> Then configure your transformer as casual Spring bean and put configuration into
> META-INF/cocoon/spring. If you wonder how to name your bean just use following pattern:
> <fullyQualifiedNameOfInterfaceImplemented>/<nameOfComponentUsedInSitemap>
>
> Where first part can have three values (respectively, for Generator, Transformer and
Serializer).
> This way of configuring sitemap components is preferred in Cocoon 2.2.
>
>   
Do you mean something like this:
in my jar defining my block sitemap, i do
META-INF/c/s/myGenerators-services.xml
in which i do <bean name="o.a.c...Generator/myGeneratorName">

and in my sitemap i do
        <map:pipeline>
            <map:match pattern="myPipeline">
                <map:generate type="myGeneratorName"/>
                <map:serialize type="xml"/>
            </map:match>
        </map:pipeline>
and also in the sitemap, i don't define
<map:components>
        <map:generators >
            <map:generator name="myGeneratorName" 
src="com.company.project.MyGeneratorClass"/>



Raphaël

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


Mime
View raw message