[Zope-PTK] Procedure: Adding a Portal Content ZClass
Mike Pelletier
mike@digicool.com
Wed, 12 Jan 2000 18:17:52 -0500 (EST)
Hi. I need to write down this checklist while I still remember all
the steps. I'm sending it here because it may be useful to others, at
least until it changes again.
To create a new kind of Portal Content:
- Add a class to PTKBase/ZopeOrg/PortalContent.py. It need not subclass
anything, because it's going to be mixed in with other classes in the
ZClass.
- Make the class available as a ZClass base by editing
PTKBase/ZopeOrg/__init__.py. (Follow the example of the other
classes.)
- Create a ZClass, subclassing first the class you created in the first
step, then 'ZopeOrg: Portal Content'.
- Delete the generated Permission object
- Insert at minimum the following to the <dtml-with> portion of the add
method:
<dtml-call "propertysheets.PortalContent.manage_editPropterties(REQUEST)">
- Change the redirect portion of the add method to honour the
wizard_destination parameter:
<dtml-if wizard_destination>
<dtml-call "RESPONSE.redirect(wizard_destination)">
<dtml-elif DestinationURL>
...
- In the ZClass's 'Define Permissions' view, set 'Create Class Instace'
to 'Add Portal Content'.
- Also set the Factory's 'Permission' value to 'Add Portal Content'.
- To provide an 'Edit this page' interface, add a method called
'user_edit_form' to the ZClass.
- To make the ZClass available to Members, create a Wizard object in
/Control_Panel/Products/ZopeOrg/ZopeOrgPortal/Wizards. It's 'action'
property should be set to 'manage_addProduct/ZopeOrg/your_zclass_add'.
--
Mike Pelletier email: mike@digicool.com
Mild mannered software developer icq: 7127228
by day, super villain by night. phone: 519-884-2434