Hi all, I have a situation where I need to be able to handle a URL like http://www.xxx.com:8080/<arg> where <arg> is somehow trapped by a python script. I know this type of thing can be done with a ZSQL method to pass in a single argument, but I am not aware of how to do this otherwise. Any ideas on how to do this? Thanks, Kevin
Kevin Carlson wrote:
Hi all,
I have a situation where I need to be able to handle a URL like http://www.xxx.com:8080/<arg> where <arg> is somehow trapped by a python script. I know this type of thing can be done with a ZSQL method to pass in a single argument, but I am not aware of how to do this otherwise. Any ideas on how to do this?
Thanks,
Kevin
Take a look at the bindings tab of your python script. There you'll find "subpath", think this is what you want. cheers, oliver
Hi Oliver, Thanks for the response. This is putting me on the right path, but it's not quite what I need. If I navigate to the URL http://www.whateverserver.com:8080/bob and the method or script named 'bob' doesn't exist, I want to be able to trap that and look up some values in a database. I tried replacing the index_html DMTL method with a Python script and it doesn't get called if I navigate to the URL shown above. I guess I sort of need a traversal hook of some sort -- I've been digging in the source to figure out how to do this, but have come up empty so far. Any other ideas? Thanks very much, Kevin -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Oliver Bleutgen Sent: Thursday, June 13, 2002 10:19 AM To: Kevin Carlson Cc: zope group Subject: Re: [Zope] Monitoring transversal Kevin Carlson wrote:
Hi all,
I have a situation where I need to be able to handle a URL like http://www.xxx.com:8080/<arg> where <arg> is somehow trapped by a python script. I know this type of thing can be done with a ZSQL method to pass in a single argument, but I am not aware of how to do this otherwise. Any ideas on how to do this?
Thanks,
Kevin
Take a look at the bindings tab of your python script. There you'll find "subpath", think this is what you want. cheers, oliver _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Kevin Carlson wrote:
Hi Oliver,
Thanks for the response. This is putting me on the right path, but it's not quite what I need. If I navigate to the URL http://www.whateverserver.com:8080/bob and the method or script named 'bob' doesn't exist, I want to be able to trap that and look up some values in a database.
I tried replacing the index_html DMTL method with a Python script and it doesn't get called if I navigate to the URL shown above. I guess I sort of need a traversal hook of some sort -- I've been digging in the source to figure out how to do this, but have come up empty so far.
Any other ideas?
Ah, sorry Kevin, did reply too fast. Well, I don't have the time to dig into that deeper, but since nobody else more knowledgable answered till now, let me try another hint. Maybe you shold look into "access rules", formely part of the siteroot product. AFAIK it should be possible to set a python script as an access rule and use this to do the stuff you want to do (I suspect you wouldn't use the subpath method then). Another remark, if you plan to put an http server like apache in front of zope anyway, you could use rewrite rules to point every request to your python script, i.e. http://www.whateverserver.com/bob/and/his/dog gets rewritten to http://www.whateverserver.com:8080/yoursmartscript/bob/and/his/dog So you could extract the data you need via subpath. cheers, oliver
PathHandler might help: http://www.zope.org/Members/NIP/PathHandler Stefan --On Donnerstag, 13. Juni 2002 10:48 -0400 Kevin Carlson <khcarlso@bellsouth.net> wrote:
Hi Oliver,
Thanks for the response. This is putting me on the right path, but it's not quite what I need. If I navigate to the URL http://www.whateverserver.com:8080/bob and the method or script named 'bob' doesn't exist, I want to be able to trap that and look up some values in a database.
-- BLOWFISH, n. - Preference for beef.
participants (3)
-
Kevin Carlson -
Oliver Bleutgen -
Stefan H. Holek