Plone 3 Products Development Cookbook - Gimenez Juan Pablo - E-Book

Plone 3 Products Development Cookbook E-Book

Gimenez Juan Pablo

0,0
34,79 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 381

Veröffentlichungsjahr: 2010

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Plone 3 Products Development Cookbook
Credits
About the Authors
About the Reviewers
Preface
What this book covers
Our Plone development project
A short note about the course of the book
Customer requirements
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Getting Started
Introduction
Installing Python on Linux
Getting ready
How to do it...
How it works…
See also
Installing Plone on Linux
Getting ready
How to do it…
How it works…
See also
Installing Plone on Windows
How to do it…
See also
Checking out code from a version controlsystem
How to do it…
How it works…
There’s more…
Creating a Plone site
How to do it…
How it works…
There’s more…
See also
2. Using Development Tools
Introduction
Changing debug mode parameter in configuration file
Running Zope instance in foreground mode
Accessing an IPython powered shell
How to do it…
How it works…
There's more…
See also
Taking advantage of an enhanced interactive Python debugger with ipdb
How to do it…
How it works…
Discovering Zope/Plone APIs and docstrings with DocFinderTab
How to do it…
How it works…
There's more…
Opening an online Python shell on Plone using Clouseau
How to do it…
There's more…
Debugging Zope exceptions with PDBDebug Mode
How to do it…
See also
Applying code changes on-the-fly using plone.reload
How to do it…
How it works…
There's more…
3. Creating Content Types with ArchGenXML
Introduction
Installing ArchGenXML
Getting ready
How to do it…
How it works…
See also
Configuring ArgoUML
Getting ready
How to do it…
How it works…
There's more…
Creating a model
Getting ready
How to do it…
How it works…
There's more…
See also
Generating code
How to do it…
There's more…
See also
Customizing generated code
Getting ready
How to do it…
How it works…
See also
Installing the product
How to do it…
How it works…
Automatically installing products in your Zope instance
How to do it…
How it works…
There's more…
See also
4. Prevent Bugs through Testing
Introduction
Glossary
Working with paster-generated test suites
Getting ready
How to do it...
How it works...
Unit test DocFileSuite
Running tests
Unit test DocTestSuite
Integration test ZopeDocFileSuite using PloneTestCase
Functional test
See also
Creating a test suite with ArchGenXML
Getting ready
How to do it...
How it works...
See also
Creating doctests with iPython
Getting ready
How to do it...
Zope functional testing
Getting ready
How to do it...
How it works...
Using Selenium functional tests
Getting ready
How to do it...
There's more...
Further reading
Installing Selenium RC and IDE
Organizing packages
Debugging tests
See also
5. Creating a Custom Content Type with Paster
Introduction
Creating an Archetypes product with paster
Getting ready
How to do it…
How it works…
There's more…
See also
Adding a content type into a product
Getting ready
How to do it…
How it works…
There's more…
See also
Changing the base class in paster content types
How to do it…
How it works…
There's more…
See also
Adding fields to a content type
Getting started
How to do it…
How it works…
There's more…
See also
Adding a custom validator to a content type
How to do it…
How it works…
There's more…
See also
Modifying the view of a content type with jQuery
Getting ready
How to do it…
How it works…
There's more…
See also
6. Creating Lightweight Content Types
Introduction
Creating a product package structure
Getting ready
How to do it...
How it works...
See also
Creating a folderish content type
Getting ready
How to do it...
How it works…
See also
Creating the user interface for Zope 3 content types
Getting ready
How to do it…
How it works…
There's more...
See also
Creating content types with Dexterity
How to do it…
How it works…
See also
7. Improving Product Performance
Introduction
Installing CacheFu with a policy product
Getting ready
How to do it…
How it works…
There's more…
See also
Improving performance by tweaking expensive code
Getting ready
How to do it…
How it works…
There's more…
See also
Testing server load and benchmarking our code
Getting ready
How to do it…
How it works…
There's more…
Bench configuration file
Running the bench
Further reading
See also
8. Internationalization
Introduction
Adding i18ndude support to ArchGenXML
How to do it…
How it works…
See also
Installing i18ndude standalone
How to do it…
See also
Using i18ndude
Getting started
How to do it...
There's more…
See also
Using Placeless Translation Services for i18n support
How to do it…
See also
Using zope.i18n approach
How to do it...
How it works…
There's more…
See also
Overriding others' translations
How to do it…
Using i18n with ArchGenXML
Getting ready
How to do it…
How it works…
There's more…
Modifying an existing field's label
See also
Using i18n with paster-created products
Getting ready
How to do it…
How it works…
There's more…
See also
Adding i18n support to any product
Getting ready
How to do it…
How it works…
There's more…
See also
Translating content
Getting started
How to do it…
How it works…
There's more…
See also
Setting language options
Getting ready
How to do it…
There's more…
See also
9. Adding Security to your Products
Introduction
Creating a new permission
Getting started
How to do it…
How it works…
There's more…
See also
Adding a new role
Getting ready
How to do it...
How it works…
There's more…
Automatic roles
Local roles
See also
Adding user groups
How to do it…
How it works…
See also
Testing security customizations
How to do it…
Protecting operations with permissions
How to do it…
How it works…
There's more…
Adding security restrictions to Dexterity content types
Testing restricted operations
Checking paster and ArchGenXML permissions
See also
Managing security with workflows
How to do it…
There's more…
See also
Adding configuration options in Plone control panel
Getting ready
How to do it…
How it works…
There's more…
See also
10. Improving User Interface with KSS
Introduction
Preparing a form to take full advantage of KSS
Getting started
How to do it…
How it works…
There's more…
See also
Changing end user pages with client-side KSS
How to do it…
How it works…
Manipulating DOM elements on document load
Dynamically adding user interactions
There's more…
See also
Submitting data via AJAX
How to do it…
How it works…
Replacing standard button's behavior
Server side KSS actions
There's more…
See also
11. Creating Portlets
Introduction
Creating a portlet package
Getting ready
How to do it…
How it works…
Portlet component configuration file
Portlet module
GenericSetup import step
See also
Customizing a new portlet according to our requirements
How to do it…
How it works…
See also
Testing portlets
How to do it…
How it works...
See also
Assigning portlets automatically
Getting ready
How to do it…
How it works…
There's more…
Assigning portlets programmatically
Portlet managers
See also
12. Extending Third-Party Products
Introduction
Using skin layers
Getting ready
How to do it...
How it works...
There's more…
See also
Overriding Zope 3 components
Getting ready
How to do it...
How it works...
There's more…
See also
Customizing Zope 3 browser templates and files
Getting ready
How to do it...
How it works...
There's more…
z3c.jbot and skin layers
Understanding browserlayer
See also
Subscribing to others' events
How to do it…
How it works…
See also
Using the ZCA to extend a third-party product: Collage
How to do it…
How it works…
There's more…
See also
13. Interacting with other Systems: XML-RPC
Introduction
Creating a configuration form
Getting ready
How to do it…
How it works…
There's more…
See also
Registering a local utility
How to do it…
How it works…
See also
Registering a global utility
Getting started
How to do it…
How it works…
There's more…
Changing the look of the form
Named utilities
Installing OpenX
Further reading
14. Getting our Products ready for Production
Introduction
Installing and configuring an egg repository
Getting ready
How to do it…
How it works…
There's more
See also
Submitting products to an egg repository
Getting ready
How to do it…
How it works…
There's more
Changing the package version number
An alternative method to submit your package
See also
Writing a production buildout
Getting ready
How to do it…
How it works…
There's more
Configuring a web server
Using or not using buildout.cfg
Production buildouts for Windows
See also
A. Creating a Policy Product
Creating a policy product
How to do it...
How it works...
There's more…
See also
Index

