You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nick Smith <ni...@hotmail.com> on 2003/10/22 01:26:09 UTC

Possible to POST using a HTML Generator?

Hi guys,

I wonder if anyone could help me: (pretty please? ;))

I'm trying to get hold of the results of a POST request made to a remote 
server - does anyone know if this is possible using the HTML generator? The 
reason I need to use this generator (I think) is that the results of the 
request will probably be HTML rather than XML, and I get the impression that 
this is the only generator that will handle regular HTML (using JTidy)?

After substantial wanderings through the cocoon folklore, I hear that the 
Web Service Proxy Generator might do want I need, except that: 1) it 
requires well formed XML to come back which I don't have, and 2) it requires 
cocoon version 1.2 at least, and I'm unfortunatly not in a position to 
upgrade yet.

What I'd ideally like to do is pass on any post parameters that cocoon gets, 
and forward them to the remote server before formatting the results of the 
post and passing them back to the user.

Could anyone give me any hint at all as to what direction I should research 
in? Is this even =possible= using cocoon?

Any ideas at all would be very gratefully recieved!

Thanks,
Nick

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Geoff Howard <co...@leverageweb.com>.
Geoff Howard wrote:

> Joerg Heinicke wrote:

>> HTMLGenerator? Why it should use httpclient? The proxy generators, yes.
>>
>> We have an example accessing remote server with HTMLGenerator in the 
>> Cocoon samples (the page switched from Yahoo News to Google SciFi not 
>> so long ago).
>>
>> <map:generate type="html" src="http://www.remoteserver.com"/>
> 
> Argh.  Now it's my turn to miss the details!  Yes, I was combining these 
> in my pea brain.  I don't know how the Source handles the http:// - 
> maybe that's the place to deal with the post.
> 
> Sounds like bottom line is - it can't be done at present.  (unless he 
> doesn't really need POST but can substitute GET).

Correcting myself: of course it can be done.  It can't be done by 
configuring the current set of components available.  A new component, 
or additional capability added to an existing component is needed.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Geoff Howard <co...@leverageweb.com>.
Joerg Heinicke wrote:

> On 23.10.2003 23:01, Geoff Howard wrote:
> 
>> Joerg Heinicke wrote:
>>
>>> Should be possible if an action handles the file upload, stores the 
>>> file on the server, returns the position on the server to the 
>>> sitemap. The HTMLGenerator (yes it's the only possibility of pushing 
>>> HTML through the pipeline) reads it from there and the rest goes on 
>>> as normally.
>>>
>>> Is this correct, Mr. File Upload Geoff? ;-)
>>
>> I don't see anything related to file uploads below.  I thought he just 
>> wanted to proxy a normal form post.  Am I missing it?
> 
> Oh no, I missed "results of a POST request". I combined POST and HTML 
> and XML and thought file upload. Sorry for that.
> 
>> As the HTML generator uses the httpclient package I think it could be 
>> modified to do this, but I don't know for sure.
> 
> HTMLGenerator? Why it should use httpclient? The proxy generators, yes.
> 
> We have an example accessing remote server with HTMLGenerator in the 
> Cocoon samples (the page switched from Yahoo News to Google SciFi not so 
> long ago).
> 
> <map:generate type="html" src="http://www.remoteserver.com"/>

Argh.  Now it's my turn to miss the details!  Yes, I was combining these 
in my pea brain.  I don't know how the Source handles the http:// - 
maybe that's the place to deal with the post.

Sounds like bottom line is - it can't be done at present.  (unless he 
doesn't really need POST but can substitute GET).

Geoff

> But this will not result in a POST AFAIK, but a GET request, while the 
> proxy generators only handle POST.
> 
> Joerg
> 
>> Geoff
>>
>>> On 22.10.2003 01:26, Nick Smith wrote:
>>>
>>>>
>>>> Hi guys,
>>>>
>>>> I wonder if anyone could help me: (pretty please? ;))
>>>>
>>>> I'm trying to get hold of the results of a POST request made to a 
>>>> remote server - does anyone know if this is possible using the HTML 
>>>> generator? The reason I need to use this generator (I think) is that 
>>>> the results of the request will probably be HTML rather than XML, 
>>>> and I get the impression that this is the only generator that will 
>>>> handle regular HTML (using JTidy)?
>>>>
>>>> After substantial wanderings through the cocoon folklore, I hear 
>>>> that the Web Service Proxy Generator might do want I need, except 
>>>> that: 1) it requires well formed XML to come back which I don't 
>>>> have, and 2) it requires cocoon version 1.2 at least, and I'm 
>>>> unfortunatly not in a position to upgrade yet.
>>>>
>>>> What I'd ideally like to do is pass on any post parameters that 
>>>> cocoon gets, and forward them to the remote server before formatting 
>>>> the results of the post and passing them back to the user.
>>>>
>>>> Could anyone give me any hint at all as to what direction I should 
>>>> research in? Is this even =possible= using cocoon?
>>>>
>>>> Any ideas at all would be very gratefully recieved!
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Joerg Heinicke <jh...@virbus.de>.
On 23.10.2003 23:38, Tony Collen wrote:

