Saving a rendered DTML document with LocalFS
Any suggestions on an easy way to save a rendedred DTML document to a file with LocalFS? We have a DTML document that is a report that can be rendered on command showing the current status of orders. We send out a daily summary to an email list. The summary has a link to the archived detail report. Currently the detail report is brought up in the browser and we do a "Save as.." to save the renderd copy. I would like to automate the saving of the rendered copy. Any suggestions? Jim Sanford
Jim Sanford wrote:
Any suggestions on an easy way to save a rendedred DTML document to a file with LocalFS?
We have a DTML document that is a report that can be rendered on command showing the current status of orders. We send out a daily summary to an email list. The summary has a link to the archived detail report. Currently the detail report is brought up in the browser and we do a "Save as.." to save the renderd copy.
I would like to automate the saving of the rendered copy.
Any suggestions?
Use something like this: <dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let> I haven't used LocalFS, so I can't help for the middle bit. -- Steve Alexander Software Engineer Cat-Box limited
On Wed, 10 May 2000, Steve Alexander wrote:
Jim Sanford wrote:
Any suggestions on an easy way to save a rendedred DTML document to a file with LocalFS?
We have a DTML document that is a report that can be rendered on command showing the current status of orders. We send out a daily summary to an email list. The summary has a link to the archived detail report. Currently the detail report is brought up in the browser and we do a "Save as.." to save the renderd copy.
I would like to automate the saving of the rendered copy.
Any suggestions?
Use something like this:
<dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let>
If all you need is to save it on the filesystem just write an external method that does that. Something like <untested> def save(self,doc,filepath): try: open(filepath,'w').write(doc) except: return 0 return 1 and call it from your DTML method like <dtml-call "save(_.render(<the report method>),'/tmp/report.doc'))"> Pavlos
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <39199CD1.196FD662@cat-box.net>, Steve Alexander <steve@cat- box.net> writes
<dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let>
Wouldn't it be more useful to save to a database? - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORqsNbTRdIWzaLpMEQJbBACgoMCXDVoc+7A1g/ImV/7S+pv9BkQAoM0y vFiUGnKMrlbYc6GFydNQjc2D =aEDf -----END PGP SIGNATURE-----
In article <39199CD1.196FD662@cat-box.net>, Steve Alexander <steve@cat- box.net> writes
<dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let>
Wouldn't it be more useful to save to a database?
Depends on what you want to use it for. --jfarr
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <02f601bfbbad$77382dd0$eb0217ac@dev.prognet.com>, Jonothan Farr <jfarr@real.com> writes
In article <39199CD1.196FD662@cat-box.net>, Steve Alexander <steve@cat- box.net> writes
<dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let>
Wouldn't it be more useful to save to a database?
Depends on what you want to use it for. --jfarr
Since Jim was indicating that the reports went out with a link to the saved file, that would seem to indicate that he wants to allow his customers to have access to previous reports. A database solution seems more useful, IMHO of course! - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORsN3rTRdIWzaLpMEQJpeACg6WrharRNeTvQkntw9Jab/lukn1QAoJQw mHuouhswdxbEkzEt8v8VVmu7 =6+in -----END PGP SIGNATURE-----
Graham Chiu wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
In article <02f601bfbbad$77382dd0$eb0217ac@dev.prognet.com>, Jonothan Farr <jfarr@real.com> writes
In article <39199CD1.196FD662@cat-box.net>, Steve Alexander <steve@cat- box.net> writes
<dtml-let rendered_data="_.render(your_dtml_method)"> Code to save rendered_data into file using LocalFS here </dtml-let>
Wouldn't it be more useful to save to a database?
Depends on what you want to use it for. --jfarr
Since Jim was indicating that the reports went out with a link to the saved file, that would seem to indicate that he wants to allow his customers to have access to previous reports. A database solution seems more useful, IMHO of course!
But file system is (one kind of a) database ;) -------------- Hannu
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <391BF2AF.5B3C1875@tm.ee>, Hannu Krosing <hannu@tm.ee> writes
Since Jim was indicating that the reports went out with a link to the saved file, that would seem to indicate that he wants to allow his customers to have access to previous reports. A database solution seems more useful, IMHO of course!
But file system is (one kind of a) database ;)
So is my waste basket! Peripheral to this is my dislike of companies that insist on sending me price lists in Excel format because to them Excel spreadsheets are a database :-( - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvFR7TRdIWzaLpMEQIdSgCeJTJEMkQAKaodUwaJmOv5DwXubGIAni7Q Qh9hMPXUxKq/v0KVnu0JntpD =fk4o -----END PGP SIGNATURE-----
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system. They are kept for snapshot/historic purposes. (Mostly to have the "evidence" when the sales person changes his story to his manager.) The reports that really matters are dynamically generated. Jim Sanford ----- Original Message ----- From: "Graham Chiu" <anon_emouse@hotmail.com> To: <zope@zope.org> Sent: Friday, May 12, 2000 2:48 PM Subject: Re: [Zope] Saving a rendered DTML document with LocalFS -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <391BF2AF.5B3C1875@tm.ee>, Hannu Krosing <hannu@tm.ee> writes
Since Jim was indicating that the reports went out with a link to the saved file, that would seem to indicate that he wants to allow his customers to have access to previous reports. A database solution seems more useful, IMHO of course!
But file system is (one kind of a) database ;)
So is my waste basket! Peripheral to this is my dislike of companies that insist on sending me price lists in Excel format because to them Excel spreadsheets are a database :-( - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvFR7TRdIWzaLpMEQIdSgCeJTJEMkQAKaodUwaJmOv5DwXubGIAni7Q Qh9hMPXUxKq/v0KVnu0JntpD =fk4o -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <00e201bfbc5b$c3a9e380$04fea8c0@sanwinmain>, Jim Sanford <jsanford@atinucleus.com> writes
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system. They are kept for snapshot/historic purposes. (Mostly to have the "evidence" when the sales person changes his story to his manager.)
I have an E-commerce site. The final order page with all items, prices etc is saved to a database as an HTML file so that customers can go back and look up previous orders from day zero. This is also for historic purposes. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.co.nz/x.php?/Shopping -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvb4LTRdIWzaLpMEQJQZgCeIUTpsFYzxkploE76b26kag7qoXMAoNXd hvYhPCEZ1bEZysxUFPOhKB9W =148u -----END PGP SIGNATURE-----
When Zope started as PCGI, it runs at the same user of the web server process (I'm using a variant of Apache). So for every file the web server has access, localFS product has access too. But some areas of the web site are restrict area (must be accessed with authentication certificates). If a content manager user can create localFS objects into Zope, the restrict content can be accessed. Is there a way to configure Zope of localFS to limit access to files in file system? Thanks for any help. Alexandre A. Drummond Barroso Extranet Software Engineer Intelligenesis Corp. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Graham Chiu Sent: Friday, May 12, 2000 6:25 PM To: zope@zope.org Subject: Re: [Zope] Saving a rendered DTML document with LocalFS -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <00e201bfbc5b$c3a9e380$04fea8c0@sanwinmain>, Jim Sanford <jsanford@atinucleus.com> writes
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system. They are kept for snapshot/historic purposes. (Mostly to have the "evidence" when the sales person changes his story to his manager.)
I have an E-commerce site. The final order page with all items, prices etc is saved to a database as an HTML file so that customers can go back and look up previous orders from day zero. This is also for historic purposes. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.co.nz/x.php?/Shopping -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvb4LTRdIWzaLpMEQJQZgCeIUTpsFYzxkploE76b26kag7qoXMAoNXd hvYhPCEZ1bEZysxUFPOhKB9W =148u -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
You can restrict access to LocalFS in the following ways: - by restricting the permissions of the Zope process in the file system - by restricting the permissions of Zope users in the LocalFS object - by limiting the base path of the LocalFS object. No one should be able to access anything outside of the base path I think in this case you would want to use method #3 don't create LocalFS objects that can access your restricted content. For example, if your directory structure is: /home/www /data /images /secure You could create LocalFS objects with base paths: /home/www/data /home/www/images Then /home/www/secure could not be accessed. Unfortunately, there is no way to create a LocalFS pointing to /home/www without giving it access to secure/. What you could do in that case is move the content up to /home/www-secure and configure apache to serve that directory from the base path /secure. Hope this helps, --jfarr "Perl is worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998 ----- Original Message ----- From: Alexandre A. Drummond Barroso <alexandre@intelligenesis.net> To: <zope@zope.org> Sent: Friday, May 12, 2000 4:33 PM Subject: [Zope] Security problems with localFS and PCGI
When Zope started as PCGI, it runs at the same user of the web server process (I'm using a variant of Apache).
So for every file the web server has access, localFS product has access too. But some areas of the web site are restrict area (must be accessed with authentication certificates).
If a content manager user can create localFS objects into Zope, the restrict content can be accessed.
Is there a way to configure Zope of localFS to limit access to files in file system?
Thanks for any help.
Alexandre A. Drummond Barroso Extranet Software Engineer Intelligenesis Corp.
All access to this site is via authenticated https. There are no anonymous users, and EVERY request for data is verified via a custom query against a permissions table. Jim ----- Original Message ----- From: "Alexandre A. Drummond Barroso" <alexandre@intelligenesis.net> To: <zope@zope.org> Sent: Friday, May 12, 2000 6:33 PM Subject: [Zope] Security problems with localFS and PCGI When Zope started as PCGI, it runs at the same user of the web server process (I'm using a variant of Apache). So for every file the web server has access, localFS product has access too. But some areas of the web site are restrict area (must be accessed with authentication certificates). If a content manager user can create localFS objects into Zope, the restrict content can be accessed. Is there a way to configure Zope of localFS to limit access to files in file system? Thanks for any help. Alexandre A. Drummond Barroso Extranet Software Engineer Intelligenesis Corp. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Graham Chiu Sent: Friday, May 12, 2000 6:25 PM To: zope@zope.org Subject: Re: [Zope] Saving a rendered DTML document with LocalFS -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <00e201bfbc5b$c3a9e380$04fea8c0@sanwinmain>, Jim Sanford <jsanford@atinucleus.com> writes
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system. They are kept for snapshot/historic purposes. (Mostly to have the "evidence" when the sales person changes his story to his manager.)
I have an E-commerce site. The final order page with all items, prices etc is saved to a database as an HTML file so that customers can go back and look up previous orders from day zero. This is also for historic purposes. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.co.nz/x.php?/Shopping -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvb4LTRdIWzaLpMEQJQZgCeIUTpsFYzxkploE76b26kag7qoXMAoNXd hvYhPCEZ1bEZysxUFPOhKB9W =148u -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
It was faster to implement on the file system. This is something that is kicked out just once a day. a summary is emailed to a select list and a link to the saved generated detail report is included in the email. Beyond that, it is not used except by my programming partner and I. If usage changes we make look into putting them into ta DB. I have already spent more time replying to emails than I did writing the code. JIm ----- Original Message ----- From: "Graham Chiu" <anon_emouse@hotmail.com> To: <zope@zope.org> Sent: Friday, May 12, 2000 4:24 PM Subject: Re: [Zope] Saving a rendered DTML document with LocalFS -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <00e201bfbc5b$c3a9e380$04fea8c0@sanwinmain>, Jim Sanford <jsanford@atinucleus.com> writes
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system. They are kept for snapshot/historic purposes. (Mostly to have the "evidence" when the sales person changes his story to his manager.)
I have an E-commerce site. The final order page with all items, prices etc is saved to a database as an HTML file so that customers can go back and look up previous orders from day zero. This is also for historic purposes. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.co.nz/x.php?/Shopping -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBORvb4LTRdIWzaLpMEQJQZgCeIUTpsFYzxkploE76b26kag7qoXMAoNXd hvYhPCEZ1bEZysxUFPOhKB9W =148u -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system.
I probably need to rethink some things about how LocalFS works because honestly it isn't very useful for, say, creating directories and then saving files to those directories through DTML. You're probably best off using an external method right now because you would need to use an external method anyway to get LocalFS do to that. --jfarr "Perl is worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998
I am using an external method to save the reports but am using LocalFS to make them available. JIM ----- Original Message ----- From: "Jonothan Farr" <jfarr@real.com> To: "Jim Sanford" <jsanford@atinucleus.com>; <zope@zope.org> Sent: Friday, May 12, 2000 5:00 PM Subject: Re: [Zope] Saving a rendered DTML document with LocalFS
These are sales/order tracking/forecasting reports. The reports are HTML tables and are easier to handle on the file system.
I probably need to rethink some things about how LocalFS works because honestly it isn't very useful for, say, creating directories and then saving files to those directories through DTML. You're probably best off using an external method right now because you would need to use an external method anyway to get LocalFS do to that. --jfarr "Perl is worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998
participants (7)
-
Alexandre A. Drummond Barroso -
Graham Chiu -
Hannu Krosing -
Jim Sanford -
Jonothan Farr -
Pavlos Christoforou -
Steve Alexander