Plone 3 Products Development Cookbook

Juan Pablo Giménez

Marcos F. Romero

Plone 3 Products Development Cookbook

Copyright © 2010 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: May 2010

Production Reference: 1300410

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN 978-1-847196-72-9

www.packtpub.com

Cover Image by Vinayak Chittar (<[email protected]>)

Credits

Authors

Juan Pablo Giménez

Marcos F. Romero

Reviewers

Martin Aspeli

Alec Mitchell

Emanuel Sartor

Acquisition Editor

Rashmi Phadnis

Development Editor

Reshma Sundaresan

Technical Editor

Pallavi Kachare

Copy Editor

Lakshmi Menon

Indexer

Hemangini Bari

Editorial Team Leader

Akshara Aware

Project Team Leader

Priya Mukherji

Project Coordinator

Prasad Rai

Proofreader

Kevin McGowan

Graphics

Geetanjali Sawant

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Authors

Juan Pablo Giménez's programming career started in 1996. He was a C/C++ programmer in real-time systems under the QNX OS, but quickly the philosophy of Linux and free software became more and more interesting for him as he became a sysadmin and a PHP programmer. In 2000 he began his own company, Rcom, through which he has provided IT services using FOSS tools to cover a wide range of languages and technologies. Despite having gone through abundant experience with other languages and CMS frameworks, today he focuses totally on developing products and sites under Plone.

