You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gritsenko <vg...@acm.org> on 2000/03/17 23:23:26 UTC

Re: Will cocoon work in this situation?

I have similar ineterest.

I do generate XML dynamically, in servlet, then save it to file, then
redirect to this xml file.

I would prefer to have Cocoon to take over XML output stream servlet
generates,
rather then taking over the request from browser to xml file.

Anybody knows how?



Viktor




----- Original Message -----
From: Brian Bray <bb...@xmission.com>
To: <co...@xml.apache.org>
Sent: Saturday, March 17, 2001 3:18 PM
Subject: Will cocoon work in this situation?


>
>
> Here is what I'm trying to do:
>
> I need to generate dynamic XML from ColdFusion and/or PHP.  I'm using
> mod_coldfusion and/or mod_php under apache.  I want to have the server be
> responsible for performing XSLT on the XML generated.
>
> To the best of my knowledge it is not possible to have
> mod_php/mod_coldfusion pass its generated content onto another apache
> processor. Is this true?  Could cocoon somehow monitor the mime types
> genrated by mod_php/mod_coldfusion and pick out the text/xml ones and
> process them?
>
> My other idea was to try to use mod_proxy as a reverse proxy server, and
> maybe integrate cocoon in there somewhere.  That would also be nice if in
> the future the site got huge the XSLT processing could be put on a
> seperate machine from the mod_php/mod_coldfusion processing.
>
> Any ideas?  Has something like this already been implemented?
>
> Thanks in advance,
>
> Brian Bray
>
>
>
> --
> Brian Bray
> bbray@xmission.com
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Will cocoon work in this situation? => XML to PDF on fly in one Serlet, no files, baby

Posted by Gritsenko <vg...@acm.org>.
Brief:

I wanted to generate XML in Servlet dynamically and pass it to Cocoon
somehow
without resorting to saving this xml to file and redirecting user's browser
to URL of this file.

I have found another
(better, easier, safer? than hacking Cocoon Producer)
solution.
Have found but not tried yet :)

See source code attached.

In few words:

I am a Servlet,
I have an XML document in form of String,
I wrap my HTTPRequest and  my XML document as String,
    into provided CocoonServletRequest,
        (I think it tricks Cocoon to think it is a file, since it fakes
implementation of getPAthInfo method, so Cocoon         thinks it is a file
and invokes it's FileProducer)
I instantitate CocoonEngine in myself,
I invoke 'handle' method of this engine, while passing to it
    my cocoonized wrapped Request,
    my own Response.

The effect is that my Response becomes Cocoon's  Response, so that whoever
receives it receives what Cocoon produced.

Viktor

PS.
This article have lead me to this solution:

http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-xmlj2ee.html




----- Original Message -----
From: Jon Brisbin <br...@ipa.net>
To: <co...@xml.apache.org>; Gritsenko <vg...@acm.org>;
<bb...@xmission.com>
Sent: Saturday, March 17, 2001 5:33 PM
Subject: RE: Will cocoon work in this situation?


>
> You might check the source code for a producer (start with
> org/apache/cocoon/producer/ProducerFromFile) and check out incorporating
> your servlet code as a producer instead of generating a file and
> redirecting...the configure cocoon.properties to use your producer instead
> of the producerfromfile...
>
> for the dynamic xml, consider checking into the producer, with the caveat
> that you'll be producing an xml file from a URL instead of from the file
as
> the ProducerFromFile does...don't remember the syntax right off, but
xerces
> can read input from a url...
>
> Jon Brisbin
> www.jbrisbin.net
>
>
> blah> -----Original Message-----
> blah> From: Gritsenko [mailto:vgritsenko@acm.org]
> blah> Sent: Friday, March 17, 2000 4:23 PM
> blah> To: cocoon-users@xml.apache.org
> blah> Subject: Re: Will cocoon work in this situation?
> blah>
> blah>
> blah> I have similar ineterest.
> blah>
> blah> I do generate XML dynamically, in servlet, then save it to file,
then
> blah> redirect to this xml file.
> blah>
> blah> I would prefer to have Cocoon to take over XML output stream servlet
> blah> generates,
> blah> rather then taking over the request from browser to xml file.
> blah>
> blah> Anybody knows how?
> blah>
> blah>
> blah>
> blah> Viktor
> blah>
> blah>
> blah>
> blah>
> blah> ----- Original Message -----
> blah> From: Brian Bray <bb...@xmission.com>
> blah> To: <co...@xml.apache.org>
> blah> Sent: Saturday, March 17, 2001 3:18 PM
> blah> Subject: Will cocoon work in this situation?
> blah>
> blah>
> blah> >
> blah> >
> blah> > Here is what I'm trying to do:
> blah> >
> blah> > I need to generate dynamic XML from ColdFusion and/or PHP.
> blah> I'm using
> blah> > mod_coldfusion and/or mod_php under apache.  I want to have
> blah> the server be
> blah> > responsible for performing XSLT on the XML generated.
> blah> >
> blah> > To the best of my knowledge it is not possible to have
> blah> > mod_php/mod_coldfusion pass its generated content onto
> blah> another apache
> blah> > processor. Is this true?  Could cocoon somehow monitor the
> blah> mime types
> blah> > genrated by mod_php/mod_coldfusion and pick out the
> blah> text/xml ones and
> blah> > process them?
> blah> >
> blah> > My other idea was to try to use mod_proxy as a reverse
> blah> proxy server, and
> blah> > maybe integrate cocoon in there somewhere.  That would also
> blah> be nice if in
> blah> > the future the site got huge the XSLT processing could be put on a
> blah> > seperate machine from the mod_php/mod_coldfusion processing.
> blah> >
> blah> > Any ideas?  Has something like this already been implemented?
> blah> >
> blah> > Thanks in advance,
> blah> >
> blah> > Brian Bray
> blah> >
> blah> >
> blah> >
> blah> > --
> blah> > Brian Bray
> blah> > bbray@xmission.com
> blah> >
> blah> >
> blah> >
> blah> >
>
blah> ---------------------------------------------------------------------
> blah> > Please check that your question has not already been answered in
the
> blah> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> blah> >
> blah> > To unsubscribe, e-mail: <co...@xml.apache.org>
> blah> > For additional commands, e-mail:
<co...@xml.apache.org>
> blah> >
> blah>
> blah>
>
blah> ---------------------------------------------------------------------
> blah> Please check that your question has not already been answered in the
> blah> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> blah>
> blah> To unsubscribe, e-mail: <co...@xml.apache.org>
> blah> For additional commands, e-mail: <co...@xml.apache.org>
> blah>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>

RE: Will cocoon work in this situation?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sat, 17 Mar 2001, Jon Brisbin wrote:

> for the dynamic xml, consider checking into the producer, with the caveat
> that you'll be producing an xml file from a URL instead of from the file as
> the ProducerFromFile does...don't remember the syntax right off, but xerces
> can read input from a url...

be very careful if you go down this route. if you allow users to put
arbitrary xml data from arbitrary sources into your cocoon reactor, you're
effectively giving them a shell account on your system.

- donald


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Will cocoon work in this situation?

Posted by Jon Brisbin <br...@ipa.net>.
You might check the source code for a producer (start with
org/apache/cocoon/producer/ProducerFromFile) and check out incorporating
your servlet code as a producer instead of generating a file and
redirecting...the configure cocoon.properties to use your producer instead
of the producerfromfile...

for the dynamic xml, consider checking into the producer, with the caveat
that you'll be producing an xml file from a URL instead of from the file as
the ProducerFromFile does...don't remember the syntax right off, but xerces
can read input from a url...

Jon Brisbin
www.jbrisbin.net


blah> -----Original Message-----
blah> From: Gritsenko [mailto:vgritsenko@acm.org]
blah> Sent: Friday, March 17, 2000 4:23 PM
blah> To: cocoon-users@xml.apache.org
blah> Subject: Re: Will cocoon work in this situation?
blah>
blah>
blah> I have similar ineterest.
blah>
blah> I do generate XML dynamically, in servlet, then save it to file, then
blah> redirect to this xml file.
blah>
blah> I would prefer to have Cocoon to take over XML output stream servlet
blah> generates,
blah> rather then taking over the request from browser to xml file.
blah>
blah> Anybody knows how?
blah>
blah>
blah>
blah> Viktor
blah>
blah>
blah>
blah>
blah> ----- Original Message -----
blah> From: Brian Bray <bb...@xmission.com>
blah> To: <co...@xml.apache.org>
blah> Sent: Saturday, March 17, 2001 3:18 PM
blah> Subject: Will cocoon work in this situation?
blah>
blah>
blah> >
blah> >
blah> > Here is what I'm trying to do:
blah> >
blah> > I need to generate dynamic XML from ColdFusion and/or PHP.
blah> I'm using
blah> > mod_coldfusion and/or mod_php under apache.  I want to have
blah> the server be
blah> > responsible for performing XSLT on the XML generated.
blah> >
blah> > To the best of my knowledge it is not possible to have
blah> > mod_php/mod_coldfusion pass its generated content onto
blah> another apache
blah> > processor. Is this true?  Could cocoon somehow monitor the
blah> mime types
blah> > genrated by mod_php/mod_coldfusion and pick out the
blah> text/xml ones and
blah> > process them?
blah> >
blah> > My other idea was to try to use mod_proxy as a reverse
blah> proxy server, and
blah> > maybe integrate cocoon in there somewhere.  That would also
blah> be nice if in
blah> > the future the site got huge the XSLT processing could be put on a
blah> > seperate machine from the mod_php/mod_coldfusion processing.
blah> >
blah> > Any ideas?  Has something like this already been implemented?
blah> >
blah> > Thanks in advance,
blah> >
blah> > Brian Bray
blah> >
blah> >
blah> >
blah> > --
blah> > Brian Bray
blah> > bbray@xmission.com
blah> >
blah> >
blah> >
blah> >
blah> ---------------------------------------------------------------------
blah> > Please check that your question has not already been answered in the
blah> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
blah> >
blah> > To unsubscribe, e-mail: <co...@xml.apache.org>
blah> > For additional commands, e-mail: <co...@xml.apache.org>
blah> >
blah>
blah>
blah> ---------------------------------------------------------------------
blah> Please check that your question has not already been answered in the
blah> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
blah>
blah> To unsubscribe, e-mail: <co...@xml.apache.org>
blah> For additional commands, e-mail: <co...@xml.apache.org>
blah>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>