Random ...
June 2018
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Tags ...

python+zope++:: Developing zope sites with dreamweaver: initial attempt
Posted at 02.Aug,2005 13:53  Comments 2 / Trackbacks 2 / Like this post!
Technorati tag(s):

I have dreamed of doing this since Zope Page Template was first introduced. And I've put this off since I'm really a DTML user (don't shoot me! ;))

Now, the plan is to mount zope as a webdav drive and use dreamweaver to manipulate Zope Page Templates and probably DTML and Scripts (Python).

When speaking about mounting webdav sites on Windows, these apps pop up:

  • webdrive - works great (or so people reported) but costs money
  • MS webfolder - you're lucky if you got this working. It's free

Googling for "webdav mount windows" led me to plone documentation site that pointed me to netdrive

Netdrive is a webdav client that we can use to mount webdav enabled servers. It's very much similar to webdrive, and it's free. So get netdrive and install.

Now we need to change the netdrive settings so that we get almost real time cache.

Map the webdav drive to a spare network mapping, e.g X:

We need to enable zope's webdav. edit zope.conf, and uncomment:

  #    # valid keys are "address" and "force-connection-close"
    address 1980
    force-connection-close off

Start dreamweaver, and add our site

  • click files > sites > new sites
  • click "Remote Info":
    • select "local/network" for Access,
    • select the webdav drive (X:),
    • check "enable check in and check out" and "check out file when opening".

Limited tests shows that checking "Automatically upload files to servers on save" won't work correctly.

Now we need to patch zope so that dreamweaver can recognize files with no extensions. I found this patch from zope-cmf mailing list. We need to edit the patch a bit to make it work with vanilla zope sites. Get the patch

To patch, go to zope SOFTWARE_HOME, and do:

  patch -p0 < /path/to/webdav.patch

Restart zope. We can also do the additional steps as mentioned in the zope-cmf list if we're interested in editing Scripts (python) in dream weaver.

With the patch, all extensionless Page Templates (and DTML and others) will have an extension of .webdav.html; e.g for a page template with id test, we'll see test.webdav.html and so can click and open with dream weaver with no problems.

This ought to work. However, if we're interested in adding Page Templates from dream weaver, we need to add PUT_factory method to our zope root.

Adding a PUT_factory:

  • get the file
  • put it in zope INSTANCE_HOME/Extensions
  • go to ZMI, Root folder
  • add external method with:
    • id: PUT_factory
    • module: put_factory
    • function: PUT_factory

Note: case is important

Testing this out. Creating new file:

  • open dreamweaver
  • create new file.
  • save file to X: (or your mapped drive; eg. test.webdav.html)
  • close file

Check via ZMI to see whether file exists. It should be saved as test and is a Page template.

Editing existing files:

  • open dreamweaver
  • navigate to mapped drive (X:)
  • double click. edit and change
  • save file
  • right click said file and click "Check In"

Things should be good.

I've done limited tests and it seems to work. YMMV. Tell me/us your experience!

Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/37/tbping 

Give us us Free!

Word has it that NetDrive isn't free. Such is life. :)

Denny  at 28.Feb,2006 13:27

Denny, I may be confused, but I thought that netdrive is/was free (as in beer). I have no idea about free as in speech, nor frankly, do I care... ;)

Sam  at 10.Oct,2006 08:34
Post a comment