Re: [Zope] Saving a Rendered DTML Document
Thanks for your help. I will try this and let you know if it works. - Asad On Thu, 8 Dec 2005, Jonathan wrote: if you want to create an html file on the file system (which is a rendered version of a dtml method), you could use something like wget (http://www.gnu.org/software/wget/wget.html). Give wget the url to the dtml method and it will create an html file on the filesystem (which you can then access via your php routines). You could even create an external method which invokes wget - you could then call this external method from the same routine which creates/modifies your dtml method, so that the html file on the file system stays in sync with the dtml method. hth Jonathan - Original Message - From: "Asad Habib" <[EMAIL PROTECTED]> To: "Robert (Jamie) Munro" <[EMAIL PROTECTED]> Cc: Sent: Thursday, December 08, 2005 9:34 AM Subject: Re: [Zope] Saving a Rendered DTML Document Hello. The PHP script that I use relies on a path to locate the HTML file on the file system and since the DTML document is a Zope object, it does not have access to that. I also tried using a Zope File object as well as a DTML document that is part of a Local File System. Using a Zope File object does not work since the ouput of a rendered DTML document is text and providing the PHP script a Zope File filled with plain text does not work. The same goes for a DTML document that is part of a Local File System, once the document is rendered it is plain text. - Asad On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote: Asad Habib wrote: Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this document will only contain HTML offcourse and must be since it will be used by a PHP script). Is there a way to do this so every time the former changes, the latter is updated as well? Any help would be appreciated. Thanks. How does the PHP read the file? Why can't PHP read the file through the web, where it will be rendered. Robert Munro Ps. ZPT is a replacement for DTML, and is no help with your problem. ___ 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 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 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] Saving a Rendered DTML Document
Hello. Thanks for your input. I tried doing this but it didn't work. - Asad On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote: Asad Habib wrote: Hello. The PHP script that I use relies on a path to locate the HTML file on the file system and since the DTML document is a Zope object, it does not have access to that. I also tried using a Zope File object as well as a DTML document that is part of a Local File System. Using a Zope File object does not work since the ouput of a rendered DTML document is text and providing the PHP script a Zope File filled with plain text does not work. The same goes for a DTML document that is part of a Local File System, once the document is rendered it is plain text. Normally in PHP if you replace the file path with a URL starting http:// (or ftp:// etc.) it will fetch the file from the web instead of the file system, no problem. Robert Munro ___ 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] Saving a Rendered DTML Document
if you want to create an html file on the file system (which is a rendered version of a dtml method), you could use something like wget (http://www.gnu.org/software/wget/wget.html). Give wget the url to the dtml method and it will create an html file on the filesystem (which you can then access via your php routines). You could even create an external method which invokes wget - you could then call this external method from the same routine which creates/modifies your dtml method, so that the html file on the file system stays in sync with the dtml method. hth Jonathan - Original Message - From: "Asad Habib" <[EMAIL PROTECTED]> To: "Robert (Jamie) Munro" <[EMAIL PROTECTED]> Cc: Sent: Thursday, December 08, 2005 9:34 AM Subject: Re: [Zope] Saving a Rendered DTML Document Hello. The PHP script that I use relies on a path to locate the HTML file on the file system and since the DTML document is a Zope object, it does not have access to that. I also tried using a Zope File object as well as a DTML document that is part of a Local File System. Using a Zope File object does not work since the ouput of a rendered DTML document is text and providing the PHP script a Zope File filled with plain text does not work. The same goes for a DTML document that is part of a Local File System, once the document is rendered it is plain text. - Asad On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote: Asad Habib wrote: Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this document will only contain HTML offcourse and must be since it will be used by a PHP script). Is there a way to do this so every time the former changes, the latter is updated as well? Any help would be appreciated. Thanks. How does the PHP read the file? Why can't PHP read the file through the web, where it will be rendered. Robert Munro Ps. ZPT is a replacement for DTML, and is no help with your problem. ___ 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 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] Saving a Rendered DTML Document
Asad Habib wrote: Hello. The PHP script that I use relies on a path to locate the HTML file on the file system and since the DTML document is a Zope object, it does not have access to that. I also tried using a Zope File object as well as a DTML document that is part of a Local File System. Using a Zope File object does not work since the ouput of a rendered DTML document is text and providing the PHP script a Zope File filled with plain text does not work. The same goes for a DTML document that is part of a Local File System, once the document is rendered it is plain text. Normally in PHP if you replace the file path with a URL starting http:// (or ftp:// etc.) it will fetch the file from the web instead of the file system, no problem. Robert Munro ___ 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] Saving a Rendered DTML Document
Hello. The PHP script that I use relies on a path to locate the HTML file on the file system and since the DTML document is a Zope object, it does not have access to that. I also tried using a Zope File object as well as a DTML document that is part of a Local File System. Using a Zope File object does not work since the ouput of a rendered DTML document is text and providing the PHP script a Zope File filled with plain text does not work. The same goes for a DTML document that is part of a Local File System, once the document is rendered it is plain text. - Asad On Thu, 8 Dec 2005, Robert (Jamie) Munro wrote: Asad Habib wrote: Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this document will only contain HTML offcourse and must be since it will be used by a PHP script). Is there a way to do this so every time the former changes, the latter is updated as well? Any help would be appreciated. Thanks. How does the PHP read the file? Why can't PHP read the file through the web, where it will be rendered. Robert Munro Ps. ZPT is a replacement for DTML, and is no help with your problem. ___ 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] Saving a Rendered DTML Document
--On 7. Dezember 2005 10:40:04 -0500 Asad Habib <[EMAIL PROTECTED]> wrote: Hi. I have never used ZPT before, but from what I read, it seems like I can include the contents of a rendered DTML document (i.e. HTML only) in a Page Template by using . Am I correct? Also, if you could point me to an example, that would help. Thanks. You are missing the basis of Zope. Any Zope object that provides an API to generate content (HTML/plain text or whatever) can be called from a PyScript, from ZPT, from DTML. You just have to call the object method. The content returned from the object is then inserted into the output stream. And tal:content would be the way to take an object and call one of its exposed methods to produce *something*. Everything else is documented in three chapters of the Zope Book. -aj pgpup8MrpWRdz.pgp Description: PGP signature ___ 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] Saving a Rendered DTML Document
Hi. I have never used ZPT before, but from what I read, it seems like I can include the contents of a rendered DTML document (i.e. HTML only) in a Page Template by using . Am I correct? Also, if you could point me to an example, that would help. Thanks. - Asad On Wed, 7 Dec 2005, Chris Withers wrote: Is there any particular reason why you posted this message twice, 5 hrs apart? Asad Habib wrote: Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. Just render it into a File object using a python script. Run the python script as part of your processing that changes the DTML document or what the DTML document renders You could, of course, stop hurting yourself and replace the DTML document with a ZPT... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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] Saving a Rendered DTML Document
Is there any particular reason why you posted this message twice, 5 hrs apart? Asad Habib wrote: Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. Just render it into a File object using a python script. Run the python script as part of your processing that changes the DTML document or what the DTML document renders You could, of course, stop hurting yourself and replace the DTML document with a ZPT... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ 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] Saving a Rendered DTML Document
Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this document will only contain HTML offcourse and must be since it will be used by a PHP script). Is there a way to do this so every time the former changes, the latter is updated as well? Any help would be appreciated. Thanks. - Asad ___ 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] Saving a Rendered DTML Document
Hello. I have a DTML document which contains some DTML, but mostly HTML. I want to save the HTML contents of this DTML document once it is rendered by Zope (i.e. once the DTML is evaluated) in another DTML document (i.e. this document will only contain HTML offcourse and must be since it will be used by a PHP script). Is there a way to do this so every time the former changes, the latter is updated as well? Any help would be appreciated. Thanks. - Asad ___ 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 )