Make a product install a folder structure in the site
This How-to applies to:
Any version.
This How-to is intended for:
Developers
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
- In your product's profiles/default folder, create a directory called 'structure'.
- To create a top-level folder with id 'installed-by-product', add a directory of that name to the structure folder.
- Create a file called .objects in the 'structure' directory
- Create a file called .properties in the 'installed-by-product' directory
- 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