Amos Latteier wrote:
At 08:57 PM 9/30/99 +0200, Martijn Faassen wrote:
Okay, going out on a limb here, try installing the XMLWidgets.tgz file (the python stuff). Then restart your Zope. Then go to the products management screen, and *delete* any XMLWidgets product that may show up. *then* import the XMLWidgets.zexp. And finally install the demo somewhere in the folder tree. Then tell me if it worked. :)
Ahh. That worked. OK, now I have some examples, but it's still very unclear how to harness the potential power of this stuff. All instances seem to only have one management tab ('manage_access') which doesn't shed too much light on how to use them.
The ZClasses are pretty boring right now and don't offer any management access; it was just an easy way to develop products without all the hassle that I had in 1.10. I'll get around to adding tabs later, when I figure out what to put in them!
Hmm. Digging a little, it looks like you call widgets with XML Documents. I'm I getting closer?
Did you read my release info? Basically you can let the manager onto any XML Node (of an XML Document), and if the manager recognizes the type and name of the XML Node, it'll find the widget to render it (which will recursively look for the sub widgets as well).
So a widget is a template for a XML Document?
Each widget can render an XML Node in a document (and any subnodes by recursive calling of the manager). So if you call the manager on the top widget of a document, the entire document will be rendered (if the manager is configured for that document structure). The powerful thing of is this that the widget manager can be dynamically reconfigured after one rendering. So you can have different displays of the same document (for instance you could select some elements and have those be rendered in a different way). Another powerful thing is that you can define events on widgets, which can be called through hyperlinks on the rendered document. These events can dynamically alter the way the widget manager renders things, and they can also change the structure of the XML Document. The goal of this is to make a structured document editor.
BTW, if you want to have WidgetManager's work like DTML Methods, and be called as methods of parent objects try this, from DTMLMethod.
class func_code: pass func_code=func_code() func_code.co_varnames='self','REQUEST','RESPONSE' func_code.co_argcount=3
I think that this will fool ZPublisher into considering your object a method of its parent.
I thought I already did something like this so I'm not sure what extra this will accomplish. You can already call the manager on top of any XML Node.
There ought to be some way to distribute ZClasses with Python base classes easily, though...
Right. In the mean time it is a good idea not to create your ZClasses inside an installed Product.
Would there still be any way to make zclasses inherit from the python base classes that the product defines this way, though? I'm not sure if they show up only in the one product or everywhere. I guess I should take a look. :) Regards, Martijn