Re: [Zope3-Users] 4 questions from a newcomer

2006-09-06 Thread Stephan Richter
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
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] 4 questions from a newcomer

2006-09-06 Thread Thierry Florac




Le mercredi 06 septembre 2006  06:54 -0400, Stephan Richter a crit:


On Tuesday 05 September 2006 11:10, Christophe Combelles wrote:
 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.



I had the same problem in my french site where we use many accentuated characters.
The solution I use until now is just to switch my Python interpreter to use UTF-8 as default encoding, via the site.py file of my Python distribution...




 Thierry





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] 4 questions from a newcomer

2006-09-06 Thread Martijn Faassen

Thierry Florac wrote:
[snip]

I had the same problem in my french site where we use many accentuated
characters.
The solution I use until now is just to switch my Python interpreter to
use UTF-8 as default encoding, via the site.py file of my Python
distribution...


If it works for you, so be it, but this is just to warn people that this 
is a really bad way to make encoding problems go away. Here's my longer 
rant about this:


Changing the Python default encoding considered harmful

http://faassen.n--tree.net/blog/view/weblog/2005/08/02/0

Regards,

Martijn

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] 4 questions from a newcomer

2006-09-06 Thread Martijn Faassen

Stephan Richter wrote:
[snip]

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.


If you are interested in just fairly simple but understandable workflow, 
you might want to look at hurry.workflow. It's in SVN here:


http://codespeak.net/svn/z3/hurry.workflow/trunk/

There's documentation in there:

http://codespeak.net/svn/z3/hurry.workflow/trunk/src/hurry/workflow/workflow.txt

Regards,

Martijn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] 4 questions from a newcomer

2006-09-05 Thread Christophe Combelles

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?



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.


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?


4) workflow:

Where is zope.app.workflow?



thanks,
Christophe Combelles


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users