[Zope] FTP automangling file extension: semi-working proof-of-concept

Jean Jordaan jean@upfrontsystems.co.za
Mon, 30 Jul 2001 16:51:35 +0200


Hi Joel

I've also toyed with ideas related to this, though I
wasn't looking at the file extension -- since my editor 
is Vim, not DreamWeaver. (When I have to work with 
designers who use DW, I just use ids that end in '.htm'.)

My dream was rather to extend the "data block" parsing
that Zope does when passing objects in and out via FTP
or WebDAV. Specifically, Python scripts arrive looking 
like this:

## Script (Python) "formatContentLayer"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=page_id
##title=
##
''' Enumerates the positioning of the content <div>s and the
    backgrounds.
'''

I'd love it if I could create new objects on the filesystem,
and have Zope create them in the ZODB when I upload. The data 
block for a DTML method might look like:

## DTML Method "sendMail"
##title=
##
<dtml-comment> .. and so on

Zope should look for a factory for the meta-type on the
first line, and create the object if successful, or fail
to upload if unsuccessful. 

To accommodate non-Zope-aware FTP- and WebDAVing, this 
behaviour should happen on ports of their own .. eg.
localhost:8021 for normal FTP and localhost:8121 for superFTP?

(I suspect I'm drifting in the direction of something like
FlareLang http://flarelang.sourceforge.net/prog-overview.html
here, with the objects represented as XML on the filesystem.
That might mean something like:
<object>
<meta_type>Script (Python)</meta_type>
<id>formatContentLayer</id>
<bindings>
<binding>container <binds>container</binds> </binding>
<binding>namespace </binding>
...
</bindings>
<parameters>
<parameter>page_id</parameter>
</parameters>
<title></title>
<body>
''' Enumerates the positioning of the content <div>s and the
    backgrounds.
'''
...
</body>
</object>
)

Regards,
Jean