4th November 2002

Am looking to use Zwiki to add collaborative document authoring capabilities to the PostgreSQL? Technical Documentation site (http://techdocs.postgresql.org).

Some details:

Am thinking this can be somehow achieved with the careful use of VirtualHostMonster? and Apache's rewrite rules

All suggestions welcome, am still very new to Python, Zope, Zwiki, etc.

:-)

Regards and best wishes,

Justin Clift (justin@postgresql.org)


Ok, am now figuring out the "VirtualHostMonster?" + Apache's mod_rewrite thing.

Notes

RewriteEngine? On

RewriteCond? %{HTTP_HOST} ^techdocs.postgresql.org$

RewriteRule? ^/guides(.*) http://127.0.0.1:8080/VirtualHostBase/http/%{HTTP_HOST}:80/techdocs.postgresql.org/VirtualHostRoot?/guides$1 [L,P]?

Is anyone with experience with mod_rewrite able to confirm that it's definitely a workable set of rules to direct just the requests for the http://techdocs.postgresql.org/guides directory to Zwiki/Zope?

This appears to be working with the exception of images. It's not including the "/guides/" directory at the start of images, althought it's getting it right for links. Probably have to look into this when less tired.

I skip the rewriting these days and just use Apache as a ReverseProxy? pointing at the VHM machine. You likely have to add one more ProxyPass? statement something like this:

# Needed due to some strange hardwired URLs in ZWiki ?? ProxyPass /misc_/ZWiki http://10.0.0.5/VirtualHostBase/http/%{HTTP_HOST}/Wiki/misc_/ZWiki/VirtualHostRoot/_vh_Wiki/


5th November 2002, 00:32

Now looking at how to turn on the "Edit" button for the Zwiki pages. Have found in the Zope management interface the "Security tab". When clicking on this after having entered into the "guides" WikiWeb? item, it brings up a list of properties that can be turned on and off for people.

Near the bottom it includes these ones, and they look like what's needed:

Next to these they each have a checkbox for "Acquire". Not sure what that's about, but will have to check it out tomorrow.

There are four columns, Anonymous, Authenticated, Manager, and Owner. They each have a checkbox in them for each of the Zope and Zwiki options.

Will have to take a look at these later on too.

Saved a few changes that looked reasonable, and voila, the "Edit" button is now on for some stuff. Have to see if this is predictable or a co-incidence.

For the moment though, need to get some sleep.


Justin,

You can keep your users in postgresql if you look for the exUserFolder product at sourceforge. This is very neat product and will all you to write a custom authentication handler. Use psycopg for the Python adapter.

I would use VHM and Apache rewrite.

regarding images .. you may have to create another rewrite for /guides/ so it goes to the correct place. (just a thought)

good luck! ~runyaga


5th November 2002, 22:48 GMT+10

Thanks Runyaga.

Will probably take a look at the exUserFolder product at SF.net in the near future. Firstly, just need to get things up and running. :)

Also, added another rewrite rule to handle the images as you suggested, so they're working fine now too.

Going to delve into the user authentication side of Zwiki now, to see how things work with that. :)

+ Justin

Notes on customising Zwiki

Am testing this out at present by coping the standard PostgreSQL? site header and footers into this, to see what happens.


7th November 2002, 06:42 GMT+10

The exUserFolder page is . It apparently will allow for customised authentication methods to be written, which combined with being able to call an external PostgreSQL? database sounds like it has potential.

It would be beneficial to tie in with the present userbase of registered PostgreSQL? members instead of having to maintain 2 separate lists.

There is a page on Zwiki implementation of exUserFolder at ZwikiAndExUserFolder.


7th November 2002, 11:17 GMT+10

