On 05.06.2007 14:26, Christian Schlichtherle wrote:
I need to set request headers when accessing an http: URL in a sitemap
pipeline.
I've digged into the source and came up with a solution to inherit from the
class org.apache.excalibur.source.impl.HTTPClientSourceFactory and override
the method getSource(String, Map). The second parameter is a Map which is
added to the GET request as header parameters by the super class. This map
seems to be null all the time. So I create a HashMap, populate it with my
parameters and pass it to the super class implementation. Finally I needed
to register my custom component in the configuration file cocoon.xconf.
Done.
Since all the building bricks already exist in Cocoon, I wonder if this has
been done already. There must be an even simpler solution, but I could not
figure it. Any hints would be welcome.
I'm not aware of a usage of that source (factory) in Cocoon. But there
is a proxy block which might help you. From a short look the generators
use HttpClient directly, not that source. I don't know if and how they
handle request headers. How do you plan to get the map filled with the
actual request headers? Are they configurable?
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]