[Zope] Product/ZClass/??? Problem
Dieter Maurer
dieter@handshake.de
Tue, 13 May 2003 19:28:06 +0200
Simon wrote at 2003-5-12 22:07 -0400:
> ... ZClass with "index_html" ...
> ...
> I can create an instance of ToolBar and add some buttons to it and
> everything looks fine, when I try to view it I see what I expect, however
> when I try to reference the toolbar from another element ie: if I have a
> ToolBar tools and I write <dtml-var tools> I get <ToolBar at tools> in the
> output.
Contrary to wide spread expectations "<dtml-var XXX>" does not call
"XXX"s "index_html" (this is done only by ZPublisher during URL traversal).
Instead, it calls "XXX", if it is callable.
Try:
<dtml-with expr="tools">
<dtml-var index_html>
</dtml-with>
instead.
Read more about it in
<http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
> Furthermore, I would like to be able to create products that have their
> own toolbars, say:
>
> AggregateWidget
> AggregateWidget (ZClass)
> index_html (to disply it's self)
> AgWToolBar (Instance of ToolBar with a defined set of ToolBar_Buttons)
>
> and then in the index_html, if I try to access AgWToolBar with something
> like <dtml-var AgWToolBar>, when I create an instance of AggreateWidget
> and then view it, I get and error:
> Error Type: Unauthorized
> Error Value: You are not allowed to access AgWToolBar in this context
The default permissions of ZClasses are extremely restricted.
You must map permissions in the corresponding tab as appropriate.
Dieter