[Zope-CMF] Re: using GenericSetup to add non-content objects
-BEGIN PGP SIGNED MESSAGE- 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. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD/aOl+gerLs4ltQ4RAvSnAJ9lHOG5l1lcvTsQIoOF3lISQ2CyEACfV3eK +pMbl+rfh1Pq2NCX5p4IgYc= =qivj -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: using GenericSetup to add non-content objects
Rob Miller a écrit : hi, 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. Hi, I have done that for the RAMCacheManagers in CPS: http://svn.nuxeo.org/trac/pub/file/CPSUtil/trunk/cachemanagersetup.py Note that a five:implements is required to make it work: http://svn.nuxeo.org/trac/pub/file/CPSUtil/trunk/configure.zcml About the construction arguments question, I cannot answer since I'm not familiar with the GenericSetup internals enough. But for the RAMCacheManager case, it's just not required. -- Olivier ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: using GenericSetup to add non-content objects
On Wed, 22 Feb 2006 22:05:53 +0100, Olivier Grisel wrote: Rob Miller a écrit : hi, 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. Hi, I have done that for the RAMCacheManagers in CPS: http://svn.nuxeo.org/trac/pub/file/CPSUtil/trunk/cachemanagersetup.py yes, it's certainly possible to write an importer for any arbitrary object, and if you have object-specific configuration that needs to happen, you'll need to write one. but all i want to do is instantiate an object of a specific type, no custom config. it seems a bit much to need to write a custom handler just so that i can pass an id argument to the constructor. -r ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: using GenericSetup to add non-content objects
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. Cheers, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests