Newest Documents Listing
Hi, is there a 'cheap' way to retrieve the items that have been changed or added ? Do I have to use ZCatalog to acheieve this ? Thanks in advance.
Get all objects in a folder sorted according to when they were last modified: <dtml-in expr="objectValues()" sort=bobobase_modification_time reverse> <dtml-var title_or_id> </dtml-in> You can also specify meta-types , if you don't want all kinds of objects: objectValues(['File','Image']) :-) on or about, Thursday, June 21, 2001, we have reason to believe that Stefan Radke wrote something along the lines of : SR> Hi, SR> is there a 'cheap' way to retrieve the items that have been changed or SR> added ? SR> Do I have to use ZCatalog to acheieve this ? SR> Thanks in advance. -- Geir Bækholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team <!-- PGPid : 0x90B47B20 -->
Geir B?kholt <geirh@funcom.com> wrote:
Get all objects in a folder sorted according to when they were last modified:
<dtml-in expr="objectValues()" sort=bobobase_modification_time reverse> <dtml-var title_or_id> </dtml-in> ...
I have been using this, but I might have stated my request not clear enough: I want this for the complete site, all contents of the Zope DB, optionally filtered by meta-types Any ideas ? Thank you again, Stefan.
do this in a pythonscript : for i in context.ZopeFind(container, obj_metatypes=('Page Template',),search_sub = 1, obj_mtime='18.06.2001'): print """<p><a href="%s">%s</a></p>""" % (i[1],i[0]) return printed tweak as required. here is the entry for ZopeFind in the ZopeQuickREference with some more info: ------------------------- Find ZopeFind(obj, [obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec, obj_permission, obj_roles, search_sub, REQUEST, result, pre]) Zope Find Interface Examples: <dtml-var standard_html_header> This will list all object ids in the current folder<br> <dtml-in "ZopeFind(this())"> <dtml-var "_['sequence-item'][0]"> </dtml-in> </dtml-var standard_html_footer> obj is the object to start looking from (in our example, this()) and is the only required argument The next 8 arguments are find terms, for example, if an object has an id you specify with 'obj_ids', it will be returned. search_sub means recursivly descend into sub folders, default is 0. REQUEST is, as allways, the request object. result and pre are used by the recursion machinery and should not be diddled with. ZopeFind returns a list of two item tuples. The first item is the object's id, the second is it path *relative to the 'obj' argument*. ZopeFindAndApply(obj, [obj_ids, obj_metatypes, obj_searchterm, obj_expr, obj_mtime, obj_mspec, obj_permission, obj_roles, search_sub=0, REQUEST, result, pre, apply_func, apply_path]) Zope Find and apply interface, difference from ZopeFind: apply_func and apply_path parameters, used to find and catalog objects. ----------------------------------- on or about, Thursday, June 21, 2001, we have reason to believe that Stefan Radke wrote something along the lines of :
SR> Geir B?kholt <geirh@funcom.com> wrote:
Get all objects in a folder sorted according to when they were last modified:
<dtml-in expr="objectValues()" sort=bobobase_modification_time reverse> <dtml-var title_or_id> </dtml-in> ... SR> I have been using this, but I might have stated my request not clear enough: SR> I want this for the complete site, all contents of the Zope DB, optionally filtered by meta-types SR> Any ideas ? SR> Thank you again, Stefan.
-- Geir Bækholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team <!-- PGPid : 0x90B47B20 -->
Hi ! Thank you for this explanation. I tried it and got it to work. But it has some tricky points. If no login dialog shall pop up while scanning the whole database, the correct combination of obj_permission and obj_roles must be set. And if trying to add some abstract-like text from the current sequence-item to the listing, like in search-engines, one must be careful when cutting it after a number of characters. Any dangling HTML causes the following list entries to be heavily mangled. In this case, a text-only retriever would be great. Is anything like this out there ? Or is there another way to do it within Zope ? Thank you, Stefan.
Hello Stefan, Friday, June 22, 2001, 15:44:13, you wrote: SR> And if trying to add some abstract-like text from the current SR> sequence-item to the listing, like in search-engines, one must be SR> careful when cutting it after a number of characters. Any dangling HTML SR> causes the following list entries to be heavily mangled. SR> In this case, a text-only retriever would be great. Is anything like SR> this out there ? There is a python library called "strip'o gram" (sorry, but i cannot remember who wrote it) that formats HTML into raw text .. I use it for presenting search-results from zcatalog, and can verify that it does the job nicely.. Have no URL here , but try a search on zope.org.. :-) -- Geir Bækholt web-developer/zopatista geirh@funcom.com funcom oslo | webdev-team <!-- PGPid : 0x90B47B20 -->
participants (3)
-
Geir Bækholt -
Geir B�kholt -
Stefan Radke