I've been struggling trying to get the catalog to index catalog
aware objects.  There are several messages from people with similar
problems, in the archives, but none of the solutions seem to work.  I have
created a Product with a catalog aware class called Job_Request.  The
Product also has a Job_Request_addForm method and a Job_Request_add
method.  The form simply asks for user input for various fields and the
Job_Request_add method is meant to create the class instance, set the
properties, and index the object.  In order to test the class I made an
object which lists all items the catalog as well as allows me to search on
a single field.  The problem seems to be that the catalog will not update
after I Input a value that the catalog has not yet seen for a particular
field.  Some Examples:

         1. The catalog already has a Job_Request object with the
agency_name property set to NASA.  If I add another object to the catalog
with agency_name = 'NASA', the result lists for an unrestricted search and
a search restricted to NASA both contain the correct record.

        2. I delete all objects where agency_name ='NASA' and then I add
a new one with the same agency_name, I get the same results as above.

        3. I add a new Job_Request where the value of agency_name is one 
that has yet to have been cataloged i.e. agency_name =
'NeverHadThisValue', and the results for an unrestricted search on
agency_name shows the record, but the results restricted by agency_name =
'NeverHadThisValue' comes up empty.

Any help on this would be greatly appreciated (Is it a bug?  If so
what's the best workaround)....


What follows is the code for my Job_Request_add method and my SearchTest


<dtml-var standard_html_header>

   <dtml-call "REQUEST.set('ts', ZopeTime())">
   <dtml-call "REQUEST.set('id',_.str(_.int(ts)))">
   <dtml-call "REQUEST.set('agency_name', agency_name)">
    ......many more REQUEST.set's ....... 

<dtml-with "Job_Request.createInObjectManager(REQUEST['id'], REQUEST)">
   <dtml-call reindex_object>

<dtml-if NoRedir>

<dtml-if DestinationURL>

 <dtml-call "RESPONSE.redirect(


    <dtml-call "RESPONSE.redirect(

<dtml-var standard_html_footer>


<dtml-var standard_html_header>
<H2>Entire Catalog</H2>
<dtml-in "Catalog(agency_name='')">
<dtml-var agency_name>
<dtml-var id>

<H2>Single Record</H2>
<dtml-in "Catalog(agency_name='NewName')">
<dtml-var agency_name>
<dtml-var id>

<H2>Try a Search</H2>
<form action="available_positions_report" method="get">
<td><input name="agency_name"
width=30 value=""></td></tr>

<tr><td colspan=2 align=center>
<input type="SUBMIT" name="SUBMIT" value="Submit Query">
<dtml-var standard_html_footer>

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to