Mailing List Archive

Minor corrections to the ZCatalog API
Hi folks,

I'd like to correct a few bugs in the ZCatalog API.

See my posting to Zope-dev:

http://lists.zope.org/pipermail/zope-dev/2001-September/013409.html


This is not adding features to the API. It is just a bit of renaming to
give methods to do with performing actions on a number of indexes more
appropriate names, and to correct some typos with the permissions and tests.

There are only two files affected, and no documentation is affected that
I've found.

There's a patch attached to the Zope-Dev email.

I'd like this to get into the next 2.4 release if possible.

I guess the next thing for me to do is check it in on a branch, and test
it thoroughly.


Andreas / Chris McD, I'm looking for a yay or nay from one of you guys :-)

--
Steve Alexander
Software Engineer
Cat-Box limited
Re: Minor corrections to the ZCatalog API [ In reply to ]
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.

- C


----- Original Message -----
From: "Steve Alexander" <steve@cat-box.net>
To: <zope-coders@zope.org>
Sent: Monday, October 01, 2001 5:30 PM
Subject: [Zope-Coders] Minor corrections to the ZCatalog API


> Hi folks,
>
> I'd like to correct a few bugs in the ZCatalog API.
>
> See my posting to Zope-dev:
>
> http://lists.zope.org/pipermail/zope-dev/2001-September/013409.html
>
>
> This is not adding features to the API. It is just a bit of renaming to
> give methods to do with performing actions on a number of indexes more
> appropriate names, and to correct some typos with the permissions and
tests.
>
> There are only two files affected, and no documentation is affected that
> I've found.
>
> There's a patch attached to the Zope-Dev email.
>
> I'd like this to get into the next 2.4 release if possible.
>
> I guess the next thing for me to do is check it in on a branch, and test
> it thoroughly.
>
>
> Andreas / Chris McD, I'm looking for a yay or nay from one of you guys :-)
>
> --
> Steve Alexander
> Software Engineer
> Cat-Box limited
>
>
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders@zope.org
> http://lists.zope.org/mailman/listinfo/zope-coders
>
Re: Minor corrections to the ZCatalog API [ In reply to ]
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
Re: Minor corrections to the ZCatalog API [ In reply to ]
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
>
>
Re: Minor corrections to the ZCatalog API [ In reply to ]
Chris McDonough wrote:

> Eek!
>
> Andreas and I just took a look at this... and I agree with your analysis.
> Could you fix it? ;-)


Sure. I'll check something in on a branch, and ping for approval :-)

--
Steve Alexander
Software Engineer
Cat-Box limited