[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher - normal.clb:1.1.2.1
Jim Fulton
jim@zope.com
Tue, 19 Mar 2002 23:12:02 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher
In directory cvs.zope.org:/tmp/cvs-serv13428
Added Files:
Tag: Zope3-publisher-refactor-branch
normal.clb
Log Message:
Beginning of documentation of publisher framework collaboration.
This uses an experimental text syntax. How does it look? :)
=== Added File Zope3/lib/python/Zope/Publisher/normal.clb ===
Publisher framework base collaboration
Participants:
publisher:IPublisher
request:IPublisherRequest
response:IPublicationResponse = request.getResponse()
publication:IPublication = request.getPublication()
Values:
root
"the top-level object"
foo
"an object obtaines by traversing the root with 'foo'"
bar
"an object obtaines by traversing the root with 'bar'"
result
"The result of calling bar"
Scenario: Normal, path = foo/bar
publisher.publish(request)
request.processInputs()
publication.beforeTraversal(request)
publication.getApplication(request)
"Get the root object to be traversed"
request.traverse(root)
publication.callTraversalHooks(request, root)
'''Call any "before traversal step" hooks. These hooks
should be called before traversing an object for the
first time. If the same object is traversed more than
once, the hook will still only be called the first
time.
The last constraint is probably important to get
virtual host semantics rigfht. :)
'''
publication.traverseName(request, root, 'foo')
publication.callTraversalHooks(request, foo)
publication.traverseName(request, foo, 'bar')
return bar
publication.afterTraversal(request, bar)
publication.callObject(request, bar)
return result
response.setBody(result)
publication.afterCall(request)
response.outputBody()
request.close()
Scenario: Error during application call, path = foo
publisher.publish(request)
request.processInputs()
publication.beforeTraversal(request)
publication.getApplication(request)
request.traverse(root)
publication.callTraversalHooks(request, root)
publication.traverseName(request, root, 'foo')
return foo
publication.afterTraversal(request, foo)
publication.callObject(request, foo)
raise AttributeError, 'spam'
publication.handleException()
response.outputBody()
request.close()