Re: [Zope] dtml forwarding request
On Thu, Jun 08, 2006 at 11:39:19PM +0200, Tino Wildenhain wrote: > Alric Aneron wrote: > > So there is no way to do it through python and DTML? > > > > I know Java has something like that. > ZEO is the canonical way to distribute zope stuff. > Well you should be sure you know what you do anyways. > Forwarding requests means you trust the users browser > to do the right thing. Maybe you can instead make > a subrequest by means of urllib and friends. If you do that, you're getting into the world of RPC and service-oriented development. There are a zillion ways to do that in zope... urllib/urllib2 as suggested, or you can use the callRemote() features of a sufficiently recent ZSyncer (see the README), or use zope's built-in XMLRPC server and on the client side use python's xmlrpclib. The latter two options are nice because they give you native python objects on both ends of the wire. Pretty much all of these will require you to write some "trusted" code, i.e. on the filesystem (in a Product or External Method). -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
Alric Aneron wrote: > So there is no way to do it through python and DTML? > > I know Java has something like that. *lol* Well you should be sure you know what you do anyways. Forwarding requests means you trust the users browser to do the right thing. Maybe you can instead make a subrequest by means of urllib and friends. Construct url (e.g. GET-parameters) is easy: in a python script: from ZTUtils import make_query targeturl="http://other.server/script?"+make_query(**context.REQUEST.form) (untested) should work. To construct form elements there is a similar function in ZTUtils, but I dont remember the name w/o looking at the source. Regards Tino Wildenhain ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
So there is no way to do it through python and DTML?I know Java has something like that.Jonathan <[EMAIL PROTECTED]> wrote: If you are using a zeo server and both server are zeo clients you could store the info on the zeo server, then do a redirect from serverA/methodA to serverB/methodB. If the servers do not have access to the same zeo server, then you are going to have to 'package-up' all the variables you need and send them to serverB/methodB Depending on what is happening in serverB/methodB you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie. methodA just sends a request to methodB, which does some processing and sends the results back to methodA for final processing/display). It's kind of hard to guess what would be best without knowing more about the application(s). Jonathan - Original Message -From:AlricAneronTo: Jonathan ; zope@zope.orgSent: Thursday, June 08, 2006 4:31 PM Subject: Re: [Zope] dtml forwardingrequest The dtml_method where I want to forward to is on anotherserver, so your may would be a little hard to do. Sorry, I didn't makemyself clear the first time.Thanks, anysuggestions?Jonathan <[EMAIL PROTECTED]> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan-Original Message -From:AlricAneronTo:zope@zope.org Sent:Thursday, June 08, 2006 4:22 PM Subject:[Zope] dtml forwarding request Hello,Is there a way in Zope to forward a request fromone page to another. When I say "forward" a request, I want toretain all the GET and POST request parameters. So similar to but response.redirectloses all the request parameters.I've been looking around and couldn't find it.Any ideas?Thanks in advance! Yahoo! Groups gets better. Checkout the new email design. Plus there�s much more to come. ___Zopemaillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev) Sneak preview the all-newYahoo.com. It's not radically different. Just radically better. Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
If you are using a zeo server and both server are zeo clients you could store the info on the zeo server, then do a redirect from serverA/methodA to serverB/methodB. If the servers do not have access to the same zeo server, then you are going to have to 'package-up' all the variables you need and send them to serverB/methodB Depending on what is happening in serverB/methodB you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie. methodA just sends a request to methodB, which does some processing and sends the results back to methodA for final processing/display). It's kind of hard to guess what would be best without knowing more about the application(s). Jonathan - Original Message - From: Alric Aneron To: Jonathan ; zope@zope.org Sent: Thursday, June 08, 2006 4:31 PM Subject: Re: [Zope] dtml forwarding request The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time.Thanks, any suggestions?Jonathan <[EMAIL PROTECTED]> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan - Original Message - From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello,Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to but response.redirect loses all the request parameters.I've been looking around and couldn't find it.Any ideas?Thanks in advance! Yahoo! Groups gets better. Check out the new email design. Plus there�s much more to come. ___Zope maillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
You can do a redirect and construct the cgi space from REQUEST. On Thu, 8 Jun 2006, Alric Aneron wrote: > The dtml_method where I want to forward to is on another server, so your may > would be a little hard to do. Sorry, I didn't make myself clear the first > time. > > Thanks, any suggestions? > > Jonathan <[EMAIL PROTECTED]> wrote: if you want to go straight from one > dtml routine to another just use dtml-var (ie. have dtml method A call > dtml method B) - then in dtml method A have: > > > > This will 'pass' control and the REQUEST space from A to B. > > Is this is not what you are looking for, then provide some more info as to > your use case. > > > > Jonathan > - Original Message - >From:AlricAneron >To: zope@zope.org >Sent: Thursday, June 08, 2006 4:22PM >Subject: [Zope] dtml forwardingrequest > > > Hello, > Is there a way in Zope to forward a request from onepage to another. > When I say "forward" a request, I want to retain allthe GET and POST > request parameters. So similar to expr="RESPONSE.redirect('...')"> but response.redirect loses all the > request parameters. > I've been looking around and couldn't find it. > Anyideas? > > Thanks in advance! > > > - >Yahoo! Groups gets better. Checkout the new email design. Plus > there�s much more to come. > > - > > ___ > Zope maillist - Zope@zope.org > http://mail.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev) > > > > - > Sneak preview the all-new Yahoo.com. It's not radically different. Just > radically better. -- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time.Thanks, any suggestions?Jonathan <[EMAIL PROTECTED]> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan- Original Message -From:AlricAneronTo: zope@zope.orgSent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwardingrequest Hello,Is there a way in Zope to forward a request from onepage to another. When I say "forward" a request, I want to retain allthe GET and POST request parameters. So similar to but response.redirect loses all therequest parameters.I've been looking around and couldn't find it.Anyideas?Thanks in advance! Yahoo! Groups gets better. Checkout the new email design. Plus there�s much more to come. ___Zope maillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev) Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] dtml forwarding request
if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan - Original Message - From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello,Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to but response.redirect loses all the request parameters.I've been looking around and couldn't find it.Any ideas?Thanks in advance! Yahoo! Groups gets better. Check out the new email design. Plus theres much more to come. ___Zope maillist - Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding! **(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] dtml forwarding request
Hello,Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to but response.redirect loses all the request parameters.I've been looking around and couldn't find it.Any ideas?Thanks in advance! Yahoo! Groups gets better. Check out the new email design. Plus theres much more to come. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )