Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Plone 3 Products Development Cookbook
Plone 3 Products Development Cookbook

Plone 3 Products Development Cookbook: 70 simple but incredibly effective recipes for creating your own feature rich, modern Plone add-on products by diving into its development framework

eBook
$26.09 $28.99
Paperback
$39.19 $48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Plone 3 Products Development Cookbook

Chapter 1. Getting Started

In this chapter, we will cover the following recipes:

  • Installing Python on Linux

  • Installing Plone on Linux

  • Installing Plone on Windows

  • Checking out code from a Version Control System

  • Creating 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 use

  • It's available in more than 40 languages

  • It has granular security

  • It's regularly updated

  • It's Open Source

  • It 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 Python on Linux


Plone 3 runs only on the old Python 2.4 version. Unfortunately, almost no modern Linux distribution (or distro) ships with or supports that version. To fill this gap, we can use a special buildout to install an isolated Python environment called virtualenv.

Even for the most modern Plone 4, which runs on Python 2.6, this method can also be applied, as we did find problems with Python 2.6, shipped with Fedora 11 and 12.

Note

The idea of using virtualenv is to have a Python installation independent from the operating system's: no matter which version of Python is native in the OS, your Plone site will still work, as it will be never modified again unless you do it explicitly.

This first buildout, not the one that we’ll use to install Plone, is a good place to start to understand its parts and the way it works.

Getting ready

To set up virtualenv, we need any version of Python installed first. So just run your own distro package manager to get it, if it is not installed yet.

Note

The following example installs Python 2.4.6 (the latest 2.4.x available at the time of writing) as a virtualenv. By changing the version number, you can apply the same method to create a Python 2.6 virtualenv. You can also get a copy of these two procedures in the source code that accompanies this book.

In the following procedure, we will compile and make Python, so we will need various packages installed in our system first. For Debian or Ubuntu, run this as root to get all the required dependencies:

# aptitude install gcc g++ libbz2-dev zlib1g-dev libreadline5-dev libssl-dev

In Fedora, run this command instead:

# yum install python-devel gcc gcc-c++ bzip2-devel gzip-devel zlib-devel readline-devel openssl-devel

Create a base folder for your Python 2.4 installation. We prefer ~/libexec/python2.4.

$ mkdir -p ~/libexec/python2.4
$ cd ~/libexec/python2.4

Then get the bootstrap Python script. This script installs the zc.buildout package inside the same buildout environment so that we won’t need any other external command.

$ wget http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py

Note

Note that the *checkout* piece in the URL above is correct. It has no special meaning.

Enter the following buildout.cfg file to create virtualenv:

[buildout] 
parts = 
    python 
    virtualenv 
    make-virtualenv 

# Add additional egg download sources here. 
# dist.plone.org contains archives 
# of Plone packages. 
find-links = 
    http://dist.plone.org 
    http://download.zope.org/ppix/ 
    http://download.zope.org/distribution/ 
    http://effbot.org/downloads 

[python] 
recipe = zc.recipe.cmmi 
url = http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz 
executable = ${buildout:directory}/parts/python/bin/python2.4 
extra_options= 
    --enable-unicode=ucs4 
    --with-threads 
    --with-readline 
    --enable-ipv6 

[virtualenv] 
recipe = zc.recipe.egg 
eggs = 
   virtualenv 

[make-virtualenv] 
recipe = iw.recipe.cmd 
on_install=true 
cmds = ${python:location}/bin/python
${buildout:directory}/bin/virtualenv --clear . 

The above buildout configuration file has three parts, which have their own recipe parameter. Let’s go through each of them:

  • The [python] part uses the zc.recipe.cmmi recipe, which downloads Python source code and compiles it. The cmmi suffix stands for Compile Make and Make Install.

  • The [virtualenv] part uses the zc.recipe.egg recipe, which installs the virtualenv Python egg and creates the executable bin/virtualenv file.

  • The [make-virtualenv] part uses the iw.recipe.cmd recipe, which can execute arbitrary shell commands. In this case, it runs the installation of a virtualenv to create an isolated Python 2.4 environment in your system.