The recommended PostgreSQL? driver for Python appears to be psycopg (http://initd.org/software/psycopg). Am downloading it now.

Notes

The way to adjust the look and feel of a Zwiki installation is through customising it's templates.

In the $ZWIKI_ROOT/templates directory there are things like standard_wiki_header, standard_wiki_footer, and others. If you change these, then the appearance of your site will be updated accordingly. It's ok to just cut and paste HTML into them (tried it, works fine).

If you create "DTML Method" documents with these names in a Zope folder (i.e. through the Zope Management Interface), these new documents will override the defaults for that folder and all subsequent sub-folders, so you can theme different areas of a website in this way.

SimonMichael mentioned there being another template file, but haven't looked into that yet.


7th November 2002, 20:14 GMT+10

Finally got the psycopg database adapter to configure and install properly. This has got to be the worst piece of configuration mangling I've ever seen required for a software util/driver/etc. :(

System configuration of the test system:

Configuration & installation steps for psycopg, run as the zope user

  1. $ ./configure --with-python=/home/zope/local/bin/python --with-python-version=2.1 --with-mxdatetime-includes=/home/zope/local/lib/python2.1/site-packages/mx/DateTime?/mxDateTime/ --with-postgres-includes=/usr/local/include/postgresql/server/ --with-postgres-libraries=/usr/local/lib --with-zope=/home/zope/zope
  2. Edit the resulting Makefile, changing the line from:

-I/usr/local/include/postgresql/server/ -I/usr/local/include/postgresql/server//server -I/home/zope/local/lib/python2.1/site-packages/mx/DateTime?/mxDateTime/ -DVERSION=\"1.0.13\" \

to:

-I/usr/local/include -I/usr/local/include/postgresql/server -I/home/zope/local/lib/python2.1/site-packages/mx/DateTime?/mxDateTime/ -DVERSION=\"1.0.13\" \

  1. $ make
  2. $ make install
  3. move the file psycopgmodule.so from /home/zope/local/lib/python2.1/site-packages to /home/zope/local/lib/python2.1/lib-dynload/
  4. Restart Zope. It should automatically load psycopg.

Do not run "make install-zope" after running "make install" as advised by the psycopg FAQ as all it does is try to clean up the source directory, incorrectly deleting some of the files needed for compilation in such a way that you'll never be able to compile the driver again afterwards and will need to unarchive the source tarball and start over. Found this out after a lot of frustration.


9th November 2002, 00:32 GMT+10

Am learning about the different permissions in the "Security" tab of the Zope Management Interface

Needed for basic operation

View
Access contents information

Needed for adding new pages

Add ZWiki Pages

To upload files

Add Documents, Images, and Files

To add comments to a page

Zwiki: Add comments to pages

To change the "type" of a page (i.e. Render this page as: Structured text + links + HTML)

Zwiki: Change page types

To edit a page

Zwiki: Change page types

These permissions can either be inherited from the directory above by having the Acquire box next to them ticked, or they can be defined explicitly by using the Anonymous, Authenticated, Manager, and Owner checkboxes.

Anonymous

Allows people that haven't logged in to do stuff

Authenticated

Allows people that have logged in to do stuff

Manager

A manager is Zope superuser person, one level down from the Zope "admin" user.

Owner

Probably the creator of the page


9th November 2002, 04:58 GMT+10

Note


10th November 2002, 15:28 GMT+10

Have implemented a customised and cut down version of Zwiki (http://techdocs.postgresql.org/guides) as a section of the PostgreSQL? Technical Documentation site. Using this to enable a live collaborative community development, and get familiar with Zwiki at the same time.

Things to be done:

Notes

The default "RecentChanges?" page has zwiki.org hard-coded in it twice, such that when people have their names set via UserOptions?, these names are displayed with links to the zwiki.org site instead of the local installation. Probably a bug, but not sure. When integrating Zwiki into a different site though, these definitely need to be changed.


10th November 2002, 17:29 GMT+10

Just started the Zwiki Administration Guide, as the documentation on this site is spread all over the place, is in rough note form, and isn't real helpful for newbies (like me). Hopefully this will assist in accelerating the growth of the Zwiki Community.

Now to get back to the stuff I'm supposed to be doing. :)


10th November 2002, 17:53 GMT+10

Notes

There is decent information about how to use a Zope Database Connection, Zope Database Adapter, and such in the Zope manual here:

Information relating to creating Zope users and authenticating them can be found at:

Information about setting up the email side of things in Zwiki can be found in:


11th November 2002, 03:51 GMT+10
Now looking at the Users and Security chapter of the Zope documentation.


11th November 2002, 14:05 GMT+10

Notes


DeanGoodmanson, 2002/11/13 23:10 GMT (via web):
Justin - Took a couple minutes on the Postgresql site. The RecentChanges? put the authentication name in as the editor, creating a link. User Pages having a consistent (or referal) name to that are a convenient way to jump to a users page and leave a comment.


SimonMichael, 2002/11/14 01:52 GMT (via web):
Justin - your wiki looks great. (This is the postgres, isn't it. :)

I learned some things from your help page, eg the way you allow pages to be created from any old link not just wikilinks. The standard_error_message DTMLMethod in your wiki folder is what takes care of this and handles errors, by the way. One thought I had was that I'd like that when people see that "formatting rules in a nutshell" box, on any site, the contents are somewhat standard. Maybe your changes could be highlighted as local additions and/or rolled into the master HelpPage in some way.

For a nicer login form, don't rule out CMF (Zwiki and Plone) or Plone (http://zwiki.org/plone ). A CMF site is quick to set up and it's the best supported of the membership solutions. (Your zwiki will probably ignore the CMF skins; with the latest cvs version onwards, you'd want to tweak the skin to preserve your current layout).


15th November 2002, 18:53 GMT+10

Wow. People are checking out this Notes page and suggesting ideas. Had better take notice of them. :)

Notes

Some useful code notes for getting DTML to display different options depending on a user's priviledge:

<dtml-var expr="AUTHENTICATED_USER.getUserName()">

<dtml-if expr="AUTHENTICATED_USER.getUserName() != 'Anonymous User'">

<dtml-if expr="AUTHENTICATED_USER.has_permission('View History',this())">

<dtml-if "AUTHENTICATED_USER.has_permission('Change ZWiki Pages',this())">

It seems like the expr= bit isn't needed for some of these. Wonder if it's a Zope 2.6.x specific thing or not? Hopefully find out with further DTML experience and understanding. :)

zope assumes the expr= if it sees "". Real Programmers don't bother with it :).


17th November 2002, 19:35 GMT+10

Notes

More useful code for getting DTML to display different user options, this time depending upon group membership:

<dtml-if "AUTHENTICATED_USER.has_role('somerole',this())">


comments:

Zope within PostgreSQL? --DeanGoodmanson, Tue, 13 Jan 2004 08:28:32 -0800 reply
Justin,

Thought of you when noticing this article HOWTO: Accessing Zope from PostgreSQL? , noted on this ZopeZen? post.

:) -- Fri, 11 Jun 2004 02:28:20 -0700 reply
Thanks Dean,

It's been a while. Kind of got busy with other things, then looked at this page again and noticed it was all in 2002!

That sure went fast, although it does also seem like a lifetime ago.

;-)

+ Justin

... -- Mon, 02 May 2005 05:18:23 -0700 reply
did'nt help us