I'm implementing search functionality on my site using ZCatalog. Right now, the searching and indexing work fine, and I'm trying to make some custom Z-Classes CatalogAware. All of my Z-Classes inherit from a Z-Class called CentralBase, which contains a DTML method called "edit", which is used as the "action" for all of their management edit forms: <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)"> <dtml-call "RESPONSE.redirect('editForm')"> To instantly make all of my Z-Classes CatalogAware, I figured that I could just: * recreate CentralBase so that it inherits from CatalogAware (is there a way to modify what Z-Classes a Z-Class subclasses from without recreating it? this is the biggest complaintm that I have with Z-Classes) * modify edit and add "<dtml-call reindex_object>" below the first line * change the add method (called by all of the *addForm methods) to also call "reindex_object" Unfortunately, it wasn't that easy. When I recreated the CentralBase class, it screwed up all of my other Z-Classes. The edit method isn't getting acquired correctly. Cannot locate object at: http://localhost:8080/News/SiteUpdates/Welcome/edit Traceback (innermost last): File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py, line 179, in publish File /home/smpitts/Zope-2.1.1-src/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/Publish.py, line 151, in publish File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/BaseRequest.py, line 334, in traverse File /home/smpitts/Zope-2.1.1-src/lib/python/ZPublisher/HTTPResponse.py, line 521, in debugError NotFound: (see above) Does anyone have any suggestions? -- Stephen Pitts smpitts@midsouth.rr.com webmaster - http://www.mschess.org
----- Original Message ----- From: "Stephen Pitts" <smpitts@midsouth.rr.com> To: <zope@zope.org> Sent: Monday, January 17, 2000 8:16 PM Subject: [Zope] ZCatalog + Subclassing Woes
Unfortunately, it wasn't that easy. When I recreated the CentralBase class, it screwed up all of my other Z-Classes. The edit method isn't getting acquired correctly.
My guess is that your new CentralBase class has a different class ID than the old one, and that is why things are breaking. If you still had the old one around, you can just put the original class ID into the new class on the Basic tab. BTW, I saw a suggestion a few days back from someone at DC that it's not a bad idea to make a Python base class for your ZClasses. If you do that, you can very easily change the base classes for that ZClass (because you just change the python). Kevin
Kevin Dangoor wrote:
From: "Stephen Pitts" <smpitts@midsouth.rr.com>
Unfortunately, it wasn't that easy. When I recreated the CentralBase class, it screwed up all of my other Z-Classes. The edit method isn't getting acquired correctly.
My guess is that your new CentralBase class has a different class ID than the old one, and that is why things are breaking. If you still had the old one around, you can just put the original class ID into the new class on the Basic tab.
I noticed something really weird yesterday related to a ZClass based product. I don't know if it will help you or not, but here goes. I was editing the myclass_addForm form that gets called by the factory. For some weird reason, my edits weren't showing up when I went to create a new instance of my class. I noticed, however, that if I created a new folder and then tried adding the class there, I would get a more recent version of my changes to the myclass_addForm. That was yesterday, where I was working under IE5. Today, the problem has gone away, and things are all behaving normally again. However, I'm working under Netscape 4.7. Coincidence? I don't know, I don't have access to the machine I was using yesterday. Are you working in IE5? As a wild-and-not-based-on-any-facts guess, I'm wondering if the difference in behavior between my two browsers is due to the recently added WebDAV support.... That's the only thing I can think of that would account for the radically different behavior between my browsers (there may be others).
On Tue, Jan 18, 2000 at 10:53:40AM -0500, Kevin Dangoor wrote:
----- Original Message ----- From: "Stephen Pitts" <smpitts@midsouth.rr.com> To: <zope@zope.org> Sent: Monday, January 17, 2000 8:16 PM Subject: [Zope] ZCatalog + Subclassing Woes
Unfortunately, it wasn't that easy. When I recreated the CentralBase class, it screwed up all of my other Z-Classes. The edit method isn't getting acquired correctly.
My guess is that your new CentralBase class has a different class ID than the old one, and that is why things are breaking. If you still had the old one around, you can just put the original class ID into the new class on the Basic tab. Never mind, that didn't work. The edit function still isn't being assimilated. What do I have to do? Recreate every single ZClass that depends on this one? -- Stephen Pitts smpitts@midsouth.rr.com webmaster - http://www.mschess.org
participants (3)
-
Art Hampton -
Kevin Dangoor -
Stephen Pitts