As you must have noticed, there are other lines of code besides the part definitions and their recipes. These lines are parameters required by every recipe, like url for the zc.recipe.cmmi recipe or cmds for iw.recipe.cmd.

Note

Note that you can reference to variables defined in the buildout by writing ${part:parameter} as used in the last line: ${buildout:directory}.

You can correctly guess that there are many different recipes, each with their special parameter configuration and variables. For instance, there are recipes to install Varnish (a proxy cache server) and MySQL.

Note

For a list of available recipes, you can visit http://pypi.python.org/pypi?:action=browse&show=all&c=512.

How to do it...

So far we have just created a configuration file to create a Python 2.4 environment, but we haven’t got it yet. So let’s move on.

  1. Run the bootstrap process:

           $ python bootstrap.py
    

    You should get an output like this:

  2. Start the buildout process with this command:

           $ ./bin/buildout
    

    Congratulations! You have successfully installed a clean Python 2.4 environment on your computer.

  3. Now you have two different choices in how to use it:

    Specifying its path:

    ~/libexec/python2.4/bin/python <script>
    

    or by activating it to include it in your PATH environment variable:

    source ~/libexec/python2.4/bin/activate
    

    You’ll notice that this will change your prompt, as shown in the following screenshot:

  4. Once activated, you can return to your original Python version by running:

    (python2.4) $ deactivate
    

    Note

    In the screenshot above, you can see that there are actually three different Python versions installed. The system default version is 2.6.2, and there is also a 2.6.4 and a 2.4.6 available in separate virtual environments.

How it works…

By running the bootstrap process in Step 1, we download the zc.buildout package. This creates the required directory structure and generates an executable buildout file, which will read and process buildout.cfg.

In Step 2, the buildout process downloads the Python 2.4 source code, compiles it, and then it creates the virtualenv.

See also

  • Installing Plone on Linux

Installing Plone on Linux


Now that we have a valid Python version, we can install Plone.

Note

There is an alternate and very handy method to install Plone on Linux (and Mac and Windows) called Unified Installer. It is a bundle that installs not only Zope and Plone, but also Python and other necessary packages. If you want to try it, go to http://plone.org/download and download the version of your choice.

Getting ready

ZopeSkel is a Python package that provides development templates for Zope and Plone. It will help us at several different stages of our projects. We will use it here to create a buildout environment. First, we must be sure we have it properly installed:

  1. Activate your just installed Python 2.4 (or whatever version you have installed) virtualenv:

    $ source ~/libexec/python2.4/bin/activate
    
  2. Install ZopeSkel:

    (python2.4)$ easy_install-2.4 ZopeSkel
    
  3. If you already have it, check for the latest version by running:

    (python2.4)$ easy_install-2.4 -U ZopeSkel
    

How to do it…

  1. Create a buildout with paster: Once you have the correct ZopeSkel version installed for your Python environment, run the following command to create a Zope/Plone buildout:

    (python2.4)$ paster create -t plone3_buildout
    

    Note

    Starting with ZopeSkel 2.15, when creating buildout environments with paster, you will see a warning message informing you that Unified Installer is the best option for installations and paster is just for experts. Although Unified Installer is great and incredibly useful, we think Plone developers should know how to create a Plone environment from scratch and this is the way to do it.

  2. Run the bootstrap process:

    (python2.4) $ cd pox
    (python2.4) $ python bootstrap.py
    
  3. Edit the buildout.cfg file and locate the eggs parameter in the main [buildout] section and add PIL (Python Imaging Library) as a package to be downloaded and installed during buildout.

    [buildout]
    ...
    eggs = 
        PIL
    ....
  4. Buildout your Zope instance: This last step is to run the buildout process.

    (python2.4) $ ./bin/buildout
    

How it works…

Executing Step 1 will start a wizard to help with the creation of the buildout.cfg, we need. For each of the following options, provide these values:

Option

