[Zope-PTK] Tools

Tres Seaver tseaver@digicool.com
Sat, 06 Jan 2001 11:39:00 -0500


Lucas Hofman wrote:
> 
> Can someone help me understand how to use the tools which have appeared
> in the New Architecture PTK. I wonder about the following:
> 1. How to change the catalog (metadata and indexes) so that when a new
> portal is instanciated these changes are in place.

Have a look at PTKBase/CatalogTool.py.  It sets up the list of
PTK-specific
indices and schema entries in its '_initIndexes' method.  When you add
one
of these catalogs, it will have all that stuff there already (they get
added
from the multi-factory labeled as 'Add PTKBase Tool' in the add list).

> 2. How to implement other policies regarding registration and
> membership? Change the files in PTKDemo or create a PTKCustomized
> product based only on PTKBase? The last option seems better, but how
> does one get a portal based on PTKCustomized instead of PTKDemo.
>
> Probably it all boils down to 'How to create a customized portal using
> the PTK'.

Definitely better to derive a new (filesystem or ZClass) class.  The
simplest way to get a portal using a customized tool is:

 * Create the portal with the default tools.

 * Delete the tool you want to replace.

 * Add your tool (which could even be a folder with PythonScripts and
   DTML in it, as long as the tool doesn't need access to resources
   unavailable to through-the-web code).

The key thing is that the replacement tool **must** implement the same
interface as the original.  These interfaces are documented in the
PTKBase/interfaces directory (and used to be available in the Zope
help system -- I'll put them back right now).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org