update: These steps should work with little adjustment on a Linux base OS also.
This is a short write-up that helps you to quickly jump to the "important" section of the dexterity manual (http://plone.org/products/dexterity/documentation/manual/developer-manual/schema-driven-types/referencemanual-all-pages). Hopefully this will minimize some of the fumbling on OS X (and Linux also). I provide some boiler plate code that should help you to skip some of the initial coding and hopefully save you some trivial errors.
Back already? Great!
Through the Web (TTW) Content Types (Warm up exercise)
This exercise will help you to appreciate some of the principles associated with dexterity based content types in Plone.
Start your Plone instance
Then go to 'admin' → 'Site Setup' → 'Add-ons', check 'Dexterity content types' and click 'Activate'.
Now go back to "Site Setup", select "Dexterity Content Types" and start tinkering with it.
Then create a new content type called 'Person'. You can do this by clicking 'add new content type' (see the screencast below):
That's it.
Creating a content type with filesystem code
Now that you've seen the through the web (TTW) approach, let's look at storing code on the filesystem. The filesystem based approach is better for version management (e.g. with git) and redistribution of the code.
To make your life easier, I've created some boilerplate code based on the dexterity manual. The instructions below will get you started quickly (assuming you already have Plone and git installed).
Step 1 - Get the example configuration file:
Get the 'example.conference.cfg' from here and place it in the same folder that contains your buildout.cfg.
Step 2 - Update buildout.cfg to use the new configuraiton file:
The changes will look something like this;
extends =
base.cfgversions.cfghttp://good-py.appspot.com/release/dexterity/1.0-next?plone=4.0.5example.conference.cfg
eggs =
PlonePIL==1.1.6plone.app.dexterityexample.conference
The re-run buildout:
bin/buildout
Step 3 - Customize the example.conference product with new content types
note: This is based on the section of the dexterity manual that discusses schema driven types.
Add 3 new files to src/example.conference/example/conference, presenter.py, program.py, and session.py.
see: http://plone.org/products/dexterity/documentation/manual/developer-manual/schema-driven-types/referencemanual-all-pages, for an explanation and the code to add to each.
Step 4 - Register the new content types as Factory Types
see: http://plone.org/products/dexterity/documentation/manual/developer-manual/schema-driven-types/referencemanual-all-pages, for instructions on doing this.
Once you've done this you should now be able to install the conference management system and add new programs, sessions and presenters, to your Plone site.
No comments:
Post a Comment