cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: New protocol and SourceFactory in Cocoon 2.2
Date Tue, 24 Apr 2007 21:18:00 GMT
Juan José Vázquez Delgado pisze:
> Hi everyone!
> I´m writing my first application with cocoon 2.2 (M3) and have a 
> problem. I´d like using a ImageReader but with a custom SourceFactory 
> and protocol. For example, I´d like something like this inside the 
> sitemap.xmap in my block:
> <map:match pattern="/repo/folder/my_file.gif">
>       <map:read type="image" 
> src="custom_protocol:///repo/folder/my_file.gif" mime-type="image/gif" />
> </map:match>
> I suposse that have to make a custom SourceFactory and Source but i 
> don´t know how configure the factory and the protocol with spring in my 
> block.

You are right, you must write custom SourceFactory and Source and register it as Spring's
bean. For concrete example take a look at:
(ServletSource and ServletSourceFactory)

And configuration should look like this one:

Source is registered with 'servlet' scheme. You specify it at the end of bean's name (after
slash sign). Rest should be obvious.

Grzegorz Kossakowski

View raw message