Here I am talking to myself again :-) I have two more questions to go along with the below. I have made a ZCatalog up near the top of my tree named EventsCatalog. I have a method named getEventsByDate that now usses this. This method works fine if invoked directly, but if not, it claims it can't find EventsCatalog -- even if both the method and the caller are clearly below EventsCatalog in the tree, thus acquisition should step in. Here's the code: <dtml-with "_(myEventList=[])"> <dtml-in "EventsCatalog.searchResults({'when' : [startDate, endDate], 'when_usage' : 'range:min:max'})"> <dtml-call "myEventList.append(EventsCatalog.resolve_url('/' + EventsCatalog.getpath(data_record_id_), REQUEST=REQUEST))"></dtml-comment> </dtml-in> <dtml-return myEventList> </dtml-with> Now, it is aborting at searchResults. Secondly, the search string *may* be working, but I don't understand the syntax. What do the colons and the curly braces signify? Why is "_usage" significant? What exactly does 'range:min:max' indicate? Thanks! John Goerzen <jgoerzen@complete.org> writes:
Hi!
OK, it looks like I've been doing things a stupid way by not using ZCatalog. I managed to find a ZCatalog.txt buried deep within the source, but I'm a bit stuck now.
First. I created a ZClass in my own Application with my Events class. Do I need to delete it and recreate it so that it lists ClassAware as one of its meta types?
When a class is ClassAware, how does it know into which catalog new items should go? I haven't been able to make the thing update catalogs automatically.
What is the purpose of using the Contents tab of a ZCatalog to actually add items inside it? What are the pros/cons of doing this? Why are these objects not automatically cataloged?
Where can I find a reference on the syntax of searching a catalog?
Thanks,
John
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
-- John Goerzen Linux, Unix consulting & programming jgoerzen@complete.org | Developer, Debian GNU/Linux (Free powerful OS upgrade) www.debian.org | ----------------------------------------------------------------------------+ The 46,834th digit of pi is 1.
On 9 Sep 1999, John Goerzen wrote:
I have made a ZCatalog up near the top of my tree named EventsCatalog. I have a method named getEventsByDate that now usses this. This method works fine if invoked directly, but if not, it claims it can't find EventsCatalog -- even if both the method and the caller are clearly below EventsCatalog in the tree, thus acquisition should step in.
A similar problem just emerged for me. I have a Catalog instance in the top-level Zope directory and the accompanying 'search' and 'report' methods. I've creatd a customized search interface in a subdirectory, but all my searches return the message that the search found nothing. If I try the search method in the top-level directory, then everything works fine. I swear this worked before, but I can't see what I changed to break it. -Tim -- Timothy Wilson | "The faster you | Check out: Henry Sibley H.S. | go, the shorter | http://slashdot.org/ W. St. Paul, MN, USA | you are." | http://linux.com/ wilson@chem.umn.edu | -Einstein | http://www.mn-linux.org/
I think this could be a problem of path. In your search look at the FORM declaration (which should be something like <form action="report" method="get">) and check out the path in the action properties For instance I have a ZCatalog at top and a search/report duo in a folder called search. I propose a little search area which is always available on my sidebar (in every levels of my site) the form is the following <form action="/search/report" method="get"> <input name="mysearch" size="10" maxlength="255" value="<dtml-if mysearch><dtml-var mysearch><dtml-else>Chercher...</dtml-if>" class="sidebar"> </form> Hope this can help you :) Tim Wilson wrote:
On 9 Sep 1999, John Goerzen wrote:
I have made a ZCatalog up near the top of my tree named EventsCatalog. I have a method named getEventsByDate that now usses this. This method works fine if invoked directly, but if not, it claims it can't find EventsCatalog -- even if both the method and the caller are clearly below EventsCatalog in the tree, thus acquisition should step in.
A similar problem just emerged for me. I have a Catalog instance in the top-level Zope directory and the accompanying 'search' and 'report' methods. I've creatd a customized search interface in a subdirectory, but all my searches return the message that the search found nothing. If I try the search method in the top-level directory, then everything works fine. I swear this worked before, but I can't see what I changed to break it.
-Tim
-- Timothy Wilson | "The faster you | Check out: Henry Sibley H.S. | go, the shorter | http://slashdot.org/ W. St. Paul, MN, USA | you are." | http://linux.com/ wilson@chem.umn.edu | -Einstein | http://www.mn-linux.org/
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
-- >> WinErr: 080 Clavier introuvable - Veuillez appuyer sur n'importe quelle touche pour continuer. << Arnaud LECAT >> Email: lecat@hexanet.fr >> WWW page:www.hexanet.fr/~lecat HEXANET >> http://www.hexanet.fr Z.A. Farman sud - 9 rue Roland Coffignot BP 415 - 51689 Reims Cedex 2 - France phone: (33) 03 26 79 30 05 Fax: (33) 03 26 79 30 06
At 05:22 10/09/99 , John Goerzen wrote:
Here I am talking to myself again :-)
I have two more questions to go along with the below.
I have made a ZCatalog up near the top of my tree named EventsCatalog. I have a method named getEventsByDate that now usses this. This method works fine if invoked directly, but if not, it claims it can't find EventsCatalog -- even if both the method and the caller are clearly below EventsCatalog in the tree, thus acquisition should step in.
Here's the code:
<dtml-with "_(myEventList=[])"> <dtml-in "EventsCatalog.searchResults({'when' : [startDate, endDate], 'when_usage' : 'range:min:max'})"> <dtml-call "myEventList.append(EventsCatalog.resolve_url('/' + EventsCatalog.getpath(data_record_id_), REQUEST=REQUEST))"></dtml-comment> </dtml-in> <dtml-return myEventList> </dtml-with>
Now, it is aborting at searchResults.
Hmmm.. don't directly know about this one. If I ever run into such a problem, and solve it, I'll let you know.
Secondly, the search string *may* be working, but I don't understand the syntax. What do the colons and the curly braces signify? Why is "_usage" significant? What exactly does 'range:min:max' indicate?
See below.
Thanks!
John Goerzen <jgoerzen@complete.org> writes:
Hi!
OK, it looks like I've been doing things a stupid way by not using ZCatalog. I managed to find a ZCatalog.txt buried deep within the source, but I'm a bit stuck now.
First. I created a ZClass in my own Application with my Events class. Do I need to delete it and recreate it so that it lists ClassAware as one of its meta types?
When a class is ClassAware, how does it know into which catalog new items should go? I haven't been able to make the thing update catalogs automatically.
What is the purpose of using the Contents tab of a ZCatalog to actually add items inside it? What are the pros/cons of doing this? Why are these objects not automatically cataloged?
Where can I find a reference on the syntax of searching a catalog?
For now, all documentation is contained in ZCatalog.txt in the ZCatalog folder and in the source itself. It is based on ZTables, which in itself was never well documented. I believe Michel is in the process of UMLifying the code, so we should have some more documentation then. As for the search terms, I believe not even Michel fully understands what options there are yet... =) -- 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 ------------------------------------------
John Goerzen wrote:
Here I am talking to myself again :-)
I have two more questions to go along with the below.
I have made a ZCatalog up near the top of my tree named EventsCatalog. I have a method named getEventsByDate that now usses this. This method works fine if invoked directly, but if not, it claims it can't find EventsCatalog -- even if both the method and the caller are clearly below EventsCatalog in the tree, thus acquisition should step in.
Here's the code:
<dtml-with "_(myEventList=[])"> <dtml-in "EventsCatalog.searchResults({'when' : [startDate, endDate], 'when_usage' : 'range:min:max'})"> <dtml-call "myEventList.append(EventsCatalog.resolve_url('/' + EventsCatalog.getpath(data_record_id_), REQUEST=REQUEST))"></dtml-comment> </dtml-in> <dtml-return myEventList> </dtml-with>
Now, it is aborting at searchResults.
Do you have a traceback?
Secondly, the search string *may* be working, but I don't understand the syntax. What do the colons and the curly braces signify? Why is "_usage" significant? What exactly does 'range:min:max' indicate?
'when' is your search term. If a search term ends in '_usage' then the usage term is used to control something in particular about the index it refers to. In this case, it is telling the 'when' index that it's search term is a min/max range search. Because it needs two values (a min and a max) you must pass a 2 item list as the value for the 'when' term. You can call catalog several ways: <dtml-in Catalog> This will call the catalog, passing REQUEST in to satisfy any search terms. Or you can pass a mapping: <dtml-in "Catalog.searchResults({'term':'value, ...})"> or you can use keyword arguments: <dtml-in "Catalog.searchResults(term=value, ...)"> -Michel
participants (5)
-
Arnaud Lecat -
John Goerzen -
Martijn Pieters -
Michel Pelletier -
Tim Wilson