[Zope-CMF] Re: modifying TypeInformation's properties
yuppie
y.2004_ at wcm-solutions.de
Tue Sep 7 12:55:40 EDT 2004
Hi Tres!
Tres Seaver wrote:
> OK, here is how I see this:
>
> - The CMFSetup product itself is mostly "mechanism", not "policy";
> it contains a default profile primarily to allow others to see how
> profiles look.
>
> - Add-on products (like CMFCalendar) can play with CMFSetup in two
> ways:
>
> o As "mechanism", by registering additional import / export steps
> (making them available to the setup tool, and thus able to be
> included in profiles). CMFCalendar needs to register export and
> import steps for the calendar tool, in order to fulfill its
> "didactic" role here.
>
> o As "policy", by including profiles. We should probably include
> a sample profile in CMFCalendar showing what a
> "site-with-calendar" export looks like, but that is less
> important than registering the steps.
>
> I would expect most "add-on" products supplying tools to use the
> first, but only those representing "finalized sites" (e.g., the
> "customer-specific" product in a consulting gig, or perhaps
> Plone itself, as a "standalone" application).
>
> - If we extend TI objects with arbitrary policy, that is "mechanism";
> CMFSetup will just record such properties (on export) in the XML
> file for types, and recreate them (on import). Configurations which
> rely on such properties will need to supply a profile which contains
> them; the most obvious way to create such a profile is by adding
> them manually or programmatically to the site and then re-exporting
> it.
Ok. Let's see how this works. Please correct me if I'm doing something
wrong:
1.) import / export steps are registered via profiles. To make the setup
tool aware of the new setup steps, we add something like that to
CMFCalendar's __init__.py:
profile_registry.registerProfile( 'default'
, 'CMFCalendar Default'
, 'Configures CMFCalendar support.'
, 'profiles/default'
, 'CMFCalendar'
)
2.) We add the directory 'profiles/default' including
'export_steps.xml', 'import_steps.xml', 'toolset.xml' and the xml files
that contain the basic CMFCalendar configuration data.
3.) The calendar tool needs new import / export handlers. So we add a
module that contains the handlers and an xml directory that contains a
'ctcExport.xml' template.
4.) What's still missing are import / export handlers for 'Event'
configuration. Can we reuse the TypesTool handler? If we run the handler
in purge mode, all other type infos are deleted. The export is already
done by the default TypesTool export. So we don't register an export
step? I'm confused.
I stop here for now. Trying to convert the CalendarTool.calendar_types
attribute to 'is_calendar_type' TI properties would lead back to the
original problem.
Cheers,
Yuppie
More information about the Zope-CMF
mailing list