I want to thank my family, my parents, my sister, and especially my grandmother Chola, for years of support and understanding while I sojourned in the-for them-incomprehensible world of programming.

Thanks to my best friends and associates in Rcom, Juan Pablo Noriega, Roman Mottino, Eugenio Oliveri, and Leandro Viani.

Thanks to Emanuel Sartor and the Plone community for always being there to help me in my learning process.

And thanks, Laura, for putting up with me and my crazy passions; without you, it would not have been possible for me to reach this far; thank you also for bringing to life Julieta and Sofia, the joy of my days.

Marcos F. Romero has been a software developer since 1997, working with Lotus Notes, both to develop applications, and as a trainer of users and other developers.

In 1999, he launched his first web site, after which he specialized in HTML, CSS, JavaScript, and DOM among other technologies.

Since then he has taken part in numerous other web sites and webapps—including a Lotus Notes CMS—and started working as a consultant to other professionals.

In 2007, he started to participate in Plone projects and became fascinated by the Open Source world.

For over 10 years he has been interested in Usability as a discipline applicable to everyday activities and, focused on the customer's and end user's needs, he aims to simplify and help their everyday tasks. Today he actively applies this concept in Inter-Cultura, a company that specializes in Usability and User Experience, where he has been working for several years.

All my appreciation to Gonzalo J. Auza, who ushered me into the world of Plone and who has supported me all along. A big thanks to Juan Pablo Giménez, who can't but continue to teach me; and to Martin Aspeli, Alec Mitchell, and Emanuel Sartor, who kindly agreed to share their knowledge by reviewing this book.

My gratitude to Rebeca Resnik, my English teacher, who has a lot to do with this endeavour.

A special thanks to my family and friends—especially to my parents—who phoned me continually for updates on my progress towards completion of this book.

But most of all, thanks to my wife, who lovingly did more than her share with our kids, buying me the time and quiet to complete this book.

About the Reviewers

Alec Mitchell is a Plone core developer and has been an active member of the Plone community since 2004. He was the release manager for Plone 2.5, a member of both the inaugural Plone 2.5 Framework Team, and the Plone 4.0 Framework Team. He is the co-maintainer of the Plone core content types (ATContentTypes), as well as the maintainer of Plone's default versioning system (CMFEditions) and a few popular add-on products for Plone.

Alec is an independent consultant based in Los Angeles, California. He specializes in Python, Zope and Plone development, high-performance website deployment and optimizations, and integration with web services. He has helped small and large organizations around the world to get the most from their content management systems.

Emanuel Sartor is an IT professional who has been involved in open source software since 1999. He is the cofounder and CTO at Menttes, an Argentinean company that provides custom Python, Plone and Zope based solutions.

As an active participant in the Open Source community, Emanuel has contributed many add-on products for Plone. He has conducted multiple talks and trainings at conferences such as The Jornadas Regionales de Software Libre and PyConAr. He also cofounded Plone Cono Sur, a regional Plone users group that continues to educate others about Plone.

