[Zope] Re: Access document_src

Andreas Tille tillea@rki.de
Wed, 9 Oct 2002 14:44:54 +0200 (CEST)


On Wed, 9 Oct 2002, Maik Jablonski wrote:

> >     if REQUEST is not None:
> >         return container['test.zpt'](REQUEST, name=name, title=title)
> >
> works for me even for anonymous... have you checked, that test.zpt can
> be viewed by anonymous without problems?
Thanks for checking this problem.  Now I know the problem better.
The reason is that I try to insert some unrendered text from some
DTML-documents.  I tried to do this by calling a Python Script
from the Page Template above.  The script looks like this ...

    ## Script (Python) "Content"
    ##bind container=container
    ##bind context=context
    ##bind namespace=
    ##bind script=script
    ##bind subpath=traverse_subpath
    ##parameters=name=None
    ##title=Return content / 'name'
    ##

    if name == None:
        name='default'

    foundname='default'

    cont = container.content
    for folder in cont.objectValues():
        if name == folder.getId():
            foundname=name
            break

    return cont[foundname].document_src()

Here is the call which causes the problem with the

     Zope has encountered an error while publishing this resource.

     Error Type: Unauthorized
     Error Value: You are not allowed to access document_src in this context

Any other reasonable way to obtain unrendered text?

Kind regards

       Andreas.