Am Freitag, 1. April 2005 22:36 schrieb Stephan Richter:
> On Thursday 31 March 2005 09:23, Florian Lindner wrote:
> > How can I make one of my objects able to be contain a site. Using
> > as a marker interface (like
> > <implements interface="" />
> > in the <content> directive) does not make it. There is a link to add a
> > site, but I get a system error when trying to add it.
> Can you send the traceback? Though I think you simply forgot the security
> declarations, so that the necessary methods are not publically available.
>     <allow
>         attributes="getSiteManager"
>         />
>     <require
>         permission="zope.ManageServices"
>         attributes="setSiteManager"
>         />

My configure.zcml:

    <interface interface=".interfaces.ICentershock"
        type="" />
    <content class=".centershock.Centershock">
           interface="" />
           interface="" />
           interface="" />
        <factory description=""/>
        <require permission="zope.Public"
            interface=".interfaces.ICentershock" />
        <require permission="zope.Public"
            set_schema=".interfaces.ICentershock" />
            attributes="getSiteManager" />
            attributes="setSiteManager" />

I'm logged in as zope.Manager.

The traceback when I hit "Webplatz erstellen" (Make site).

2005-04-03T17:24:33 ERROR SiteError 
Traceback (most recent call last):
  File "/home/florian/Zope3/src/zope/publisher/", line 138, in 
    result = publication.callObject(request, object)
  File "/home/florian/Zope3/src/zope/app/publication/", line 
155, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/home/florian/Zope3/src/zope/publisher/", line 113, in 
    return debug_call(object, args)
  File "/home/florian/Zope3/src/zope/publisher/", line 119, in 
    return object(*args)
  File "/home/florian/Zope3/src/zope/app/component/browser/", line 
178, in addSiteManager
AttributeError: 'Centershock' object has no attribute 'setSiteManager' - zope.manager [3/Apr/2005:17:24:33 -0300] 
"GET /cs/addSiteManager.html HTTP/1.1" 500 311 
"http://localhost:8080/cs/@@contents.html"; "Mozilla/5.0 (compatible; 
Konqueror/3.3; Linux) (KHTML, like Gecko)"

The object I try to add the site to was created after I add the missing 
permission declaration.

> > Or directly inherit from
> That would work too, but it might have unwanted side-effects.

Ok, prefer the other way.


Zope3-users mailing list

Reply via email to