[Zope3-dev] Zope.App.ZopePublication

Jim Fulton jim@zope.com
Sat, 09 Mar 2002 13:38:32 -0500


Stephan Richter wrote:
> 
> Hello Jim,
> 
> I ran into some major issues implementing XML-RPC. While I got the basic
> XML-RPC transfer working (yipee), all the code in ZopePublication is
> Browser-specific(as in View Type). I will therefore refactor the entire
> module.

Hm. I'd like to get some more info on this. I think that the BrowserPublication
class is browser specific. I don't see browser dependencies elsewhere.

I'm not sure what you are refering to with View Type.

> Also, in XML-RPC I have no way to say:
> ...../contentObject/ViewName;view/method, since I have no possibility to
> use ';view' in the dot-notation. So what I decided to do is that I only
> allow for one XML-RPC view per content object, and the traverser looks it
> up like follows:
> 
> 1. get name
> 2. is there a subobject with that name
> 3. if yes, get it; if no, get the view (there is only one) and find the method
> 
> Another possibility would be to have some sort of view marker, like
> ..../contentObject/ViewName_VIEW/method, which I think is not very elegant;
> even ..../contentObject/VIEW/ViewName/method is not that good, since it
> would look too strange for a non-Zope user to use.
> 
> I am going to play around some more and try to get the first design working...

I think we covered this in IRC. You can use a getattr from Python:

  getattr(contentobject, 'viewname;view').method

or specify the path to the view whjen you create the server.
These to approaches are equivalent, since doing a getattr on an
xmlrpc proxy simply changes the server URL that the proxy uses to
send requests.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org