Is there any way to persuade a "vanilla" Zope 2.7.0 installation (read: no Plone, CMF, etc.) to send reasonable mimetypes for things like Python scripts or DTML methods or documents? -- Kirk Strauser The Day Companies
On Mon, 26 Jul 2004 10:41:24 -0500, Kirk Strauser <kirk@daycos.com> wrote:
Is there any way to persuade a "vanilla" Zope 2.7.0 installation (read: no Plone, CMF, etc.) to send reasonable mimetypes for things like Python scripts or DTML methods or documents?
Do the names of your scripts have extensions? If so, you should be able to configure the MIME types for the extensions by configuring Zope to load additional mappings of extensions for MIME types. See the "mime-types" setting in your zope.conf file; there's a description of how to use that in the sample zope.conf that gets created in a new instance. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com>
On Monday 26 July 2004 10:52, Fred Drake wrote:
Do the names of your scripts have extensions?
No, they don't. An example name is "resolveImageIds". I didn't want to use extensions anywhere on the site because I didn't want to, say, replace a DTML method with a Python script and have to chose between renaming the object or updating 50 other objects throughout the site that access it. -- Kirk Strauser The Day Companies
I *think* you can give each of these ZODB objects a property named "content-type" set to the content type you want it to be and it will do the right thing. You probably don't want to do this on each object, but this can happen now. On Mon, 2004-07-26 at 12:13, Kirk Strauser wrote:
On Monday 26 July 2004 10:52, Fred Drake wrote:
Do the names of your scripts have extensions?
No, they don't. An example name is "resolveImageIds". I didn't want to use extensions anywhere on the site because I didn't want to, say, replace a DTML method with a Python script and have to chose between renaming the object or updating 50 other objects throughout the site that access it.
On Monday 26 July 2004 11:38, Chris McDonough wrote:
I *think* you can give each of these ZODB objects a property named "content-type" set to the content type you want it to be and it will do the right thing. You probably don't want to do this on each object, but this can happen now.
Actually, there's no way to add properties to a Python script through the management interface, and I don't believe that it would be conceptually possible anyway (since you should theoretically be setting the properties inside the script itself). I think. I would be pleasantly surprised to find out that I'm wrong. :) -- Kirk Strauser The Day Companies
On Mon, 2004-07-26 at 14:03, Kirk Strauser wrote:
On Monday 26 July 2004 11:38, Chris McDonough wrote:
I *think* you can give each of these ZODB objects a property named "content-type" set to the content type you want it to be and it will do the right thing. You probably don't want to do this on each object, but this can happen now.
Actually, there's no way to add properties to a Python script through the management interface, and I don't believe that it would be conceptually possible anyway (since you should theoretically be setting the properties inside the script itself). I think. I would be pleasantly surprised to find out that I'm wrong. :)
Right you are, sorry. It would likely still be possible to set a content-type attribute on these objects (albeit not via the management interface; likely via the debugger or an external method or product code or whatever), and that might have the "right" effect. - C
On Mon, 26 Jul 2004 11:13:07 -0500, Kirk Strauser <kirk@daycos.com> wrote:
No, they don't. An example name is "resolveImageIds". I didn't want to use extensions anywhere on the site because I didn't want to, say, replace a DTML method with a Python script and have to chose between renaming the object or updating 50 other objects throughout the site that access it.
Very reasonable; I certainly wasn't going to advocate changing them. I'm not sure of the best way to deal with the MIME types issue, though. It would be nice for them to do the right thing, but it may be that the right thing requires changing the implementations for those types in some way. I don't imagine it would take much if everyone agreed what the right MIME types were. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com>
On Monday 26 July 2004 11:39, Fred Drake wrote:
Very reasonable; I certainly wasn't going to advocate changing them.
Just making sure. :)
I don't imagine it would take much if everyone agreed what the right MIME types were.
Kate accepts either of "application/x-python" and "text/x-python", both of which seem reasonable. -- Kirk Strauser The Day Companies
On Mon, 26 Jul 2004 13:10:33 -0500, Kirk Strauser <kirk@daycos.com> wrote:
Kate accepts either of "application/x-python" and "text/x-python", both of which seem reasonable.
"text/x-python" is what the Grail developers decided to use, and is something that gets used more than anything else when something specific is used. I wouldn't object if Zope always generated that content-type for Python Scripts. Something would still need to be determined for DTML; perhaps text/vnd.zope.dtml (and it should be properly registered with IANA). -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com>
On Mon, 26 Jul 2004 11:13:07 -0500 Kirk Strauser <kirk@daycos.com> wrote:
On Monday 26 July 2004 10:52, Fred Drake wrote:
Do the names of your scripts have extensions?
No, they don't. An example name is "resolveImageIds". I didn't want to use extensions anywhere on the site because I didn't want to, say, replace a DTML method with a Python script and have to chose between renaming the object or updating 50 other objects throughout the site that access it.
How would the client know what mime type to use? External editor solves this problem by passing metadata from the server, but OTOH you cannot create new objects through external editor, so it essentially punts on the "what to create" dilemma. -Casey
On Monday 26 July 2004 13:25, Casey Duncan wrote:
How would the client know what mime type to use?
Are you referring to the situation in which the webdav client is writing to an object that doesn't already exist? If so, then I have no good answer. For the moment, I'm more interested in being able to open an already existing object and have a reasonably clueful editor automatically apply the appropriate syntax highlighting, indention rules, etc. Right now, whether using Emacs via FTP or Kate via webdav, I have to open each individual file and then tell the editor to load the appropriate editing mode. I would be quite happy to not have to do that anymore. How does Zope currently decide which mimetype to send when a client requests a file via webdav? -- Kirk Strauser The Day Companies
On Mon, 2004-07-26 at 15:02, Kirk Strauser wrote:
Right now, whether using Emacs via FTP or Kate via webdav, I have to open each individual file and then tell the editor to load the appropriate editing mode.
How do you do that in Kate, BTW? I'm able to do it in Komodo easily, but it looks like KDE/Kate has a static-only mapping. - C
On Monday 26 July 2004 14:26, Chris McDonough wrote:
How do you do that in Kate, BTW? I'm able to do it in Komodo easily, but it looks like KDE/Kate has a static-only mapping.
What? Set the editing mode? That's just a menu option. If you're asking about how to get Kate to always open a given file in a specific mode, then I have no idea. I just started playing around with it last week as a possible candidate for replacing Emacs. -- Kirk Strauser The Day Companies
On Mon, 2004-07-26 at 15:54, Kirk Strauser wrote:
On Monday 26 July 2004 14:26, Chris McDonough wrote:
How do you do that in Kate, BTW? I'm able to do it in Komodo easily, but it looks like KDE/Kate has a static-only mapping.
What? Set the editing mode? That's just a menu option.
OIC, it's the Tools -> Highlight Mode option. I don't know how I missed it before, thanks.
If you're asking about how to get Kate to always open a given file in a specific mode, then I have no idea. I just started playing around with it last week as a possible candidate for replacing Emacs.
Nah, I just meant in an ad-hoc way.
On Monday 26 July 2004 15:11, Chris McDonough wrote:
OIC, it's the Tools -> Highlight Mode option. I don't know how I missed it before, thanks.
Oh! Sorry for the terse response; I didn't realize that was really what you were asking.
Nah, I just meant in an ad-hoc way.
I've got that part down pat. Now if only I can find the non-ad-hoc way. :) -- Kirk Strauser The Day Companies
On Mon, 26 Jul 2004 14:02:52 -0500 Kirk Strauser <kirk@daycos.com> wrote:
On Monday 26 July 2004 13:25, Casey Duncan wrote:
How would the client know what mime type to use?
Are you referring to the situation in which the webdav client is writing to an object that doesn't already exist? If so, then I have no good answer.
Right, me neither, especially in the absence of file extensions. Most clients are pretty clueless about setting a Content-Type HTTP header as well, and if you are using FTP, you're just SOL...
For the moment, I'm more interested in being able to open an already existing object and have a reasonably clueful editor automatically apply the appropriate syntax highlighting, indention rules, etc.
External editor solves this problem by adding file extensions to the temporary files you are editing based on what kind of object it is or what kind of data it contains. It can do this because it receives object metadata from the server. Some editors (such as NEdit) will introspect the file and try to determine what kind of file it is that way. This is easier to do with some formats (like HTML/XML) then others, but it us effective when it works.
Right now, whether using Emacs via FTP or Kate via webdav, I have to open each individual file and then tell the editor to load the appropriate editing mode. I would be quite happy to not have to do that anymore.
Yup. The stupid thing is that the Mac had this problem solved in 1984, with type/creator file metadata *sigh*.
How does Zope currently decide which mimetype to send when a client requests a file via webdav?
This is generally based on the content_type attribute of the object (as Chris said), but some objects have their own rules. It would not be difficult to wire in "text/x-python" for python scripts, for example. -Casey
On Tuesday 27 July 2004 08:43, Casey Duncan wrote:
Right now, whether using Emacs via FTP or Kate via webdav, I have to open each individual file and then tell the editor to load the appropriate editing mode. I would be quite happy to not have to do that anymore.
Yup. The stupid thing is that the Mac had this problem solved in 1984, with type/creator file metadata *sigh*.
I never used pre-OS X Macs, so I'm not too familiar with the mechanism. How would it compare to mime information?
This is generally based on the content_type attribute of the object (as Chris said), but some objects have their own rules. It would not be difficult to wire in "text/x-python" for python scripts, for example.
Where would an interested party begin to look for doing such a thing? I'd be willing to take a shot at it, with the caveat that I'm more experienced programming *inside* Zope and not directly *on* Zope. -- Kirk Strauser The Day Companies
On Tuesday, July 27, 2004, at 11:02 AM, Kirk Strauser wrote:
Yup. The stupid thing is that the Mac had this problem solved in 1984, with type/creator file metadata *sigh*.
What's even more stupid is that, though they have this in OSX as well, Goliath on OSX doesn't use it properly, and/or the mac doesn't use it properly, and even worse there's no way (I can find...) to set up the built-in webdav's type translation.
Hi all In my opinion would be interesant to be a product like Virtual Host Monster and these "special" products to add file extensions in webdav and FTP Some days ago I try to understand the publish process in these services to do the product but I can't understand it I would like a product that could stablish the extension with my own criteria, put or not if I like to use it... I would like I can "assignate" these extensions to meta_types with a list or something easy and you could use some redefinition to these extension by putting other "FTP/WebDav extensions" products in the containers like acl_users I can't understand what problem could be these product... I read in one year of zoping a lot of messages about these problem. Perhaps you could satisfy the people that confide in zope Thanks and sorry if these message incommode someone ----- Original Message ----- From: "Marc Lindahl" <marc@bowery.com> To: <zope@zope.org> Sent: Wednesday, July 28, 2004 2:59 AM Subject: Re: [Zope] Re: Webdav and mimetypes
On Tuesday, July 27, 2004, at 11:02 AM, Kirk Strauser wrote:
Yup. The stupid thing is that the Mac had this problem solved in 1984, with type/creator file metadata *sigh*.
What's even more stupid is that, though they have this in OSX as well, Goliath on OSX doesn't use it properly, and/or the mac doesn't use it properly, and even worse there's no way (I can find...) to set up the built-in webdav's type translation.
_______________________________________________ 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 )
On Wednesday, July 28, 2004, at 01:59 am, Marc Lindahl wrote:
On Tuesday, July 27, 2004, at 11:02 AM, Kirk Strauser wrote:
Yup. The stupid thing is that the Mac had this problem solved in 1984, with type/creator file metadata *sigh*.
What's even more stupid is that, though they have this in OSX as well, Goliath on OSX doesn't use it properly, and/or the mac doesn't use it properly, and even worse there's no way (I can find...) to set up the built-in webdav's type translation.
I think what this thread showed (sorry I got to it a bit late) is that Zope long ago outgrew its server-side web-interface life and that if somebody were to bridge the quality-of-interface gap between the excellent cgi server etc inside Zope and the rather terrible user interface (only terrible because you instinctively want to be able to drag and drop while preserving object metadata, or right-click to edit properties, and you don't want to have to edit scripts through a web browser's non-syntax-coloured <textarea>s) If we also got a tight integration between local and server metadata, so we could upload files intelligently into new Zope objects without using a web form, then we'd win again. Personally, I don't really want to see the join between Zope and my desktop unless I choose to :-) Forgive me if I've missed any existing software that does these things and tell me where I can get it! Ben
Ben Weiner, Text Matters wrote:
Forgive me if I've missed any existing software that does these things and tell me where I can get it!
Have a look at WebDrive and Zope's WebDAV source port. Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (8)
-
Ben Weiner, Text Matters -
Casey Duncan -
Chris McDonough -
Chris Withers -
Fred Drake -
Garito -
Kirk Strauser -
Marc Lindahl