[Zope-CMF] Re: using GenericSetup to add non-content objects

Tres Seaver tseaver at palladion.com
Thu Feb 23 06:59:33 EST 2006

Hash: SHA1

yuppie wrote:
> Hi Rob!
> Rob Miller wrote:
>> i'm trying to use GenericSetup to add tool-like objects to my site at
>> creation time.  i say "tool-like" because the objects in question (RAM
>> and
>> HTTP cache managers) act as tools, but they have constructors that
>> require
>> additional arguments... the current tool.py importer assumes that the
>> constructor for a tool doesn't take any arguments.
>> neither is the content importer appropriate, since these aren't content
>> objects.  is there some straightforward way to add arbitrary objects to
>> the root of the site that i'm missing?  if not, how would folks feel
>> about
>> some slight changes to the tool.py to allow for additional constructor
>> arguments to be specified?
>> on a related note, i'd also like to allow tool titles to be specified in
>> toolset.xml.  anyone have a problem w/ this being added to tool.py?
> RAM and HTTP cache managers just require the object id as argument. +1
> for fixing this id issue in the toolset handler.
> But everything else like titles are properties of the tool itself that
> have nothing to do with the container and might need tool-specific setup
> code. Allowing to set arbitrary arguments in 'toolset.xml' violates the
> current structure of the profiles. So -1 for supporting other arguments
> than id.

Agreed.  I think there is support for an optional tool ID lying around
somewhere in there;  maybe I dropped it on the floor?

As a workaround for tools which require extra arguments, but for which
several possible "stock" configurations are possible, one could register
a factory other than the class itself (this won't scale against large
numbers of arguments or possible values, obviously).

- --
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Zope-CMF mailing list