Re: [Zope] probably a simple answer..
I'm thinking Kate means that she is writing to an Excel file on a Zope/Windows server, acting as a simple database, perhaps via ODBC. Kate can you clarify what you are trying to do? Thanks. -- Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Phone: 505 994-2135 Fax: 505 994-3603
Not really.. Ideally, I'd like the script just to save the file to a pre-selected path. Then anyone can open it from there. Kate -----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of hpinson@indepthl.com Sent: Thursday, November 17, 2005 12:14 PM To: zope@zope.org Subject: Re: [Zope] probably a simple answer.. I'm thinking Kate means that she is writing to an Excel file on a Zope/Windows server, acting as a simple database, perhaps via ODBC. Kate can you clarify what you are trying to do? Thanks. -- Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Phone: 505 994-2135 Fax: 505 994-3603 _______________________________________________ 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 )
Well, I can suggest how I might approach it, which might be different than what you intend... but for what it is worth... First, run Zope on a Windows server so you can interact with an Excel file as an ODBC Data Source (DSN). You could setup a Zope/ODBC adaptor Product like zodbc or (better) mxODBC in Zope. Then in Windows control panel, setup an ODBC DSN to the Excel file, and create a Zope/ODBC connection in the ZMI. Then you might be able to use ZSQL methods, or Python if you perfer, perhaps using SQL or the Windows API, to write to the Excel spreadsheet. You might have to use some sort of external file storage for the Excel file, i.e. I'm not sure how you could store the Excel file in the ZODB and still interact with it and expose it through Zope, though that might be possible. Like Andreas said, you can't write to a users file system directly, if that's what you meant. -- Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Phone: 505 994-2135 Fax: 505 994-3603
Well, we're working on porting it over from linux but at the moment that's my only option... I just had this impression that I'd seen something whereby I could write to the filesystem using an external method. Kate -----Original Message----- From: hpinson@indepthl.com [mailto:hpinson@indepthl.com] Sent: Thursday, November 17, 2005 1:06 PM To: Kate Legere; zope@zope.org Subject: RE: [Zope] probably a simple answer.. Well, I can suggest how I might approach it, which might be different than what you intend... but for what it is worth... First, run Zope on a Windows server so you can interact with an Excel file as an ODBC Data Source (DSN). You could setup a Zope/ODBC adaptor Product like zodbc or (better) mxODBC in Zope. Then in Windows control panel, setup an ODBC DSN to the Excel file, and create a Zope/ODBC connection in the ZMI. Then you might be able to use ZSQL methods, or Python if you perfer, perhaps using SQL or the Windows API, to write to the Excel spreadsheet. You might have to use some sort of external file storage for the Excel file, i.e. I'm not sure how you could store the Excel file in the ZODB and still interact with it and expose it through Zope, though that might be possible. Like Andreas said, you can't write to a users file system directly, if that's what you meant. -- Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Phone: 505 994-2135 Fax: 505 994-3603
On 11/17/05, Kate Legere <klegere@kfpl.ca> wrote:
Well, we're working on porting it over from linux but at the moment that's my only option... I just had this impression that I'd seen something whereby I could write to the filesystem using an external method.
Kate
Sure you could write to the filesystem of the server hosting Zope. I do it with XML files, having Zope Product code open a file, parse it, modify it, write it to the filesystem. The uid running Zope will need write permission to wherever you want the file to go. If you want the resulting file to appear as a downloadable file linked on a web site, you could work with ExternalFile or similar. None of this touches on the issue of how you create an Excel file (you hope to do this from Linux?) Rob
Kate Legere wrote:
Well, we're working on porting it over from linux but at the moment that's my only option... I just had this impression that I'd seen something whereby I could write to the filesystem using an external method.
Categorically, no web server can write to the file system on a client, think about what a horrific security hole that would be ;-) Why on earth would you port anything over _from_ linux?! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
External methods can certainly use the built in Python "open" function. However, I'd shudder at the thought of creating an "Excel" file rather than a plain-text CSV (comma separated values) file, since the former is (I presume) closed-source and binary, whilst the latter is simple text, human readable and should be easy to make. However, it sounds like this part might already be working, so YMMV. Also, it sounds like you're intending to have Zope/Plone generate the file, and then placing it on a file system so that users can get at it "from anywhere". Keep in mind that if the data in MySQL changes, the file system version won't (necessarily) have been updated.... hence it'll be out of date with no indication to the viewer. To solve that, presuming you're only providing file system access for MSWindows clients, you could put a MSW-style-URL-link file on the shared file system. Then you would have semi-transparent access to the current data through a file system "file" (if there is anonymous access or authentication transparent to the user). And if you *DO* write the file to the file system, be sure to test for concurrent read/write conflicts on the file (and it's timing related, so do lots of read-hits while writing, or use a write-and-rename scheme. (I could recount a horror story of intermittently lost data at the customer site that I never did duplicate locally). Either way, good luck. Kate Legere wrote:
Well, we're working on porting it over from linux but at the moment that's my only option... I just had this impression that I'd seen something whereby I could write to the filesystem using an external method.
Kate
-----Original Message----- From: hpinson@indepthl.com [mailto:hpinson@indepthl.com] Sent: Thursday, November 17, 2005 1:06 PM To: Kate Legere; zope@zope.org Subject: RE: [Zope] probably a simple answer..
Well, I can suggest how I might approach it, which might be different than what you intend... but for what it is worth...
First, run Zope on a Windows server so you can interact with an Excel file as an ODBC Data Source (DSN). You could setup a Zope/ODBC adaptor Product like zodbc or (better) mxODBC in Zope. Then in Windows control panel, setup an ODBC DSN to the Excel file, and create a Zope/ODBC connection in the ZMI. Then you might be able to use ZSQL methods, or Python if you perfer, perhaps using SQL or the Windows API, to write to the Excel spreadsheet. You might have to use some sort of external file storage for the Excel file, i.e. I'm not sure how you could store the Excel file in the ZODB and still interact with it and expose it through Zope, though that might be possible.
Like Andreas said, you can't write to a users file system directly, if that's what you meant.
participants (5)
-
Chris Withers -
hpinson@indepthl.com -
Kate Legere -
Nikko Wolf -
Robert Boyd