Yes, you may define them in your Spring config, like so:

<bean name="org.apache.cocoon.generation.Generator/myGenerator"
    class="com.mycom.MyGenerator" scope="prototype">
   <!-- Property injection -->
 </bean>

Note the format of the name attribute on your Spring bean!

Then you may use them in your sitemap, like this:

<map:match pattern="*">
        <map:generate src="..." type="myGenerator"/>
        <map:serialize/>
</map:match>


Cheers,

Robin

On 20 Jun 2008, at 15:27, Boris Goldowsky wrote:

As far as I know you still configure your generators the same as in
Cocoon 2.1, in the sitemap.xmap (not .xconf) file:

<map:components>
    <map:generators>
       <map:generator src="x.y.z.BeanGenerator" name="bean" />

I asked on this list a while back whether you can define sitemap
components via Spring configuration, but no one answered, so I assume
you cannot.

Bng


On Fri, 2008-06-20 at 13:56 +0100, David Legg wrote:
I would like to write a custom Cocoon generator in a Cocoon 2.2 application.

I've come across the excellent "Creating a Generator" [1] page on the
Cocoon site but I haven't spotted how Cocoon knows that when you use
<map:generate type="bean" /> in the sitemap it should use the new class
"BeanGenerator" as defined in the article.

I understand the 'old' way of doing this by creating a sitemap.xconf
file but I'd like to master the new technique.

I suspect if I read and re-read the Cocoon spring configurator [2] pages
it might sink in... but it would have to sink a long way ;-)

Regards,
David Legg

[1] http://cocoon.apache.org/2.2/core-modules/core/2.2/688_1_1.html

[2]
http://cocoon.apache.org/subprojects/configuration/1.0/spring- configurator/1.0/1304_1_1.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to