Wolfgang Strobl writes:
"Finding"a bunch of DTML Documents into a Zcatalog is easy. But how to do that programmatically? I haven't even found a way of doing that for a single DMTL Document. You call the catalog with your search terms as keyword paramters:
<dtml-in "catalog(principia_search_source='cool and new')"> .... </dtml-in> Have a look at the two ZCatalog tutorials on zope.org. Dieter
On 6 Nov 2000, at 21:46, Dieter Maurer wrote:
Wolfgang Strobl writes:
"Finding"a bunch of DTML Documents into a Zcatalog is easy. But how to do that programmatically? I haven't even found a way of doing that for a single DMTL Document. You call the catalog with your search terms as keyword paramters:
<dtml-in "catalog(principia_search_source='cool and new')"> .... </dtml-in>
Have a look at the two ZCatalog tutorials on zope.org.
Who said anything about searching? :-) A ZCatalogs management interface contains a function "Find Items to ZCatalog". This function performs a recursive search and adds all objects matching the specified criteria to the Catalog. This works quite well with DMTL Documents, as long as one does it via the management interface. I asked about how to perform this function (to spell it out again: _adding_ a _DTML Document_) programmatically, i.e. via DTML, of from Python code. There is a How-To "Adding ZClass Instances Programmatically", and a lot of gobbledigoop about when, how and why. But I haven't found anything about how to "index" or "reindex" a plain and simple DTML Document. -- Wolfgang Strobl
Wolfgang Strobl wrote:
There is a How-To "Adding ZClass Instances Programmatically", and a lot of gobbledigoop about when, how and why. But I haven't found anything about how to "index" or "reindex" a plain and simple DTML Document.
In Python: your_catalog.catalog_object(your_dtml_document,your_dtml_document.absolute_url()) This sort of thing shouldn't be done in DTML! :P cheers, Chris
On 7 Nov 2000, 10:37 Chris Withers wrote:
Wolfgang Strobl wrote:
There is a How-To "Adding ZClass Instances Programmatically", and a lot of gobbledigoop about when, how and why. But I haven't found anything about how to "index" or "reindex" a plain and simple DTML Document.
In Python:
your_catalog.catalog_object(your_dtml_document,your_dtml_document.abso lute_url())
Thanks, that's just what I was looking for.
This sort of thing shouldn't be done in DTML! :P
Of course not! I prefer Python to DTML (and dislike ZClasses for that reason) for more than the most simple programming tasks, anyway. But it comes handy for trying something out. Btw, shouldn't that be In DTML: <dtml-var "myCatalog.catalog_object(myItem, '/'+myItem.absolute_url(relative=1))"> ? -- o ( Wolfgang.Strobl@gmd.de (+49 2241) 14-2394 /\ * GMD mbH #include _`\ `_<=== Schloss Birlinghoven, <std.disclaimer> __(_)/_(_)___.-._ 53754 Sankt Augustin, Germany ________________
participants (4)
-
Chris Withers -
Dieter Maurer -
Wolfgang Strobl -
Wolfgang Strobl