>> We have an example accessing remote server with HTMLGenerator in the 
>> Cocoon samples (the page switched from Yahoo News to Google SciFi not 
>> so long ago).
>>
>> <map:generate type="html" src="http://www.remoteserver.com"/>
>>
>> But this will not result in a POST AFAIK, but a GET request, while the 
>> proxy generators only handle POST.
> 
> This is wrong -- they can use either GET or POST, configured via parameter.

Then I did not remember correctly (or it has changed in the meantime). I 
thought there was a "we do not handle GET exception" anywhere.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Tony Collen <co...@umn.edu>.
Joerg Heinicke wrote:

  > Oh no, I missed "results of a POST request". I combined POST and HTML
> and XML and thought file upload. Sorry for that.
> 
>> As the HTML generator uses the httpclient package I think it could be 
>> modified to do this, but I don't know for sure.
> 
> 
> HTMLGenerator? Why it should use httpclient? The proxy generators, yes.

The WSProxy and the HttpProxy both use commons-httpclient, but I believe 
that "down below", the HTMLGenerator seems to use a Source.  I'm not 
sure how this is handled under the hood of source though, it could just 
be java.net.URL, or something.
> 
> We have an example accessing remote server with HTMLGenerator in the 
> Cocoon samples (the page switched from Yahoo News to Google SciFi not so 
> long ago).
> 
> <map:generate type="html" src="http://www.remoteserver.com"/>
> 
> But this will not result in a POST AFAIK, but a GET request, while the 
> proxy generators only handle POST.

This is wrong -- they can use either GET or POST, configured via parameter.

Regards,

Tony

> 
> Joerg



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Joerg Heinicke <jh...@virbus.de>.
On 23.10.2003 23:01, Geoff Howard wrote:

> Joerg Heinicke wrote:
> 
>> Should be possible if an action handles the file upload, stores the 
>> file on the server, returns the position on the server to the sitemap. 
>> The HTMLGenerator (yes it's the only possibility of pushing HTML 
>> through the pipeline) reads it from there and the rest goes on as 
>> normally.
>>
>> Is this correct, Mr. File Upload Geoff? ;-)
> 
> 
> I don't see anything related to file uploads below.  I thought he just 
> wanted to proxy a normal form post.  Am I missing it?

Oh no, I missed "results of a POST request". I combined POST and HTML 
and XML and thought file upload. Sorry for that.

> As the HTML generator uses the httpclient package I think it could be 
> modified to do this, but I don't know for sure.

HTMLGenerator? Why it should use httpclient? The proxy generators, yes.

We have an example accessing remote server with HTMLGenerator in the 
Cocoon samples (the page switched from Yahoo News to Google SciFi not so 
long ago).

<map:generate type="html" src="http://www.remoteserver.com"/>

But this will not result in a POST AFAIK, but a GET request, while the 
proxy generators only handle POST.

Joerg

> Geoff
> 
>> On 22.10.2003 01:26, Nick Smith wrote:
>>
>>>
>>> Hi guys,
>>>
>>> I wonder if anyone could help me: (pretty please? ;))
>>>
>>> I'm trying to get hold of the results of a POST request made to a 
>>> remote server - does anyone know if this is possible using the HTML 
>>> generator? The reason I need to use this generator (I think) is that 
>>> the results of the request will probably be HTML rather than XML, and 
>>> I get the impression that this is the only generator that will handle 
>>> regular HTML (using JTidy)?
>>>
>>> After substantial wanderings through the cocoon folklore, I hear that 
>>> the Web Service Proxy Generator might do want I need, except that: 1) 
>>> it requires well formed XML to come back which I don't have, and 2) 
>>> it requires cocoon version 1.2 at least, and I'm unfortunatly not in 
>>> a position to upgrade yet.
>>>
>>> What I'd ideally like to do is pass on any post parameters that 
>>> cocoon gets, and forward them to the remote server before formatting 
>>> the results of the post and passing them back to the user.
>>>
>>> Could anyone give me any hint at all as to what direction I should 
>>> research in? Is this even =possible= using cocoon?
>>>
>>> Any ideas at all would be very gratefully recieved!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Tony Collen <co...@umn.edu>.
Geoff Howard wrote:

> Joerg Heinicke wrote:
> 
>> Should be possible if an action handles the file upload, stores the 
>> file on the server, returns the position on the server to the sitemap. 
>> The HTMLGenerator (yes it's the only possibility of pushing HTML 
>> through the pipeline) reads it from there and the rest goes on as 
>> normally.
>>
>> Is this correct, Mr. File Upload Geoff? ;-)
> 
> 
> I don't see anything related to file uploads below.  I thought he just 
> wanted to proxy a normal form post.  Am I missing it?
> 
> As the HTML generator uses the httpclient package I think it could be 
> modified to do this, but I don't know for sure.

The WebServiceProxyGenerator and the HttpProxyGenerator both are 
configurable for POST, but they require XML back from the remote 
service.  Perhaps we should think about refactoring a proxy so it 
requires XML or not (ran through tidy).  There's definately some 
similarity between these components.


Regards,

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Geoff Howard <co...@leverageweb.com>.
Joerg Heinicke wrote:
> Should be possible if an action handles the file upload, stores the file 
> on the server, returns the position on the server to the sitemap. The 
> HTMLGenerator (yes it's the only possibility of pushing HTML through the 
> pipeline) reads it from there and the rest goes on as normally.
> 
> Is this correct, Mr. File Upload Geoff? ;-)

I don't see anything related to file uploads below.  I thought he just 
wanted to proxy a normal form post.  Am I missing it?

As the HTML generator uses the httpclient package I think it could be 
modified to do this, but I don't know for sure.

Geoff

> On 22.10.2003 01:26, Nick Smith wrote:
> 
>>
>> Hi guys,
>>
>> I wonder if anyone could help me: (pretty please? ;))
>>
>> I'm trying to get hold of the results of a POST request made to a 
>> remote server - does anyone know if this is possible using the HTML 
>> generator? The reason I need to use this generator (I think) is that 
>> the results of the request will probably be HTML rather than XML, and 
>> I get the impression that this is the only generator that will handle 
>> regular HTML (using JTidy)?
>>
>> After substantial wanderings through the cocoon folklore, I hear that 
>> the Web Service Proxy Generator might do want I need, except that: 1) 
>> it requires well formed XML to come back which I don't have, and 2) it 
>> requires cocoon version 1.2 at least, and I'm unfortunatly not in a 
>> position to upgrade yet.
>>
>> What I'd ideally like to do is pass on any post parameters that cocoon 
>> gets, and forward them to the remote server before formatting the 
>> results of the post and passing them back to the user.
>>
>> Could anyone give me any hint at all as to what direction I should 
>> research in? Is this even =possible= using cocoon?
>>
>> Any ideas at all would be very gratefully recieved!




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Possible to POST using a HTML Generator?

Posted by Joerg Heinicke <jh...@virbus.de>.
Should be possible if an action handles the file upload, stores the file 
on the server, returns the position on the server to the sitemap. The 
HTMLGenerator (yes it's the only possibility of pushing HTML through the 
pipeline) reads it from there and the rest goes on as normally.

Is this correct, Mr. File Upload Geoff? ;-)

Joerg

On 22.10.2003 01:26, Nick Smith wrote:

> 
> Hi guys,
> 
> I wonder if anyone could help me: (pretty please? ;))
> 
> I'm trying to get hold of the results of a POST request made to a remote 
> server - does anyone know if this is possible using the HTML generator? 
> The reason I need to use this generator (I think) is that the results of 
> the request will probably be HTML rather than XML, and I get the 
> impression that this is the only generator that will handle regular HTML 
> (using JTidy)?
> 
> After substantial wanderings through the cocoon folklore, I hear that 
> the Web Service Proxy Generator might do want I need, except that: 1) it 
> requires well formed XML to come back which I don't have, and 2) it 
> requires cocoon version 1.2 at least, and I'm unfortunatly not in a 
> position to upgrade yet.
> 
> What I'd ideally like to do is pass on any post parameters that cocoon 
> gets, and forward them to the remote server before formatting the 
> results of the post and passing them back to the user.
> 
> Could anyone give me any hint at all as to what direction I should 
> research in? Is this even =possible= using cocoon?
> 
> Any ideas at all would be very gratefully recieved!
> 
> Thanks,
> Nick
> 
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today! 
> http://www.msn.co.uk/messenger
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org