[Zope-Coders] Minor corrections to the ZCatalog API

Chris McDonough chrism@zope.com
Tue, 2 Oct 2001 09:24:48 -0400


Eek!

Andreas and I just took a look at this... and I agree with your analysis.
Could you fix it?  ;-)  Specifically in the case of manage_delIndexes,
however, it'd be nice to not need to create this method again.  Instead, we
shoud fix the regression test suite and ZCatalog catalogIndex.dtml (which is
no longer actually used with PluginIndexes) to use manage_delIndex, and all
existing manage_somethingIndexes (plural) methods should die if they exist.

We should really go in and switch this module to declarative security at
some point.  :-(

- C

----- Original Message -----
From: "Steve Alexander" <steve@cat-box.net>
To: "Chris McDonough" <chrism@zope.com>
Cc: <zope-coders@zope.org>
Sent: Monday, October 01, 2001 6:18 PM
Subject: Re: [Zope-Coders] Minor corrections to the ZCatalog API


> Chris McDonough wrote:
>
>  > Steve,
>  >
>  > Thanks!
>  >
>  > I don't understand, however, how this doesn't have any documentation
>  >  impact if the API is changing.  I also don't understand how it
>  > maintains backwards-compatibility.
>
>
> Good points.
>
> The corrections are to the API for plug-in indexes. The API was
> incorrectly and inconsistently named to start with.
>
> It also seems to be undocumented. Please point me at any documentation
> you can find for these methods of ZCatalog.py:
>
>    manage_delIndexes
>    manage_deleteIndex
>    manage_clearIndexes
>
> Specifically, in ZCatalog.py:
>
>    * There is a security declaration for manage_delIndexes, but there
>      is no method by that name.
>
>    * There is a method called manage_deleteIndex, which has no security
>      declaration.
>
>    * manage_delIndexes is called in regressionCatalogTiming.py
>
>    * manage_delIndexes is called from catalogIndexes.dtml and
>      manageIndex.dtml
>
>    * The method manage_deleteIndex takes a sequence of index ids as
>      an argument. The cardinality of its name is incorrect.
>
> Therefore, I reckon the method is misnamed. A typo.
>
>
>    * manage_clearIndex has no security declaration.
>
>    * manage_clearIndex has the same pattern of signature as
>      manage_delIndexes (aka manage_deleteIndex). That is, it
>      takes a sequence of ids, not a single id.
>
>    * manage_clearIndex is only used in manageIndex.dtml.
>
> Therefore, I reckon it will be more consistent, and very little pain, to
> rename the method manage_clearIndex to manage_clearIndexes.
>
> The same arguments that apply to manage_clearIndex also apply to
> manage_reindexIndex. It has no security declaration, is referenced in
> only one place, and must take a sequence of index ids.
>
>
> In summary, there is virtually no backwards compatibility to be
> maintained, especially with manage_deleteIndex, which doesn't work from
> the ZMI anyway.
>
> --
> Steve Alexander
>
>