Value

Enter project name

pox, after Plone and OpenX, the fictitious project we are tackling in this book. Here you can choose whatever name you want and paster will create a directory with that name.

Expert Mode?

With the plone3_buildout template, no matter which mode you choose (easy/expert/all), you’ll be prompted for the following options.

Plone Version

A valid released version of Plone. Although we have run paster with the plone3_buildout template, we can enter Plone 4 version numbers. Don’t forget to choose 3.x versions for Python 2.4 and 4.x versions for Python 2.6.

Zope2 Install Path

If you want to share this instance Zope installation with another existing one, enter its path. If not, just leave it blank.

Plone Products Directory

Again, if you already have a previous installation with the list of Plone products you want to use, enter its path. If you want a fresh installation, leave it blank.

Initial Zope Username

The desired Zope administrator user.

Initial User Password

Choose one. Don’t leave it blank, as you won’t be able to log in.

HTTP Port

Pick a free port in your development machine.

Debug Mode

off

Verbose Security

off

A new folder named pox (the project name we used in the first option) with a basic directory structure and two very important files—bootstrap.py and buildout.cfg— will have been created.

In Step 2, we run the bootstrap process to complete the directory structure and generate the executable buildout file.

Let’s see what buildout.cfg looks like after Step 3, where we added PIL in the eggs parameter:

[buildout]
parts =
    zope2
    productdistros
    instance
    zopepy

This is a four-part buildout. Each part will be run consecutively.

extends = http://dist.plone.org/release/3.3.4/versions.cfg
versions = versions

Egg version numbers will be fixed (or pinned) to the ones listed in the URL above. Note that the URL is set according to the release number you have chosen when you ran the paster command before.

find-links =
    http://dist.plone.org/release/3.3.4
    http://dist.plone.org/thirdparty

Downloaded and installed eggs should be fetched from these package index servers.

# Add additional eggs here
eggs =
    PIL

# Reference any eggs you are developing here, one per line
# e.g.: develop = src/my.package
develop =

We will start using the eggs and develop parameters in the next chapter as we begin adding packages to our Zope instance. Meanwhile, we will need Python Imaging Library (PIL).

[zope2]
# For more information on this step and configuration options: 
# http://pypi.python.org/pypi/plone.recipe.zope2install
recipe = plone.recipe.zope2install
fake-zope-eggs = true
url = ${versions:zope2-url}

A recipe for Zope 2 installation:

[productdistros]
recipe = plone.recipe.distros
urls =
nested-packages =
version-suffix-packages =

A special recipe to download and install old-style Zope products (not released as eggs):

[instance]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
http-address = 8080
#debug-mode = on
#verbose-security = on
eggs =
    Plone
    ${buildout:eggs}

# If you want to register ZCML slugs for any packages, 
# list them here.
# e.g. zcml = my.package my.other.package
zcml =

products =
    ${buildout:directory}/products
    ${productdistros:location}

These are several configuration settings for the Zope instance that will be created during the buildout process.

[zopepy]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = zopepy
extra-paths = ${zope2:location}/lib/python
scripts = zopepy

zopepy is a Python interpreter with a sys.path variable full of the downloaded eggs and packages available at the instance's /lib/python folder. This is particularly useful to check if every package is available as expected.

The last step will take longer to execute than the previous steps, as it will download all the eggs listed in the buildout.cfg file above and all their dependencies (at the time of writing, Plone 3.3.4 has 74 direct dependencies).

This buildout executes the four parts explicitly mentioned in the parts definition at the top of the file:

  • [zope2]: Its plone.recipe.zope2install recipe downloads and installs the Zope 2 version mentioned in ${versions:zope2-url}. You can find this parameter at http://dist.plone.org/release/3.3.4/versions.cfg, the URL of the extends parameter.

  • [productdistros]: It executes with its plone.recipe.distros recipe. In our example, we don’t have any urls listed, so it won’t process anything here.

    Note

    Note that there are very few old-style Zope products that are really worth installing in a modern instance. Being old-style means being unmaintained, so use them carefully.

  • [instance]: It uses a plone.recipe.zope2instance recipe to install a Zope instance. We can see here most of the options we set when we ran the paster command before.

  • [zopepy]: Using zc.recipe.egg will create a Python interpreter named zopepy with all the eggs found in the instance section (check ${instance:eggs}) in the sys.path variable.

