[Zope3-Users] Permissions for updateOrder() on OrderedContainer

2006-08-08 Thread Arne Nordmann

Hi folks,

first of all: I'm working with Zope 3.3 and Python 2.4.

I created a hierarchical structure of OrderedContainers - some kind of a 
tree - and now want to sort it with Python. To move the containers from 
level to level in this tree with the ObjectMover is no problem, but 
updating the order of the contained elements inside the containers fails 
with a ForbiddenAttribute error.


For example:
A, B, C are containers with the names 'A', 'B' and 'C'.
B and C are contained by A.

 A.updateOrder(['C', 'B'])
Traceback (most recent call last):
...
ForbiddenAttribute: ('updateOrder', mypackage.cont.Cont object at 
0x022244B0

-
(object at 0x022244B0 is OrderedContainer 'A')

configure.zcml defines each used interface with permission 
'ManageContent' and I'm logged in as 'Manager'. Accessing the method 
keys(), values(), etc. of the OrderedContainers is no problem. So what's 
the problem?


Every hint or comment one that would be great, because I'm trying and 
searching for hours yet.


Thanks,

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


Re: [Zope3-Users] zope3's TAL ZPT reference

2006-08-08 Thread Michele Amori
I wrote this statements in a zpt page (with zope 3.2):

tal:content=here/title
tal:content=container/title
tal:content=template/title
tal:content=context/title

but no one of that seems to work. Zope returns an error. So Zope2.7's 
documentation is not useful for z3 developers.

Amoz

Alle 17:17, lunedì 07 agosto 2006, Gary Poster ha scritto:
 On Aug 7, 2006, at 11:10 AM, Florian Lindner wrote:
  Am Montag, 7. August 2006 14:57 schrieb Michele Amori:
  Hello all,
  actually I'm a zope newbie. I must develop web applications with
  zope 3.2,
  in the next future, so I'd like some help from this ML.
  I'm searching for a ZPT (or TAL) reference for Zope 3...where is it?
 
  Take a look here:
 
  http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/
  AppendixC.stx

 That's maybe a good intro, but will include some information that is
 out of date for Zope 3 (context vs. here comes to mind).

 The specs are still valuable, for information in the abstract.

 http://www.zope.org/Wikis/DevSite/Projects/ZPT/TAL
 http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES
 http://www.zope.org/Wikis/DevSite/Projects/ZPT/METAL

 Also, the two Zope 3 books (by Philipp von Weitershausen and Stephan
 Richter, respectively) are still reasonably up-to-date in regards to
 ZPT in Zope 3.

 Gary

-- 
Michele Amori - Analista Programmatore
[EMAIL PROTECTED]
Sestante S.r.l.
via della giustizia, 9
61032 - Fano (PU)
http://www.sestante.net
tel. 0721-830888
cell. 328-0714776
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Upgrading from 3.2.0 to 3.2.1

2006-08-08 Thread Kim L. Jacobsen



Hi,

I've been playing 
around with Zope 3.2.0, installed psycopgDA, configured DB-connections, 
installed other products and made some modifications in ZMI (can't quite 
remember all of them). Now I want to upgrade to 3.2.1. Do I have do start from 
scratch again, or is there a method for upgrading Zope 3.

Thanks 
in advance
Kim

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


Re: [Zope3-Users] Permissions for updateOrder() on OrderedContainer

2006-08-08 Thread Tom Dossis
Arne Nordmann wrote:
 
 A.updateOrder(['C', 'B'])
 Traceback (most recent call last):
 ...
 ForbiddenAttribute: ('updateOrder', mypackage.cont.Cont object at
 0x022244B0
 -
 (object at 0x022244B0 is OrderedContainer 'A')
 
 configure.zcml defines each used interface with permission
 'ManageContent' and I'm logged in as 'Manager'. Accessing the method
 keys(), values(), etc. of the OrderedContainers is no problem. So what's
 the problem?

Hi, just confirming that you've included a directive for
IOrderedContainer, e.g.

class class=mypackage.cont.Cont
  ...
  require
 permission=zope.ManageContent
 interface=zope.app.container.interfaces.IOrderedContainer
 /
   ...


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


[Zope3-Users] Re: zope3's TAL ZPT reference

2006-08-08 Thread Philipp von Weitershausen
Michele Amori wrote:
 I wrote this statements in a zpt page (with zope 3.2):
 
 tal:content=here/title
 tal:content=container/title
 tal:content=template/title
 tal:content=context/title
 
 but no one of that seems to work. Zope returns an error. So Zope2.7's 
 documentation is not useful for z3 developers.

You're confusing a TAL reference with a Zope 2 API reference. The above
examples obviously require the Zope 2 API (which wants all objects to
have a 'title' attribute) which doesn't apply to Zope 3. It still
demonstrates TAL.

My book documents Page Templates (TAL/TALES/METAL): http://worldcookery.com

Philipp

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


[Zope3-Users] Re: zope3's TAL ZPT reference

2006-08-08 Thread Philipp von Weitershausen
Warren Turkal wrote:
 On Tuesday 08 August 2006 05:01, Michele Amori wrote:
 but no one of that seems to work. Zope returns an error. So Zope2.7's
 documentation is not useful for z3 developers.
 
 The shear lack of recent and easily available documentation definitely makes 
 zope3 hard to approach for someone who's wanting to check it out. Maybe some 
 more recent links on the zope3 webpage would be good?

We all know zope.org definitely needs improvement. You're most welcome
to help here if you have suggestions.

In the mean time, I suggest you check out
http://worldcookery.com/Appetizers. Or just buy my book, that's the
easiest available documentation on Zope 3 that you can get - 480 pages
of Zope docs on your lap :)

Philipp

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


[Zope3-Users] Re: Upgrading from 3.2.0 to 3.2.1

2006-08-08 Thread Philipp von Weitershausen
Kim L. Jacobsen wrote:
 I've been playing around with Zope 3.2.0, installed psycopgDA,
 configured DB-connections, installed other products and made some
 modifications in ZMI (can't quite remember all of them). Now I want to
 upgrade to 3.2.1. Do I have do start from scratch again, or is there a
 method for upgrading Zope 3.

You can have more than one Zope 3 installed, e.g. you can install Zope
3.2.1 in parallel to 3.2.0 and switch your instance over to 3.2.1 (by
editing the start scripts in $INSTANCE/bin). You can also install Zope
3.2.1 into the place where 3.2.0 was installed; your instance should
continue to work. Such a thing isn't recommended when upgrading between
major versions, though (3.2 to 3.3).

Philipp

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


[Zope3-Users] Re: Interface or adapter for AddMenuItems

2006-08-08 Thread Philipp von Weitershausen
John Smith wrote:
 Hi,
 
 I have a content container object and I was wondering
 what is the easiest/best way to access the list of
 allowed content types which may be added to this
 container.
 
 Is there an interface to which I can adapt my object,
 or a menu service/utility?
 
 I looked in the page template code template.pt, but it
 looks as if the items in the add menu come in as some
 kind of html text string.
 
 Any help gratefully received,

Get the container's adding view:

   adding = z.c.getMultiAdapter((obj, request), name='+')

and then iterate over the adding info:

   for info in adding.addingInfo():
  ... # do fun stuff with info here

HTH

Philipp

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


[Zope3-Users] Re: Permissions for updateOrder() on OrderedContainer

2006-08-08 Thread Philipp von Weitershausen
Arne Nordmann wrote:
 Hi folks,
 
 first of all: I'm working with Zope 3.3 and Python 2.4.
 
 I created a hierarchical structure of OrderedContainers - some kind of a
 tree - and now want to sort it with Python. To move the containers from
 level to level in this tree with the ObjectMover is no problem, but
 updating the order of the contained elements inside the containers fails
 with a ForbiddenAttribute error.
 
 For example:
 A, B, C are containers with the names 'A', 'B' and 'C'.
 B and C are contained by A.
 
 A.updateOrder(['C', 'B'])
 Traceback (most recent call last):
 ...
 ForbiddenAttribute: ('updateOrder', mypackage.cont.Cont object at
 0x022244B0
 -
 (object at 0x022244B0 is OrderedContainer 'A')
 
 configure.zcml defines each used interface with permission
 'ManageContent' and I'm logged in as 'Manager'. Accessing the method
 keys(), values(), etc. of the OrderedContainers is no problem. So what's
 the problem?

ForbiddenAttribute are always (ALWAYS!!!) a lack of missing security
declarations or code accessing stuff it shouldn't. Since accessing
updateOrder seems reasonable to do, you're most definitely lacking a
security declaration for it.

Zope will not allow anything if you don't declare it.

Philipp

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


[Zope3-Users] Re: default defaultView

2006-08-08 Thread Philipp von Weitershausen
Florian Lindner wrote:
 Hello,
 is there a kind of default defaultView?
 So when a object is called and no defaultView is defined that a view like 
 index.html is called? I thought yes, but a test has not proven that.
 
 If there is really no such default, why? I think a little bit more (optional) 
 convention over configuration would be good for Zope...

zope.app/browser.zcml says:

  browser:defaultView name=index.html /

So, as you can see, we indeed have a default default view. It's index.html.

Philipp

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