[Zope] DTML syntax

Michel Pelletier michel@digicool.com
Thu, 26 Aug 1999 01:05:22 -0400


Tim Wilson wrote:
> 
> On Wed, 25 Aug 1999, Kevin Dangoor wrote:
> 
> > If it works better for you, you can store the PDFs in the same area as other
> > related content. If you want to make a central PDF download page, you could
> > then set up ZCatalog to index the property "content_type", and do a Find to
> > catalog the objects. Then, your download page just needs to search the
> > catalog for content_type: application/pdf (or whatever the type is).
> >
> > It could be as simple as:
> >
> > <dtml-in "Catalog({'metatype': 'File', 'content_type': 'application/pdf'})">
> > <a href="/<dtml-var "getpath(data_record_id_)">/index.html"><dtml-var
> > title></a>
> > </dtml-in>
> 
> OK, this is cool. I just read the ZCatalog tutorial. Are you suggesting a
> simple search interface at the central download page or simply using
> ZCatalog to find the relevant, but scattered, PDF files and then create
> some sort of list of them that a user can click on?
> 

Standard file objects are not catalogable by default, so you must first
wrap them in an object that is.  By creating a ZClass that first
subclasses CatalogAwareness, and then File, you can create ZClass that
stores your PDF files and also catalog's itself in the catalog.  These
features will also improve with time, they are new in 2.0.  Perhaps even
in the future all Zope objects will be more catalog intelligent.  As a
brute force measure to catalog non catalogable objects, you can tell the
catalog to 'sweep' your your whole Zope system to catalog objects that
match certain criteria.

The use of this protocol means that an intelligent intra-catalog
protocol could be developed when catalogs try to catalog other
catalogs.  In addition, the objects that the catalog returns from a
query can be made catalog aware themselves.

*That* whole idea overwhelms me instantly.

You're application can be much simpler.  Just design a ZClass that
represents the object, whether it be a PDF file with meta data or
whatever, as what you want it to be.  A how-to on this will be
forthcoming.  In the meantime, I believe the KM news author is working
with ZClasses, perhaps she/he can relate the experience?

-Michel

> -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 )