See also

  • Installing Python on Linux

  • Installing and configuring an egg repository

  • Writing a production buildout

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

Checking out code from a version controlsystem


Developing without a Version Control System (VCS) is strongly discouraged: you may not want to use VCS while simply following the recipes in this book. However, any project, large or small, should use a VCS wherever possible. In the next chapter, we will start developing a package, so we’ll adjust our buildout with a handy extension to support the development of products: mr.developer.

How to do it…

Edit buildout.cfg and add the following lines:

[buildout]
...
extensions = mr.developer 
sources = sources 
    
[sources] 
# repository information here
# format <name> = <kind> <url>
# my.package = svn http://example.com/svn/my.package/trunk

How it works…

By adding the mr.developer extension, we can define a new [sources] section with settings to automatically checkout our projects—at buildout time—from whatever version control system we use. This will facilitate the repetitive task of updating every package we develop.

Supported kinds of repositories are:

More information about mr.developer is available at http://pypi.python.org/pypi/mr.developer.

There’s more…

If you are interested in any of the above VCS, read more about them at:

Creating a Plone site


We have no Plone site to play with yet (if you used the unified installer method, you should already have one though). A Plone site lives in the Zope Object Database (ZODB) and can be created by starting the instance and going through the Zope Management Interface (ZMI) (instructions for this a bit later). However, there is a better method to create a Plone site using the buildout automation process.

How to do it…

Edit buildout.cfg and add [plonesite] in the main parts parameter:

[buildout]
parts =
    zope2
    productdistros
    instance
    zopepy
    plonesite
...

And then add this new section at the bottom of the file:

[plonesite]
recipe = collective.recipe.plonesite
site-id = plone
instance = instance

Note

The new recipe, collective.recipe.plonesite, can be used to create or update Plone sites. We’ll learn more about it in the following chapters.

Now we’re ready to rebuild and start the instance.

./bin/buildout
./bin/instance fg

Finally, on browsing to http://localhost:8080/plone, you’ll see a Plone site.

How it works…

The new [plonesite] part makes the buildout process run the collective.recipe.plonesite recipe. With the correct parameters (site-id, instance, and some other ones that you might need), it will create or update a Plone site inside the Zope instance.

A particularly useful parameter is products, which automatically installs a list of products when buildout is run. We will use it in Opening an online Python shell on Plone using Clouseau.

For more information about this recipe and its options visit http://pypi.python.org/pypi/collective.recipe.plonesite.

There’s more…

As we said earlier, you can also create as many Plone sites as you need through the Web, that is to say, from the ZMI at the Zope root. This could be especially handy during development.

By going to http://localhost:8080/manage, you will be asked to authenticate yourself. Use the admin user you defined in the buildout.cfg file.

Depending on your Plone version, you will use different methods to create a Plone site:

Up to version 3.x of Plone, pick the Plone Site option from the combo-box at the top-right corner, and then click on the Add button (or just leave the combo-box). Then fill the short form and submit your changes. A new Plone site will be created with the ID you have specified.

With Plone 4.x, there is a new Add Plone Site button at the top-right corner, above the combo-box we have just mentioned.

As mentioned at the beginning of this chapter, we’ll incorporate more configuration options to our buildout.cfg as we create products in the project. So keep an eye open or just go to the Index of the book and look for “buildout” to go straight to them.

See also

  • Opening an online Python shell on Plone using Clouseau

  • Testing server load and benchmarking our code

  • Installing and configuring an egg repository

Left arrow icon Right arrow icon

