How to create a ZOPE demo cd

Sébastien Georget

Version française


Table of Contents

Why ?
Which content ?
How ?
ZOPE installation
under windows
under linux
Prepare the demo
Configure the server for a read-only media
under linux
under windows
Modification of the starting script
Burn the image

Why ?

To show what can Zope do during a slideshow, or to distribute a Zope application. The server can be started from the CD-ROM without writing on the local hard drive.

Which content ?

with the products that you want to use during your demo (or you want to distribute), for instance:

How ?

It is possible to create a CD for windows, for linux or both. When an operation is related to one OS only, it is specified.

  1. Installation of ZOPE under linux and/or windows

  2. Creation of a ZOPE instance containing the products to show.

  3. Run the server to fill the ZODB (FIXME: and to generate bytecode ?)

  4. Modification of the configuration to make it startable from a read-only media.

  5. Burn the CD.

ZOPE installation

under windows

Download ZOPE and start the installation. Install it under c:\zope and choose a Custom installation. Create the ZOPE instance under c:\zope\instance

Note

The drive letter doesn't matter.

under linux

First, get Python binaries or compile it from sources.

        tar jxf Python-2.3.3.tar.bz2
        cd Python-2.3.3
        ./configure --prefix=/tmp/python
        make
        make install
      

Then, compile ZOPE

        tar zxf Zope-2.7.0.tgz
        cd Zope-2.7.0
        ./configure --prefix=/tmp/zope --with-python=/tmp/python/bin/python --optimize
        make install
      

Note

You could install your distro packages (rpm/deb) with a different root to achieve the same result.

Finish with creating your ZOPE instance

        cd /tmp/zope/bin
        ./mkzopeinstance.py --dir /tmp/zope/instance --user admin:z0pe
      

Prepare the demo

Now you can install all the products needed during the demo in the Products folder of the instance. Then run the server with the runzope script located in the bin folder.

Une fois l'application initialisée avec vos données, vous pouvez stopper le serveur.

Configure the server for a read-only media

The default configuration file must be modified to be independant from the system on which the demo will run. Here are the main modifications:

under linux

        
        #%define INSTANCE /tmp/zope/instance
        #%define ZOPE /tmp/zope

        instancehome /plop

        zserver-read-only-mode on
        read-only-database on

        #comment eventlog and logger sections
        <zodb_db main>
          # Main FileStorage database
          <filestorage>
            path /plop
          </filestorage>
          mount-point /
        </zodb_db>
        
      

The file can be downloaded here : linux/zope.conf

under windows

        
        %define INSTANCE \winzope\instance
        %define ZOPE \winzope

        instancehome \winzope

        zserver-read-only-mode on
        read-only-database on

        #comment eventlog and logger sections
        <zodb_db main>
          # Main FileStorage database
          <filestorage>
            path \winzope\instance\var\Data.fs
          </filestorage>
          mount-point /
        </zodb_db>
        
      

The file can be downloaded here : windows/zope.conf

Then create the following script at the root of the ZOPE instance:

      # From : http://zope.org/Members/jens/docs/zope_on_cdrom/
      import Globals, ZODB.FileStorage, ZODB.DemoStorage

      name='%s/Data.fs' % Globals.data_dir

      base=ZODB.FileStorage.FileStorage(name, read_only=1)
      Storage=ZODB.DemoStorage.DemoStorage("Demo (%s)" % name, base)
    

Modification of the starting script

The default configuration file must be modified to be independant from the system on which the demo will run. The scripts are available here and should be saved at the root of the cd-rom.

Burn the image

Here is the content of the cd:

  • /runzope (linux)

  • /runzope.bat (windows)

  • /zope/ (linux)

  • /python/ (linux)

  • /winzope/ (windows)

It is possible to add an autorun for windows as it is described in the following howto:

http://www.zope.org/Members/jens/docs/zope_on_cdrom