[Zope-dev] multiple monkeypatches

Jerome Alet alet@librelogiciel.com
Thu, 6 Jun 2002 16:10:19 +0200


On Thu, Jun 06, 2002 at 09:24:58AM -0400, Casey Duncan wrote:
> 
> I am going to experiment with ExternalEditor to see if I can dynamically
> patch manage_main reliably rather than replacing it outright. If I work
> out a reliable scheme, I'll write a how-to on it. Then maybe other
> products can then use the same technique.
 
Couldn't there be a plugin mechanism for the management interface ?

I can see three sort of plugins :

   Top plugin :
   
       * will be displayed once at the top of the ZMI (below tabs)
         e.g. ZShell
         
   Line plugin :
      
       * will be displayed once for each object (on each line)
         e.g. ExternalEditor
       
   Bottom plugin :
   
       * will be displayed once on the buttons line
         e.g. Your_product_of_choice
   
Then every product would just have to register itself as a 
ZMITopPlugin, ZMILinePlugin, or ZMIBottomPlugin, or both. 

then the ZMI (main.dtml in fact) would just have to loop for each 
list of registered plugins whenever its needed : once at the top, 
once for each line listing objects, and once for the bottom. 

and if ZMILinePlugins could set a filter to be called only for some
metatypes this would be really cool !

Any comment ?

BTW Casey and others, if you need some help then I'd be pleased to 
do whatever I can, with a small amount of free time though...

> The problem is somewhat easier to solve for methods since you can detect
> whether they have already been replaced (with func_globals) and you can
> do the old "run my code and call the old one" trick. 

agreed, unfortunately...

bye,

Jerome Alet