Key benefits

  • Create custom content types, add utilities, and internationalize your applications using Plone products
  • Manage site installation, configuration, and customization with code instead of manual actions that are likely to be forgotten
  • Guarantee your code operation and performance by including automatic testing and caching techniques
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible.

Description

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.

Who is this book 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.

What you will learn

  • Set up a news website with many banners hosted in OpenX and get to know about all the tools you must have before starting any project
  • Easily detect and debug existing errors in the code by installing some special tools such as IPython, ipdb, and PDBDebugMode among others
  • Create a new content type (based on an existing one) using ArchGenXML and wrap the final product into a Python egg
  • Create a new content type from scratch automatically using paster
  • Complement your content types by placing related information in new portlets and manage these portlets
  • Improve the performance of your product by creating lightweight content types and taking advantage of other features of Plone
  • Secure some tasks and content types by setting permissions, roles, groups, workflows and configuration options
  • Protect the operation of your code from accidental changes by setting up some automatic tests such as unit tests, functional tests, and integration tests
  • Easily translate your website by using internationalization facilities in Plone
  • Display your final web page as per your requirement by adding new features to existing third-party products
  • Integrate your products with external software like Python packages or other systems via XML-RPC
  • Improve the user interface by creating simple client-side visual changes and server-side manipulation of objects with KSS
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 10, 2010
Length: 388 pages
Edition : 1st
Language : English
ISBN-13 : 9781847196729
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : May 10, 2010
Length: 388 pages
Edition : 1st
Language : English
ISBN-13 : 9781847196729
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 91.98 114.98 23.00 saved
Professional Plone 4 Development
$52.79 $65.99
Plone 3 Products Development Cookbook
$39.19 $48.99
Total $ 91.98 114.98 23.00 saved Stars icon

Table of Contents

