At 20:04 17/10/99 , gtk wrote:
Problem #1: I can't put "foo" up as a subobject of foocontainer. Why not?
ZClasses with a Factory inside an ObjectManager derived ZClass automatically are addable to that ZClass. You cannot add them on the subobject tab because that is only for objects outside the current ObjectManager.
Problem #2: By hacking an index_html with a link to foo_addForm, I can add a foo (so why can't I put foo in the list of subobjects?). Cool. Unfortunately, this code in foo_add doesn't result in anything going in the catalog:
<dtml-with "foo.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call setCatalog(PARENTS[0],REQUEST)> <dtml-call index_object()>
Changing the first argument to setCatalog doesn't make a shred of difference.
Where did this setCatalog come from? It's not in the CVS, nor in the current code. I have (simplified): Foo (ZClass) - Inherits ObjectManager, ZCatalog (in that order) - On the Permissions tab 'Add Bars' is selected. - Subobjects: None - Views do not include any ZCatalog specific methods, because I am hiding the fact it is a Catalog. I just use its methods from other views and methods. Foo_factory Foo_addForm Foo_add_permission Bar_add_permission Foo_add - <dtml-with "Foo.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)"> <dtml-comment>I also change the indexes and schema of Catalog here, using manage_delColumns, manage_delIndexes, manage_addColumn and manage_addIndex. </dtml-comment> </dtml-with> Within the Foo ZClass, I have: Bar (Zclass) - Inherits from CatalogAware Bar_addForm Bar_factory Bar_add - <dtml-with "Bar.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)"> <dtml-call "manage_editCataloger(PARENTS[1].id, REQUEST)"> <dtml-call reindex_object> </dtml-with> The manae_editCataloger method sets the ObjectManager and ZCatalog derived ZClass as the Catalog to index this new object. You'll have to make sure that you either have the latest CVS version of CatalogAwareness.py, or change the method signature of manage_editCataloger to: def manage_editCataloger(self, default, REQUEST)
Finally;
Problem #3: "Find items to ZCatalog" in an instance of foocontainer doesn't permit me to add foos. Why not?
I don't know about this one. I don't find the objects into my ZCatalog, I make them add and remove themselves.
In it I have one ZClass that inherits from CatalogAware, and with some twiddling in the constructor methods instances of the CatalogAware classes are indexing themselves in the container ZClass just fine.
I don't suppose you're willing to HowTo that one?
I hereby grant you permission to write a HowTo with the above info =). I am really very busy with two Zope projects right now, plus a lot of personal things thrown in the mix as well.. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------