Current

This document is valid for the current version of Plone.

Factory Tool

by Plone Documentation Team last modified Dec 27, 2009 05:45 PM
Contributors: Mikko Ohtamma, Martin Aspeli, Kamon Ayeva, Israel Saeta Pérez
Information about the Factory tool settings import and export.

Use the factorytool.xml import steps to include new types into the Plone Factory Tool  when creating new Archetypes content-types. This is needed because Archetypes needs the content to be already created before validating it. In order to avoid broken objects in the site, they're first created in a place called portal factory and moved to the desired place later after they've been validated.
Imagine you've created the Cat content-type and want to register a factory for it. Just create a factorytool.xml file for your extension profile with the following contents:

<?xml version="1.0"?>
<object name="portal_factory" meta_type="Plone Factory Tool">
  <factorytypes>
    <type portal_type="Cat"/>
  </factorytypes>
</object>

Check the Archetypes Developer Manual for more info about how to create content-types.