14 Chapters
Getting Started Chevron down icon Chevron up icon
Using Development Tools Chevron down icon Chevron up icon
Creating Content Types with ArchGenXML Chevron down icon Chevron up icon
Prevent Bugs through Testing Chevron down icon Chevron up icon
Creating a Custom Content Type with Paster Chevron down icon Chevron up icon
Creating Lightweight Content Types Chevron down icon Chevron up icon
Improving Product Performance Chevron down icon Chevron up icon
Internationalization Chevron down icon Chevron up icon
Adding Security to your Products Chevron down icon Chevron up icon
Improving User Interface with KSS Chevron down icon Chevron up icon
Creating Portlets Chevron down icon Chevron up icon
Extending Third-Party Products Chevron down icon Chevron up icon
Interacting with other Systems: XML-RPC Chevron down icon Chevron up icon
Getting our Products ready for Production Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(4 Ratings)
5 star 0%
4 star 100%
3 star 0%
2 star 0%
1 star 0%
Maurits van Rees Jun 18, 2010
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This is a very practical book. The authors do not present much theory, except when it is really needed to understand the recipes. With 70 recipes of about 5 pages each, there is not much room to go very deep into a subject. I think that does make for a book that I can point to in answer to questions on mailing lists: "Oh, just read that recipe in the cookbook on page 42."I would say the book is for beginning to intermediate Plone programmers. The only new information I saw for myself was about plone.app.content and dexterity. Still, it is good to have available when you think: "Today I want to bake a fresh portlet, let's get the cookbook." You will find good, solid information in this book.Read a more complete review on my weblog: [..]
Amazon Verified review Amazon
Kindle Customer Jun 16, 2010
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book contains 350 pages of expert-level advice for the experienced Plone developer. This is not a book for Plone newbies-- the authors state right up front that readers should have some understanding of Plone/Python/Zope, and I believe this is true. For those already aware of the basics, though, this book reads like the working notes of a top-level Plone consultant.The book is organized around a hypothetical 10 requirements presented to the reader for a client's website. (The 10 include such tasks as preparing for internationalization, allowing multimedia content in downloadable and playable form, and 8 other reasonable requests.) Throughout the book, the reader is told how to fulfill these 10 requirements. Along the way there are a multitude of best practices outlined, too.The book is set up to be read as a reference. Some chapters build on others, but many allow an immediate jump to the desired topic. This fits the book's flavor, which is more reference than overview.All things considered, I would recommend this book to anyone who wants to undertake serious Plone 3 development.
Amazon Verified review Amazon
Israel Saeta Pérez Jun 13, 2010
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
When I received a review request for Plone 3 Products Development Cookbook from Packt, the first thing I thought was: How didn't I know about this book before, and who are the authors? I'd certainly not heard about them (Juan Pablo Giménez and Marcos F. Romero) nor this upcoming book ever before, but it seems there are a lot of Plone books being written behind the scenes by people not hanging at #plone too. :)The list of reviewers, comprising Martin Aspeli, Alec Mitchell and Emanuel Sartor, being as they are core and very active developers, automatically made me think this was going to be an accurate and up-to-date book.This is the second book in the market about modern development with Plone, after Martin Aspeli's Proffessional Plone Development. And after having skimmed through it (if you try to proof-read this kind of books from top to bottom your brain can explode), I can say that it's probably going to become a classic invaluable reference as PPD already is.Plone 3 Products Development Cookbook spans over 350 pages full of useful tips, set-up instructions and step-by-step coding approaches to solve specific use-cases (that's why it's called "cookbook"). Even if the book title says Plone 3, I think it's just a Packt policy - one can be sure that most of the contents (if not all them) will be valid for Plone 4 too, and the authors even included some special instructions for Plone 4.The book show-cases the development of an hypothetical digital newspaper with Plone, covering the whole process: From installing Python and Plone in Linux or Windows (Mac OSX specifics aren"t covered in this book) to preparing the production environment, passing through the installation of useful development tools like ipdb, DocFinderTab or plone.reload, creating content-types using ArchGenXML, paster-aided plain Archetypes or Dexterity, internationalizing and localizing the product, building XML-RPC interaction with other systems, and more (see the full table of contents). All the features coded include automated tests, what is a Very Good Practice and will help devs to be less afraid of writing tests.The book is organized in a recipe-list fashion, in chapters, every recipe including "getting ready", "how to do it", "how it works" and "there is more" sections. Sometimes the separation of concerns between these sections is not very clear, but one can expect a series of short steps in "how to do it", to use as reference, and some brief explanation in "how it works".In my opinion, this is not a book for beginners. Even if there are some explanations in the "how it works" section of each recipe, they are almost always quite brief, and can certainly make you have to re-read and Google for more documentation often, if you really want to understand how the Zope Component Architecture, ZPT, skin layers, z3c.forms, etc. work. I see it more as a reference book for more advanced developers, who can also discover in this book some tricks and approaches they didn't know before - I certainly did!Summing up, this is a really useful reference for folks with previous developing experience in Plone. My sincere congratulations to the authors for their hard work to make this happen - I'm sure it will hit the shelves of every active Plone developer!
Amazon Verified review Amazon
J. Kidd Jul 21, 2010
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book provides practical information on how to create a Plone product from beginning to end. It says on the cover that it provides "quick answers to common problems," but it actually does quite a bit more than that. It also provides you with tools that will help in making product development more effective.I come to this book as someone who has used Plone for many years, but would like to learn more about developing products for Plone. In addition to providing step by step instructions for common product creation tasks, the book also provides information on debugging tools, creating tests for your products, and packaging your products for distribution.So far, the book has held up to practical tests as well. It was able to help someone in our office, who had never created a custom content type before, create a new content type quickly and easily. We're thinking of using the book in our monthly Plone meetings to help the people who come to our group get up to speed in the creation of content types.If there is one problem with this book, it is that it is for Plone 3 when Plone 4 will be released soon. Much of what is here will still be useful, but there will be some changes. Of course, writing a book like this, you will always we trying to hit a moving target. Still, I would have liked to have seen a chapter at the end on what was coming in Plone 4 and what we could have expected to be different.But, as I've said, this book has already proved its usefulness to me. I would highly recommend it.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
Modal Close icon
Modal Close icon