Hi all
 
I used the catalog anything manual to do have my sql data from postgres to be indexed into zope but i ran into trouble. I must warn you i am a newbie so it must be a very silly mistake somewhere. Let me explain what I did
 
My config
Linux OS
Zope 2.3.0
Postgres 7.0.3
ZPyGreSQL DA
 
The process
Since i am a newbie i was not sure what you meant in the cataloganything doc when you said...
=============

Setting Up the Catalog

The first step in any search is to set up the catalog. There is no difference in setting up a catalog for "normal" searches and setting one up for a search of SQL data, so I'm not going to go into detail here on how to do that. Just make sure you have created a catalog with the desired indexes and meta data.

==============

So i just used the chapter 9 reference that was provided earlier and i created a ZCatalog called Products. I was not sure what else to do so i just let the defaults remain as it is - the AnimalTracker example in chap 9 didnt seem relevant to me since i have no dtml methods to search for - only products info from the postgres. So i just didnt do anything further. I have a products table in the postgres rdbms that i want to search by title and description. So after this i created a zsql method called getProdtoCatalog under the ZCatalog itself - the query i used is

SELECT prodid as Number, Title,
Descr || ' ' || Title as PrincipiaSearchSource,
'Product' as meta_type, prodid as id, Descr as summary
FROM products

Now i went into the Find Objects section and searched for the getProdtoCatalog zsql method and added to the catalog

Next i went and created the python script (again under the Products ZCatalog itself) and i called it catalogProducts this is the code inside

for book in container.getProdToCatalog():
    container.catalog_object(Product,
    '/learn/search/Products/'+Product.Number+'/proddetails.html')
    print 'Product #' + Product.Number
return printed

The moment i test it i run into trouble - Can any one help please

regards

bobby

For the error message this is what i get....

===================

Zope Error

Zope has encountered an error while publishing this resource.

Error Type: AttributeError
Error Value: getProdToCatalog


Troubleshooting Suggestions

  • The URL may be incorrect.
  • The parameters passed to this resource may be incorrect.
  • A resource that this resource relies on may be encountering an error.

For more detailed information about the error, please refer to the HTML source for this page.

If the error persists please contact the site maintainer. Thank you for your patience.

Powered by Zope

Traceback (innermost last):
  File /home/bobby/Zope-2.3/lib/python/ZPublisher/Publish.py, line 222, in publish_module
  File /home/bobby/Zope-2.3/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /home/bobby/Zope-2.3/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook
    (Object: Traversable)
  File /home/bobby/Zope-2.3/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /home/bobby/Zope-2.3/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: catalogProducts)
  File /home/bobby/Zope-2.3/lib/python/ZPublisher/Publish.py, line 112, in call_object
    (Object: catalogProducts)
  File /home/bobby/Zope-2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__
    (Object: catalogProducts)
  File /home/bobby/Zope-2.3/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec
    (Object: catalogProducts)
  File /home/bobby/Zope-2.3/lib/python/Products/PythonScripts/PythonScript.py, line 330, in _exec
    (Object: catalogProducts)
    (Info: ({'script': <PythonScript instance at 88d81b0>, 'context': <ZCatalog instance at 8d02630>, 'container': <ZCatalog instance at 8d02630>, 'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 2, in catalogProducts
  File /home/bobby/Zope-2.3/lib/python/Products/PythonScripts/Guarded.py, line 273, in __getattr__
  File /home/bobby/Zope-2.3/lib/python/Products/PythonScripts/Guarded.py, line 143, in __careful_getattr__
    (Object: Traversable)
AttributeError: (see above)
===================