[Repoze-dev] Repoze CVS: intro.txt
Tres Seaver
tseaver at agendaless.com
Wed Sep 12 23:27:23 UTC 2007
Update of /home/repoze/cvs/repoze.obob/doc
In directory laguna.palladion.com:/tmp/cvs-serv17082/doc
Modified Files:
intro.txt
Log Message:
- Add 'setup' / 'teardown' methods to traversal helper API.
Index: intro.txt
===================================================================
RCS file: /home/repoze/cvs/repoze.obob/doc/intro.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- intro.txt 12 Sep 2007 20:20:25 -0000 1.5
+++ intro.txt 12 Sep 2007 23:27:21 -0000 1.6
@@ -79,6 +79,16 @@
class, or supply a factory returning an object (e.g., a module) implementing
the same methods:
+ 'setup' -- required; called before any other request processing.
+
+ Contract::
+
+ setup()
+
+ E.g. in the Zope2 stack, call 'newInteraction'??
+
+ The default implementation is a no-op.
+
'path_elements' -- required; computes the list of path elements to be
traversed
@@ -96,11 +106,13 @@
Contract::
- before_traverse(current, name, request) # raise to veto
+ before_traverse(current, name) # raise to veto
E.g. in the Zope2 stack, note location of most-recently-seen
'__allow_groups__' user folder.
+ The default implementation is a no-op.
+
'traverse' -- required; called to traverse each path element.
Contract::
@@ -117,26 +129,28 @@
Contract::
- before_traverse(published, request) # raise to veto
+ before_traverse(published) # raise to veto
E.g., in the Zope2 stack, ask the security machinery to authorize
access to the published object.
+ The default implementation is a no-op.
+
'invoke' -- required; called to get the result from the published object.
Contract::
- invoke(published, request) -> result
+ invoke(published) -> result
E.g., in the Zope2`stack, use 'mapply'.
- The default implementaition just calls 'published', passing the request.
+ The default implementaition just calls 'published'.
'map_result' -- required; called to map the result onto triple for WSGI.
Contract::
- map_result(request, result) -> status, headers, body_iter
+ map_result(result) -> status, headers, body_iter
E.g., in the Zope2`stack, extract status, headers, and body_iter from
the response object.
@@ -145,6 +159,16 @@
status is 200, headers is an empty dict, body_iter is a list
containing the result.
+ 'teardown' -- required; called at end of request processing
+
+ Contract::
+
+ teardown()
+
+ E.g., in the Zope2 stack, call 'endInteraction?
+
+ The default implementation is a no-op.
+
Sample obob configurations
The absolute minium configuration would thus be::
_______________________________________________
Repoze-dev mailing list
Repoze-dev at lists.repoze.org
http://lists.repoze.org/mailman/listinfo/repoze-dev
More information about the Repoze-dev
mailing list