[Zope3-dev] xml-rpc comments

Jim Fulton jim at zope.com
Thu Aug 26 06:35:36 EDT 2004


I don't like the defaultView concept we have for xmlrpc now.

Imagibe we had an xml-rpc view named 'statistics', with methods
'summary' abd 'detailed', for reporting statistics on polls.

You could access the summary method as:

    .../poll/statistics/summary

You might want to be able to access the summary method
as if it was a method of the poll:

    .../poll/summary

I think this has value, and the xml-rpc defaultView mechanism
lets you do this, howeverm it creates an ambiguity.  Suppose there
was an xml-rpc view named 'summary'. Which one would we get?
As things stand now, the summary view would take precedence over
the method, which is good, however, I'd really rather not
create this ambiguity in the first place.

Rather than having a defaultView, I'd prefer to have zmlrpc method and
methods directives (similar to browser page and pages directives) that
allow the creation of xml-rpc views that are individual methods.  So, if
someone wanted to be able to use the summary method directly, then would
create a directive like:

   <xmlrpc:method
       name="summary"
       for=".IPoll"
       permission="MrPoll.ManagePolls"
       class=".PollStatistics"
       />

or:

   <xmlrpc:methods
       for=".IPoll"
       permission="MrPoll.ManagePolls"
       class=".PollStatistics"
       >
       <xmlrpc:method name="summary" />
       <xmlrpc:method name="detail" />
   </xmlrpc:methods>

(Note that methods would allow separate permissions for each method and
both directives would support specifying view attrs different then the
publihed name.)

The advantage of this approach is that it is more explicit and will
catch conflicts between method and view names, since it makes methods
into views.

If possible, I'd like to remove the defaultView directive so as not
to create legacy that we have to deprecate later.  Unfortunately, we
don't have time to add the method(s) directives for X3.0.

Would anyone mind if the xmlrpc:defaultView directive (and mechanism) went
away for X3.0?

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org



More information about the Zope3-dev mailing list