Personal tools
You are here: Home Documentation How-tos Make a product install a folder structure in the site
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Make a product install a folder structure in the site

This How-to applies to: Any version.
This How-to is intended for: Developers

Creating Folders at product install time can be done by your product's install script, but it's much easier to let Generic Setup take care of it. This how-to explains how to use profiles/default/structure to create folders at product install time. Explains the use of the files .objects, .preserve and .properties.

Purpose

You want your product to install a folder structure in the site when the product is installed. For example, if you have a product which creates objects, you might want to create a special folder for them. Of course, you could do all this programmatically, but there's a much simpler way: Generic Setup has alredy taken care of it.

Prerequisities

You'll need a basic understanding of Generic Setup.

Step by step

  1. In your product's profiles/default folder, create a directory called 'structure'. 
  2. To create a top-level folder with id 'installed-by-product', add a directory of that name to the structure folder.
  3. Create a file called .objects in the 'structure' directory
  4. Create a file called .properties in the 'installed-by-product' directory
  5. Create a file called .preserve in the 'structure' directory

.objects registers the folder to be created:

installed-by-product,Folder
.properties sets properties of the folder to be created:
[DEFAULT]
description = Folder for imported Projects
title = Imported Projects
.preserve will make sure the folder isn't overwritten if it already exists.
installed-by-product

Further information

See http://vanrees.org/weblog/creating-content-with-genericsetup

by Kees Hink last modified August 10, 2008 - 19:13 All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by