[Zope-CMF] [dev] CatalogTool as utility

2011-09-19 Thread yuppie
Hi!


Converting the CatalogTool is not so easy because it is just a small 
subclass of ZCatalog. And ZCatalog expects REQUEST in its acquisition 
context.

AFAICS the only place where this causes trouble is the 
AbstractCatalogBrain API. But I might be missing other issues. Maybe 
some people can test CMF trunk with their code? Is there a Plone branch 
that is tested against CMF trunk?

Currently CMF trunk contains some hacks to work around the catalog brain 
issues. But I hope there is a better solution. Maybe the ICatalogBrain 
methods getURL, _unrestrictedGetObject and getObject should have a 
REQUEST argument that is used instead of self.REQUEST?

Any kind of feedback and help is welcome.


Cheers,

Yuppie
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] [dev] CatalogTool as utility

2011-09-19 Thread Martin Aspeli
On 19 September 2011 14:56, yuppie y.2...@wcm-solutions.de wrote:

 Hi!


 Hanno Schlichting wrote:
  On Mon, Sep 19, 2011 at 11:57 AM, yuppiey.2011-E2EsyBC0hj3+aS/
 vkh9...@public.gmane.org  wrote:
  Currently CMF trunk contains some hacks to work around the catalog brain
  issues. But I hope there is a better solution. Maybe the ICatalogBrain
  methods getURL, _unrestrictedGetObject and getObject should have a
  REQUEST argument that is used instead of self.REQUEST?
 
  Any kind of feedback and help is welcome.
 
  Mmh, why don't we just use zope.globalrequest in ZCatalog directly?
  And create a new ZCatalog 2.14 release series with this. Then we don't
  have to wait for Zope 4.0 to include it.

 Using an explicit argument is always cleaner than using
 zope.globalrequest. And getObject() already has a (currently unused)
 REQUEST argument. And we might be able to provide a migration path for
 the API change: If we don't use registerToolInterface, we don't have to
 change getObject/getURL calls in places where we still use getToolByName.

 But with zope.globalrequest we can avoid modifying the API. So if it is
 fine to smuggle a zope.globalrequest dependency in Zope 2.13, that might
 be the better solution. Or did you mean to use ZCatalog 2.14 only in CMF?


getURL() is an extremely common operation, and is often called in TALES
expressions.

-100 on making it take a mandatory request parameter when there are other
solutions available.

Martin
___
Zope-CMF maillist  -  Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests