Traversing question
Hello zope, I have to all requests are handled by only one method/zpt. I set the access rule like this: rq=context.REQUEST s=str(rq.PATH_INFO) rq.set("MainPath",s) # debug if (s<>'/manage') and (s<>'/'): from string import split l=split(s,'/') rq.set("MainPath",l) # debug TraversalRequestNameStack=['index_html'] <--- I try to the Zope get this object, and not the original URL but it have failed. When I try with: http://mysite/o I want to this request are stored into MainPath ("/o"), and the Zope don't drop an error, but it is get the default index_html, and process that. But it is drop the error: Site Error An error was encountered while publishing this resource. Resource not found Sorry, the requested resource does not exist. Check the URL and try again. Resource: o GET What I can do to prevent the error, and redirect the process to the main index_html ??? Thanx for any advance !!! KK -- Best regards, fowlertrainer mailto:fowlertrainer@anonym.hu
What are you trying to accomplish? Ever heard of restrictedTraverse()? -aj --On Montag, 15. Dezember 2003 17:09 Uhr +0100 fowlertrainer@anonym.hu wrote:
Hello zope,
I have to all requests are handled by only one method/zpt.
I set the access rule like this:
rq=context.REQUEST s=str(rq.PATH_INFO) rq.set("MainPath",s) # debug if (s<>'/manage') and (s<>'/'): from string import split l=split(s,'/') rq.set("MainPath",l) # debug TraversalRequestNameStack=['index_html'] <--- I try to the Zope get this object, and not the original URL
but it have failed.
When I try with:
I want to this request are stored into MainPath ("/o"), and the Zope don't drop an error, but it is get the default index_html, and process that.
But it is drop the error:
Site Error An error was encountered while publishing this resource. Resource not found Sorry, the requested resource does not exist. Check the URL and try again. Resource: o GET
What I can do to prevent the error, and redirect the process to the main index_html ???
Thanx for any advance !!!
KK
fowlertrainer@anonym.hu wrote:
I have to all requests are handled by only one method/zpt. [...] but it have failed.
That's fortunate, since you'd be locking yourself out of the ZMI. It's not enough to pass '/manage', since that's just a frameset through which you view '/manage_main' and many other URLs (depending on what you're doing in the ZMI). If at all possible, make the Rule conditional on the SERVER_NAME instead, so that you can directly access everything in your site from "http://admin.example.com/manage" or similar while people who visit "http://www.example.com/" are affected by the Rule. Finally, the problem that is preventing your Rule from working is the following line:
TraversalRequestNameStack=['index_html']
...which should be like this instead: rq['TraversalRequestNameStack'][:]=['index_html'] Cheers, Evan @ 4-am
participants (3)
-
Andreas Jung -
Evan Simpson -
fowlertrainerļ¼ anonym.hu