A Laura, Julieta y Sofía

A Mercedes, Clara, Magui y Rosario

Preface

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 explanations 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 to your website.

What this book covers

Chapter 1, Getting Started will introduce the reader to the project that will be developed: a news website with banners hosted in OpenX. It will also cover the tools a Plone developer must have before starting a project.

Chapter 2, Using Development Tools, will show you how to install and use special tools that we often need to find problems (debug), modify code on the fly, or get help on tasks during the development phase of a project.

Chapter 3, Creating Content Types with ArchGenXML, will introduce the ArchGenXML technology by creating a new content type (based on an existing one), and will wrap the final product into a Python egg. It is a great tool to help with the development of Archetypes-based content types.

Chapter 4, Prevent Bugs through Testing, will show how automatic testing helps preventing the malfunctioning of features due to lack of communication or ignorance of some parts of code when projects evolve or the development team changes.

Chapter 5, Creating a Custom Content Type with Paster will cover the creation of Archetypes content types from scratch by hand... kind of. We will actually use paster to automatically create most of it.

Chapter 6, Creating Lightweight Content Types, will introduce other technologies to create lighter content types. (Archetypes is a great, though very large, framework developing content types.)

Chapter 7, Improving Product Performance, will teach you how to reap the benefits of Plone by dealing with the problem of creating content types in which the objects’ final HTML rendering performs badly, and how to benchmark these improvements.

Chapter 8, Internationalization, will cover the different tools used to offer a properly internationalized product.

Chapter 9, Adding Security to our Products will go through the steps to secure tasks and content types: permissions, roles, groups, workflows, and configuration options.

Chapter 10, Improving User Interface with KSS, will introduce the use of KSS — an Ajax framework that allows UI development without writing any JavaScript, in Plone by creating from simple client-side visual changes to server-side objects manipulation.

Chapter 11, Creating Portlets, will give you step-by-step instructions for adding portlets. Portlets are used to provide contextual information about the main contents of a page.

Chapter 12, Extending Third Party Products, will deal with what to display in the final web page and how, and will show how to add new features to existing components.

Chapter 13, Interacting with Other Systems: XML-RPC will go through some essential Python modules which are used in the advertisement service to communicate with an external non-Python-based system.

Chapter 14, Setting our Products Ready for Production, will help you create your own products repository and be ready for the website launch. After finishing the development of the products, we must make them available for future use or evolution.

Appendix, Creating a Policy Product, will introduce a special kind of product to deal with site installation, configuration, and customization with code, instead of using manual actions that are likely to be forgotten.

Our Plone development project

Although this is a cookbook, we won’t give isolated recipes for each individual task, we’ll follow a common theme throughout the book to make it easy to understand.

A short note about the course of the book

Some of the topics that we cover may not be all together in one chapter because:

They don't require a whole chapter or section but are better explained in different stages of the development project.They need an introduction and will be complemented with tips later in the book.

Examples of these subjects are buildout recipe configuration and code testing.

In addition, we’d like to mention that, for ease of explanation and understanding, we approached the writing of the book as if this were a website project commissioned to us by a customer.

Customer requirements

The project we are tackling is the design of a digital newspaper website with a particular requirement: the customer needs, with equal importance, to publish pieces of news and to insert advertisements all over the place.

Below is a summarized list of the functionalities the customer requested and we will cover in this book. We will include details related to specific things that Plone doesn’t provide out of the box.

News items will be published in several sections and must include fields like country and lead paragraph or intro.Multimedia content will illustrate and complement written information.Multimedia content should be played online but may also be downloaded.Advertisement banners will be located in several areas of every page.Advertisement banners may vary according to the section of the website.Commercial (and non-technical) staff should be able to modify the location of the banners.All sections will have a front page with a special layout including the last published content.

In addition, the customer is planning to release a Spanish version of the website in the near future. So they also require that:

Everything in the website must be translated or, at least, be translatable into other languages.

There are also two additional requirements that are not particular to this project but to everyone, and are related to the quality of the final product:

Accessing the website must be fast, especially for readers.All of the code must be properly commented and tested so that future changes can be made, without too much effort, by a different development team.

Of course, the customer has his own branding, so they need the website to have a distinctive look and feel. This part of the project will be developed by another company (that will not be covered in this book). The process of creation and applying visual design to a Plone site is called skinning. The result of this process is called the skin or theme, which is usually contained in a single Plone product.

Note

Take a look at the list of ready-to-use themes at: http://plone.org/products/by-category/themes.

What you need for this book

To follow all the recipes of this book you merely need a Linux or Windows system that can run Python 2.4 or above. There are only two recipes, however, that are intended for Linux only.

Who this book is for

This book is for programmers who have some knowledge of Python, Plone, and Zope. If you want to develop feature-rich add-on products in Plone, this book is for you. It is aimed at the development of backend features, so you need not have other web-related skills such as HTML, CSS, or JavaScript.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for the book

Visit https://www.packtpub.com//sites/default/files/downloads/6729_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Getting Started

In this chapter, we will cover the following recipes:

Installing Python on LinuxInstalling Plone on LinuxInstalling Plone on WindowsChecking out code from a Version Control SystemCreating a Plone site

Introduction

Plone is probably the best Python CMS (Content Management System). This means that it’s a piece of software that provides all the necessary tools for people to publish content.

Why do we say that Plone is the CMS? For several reasons:

It's easy to useIt's available in more than 40 languagesIt has granular securityIt's regularly updatedIt's Open SourceIt has almost everything we need and, if it doesn't, we can add that specific need

These two last are, no doubt, its most important features: Plone is extendible, because it’s also a framework, and that is what we’ll mostly cover in this book—the components that are part of the framework and how to use them to build our extensions.

Note

Find out more about Plone features at: http://plone.org/about.

In Plone, the extension facility is provided via the installation of products. Think of them as plugins, add-ons, extensions, or whatever name you want. In Plone literature, they are called products, though.

Note

While most Plone add-ons are technically Python packages, we will use the term products throughout this book because it is still very commonly used in Zope and Plone sphere.

As a matter of fact, Plone itself is a whole set of products, and some of its current basic features were born initially as additional characteristics, like Archetypes (more of this in the Chapter 3). With a little luck and a lot of work, one of your products may be included in a future release.

Note

You can find a variety of available Open Source community-developed products at http://plone.org/products.

In this chapter, we are going to install Plone (in both Linux and Windows). Plone is not an isolated software application, it needs Zope and other associated products to be installed as well. To understand this process and all these components, let’s define a not-too-comprehensive, but sufficient glossary:

Term

Definition

Python module

A file containing Python definitions and statements.

Python package

A set of Python modules.

Python egg

A way of distributing Python packages. It is very interesting because it provides not only the programming code but also metadata like the version number, dependencies, and license terms.

Buildout

An environment or system created with a configuration file that is used by a special Python package, named zc.buildout, to execute a set or parts in a repeatable way so that it can be run on different computers or operating systems.

Buildout Recipe

A Python package, used by zc.buildout, that performs a particular action, like compiling the source code of an application, downloading and extracting a tar.gz file, executing some shell commands, and so on.

Zope installation

The set of Python packages, templates, and other files needed to execute a Zope server.

Zope instance

A particular Zope server installation, each of which might have its own configuration set of add-on Python packages and database.

In the following sections, we’ll mainly look at a method named buildout for a proper Zope instance set up. However, we won’t cover all of its possibilities. Throughout the whole book, after adding products to the project we are developing, we will add recipes or parameters to the buildout file, which we will create in this chapter.

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:

A welcome screen, as shown in the screenshot.The choice for the destination path for Plone (c:\Program Files\Plone, by default).The configuration of the Zope instance administrator account (read: username and password).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…

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.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 PanelOpen 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.
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.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.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.

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
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 ZopeSkelpaster create -t plone3_buildoutcd poxpython bootstrap.pybin\buildout.exe

See also

Installing Plone on LinuxInstalling and configuring an egg repositoryWriting a production buildout