You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Seth Ladd <sh...@osfmail.isc.rit.edu> on 2000/03/01 21:55:37 UTC

mapping filenames to producers?

Hello,

I've checked around, and I can't seem to figure out if this is possible or
not.  What I'd love to do is map a virtual file specified in the URI to a
producer.

In other words, I'd love to say http://myserver.com/anything/index.xml map
to a special IndexProducer, yet have the rest of the XML files be served
by the FileProducer.

What I would like to avoid is having to specifiy the producer on the URI,
such as http://myserver.com/anything/index.xml?producer=IndexProducer.  I
know I can set a default producer, but I'd like a more fine grained
producer selection.  Is this functionality only addressed with the
sitebook, which is a Cocoon2 feature only?

I guess one way to get around this is use something like mod_rewrite to
morph http://myserver.com/blahblah/index.xml to
http://myserver.com/blahblah/index.xml?producer=IndexProducer.

Any hints?

thanks very much,
Seth



Re: mapping filenames to producers?

Posted by Seth Ladd <sh...@osfmail.isc.rit.edu>.
> Seth Ladd wrote:
> [...]
> > I guess one way to get around this is use something like mod_rewrite to
> > morph http://myserver.com/blahblah/index.xml to
> > http://myserver.com/blahblah/index.xml?producer=IndexProducer.
> 
> I guess so. So why do you need it done by Cocoon itself?

So I can avoid a dependency on Apache, that's all.  Besides, the function
of tieing a request to a producer should be Cocoon's job I think.

Seth


Re: mapping filenames to producers?

Posted by Sylvan Ravinet <sy...@ravinet.com>.
Seth Ladd wrote:
[...]
> I guess one way to get around this is use something like mod_rewrite to
> morph http://myserver.com/blahblah/index.xml to
> http://myserver.com/blahblah/index.xml?producer=IndexProducer.

I guess so. So why do you need it done by Cocoon itself?

-Sylvan

-- 
________________________________________
Sylvan Ravinet - Contact information:
http://www.ravinet.com/contact-info.html

Re: mapping filenames to producers?

Posted by Seth Ladd <sh...@osfmail.isc.rit.edu>.
> Either do that, or write your own special producer that uses a
> configuration file to map URLs to producers, or help Pier with cocoon2's
> sitemap.

Oh, I didn't realize that the sitemap had been started.  I'll definately
check it out and see if there is anyway I can help out with it.

Thanks,
Seth


Re: mapping filenames to producers?

Posted by Mike Engelhart <me...@earthtrip.com>.
Gabor Dolla wrote:

> How can you call a producer from a producer ?
> Do you need JDK 2.2 with RequestDispatcher ?
> 
> Gabor
I'm not sure you can do that with a JSDK 2.2 RequestDispatcher.
RequestDispatcher's don't work if an outputstream has already been opened.
I can't remember exactly but I'm pretty sure Producer's create an
outputstream by default. You'll have to look at the source.

Mike


Re: mapping filenames to producers?

Posted by Gabor Dolla <ag...@mezon.net>.
> I reckon you'd look at the code for ProducerFactory and see how it does
> it. :)

Well, I did take a look but still I could not understand the role of
ProducerFactory... Maybe someone could explain it ??

Gabor



Re: mapping filenames to producers?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 2 Mar 2000, Gabor Dolla wrote:

> > 
> > Either do that, or write your own special producer that uses a
> > configuration file to map URLs to producers, or help Pier with cocoon2's
> > sitemap.
> How can you call a producer from a producer ?
> Do you need JDK 2.2 with RequestDispatcher ?

I reckon you'd look at the code for ProducerFactory and see how it does
it. :)

- donald


Re: mapping filenames to producers?

Posted by Gabor Dolla <ag...@mezon.net>.
> 
> Either do that, or write your own special producer that uses a
> configuration file to map URLs to producers, or help Pier with cocoon2's
> sitemap.
How can you call a producer from a producer ?
Do you need JDK 2.2 with RequestDispatcher ?

Gabor



Re: mapping filenames to producers?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 1 Mar 2000, Seth Ladd wrote:

> Hello,
> 
> I've checked around, and I can't seem to figure out if this is possible or
> not.  What I'd love to do is map a virtual file specified in the URI to a
> producer.
> 
> In other words, I'd love to say http://myserver.com/anything/index.xml map
> to a special IndexProducer, yet have the rest of the XML files be served
> by the FileProducer.
> 
> What I would like to avoid is having to specifiy the producer on the URI,
> such as http://myserver.com/anything/index.xml?producer=IndexProducer.  I
> know I can set a default producer, but I'd like a more fine grained
> producer selection.  Is this functionality only addressed with the
> sitebook, which is a Cocoon2 feature only?
> 
> I guess one way to get around this is use something like mod_rewrite to
> morph http://myserver.com/blahblah/index.xml to
> http://myserver.com/blahblah/index.xml?producer=IndexProducer.

Either do that, or write your own special producer that uses a
configuration file to map URLs to producers, or help Pier with cocoon2's
sitemap.

- donald