Plone 3 Products Development Cookbook
上QQ阅读APP看书,第一时间看更新

Automatically installing products in your Zope instance

When working on a project like ours, you will find it very useful to automatically install some products in your Zope instance at buildout time.

How to do it…

  1. If not done yet, add a new line in the parts definition at the top of buildout.cfg to tell buildout to create a Plone site automatically:
    [buildout]
    
    ...
    
    parts = 
    
    ...
    
     plonesite
    
  2. And then add a new [plonesite] part at the bottom of the file:
    [plonesite]
    recipe = collective.recipe.plonesite
    site-id = plone
    instance = instance
    products = 
     Products.poxContentTypes
    
  3. Don't forget to build your instance and launch it once more.
    ./bin/buildout
    ./bin/instance fg
    

How it works…

The recipe used in [plonesite] part here — collective.recipe.plonesite — will create or update a new Plone site when the buildout is run. In addition, if any product is specified in the products parameter, it will be automatically installed.

Once your Zope instance is up, you can open your Plone home page and click on the Add new drop-down menu. By clicking on the XNewsItem option, a new form should open as shown in the following screenshot:

How it works…

There's more…

You also have the option to install products manually:

  1. Log into your Plone site as admin user.
  2. Click on the Site Setup link on the top-right corner and then click on the Add-on Products link, or just go to http://localhost:8080/Plone/prefs_install_products_form.
  3. In the Add/Remove Products page, select poxContentTypes in the Products available for install list and press the Install button below.

See also

  • Creating a Plone site
  • Opening an online Python shell on Plone using Clouseau
  • Creating a policy product
  • Installing and configuring an egg repository