Additional HTML-Header on ZServer FTP-get
After I have read about ZServer and the FTP access method, I was really intrigued by the possibility to use emacs+ange-ftp to easily manage Zope Documents. After a bit of struggling with the Zope configuration I got it working: I LOVE emacs: I can open a file '/localhost:8021:/standard_html_header', edit it and then save it with C-x C-s and it will be changed in the Zope-Database. Cool. (I patched ange-ftp to support Port Numbers though...) Now to the Problem: Whenever I open a DTML-Document or DTML-Method, ZServer seams to add '<html><head></head>' as the first line. Saving the changed document then saves this additional HTML-Header... Bad... Is this a (known?) Bug in ZServer? I'm using ZServer Version 1.0b1 with Zope 1.10.2 and ZPublisher 990415. Another question: How does ZServer determine the type of Object to Add when put-ing a new File? Stefan.
At 07:48 PM 6/8/99 +0200, Stefan Bund wrote:
After I have read about ZServer and the FTP access method, I was really intrigued by the possibility to use emacs+ange-ftp to easily manage Zope Documents.
After a bit of struggling with the Zope configuration I got it working: I LOVE emacs: I can open a file '/localhost:8021:/standard_html_header', edit it and then save it with C-x C-s and it will be changed in the Zope-Database. Cool. (I patched ange-ftp to support Port Numbers though...)
Yes this is very cool. BTW, EFS already supports FTP port numbers.
Now to the Problem: Whenever I open a DTML-Document or DTML-Method, ZServer seams to add '<html><head></head>' as the first line. Saving the changed document then saves this additional HTML-Header... Bad...
Is this a (known?) Bug in ZServer?
This is an known and fixed bug. Unfortunately that doesn't help you right now unless you want to upgrade to the latest unstable release.
Another question: How does ZServer determine the type of Object to Add when put-ing a new File?
This is not some much a ZServer issue as a Zope PUT handling issue. For the most part the same code that handles FTP put handles HTTP PUT and WebDAV put. Basically Zope looks for a content-type header on the request, barring that, it uses the mimetypes module to guess the mime-type from the file extension. Then it creates a Zope object that it chooses as most closely matching the content-type. Of course there are problems with this approach. What if you create a Z Class and want to associate a file extension or a mime-type with it? What if you want DTML Documents, rather than DTML Methods to be created by PUT? What if you want WebDAV puts to treat .txt files differently than FTP puts? Etcetera, etcetera. I don't think this issue has been a priority for anyone so far. If it is for you, we're open to suggestions. (And patches ;-) -Amos
pavlos@gaaros.msrc.sunysb.edu (Pavlos Christoforou) writes:
On 8 Jun 1999, Stefan Bund wrote:
(I patched ange-ftp to support Port Numbers though...) Excellent!!
Can we have the patches ;-)
Sure. I'll send them to you by personal mail. Just one remark: It's realy just a hack, and I don't know if it will work with gateways or smart gateways (I rather think not). But here it is. If you have a better idea I'd be glad to hear about it. amos@aracnet.com (Amos Latteier) writes:
Yes this is very cool. BTW, EFS already supports FTP port numbers.
Hmmm.. can someone tell me, what EFS is, and how it incorporates with emacs? Bye, Stefan.
On 09 Jun 1999 10:23:11 +0200, Stefan Bund <asbund@gmx.de> said: Stefan> Sure. I'll send them to you by personal mail. Just one remark: It's Stefan> realy just a hack, and I don't know if it will work with gateways or Stefan> smart gateways (I rather think not). I'd like to have the patched ange-ftp as well! Thanks. Stefan> But here it is. If you have a better idea I'd be glad to hear about Stefan> it. Stefan> Hmmm.. can someone tell me, what EFS is, and how it incorporates Stefan> with emacs? All I know: it's the default FTP mode that ships with XEmacs. It understands port numbers like this C-x C-f /user@hostname#port:/pathname/ Alex Rice | alrice@swcp.com | http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA
participants (4)
-
Alex Rice -
Amos Latteier -
Pavlos Christoforou -
Stefan Bund