ZClasses and ZCatalog: reindexing problem
Hi all, I've been trying to create a simple, searchable database of scholarly publications for a university department with a customized ZClass, ZCatalog, and the ZSearch interface but have run into two problems I cannot solve: 1) I can add a new catalog-aware class instance which the Catalog will pick up, but the properties of this new instance (author, pub_title, publisher, year, etc.) are not made available to search results; 2) the addition of this new instance prevents the ZSearch interface from returning results for any other query, even for ones that worked before the addition. I just don't know why this should be. I thought the problem lay with the constructor _add method, but I've read all the tutorials and done the code changes there: still no success. I then thought AlexR's suggestion to create two methods in the ZClass for editing property changes might have something to do with the plumbing of reindexing, but apparently not. I then thought Catalog's reindexing might be messed up by enabled subtransactions, so I disabled them -- but this didn't help either. I can snag the new instance's properties via DTML, so the problem must be with Catalog -- right? I just don't have the Python smarts to get into the source to see what's going wrong -- does anyone have any suggestions? People at this university are excited about Zope, and some influential eyes are following our website's development closely. Grateful for any help, Anthony Monta Department of English Louisiana State University apmonta@excite.com BTW, the site is www.english.lsu.edu -- open-source all the way with Linux and Zope, and no admin problems whatsoever. _______________________________________________________ Get 100% FREE Internet Access powered by Excite Visit http://freelane.excite.com/freeisp
I've been trying to create a simple, searchable database of scholarly publications for a university department with a customized ZClass, ZCatalog, and the ZSearch interface but have run into two problems I cannot solve:
----- Original Message ----- From: "Anthony Monta" <apmonta@excite.com> To: <zope@zope.org> Sent: Thursday, April 20, 2000 10:09 AM Subject: [Zope] ZClasses and ZCatalog: reindexing problem 1)
I can add a new catalog-aware class instance which the Catalog will pick up, but the properties of this new instance (author, pub_title, publisher, year, etc.) are not made available to search results; 2) the addition of this new instance prevents the ZSearch interface from returning results for any other query, even for ones that worked before the addition.
I don't know about #2 above, but I would make sure that your ZClass_add method has: <dtml-with "createInObjectManager stuff...." <dtml-call "propertysheets.YourPropSheet.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> For editing your CatalogAware ZClass instance properties, you will need to create your own method to edit the properties and to post the changes... (To post the changes, just take those two lines within <dtml-with> above, and make a method out of it.) HTH, Kevin
Anthony, 1)
I can add a new catalog-aware class instance which the Catalog will pick up, but the properties of this new instance (author, pub_title, publisher, year, etc.) are not made available to search results;
Do you call <dtml-call reindex_object> when you add you instnace like so: <dtml-with "MyZClass.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.MyProperties.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> You must call it after you change the instance's properties. You also must do so anytime you edit those properties. That means you can't call '/propertysheets/MyProperties/manage' to edit them. You must construct you own DTML. 2) the addition of this new
instance prevents the ZSearch interface from returning results for any other query, even for ones that worked before the addition.
This is probably because your search and report are reporting properties from you ZClass like 'author', but not all the items in the Catalog have the 'author' property. If you are searching for a particular 'meta_type' like a 'ZBook', that has a property 'author', if you don't narrow down you search to just ZBook's, the report page will ask for the 'author' property of plain old 'Folders'. And plain old 'Folders' don't have an author property. And you'll get a traceback. Hope that helps, Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (3)
-
Anthony Monta -
Jason Spisak -
Kevin Dangoor