[Zope] help! url <-> object mapping?

John Ziniti jziniti@speakeasy.org
Fri, 07 Feb 2003 13:13:22 -0500


This is not exactly a very "Zope-y" way of thinking about this
problem.  In Zope, you would probably have each type of object
know how to generate that "html page returned in the frameset"
all by itself, so Zope will map the URL to the object, hand the
request to the object, and the object will generate the HTML
that you want.

HTH,
John Ziniti

Mark Anquoe wrote:

> I am relatively new to zope. Thank you in advance for any help.
> here is my situation:
>
> user enters url
> zope maps url to object
> zope stitches together a frames html page according to my structure of 
> inherited attributes.
> one of the html pages in the returned frameset needs to change itself 
> depending on what type of object was asked for by the initial url 
> request.
>
> I know I can get the initial requested url through the request object
>
> request = container.REQUEST
>
> and I know that all these objects have meta_type attributes.
> But how do I find a reference to the object to which zope has mapped 
> the requested url that I can then test for its meta_type?
> I keep coming back to this bit of code in the page:
>
> fullpath = request.get('full')
> if not fullpath:
>  fullpath = '0:%s' % url_quote(request.URL1)
>
> bookmarkid = context.db.get_link_id(fullpath)
>
> something related to the unique ID looks promising, but I have found 
> no api that details the various methods available to call on the 
> context or db objects.
>
> any help is appreciated.
>
> thank you.
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>