Re: [Zope-dev] A Modest Proposal Concerning Monkey Patches
Hmm... that is not good. I can't see you getting an API to change a DTML file. The only option would be to create the ObjectManager's contents page from python, and people seem not to like doing that, but it would allow a little more engineering to take place. Hmmm... It looks as though what is needed is fish-bowl proposal to redesign the way ObjectManager handles and displays rows for specific object types - the requirement being that this be third-party-pluggable (For want of a better term). (No that was not me volunteering - too much on at the moment, sorry). One question about zshell though, what is the box that is added "left of the add product pulldown"? Is it something that ABSOLUTELY has to be on the contents listing (i.e. something to do with creating or maintaining the objects listed?). Could it be backdoor'd into all_meta_types so that it, itself is listed in the pulldown, or could it have a ZMI tab of it's own (Both of these are easier than live patching the DTML)? Adrian... -- Adrian Hungate EMail: adrian@haqa.co.uk Web: http://www.haqa.co.uk ----- Original Message ----- From: "Jim Penny" <jpenny@universal-fasteners.com> To: "Adrian Hungate" <adrian@haqa.co.uk> Sent: Wednesday, August 14, 2002 4:26 PM Subject: Re: [Zope-dev] A Modest Proposal Concerning Monkey Patches
On Wed, Aug 14, 2002 at 03:48:51PM +0100, Adrian Hungate wrote:
Hmm... ok, now I see what you are talking about, however, you are talking about modifying a DTMLFile object - I am not sure of any reliable API (Or even magic) that will allow that to happen in a "play nice with others" way.
Just for clarity's sake (For me if no-one else), what object type are you wanting to change manage_main for?
I have to admit to not knowing zshell or external_editor well, but I have seen mentions of ee making changes to the ZMI - I had assumed this was the addition of tabs (And DTMLFiles), not the replacement of them. I take it I was wrong in this assumption?
yeah, externaleditor inserts icons into many rows of the name column. zshell want an extra text box to the left of the "add product" pulldown. There are other products that do similar things. I think the Photo product modifies things in a similar manner to externaleditor. These are, I suspect, not even at the object stage. You have to modify rows in a table.
Jim
On Wed, Aug 14, 2002 at 05:08:21PM +0100, Adrian Hungate wrote:
One question about zshell though, what is the box that is added "left of the add product pulldown"? Is it something that ABSOLUTELY has to be on the contents listing (i.e. something to do with creating or maintaining the objects listed?). Could it be backdoor'd into all_meta_types so that it, itself is listed in the pulldown, or could it have a ZMI tab of it's own (Both of these are easier than live patching the DTML)?
About ZShell : IF and ONLY if you want to use ZShell from the right frame of the ZMI (manage_main) you currently have to modify manage_main to put a text input field somewhere on it. Then running ZShell from there applies ZShell commands to the current folderish object. (Of course you can in any case use ZShell by pointing your web browser to it) Of course ZShell could use a special tab, or another clever solution, but IMHO this is really NOT the problem here. The problem is not about ZShell, ExternalEditor, or any other Zope product, but if I understand correctly it is about extending, not replacing, the Zope's main management interface. Jim please correct me if I'm wrong. That's why I proposed to add three loops in manage_main, to loop over three different types of plugins. Each Zope product which wants to extend the ZMI should register itself once as a ZMI plugin of three sorts : - top ZMI plugin : displayed once at the top (ex : ZShell) - line ZMI plugin : displayed once for each object (ex : External Editor) - bottom ZMI plugin : displayed once at the bottom (ex : xxx) registering a ZMI plugin would be as simple as : root.registerZMIPlugin("top|line|bottom", self) or : root.registerTopZMIPlugin(self) root.registerLineZMIPlugin(self) root.registerBottomZMIPlugin(self) self represents the object which wants to register as a ZMI plugin. It would have to provide at least one of the three methods : TopZMIPlugin(self, obj) LineZMIPlugin(self, obj) BottomZMIPlugin(self, obj) these three methods would have to render some html snippet, e.g. a form with a text input field for ZShell, or a nice icon with a link for External Editor. obj would be the object on which the method applies, e.g. current folder, or current object in the object listing. This way manage_main could be rendered more powerful by just adding three <dtml-in> in it, and its aspect wouldn't even change in case no ZMI plugin would be registered (which is the case with a base Zope installation). any comment ? thx for reading Jerome Alet
On Wed, Aug 14, 2002 at 09:33:02PM +0200, Jerome Alet wrote:
registering a ZMI plugin would be as simple as :
root.registerZMIPlugin("top|line|bottom", self)
or :
root.registerTopZMIPlugin(self) root.registerLineZMIPlugin(self) root.registerBottomZMIPlugin(self)
self represents the object which wants to register as a ZMI plugin.
I forgot to add that "root" in this case means any unique Zope object which we are certain is always present (e.g. the root object or the ControlPanel), which would register all plugins as its own properties and could list all plugins (that's why the ControlPanel is a good idea, but I don't know if it would support this functionnality easily). hoping this gets clearer now Jerome Alet
participants (2)
-
Adrian Hungate -
Jerome Alet