[Zope3-checkins] SVN: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/metaconfigure.py hooking to IRequestPublicationRegistry

Tarek Ziadé tziade at nuxeo.com
Fri Oct 7 07:31:12 EDT 2005


Log message for revision 38865:
  hooking to IRequestPublicationRegistry

Changed:
  U   Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/metaconfigure.py

-=-
Modified: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/metaconfigure.py
===================================================================
--- Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/metaconfigure.py	2005-10-07 11:25:39 UTC (rev 38864)
+++ Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/metaconfigure.py	2005-10-07 11:31:11 UTC (rev 38865)
@@ -19,6 +19,9 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope.app.zapi import getUtility
+from zope.app.publication.interfaces import IRequestPublicationRegistry
+
 class RequestPublicationRegisterer(object):
     """ Link a request type to a request-publication factory """
 
@@ -53,7 +56,14 @@
         """ calls the register factory utility, that actually links
             the factory.
         """
-        pass
+        factory_registerer = zapi.getUtility(IRequestPublicationRegistry)
+        registerer = factory_registerer.register
 
+        # need to register all methods<->mimetypes combos here
+        # for imbrication: usally there are more methods than mimetypes
+        for method in methods:
+            for mimetype in mimetypes:
+                registerer(method, mimetype, name, priority, factory)
+
 def publisher(_context, name, factory, method='*', mimetype='*', priority=0):
     RequestPublicationRegisterer(name, factory, method, mimetype, priority)



More information about the Zope3-Checkins mailing list