[OLUG] Help a Zope dope

Daniel Pfile pfiled at marietta.edu
Mon Jun 26 23:31:06 UTC 2000


On Mon, 26 Jun 2000, Dave Burchell wrote:

> I'm trying to get started with Zope, but I just can't seem to get any
> traction.  I need a Zope guru to help me see the forest for the one hand
> clapping.

Congrats, zope is some good stuff, since i've started using it about 6
months ago i've done a few large sites in it. I like it alot, you'll never
look back at perl the same way again.
 
> Let's say I've set up Zope and Z server on my Linux box and I want to
> let people who visit my Web site leave comments.  I want to give them a
> textbox and a submit button.  (I've got this part down.)  When the user
> hits "submit" I want to add the comments to a Zope object database as a
> text document.  Perhaps I want to change the permissions so everyone
> can read this document but no one but the superuser can delete it.

Well, there are a few aproaches to this, you need to give an anonymous
user the perms to create a document in whichever folder you want the
messages stored in, but not the permisions to delete the file. I forget
the exact name of the method to create the document, check out what gets
called when you create a dtml method or document from the manage_main
interface.

Anyway, IMO, unless you're just trying to learn some dtml and zope, I
wouldn't make your application this way. Zope has something called
zclasses that allow you to make new objects in zope. There is a basic
tutorial in the zope developers guide on the main site. Beehive also has
some commercial tutorials available on zclasses and
users/groups/perms. For 30 DM each (about $15 US). I just bought them both
the other day, I was rather disapointed in the user/group/perm one, but
that was probobly because i'm already rather skilled in that area. The
zclass one is top notch tho, it should get you started and knowing enough
to make use of everything else on the zope site and actually use zclasses.

Anyway, it sounds like what you're making is a guestbook. There is a
zclass on the zope.org site called 'guestbook' i think. I'd give that a
look and see if it does what you want, or use it for ideas to create your
own object.

> This simple wish can't be hard, but how do I do it?  And where can I get
> some intro docs so a Zope novice can RTFM?

I wish it were that simple, like most opensource projects, the code moves
faster than the docs. Hence the reason beehive is offering commercial zope
tutorials. After you've read the content manager's guide, and had a glance
through the dtml ref/zsql guide/dev guide. I'd recomend reading a few of
the howtos, doesn't matter which ones, just to help you get a feel for how
zope works. After that, the zope doc project (zdp.zope.org) is pretty
good. And of course the mailing lists and the source. You'll probobly want
to learn a bit of python too, if you know any other lang, you should be
able to pick python up in a weekend. Learning python is a good bet to pick
it up.

> While I'm at it, how do I write a Python script and run it from the command
> line that accesses Zope documents, perhaps even adding new documents and
> modifying old ones?

There are a few ways to do this.
1: Running locally (or with zeo) import the proper modules to access the
zodb and manipulate the objects using python. You should read a little up
on the zodb (zodb howto maybe) in order to do this. There is a script on
zope.org called zope shell (i think) that basicly does exactly what you
want.

2: XML-RPC, there are libs out there for python that allow you to use
xml-rpc (what we had before SOAP aka microsoft .NET) which zope has enable
already, meaning you can call any zope method with xml-rpc. So, using the
xml-rpc python module, you can access zope using http as a transport
layer. It gets rather odd when you're accessing zclasses i've heard, but
overall it's not to rough. Oh yah, zope will do SOAP soon.

3: Use ftp. In addition to http, xml-rpc, webdav (you could use that too,
but i won't go over that), zope does ftp. This is usefull for getting into
zope using kde/gnome/window's file managers, or emacs. It works just like
ftp, only on whatever port you specified in your z2.py startup script
(maybe 8021).


Anyway, sorry if i was vague, there's alot to zope. It's a pretty amazing
versitile piece of software. One of these days I'll do a presentation for
olug on zope, if i can just make it to one of the meetings... I keep an
extremly odd schedule. I didn't get home this past sunday till 8 am for
example.

If you need some more help, just drop me an email, I'll see what i can get
to at home on the linux box/mac. I hate this gimpy nt workstations at
work...

Good luck young zen master.

# Daniel Pfile        # I have no cool signature.
# pfiled at marietta.edu # Finger for free illegal software.



---------------------------------------------------------------------
To unsubscribe, e-mail: olug-unsubscribe at bstc.net
For additional commands, e-mail: olug-help at bstc.net



More information about the OLUG mailing list