Book Image

Plone 3 Products Development Cookbook

Book Image

Plone 3 Products Development Cookbook

Overview of this book

The Plone Content Management System is one of the best open source CMS, because by using Plone's development framework you can extend its functionality according to the specific requirements of your website. The Plone framework has lots of components that can be used to create add-ons or extensions called Plone Products. You can optimize your site for improved usability, accessibility, and security by creating custom Plone products.This book covers recipes that will help you create custom Plone Products and implement them on your website. Every topic covered in this book is accompanied by essential fundamentals and step-by-step explanation that will help you understand it better. With the help of this book you will be able to create custom Plone products that are well suited for your website.You can read the whole book or just pick recipes relevant for you; cross references help you understand the recipes even if you do not read them in order.If you work through the book in order, you will start by setting up an example project of a news website that will be developed throughout the book. You will learn about all of the necessary tools a Plone developer must have before starting any project. You will develop the website further by detecting problems and debugging them. You will be able to modify code on-the-fly or get help on how to do some tasks by installing and using special tools such as IPython, ipdb, and PDBDebugMode. You will then create a new content type, based on an existing one, and wrap the final product into a Python egg.You will set up automated testing to prevent errors in code that have evolved in the development stage. You will use paster to automatically create a new custom content type from scratch. You will improve the performance of your application by creating lightweight content types and following other recipes covered in this book. Key features such as usability, internationalization, accessibility and security are covered to make sure that your development and customizations will be at the level of Plone core and its most remarkable add-on products.You will improve your user interface by creating simple client-side visual changes and server-side manipulation of objects. You will learn to create and manage portlets by using Portlet manager and customize your website by modifying third-party products. Finally you will learn to communicate with an external non-Python-based system and make your products available for future use.
Table of Contents (21 chapters)
Plone 3 Products Development Cookbook
Credits
About the Authors
About the Reviewers
Preface
Index

Installing Plone on Windows


As with Linux and Mac, there is also a Windows unified installer (based on the buildout method described above) available, which provides the easiest way to install Plone in a Windows environment.

Download the latest Plone release from http://plone.org/download (3.3.4 at the time of writing) and run it.

This installation process is an easy four-step wizard that will guide you through:

  1. A welcome screen, as shown in the screenshot.

  2. The choice for the destination path for Plone (c:\Program Files\Plone, by default).

  3. The configuration of the Zope instance administrator account (read: username and password).

  4. A confirmation screen.

As a way of learning the buildout approach, which we introduced in the last two recipes, you are encouraged to go through the buildout.cfg file created in the chosen destination folder.

Although this method is really straightforward, if you plan to use several buildouts, Windows installer is unlikely to be the best solution, as it will reinstall the whole bundle, including the Python interpreter, every single time you create a new buildout.

As we have covered for Linux, we will see here the manual installation method to create a Zope instance on a Windows system.

How to do it…

  1. Install the required Python version: If you are planning to create a Plone 4.x site, you will need Python 2.6. If not, Python 2.4 is required. Download the Windows Python installer from http://www.python.org/download/windows and run the installer.

  2. By adding Python directory to the PATH environment variable, we can reuse the Python installation for other development buildouts. We are assuming here that you have installed Python 2.4 in the c:\Python24 folder; change the paths according to your directory choices.

    • Go to the Windows Control Panel

    • Open System options. You can get here by pressing the Windows logo key + Pause.

    • Click on the Advanced tab in Windows XP or Advanced system settings in Windows Vista.

    • Then click on the Environment variables button.

    • Find the PATH variable and add c:\Python24;c:\Python24\Scripts.

  3. Install the PyWin32 extension: We also need Python Win32 extensions. Download the correct file for your Python version at http://sourceforge.net/projects/pywin32/files and run the downloaded installer.

  4. Install Python Imaging Library (PIL): download it from http://effbot.org/downloads. Again, pick the relevant installer for your Python version. At the time of writing, PIL-1.1.7.win32-py2.4.exe is the choice for Python 2.4.

  5. Install a C compiler to build Zope: The easiest solution is to install MinGW, obtainable from http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer, and run the installer.

    Note

    We chose c:\MinGW as the installation folder. If you choose a different one, please adjust the next steps.

    After the installation is finished, copy cc1.exe and collect2.exe from the c:\MinGW\libexec\gcc\mingw32\3.4.5 folder to c:\MinGW\bin.

    Now add c:\MinGW\bin to the system PATH environment variable the same way we did with the Python PATH.

  6. Fix the Python compiler problem: Given that the Python-installed version has been compiled on a different machine (we installed the binaries and they are usually compiled with Visual Studio), in order to prevent problems during other packages’ compilation, we must tell our environment to use the just-configured MinGW compiler.

    To do this, create or update the distutils.cfg file in c:\Python24\Lib\distutils (adjust the path to your Python installation directory) with this content:

    [build]
    compiler=mingw32
  7. Create a buildout with paster: As with Linux, we can use ZopeSkel templates to create new buildouts. If you have any doubt about the following commands, refer to the instructions in the Installing Plone on Linux section.

    First download the EasySetup installation file from http://peak.telecommunity.com/dist/ez_setup.py and run

    python ez_setup.py
    

    Now you can use easy_install to install ZopeSkel, and then create the buildout:

    easy_install ZopeSkel
    paster create -t plone3_buildout
    cd pox
    python bootstrap.py
    bin\buildout.exe
    

See also

  • Installing Plone on Linux

  • Installing and configuring an egg repository

  • Writing a production buildout