'including' output from external files in a DTML doc?
Hi all, I thought that the simple blah <!--#var quote--> where quote is a DTML method called <!--#call "RESPONSE.redirect('http://host.domain/cgi-bin/general/quote.pl')"--> might include the output from quote.pl at the point where <!--#var quote--> appears. It doesn't. The redirect loads up quote.pl (which it was always going to do of course....) Anyone got any ideas on how to include output from external programs (in my case it will be Perl and PHP3) in a Zope document? tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
At 15:57 21/05/99 , Tony McDonald wrote:
Hi all, I thought that the simple
blah <!--#var quote-->
where quote is a DTML method called <!--#call "RESPONSE.redirect('http://host.domain/cgi-bin/general/quote.pl')"--> might include the output from quote.pl at the point where <!--#var quote--> appears.
It doesn't. The redirect loads up quote.pl (which it was always going to do of course....)
Anyone got any ideas on how to include output from external programs (in my case it will be Perl and PHP3) in a Zope document?
tone ------
By using an external method. That method should retrieve the URL, and return the contents of the URL. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-6254545 Fax: +31-35-6254555 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Tone, Couldn't you create an external method that used urllib to open th document through http, since both bits are on the same machine the overhead should be insignificant. HTH Phil phil@philh.org ----- Original Message ----- From: Tony McDonald <tony.mcdonald@ncl.ac.uk> To: Zope List <zope@zope.org> Sent: Friday, May 21, 1999 2:57 PM Subject: [Zope] 'including' output from external files in a DTML doc?
Hi all, I thought that the simple
blah <!--#var quote-->
where quote is a DTML method called <!--#call "RESPONSE.redirect('http://host.domain/cgi-bin/general/quote.pl')"-->
might include the output from quote.pl at the point where <!--#var quote--> appears.
It doesn't. The redirect loads up quote.pl (which it was always going to do of course....)
Anyone got any ideas on how to include output from external programs (in my case it will be Perl and PHP3) in a Zope document?
tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
No claims of efficiency or elegance, however this has worked for me, this is doc1: <!--#unless "REQUEST.has_key('minimalLineItems')"--> <!--#call "RESPONSE.redirect(vfaEstimatorURL+'rt1?ReturnURL='+URL+'&'+createQSForEstimator())"--> <!--#/unless--> <!--#if "REQUEST.has_key('minimalLineItems')"--> process page with results passed back in REQUEST['minimalLineItems']... <!--#/if--> this is doc2(in this case rt1): <!--#if "REQUEST.has_key('ReturnURL')"--> <!--#if "REQUEST.has_key('sitCSIItems')"--> <!--#call "RESPONSE.redirect(ReturnURL+'?minimalLineItems='+genMinimalLineItems(sitCSIItems))"--> <!--#/if--> <!--#/if--> 1. 'doc1' is called directly, therefore REQUEST['minimalLineItems'] doesn't exist. 2. It packs up its URL as the query parameter 'ReturnURL'. 3. It adds to the query whatever else 'doc2' expects as input. 4. It does the redirect to 'doc2'. 5. 'doc2' verifies it has been sent the query parameters it needs. 6. It does its processing thing. 7. It builds a query string with the 'return data'. 8. It does the redirect to the 'ReturnURL' furnished by 'doc1'. 9. 'doc1' now has the package of data it needs and goes about its business. note: a. 'doc1' could pass the URL of an arbitrary 'doc3' as the 'ReturnURL' to 'doc2'. b. none of the 'docs' need to be dtml/python, I've used asp for 'doc1' and 'doc3'. Hope this helps.
participants (4)
-
Mark Millikan -
Martijn Pieters -
Phil Harris -
Tony McDonald