[Zope3-Users] 4 questions from a newcomer

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Sep 6 06:54:18 EDT 2006


On Tuesday 05 September 2006 11:10, Christophe Combelles wrote:
> Hello,
>
> I'm currently spending all my time to learn zope3, and while searching some
> doc, I have gathered some useful links in the following wiki page :
> http://ccomb.free.fr/wiki/wakka.php?wiki=Zope3
> (curr in french, but I will rewrite the text in english soon)
> Please feel free to add other useful links if you have some.
>
>
> Now I have 4 questions :
> (I've just swithed from 3.2.1 to 3.3.0b2, with python 2.4.4c0 on debian
> Sid.)
>
> 1) TALES root variable
> ----------------------
> In a tales expression, where has the "root" context variable gone? In
> zope2, we could use "path:root/path/to/object" or "path:/path/to/object",
> but it doesn't work with Zope 3. How can we access some object with an
> absolute path?

Right, there is not root namespace by default. I actually have never needed 
this feature. However, you can write your own TALES namespace adapter, so 
that you can say: mynamespace:root. We sometimes write our own namespace 
adapters to this sort of thing.

> 2) utf-8 error in i18nfile
> --------------------------
> Why do I always get an error when I try to add some utf-8 text into an
> i18nfile? I just add an i18nfile in the ZMI, then I chose a name and I set
> the contentType to "text/plain;charset=utf-8". If I enter some text with
> accents like "éàôî", I get a system error which says : UnicodeDecodeError:
> 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in
> range(128).
> I don't get any error with a simple File object.

Okay, I18n file is a demo that is probably not well-developed. Don't use it. I 
will propose to not distribute it anymore. Noone is using it, so you are on 
your own finding the problem and providing a patch.

> 3) "order" attribute in browser:menuItem directive:
> ---------------------------------------------------
> I want to add a new view tab in the ZMI to be able to edit object
> attributes of some objects. So I'm adding a new menuItem in the zmi_views
> menu via ZCML with: <browser:menuItem
>      action="properties.html"
>      for=".mymodule.IMyClass"
>      title="properties"
>      menu="zmi_views"
>      permission="zope.ManageContent"
>      order="2" />
> (MyClass is just a derived Folder with custom attributes)
> The problem is: the new tab always appear in the first place. I would like
> to put it just after the "content" tab, not before. The "order" directive
> does not work for that. How can I reorder the tabs so that my new tab
> appears in the 2nd position?

The default implementation of menus sorts by interface first, and this item is 
most specific. See zope.app.publisher.browser.menu. If you do not like this 
behavior, you have to implement your own menu code.

In my customer development I am not using the menu code at all anymore. We use 
viewlets to do everything, including menus.

> 4) workflow:
> ------------
> Where is zope.app.workflow?

It has never been released with Zope 3, just as an add-on package. People are 
now encouraged to use zope.wfmc and zope.app.wfmc. There is also a z3lab 
extension specifically for document workflows.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list