Installing New Zope Packages
You should know how to use the command line of your operating system.
You should know how to install Python and Zope 3 (and do so before reading this chapter).
After having installed Zope 3, there is only so much you can do with it. However, there are a bunch of interesting third-party add-on packages, such as relational database adapters and a Wiki implementation. A Wiki consists of a collection of pages that can be edited by any party visiting the page. The pages are connected via Wiki links, which are references to other Wiki pages via name. This chapter demonstrates how to install these packages, especially the ones maintained in the Zope repository.
Installing third-party packages in Zope 3 is much more explicit and similar to doing so in Python than in Zope 2. You can put a Zope 3 add-on package anywhere in your Python path, as you can any other Python package. This means that you can use the distutils package to distribute your add-on.
However, after you install the package, the Zope 3 framework does not know about it, and no magical package detection is used to find available packages. The Zope 3 framework is configured using Zope Configuration Markup Language (ZCML). Zope-specific Python packages also use ZCML to register their components with Zope 3. Therefore, you have to register a package's root ZCML file with the startup mechanism.
This chapter demonstrates how to install the Wiki application for Zope 3. If you are using the repository version of Zope 3, Wiki will already be installed, but the steps shown in this chapter are the same for all other packages.
Step 1: Determining the Installation Directory
Determining where to install a package can be a difficult challenge because packages can be located anywhere in the path hierarchy. For example, the Wiki application is a top-level Python package and the Jobboard Example lives in zope.app.demo.
You usually want to place third-party packages in the common Zope 3 directory structure because that makes it easiest to find the packages later. After you have determined the Zope 3 package root, you are all set. For the repository distribution, the package root is Zope3/src, where Zope3 is the directory that you checked out from the repository (for example, svn://svn.zope.org/repos/main/Zope3/trunk). For distributions, the package root is Zope3/lib/python, where Zope3 is /usr/local/ZopeX3-VERSION by default or the directory specified using the --prefix option of configure. An alternative is to use the zope instance as package rootfor example, Zope3-Instance/lib/python, where Zope3-Instance is the path to the Zope 3 instance directory you provided during the mkzopeinstance call. The remainder of the book assumes that you are working with the distribution.
To install the Wiki application, you have to go to the Zope3-Instance/lib/python directory, which should be available in a Zope 3 instance.