This list is not intended as a in-depth tutorial to learn how to create new content-types in Plone (if you are looking for that, please check the Archetypes Developer Manual), but as a checklist to ensure you’ve not forgot any step.
- Create the skeleton of the package using paster -t plone.
- Add the package to your buildout.cfg, including the eggs, develop and zcml sections.
- Define your type interfaces using zope.schema.
- Implement the interface using Archetypes.
- Define the content-type fields using Archetypes.atapi.Schema.
- Bridge the getters and setters to attributes using atapi.ATFieldProperty.
- Define the security policies for the class attributes throught <require /> directives into your configure.zcml.
- Register the neccessary resources (images, css, javascript) into your browser/configure.zcml file, throught <browser:resource /> directives.
- Implement the main view of the object.
- Register a <browser:page /> into the browser/configure.zcml file, referencing the view class and the content-type interface.
- Write the implementation of the referenced class above, using Products.Five.browser.pagetemplatefile.ViewPageTemplateFile and defining any internal methods that you’ll need into the rendered templates later.
- Write the associated template, using ZPT.
- Write the GenericSetup install code for the new content-type:
- Register a extension profile into your configure.zcml, using a <genericsetup:registerProfile /> directive.
- Register the type into the portal_types tool throught a types.xml file.
- Specify the details for each type into the types/your-type-name.xml file.
- Write the __init__.py package’s boilerplate code to initialize the content-type and create the factory functions.
- Write down your configuration data into a config.py file.
- Assign add permissions to desired roles throught rolemap.xml.
- Register the type factory in the factorytool.xml file.
Thanks to Martin Aspeli for such a great book!
Related articles
Tags: archetypes, plone


2 comments
Comments feed for this article
Trackback link: http://dukebody.com/2009/02/creating-a-new-content-type-with-archetypes-in-plone-3-checklist/trackback/