[Zope3-checkins] CVS: Zope3/src/zope/app/services - configure.zcml:1.57.6.1 pagefolder.py:1.14.6.1 view.py:1.35.6.1 zpt.py:1.14.6.1

Jim Fulton cvs-admin at zope.org
Sun Nov 9 11:08:57 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/services

Modified Files:
      Tag: adaptergeddon-branch
	configure.zcml pagefolder.py view.py zpt.py 
Log Message:
Created a global presentation service that replaces the 
global view, resource, and skin services.

Now look up presentation components by adapting from a request type,
rather than adapting to a presentation type.





=== Zope3/src/zope/app/services/configure.zcml 1.57 => 1.57.6.1 ===
--- Zope3/src/zope/app/services/configure.zcml:1.57	Sun Sep 21 13:32:48 2003
+++ Zope3/src/zope/app/services/configure.zcml	Sun Nov  9 11:08:26 2003
@@ -58,9 +58,9 @@
       />
 </content>
 
-<!-- View Service -->
+<!-- View Service
 
-<content class="zope.app.services.view.ViewService">
+<content class="zope.app.services.presentat.ViewService">
   <factory
       id="zope.app.services.ViewService"
       permission="zope.ManageServices"
@@ -103,11 +103,13 @@
    />
 
 
+-->
+
 <!-- Menu Service -->
 <include file="menu.zcml"/>
 
 
-<!-- Page Templates -->
+<!-- Page Templates
 
 <content class="zope.app.services.zpt.ZPTTemplate">
   <factory
@@ -149,6 +151,8 @@
   provides="zope.app.interfaces.services.registration.IRegistered"
   factory="zope.app.services.registration.Registered"
   />
+
+ -->
 
 <!-- Role Templates -->
 


=== Zope3/src/zope/app/services/pagefolder.py 1.14 => 1.14.6.1 ===
--- Zope3/src/zope/app/services/pagefolder.py:1.14	Sun Sep 21 13:32:54 2003
+++ Zope3/src/zope/app/services/pagefolder.py	Sun Nov  9 11:08:26 2003
@@ -21,8 +21,8 @@
 __metaclass__ = type
 
 from zope.app.container.btree import BTreeContainer
-from zope.app.interfaces.services.view import IZPTTemplate
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.app.interfaces.services.presentation import IZPTTemplate
+from zope.publisher.interfaces.browser import IBrowserRequest
 from zope.app.traversing import getPath
 from zope.app.interfaces.services.registration import ActiveStatus
 from zope.app.services.registration import RegistrationManagerContainer
@@ -42,7 +42,7 @@
 
     implements(IPageFolder)
 
-    presentationType = IBrowserPresentation
+    presentationType = IBrowserRequest
     layer = "default"
     description = ''
     title = ''


=== Zope3/src/zope/app/services/view.py 1.35 => 1.35.6.1 ===
--- Zope3/src/zope/app/services/view.py:1.35	Sun Sep 21 13:31:12 2003
+++ Zope3/src/zope/app/services/view.py	Sun Nov  9 11:08:26 2003
@@ -16,14 +16,17 @@
 """
 __metaclass__ = type
 
+from zope.app import zapi
 from __future__ import generators
 
 from persistence import Persistent
 from persistence.dict import PersistentDict
 
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
+
 
-from zope.component.interfaces import IViewService, IGlobalViewService
+from zope.component.presentation import IGlobalPresentationService
+from zope.component.presentation import IPresentationService
 from zope.component.exceptions import ComponentLookupError
 
 from zope.app.i18n import ZopeMessageIDFactory as _
@@ -32,7 +35,6 @@
 from zope.app.interfaces.services.registration import IRegistry, IRegistration
 from zope.app.services.registration import RegistrationStack
 from zope.app.services.registration import SimpleRegistration
-from zope.app.services.servicenames import Views
 from zope.app.component.nextservice import getNextService
 from zope.app import zapi
 from zope.interface import implements
@@ -43,17 +45,17 @@
 from zope.exceptions import NotFoundError
 
 from zope.app.interfaces.services.interface import IInterfaceBasedRegistry
-from zope.app.interfaces.services.view import IViewRegistration
-from zope.app.interfaces.services.view import IPageRegistration
-from zope.app.interfaces.services.view import ILocalViewService
+from zope.app.interfaces.services.presentation import IViewRegistration
+from zope.app.interfaces.services.presentation import IPageRegistration
+from zope.app.interfaces.services.presentation import ILocalPresentationService
 from zope.app.services.adapter import PersistentAdapterRegistry
 from zope.configuration.exceptions import ConfigurationError
 from zope.app.interfaces.services.service import ISimpleService
 from zope.app.container.contained import Contained
 
-class ViewService(Persistent, Contained):
+class PresentationService(Persistent, Contained):
 
-    implements(IViewService, ILocalViewService, IRegistry, ISimpleService,
+    implements(IPresentationService, ILocalPresentationService, IRegistry, ISimpleService,
                IInterfaceBasedRegistry)
 
     def __init__(self):
@@ -144,12 +146,12 @@
             view = registry.active().getView(object, request)
             return view
 
-        views = getNextService(self, Views)
+        views = getNextService(self, Presentation)
 
         return views.queryView(object, name, request, default)
 
     def getDefaultViewName(self, object, request):
-        "See IViewService"
+        "See IPresentationService"
 
         name = self.queryDefaultViewName(object, request)
 
@@ -160,10 +162,10 @@
         return name
 
     def queryDefaultViewName(self, object, request, default=None):
-        "See IViewService"
+        "See IPresentationService"
 
         # XXX: need to do our own defaults as well.
-        views = getNextService(self, Views)
+        views = getNextService(self, Presentation)
         return views.queryDefaultViewName(object, request, default)
 
     def getRegisteredMatching(self, required_interfaces=None,
@@ -206,7 +208,7 @@
             for info in reg.info():
                 yield info["registration"]
 
-        next = getNextService(self, Views)
+        next = getNextService(self, Presentation)
         next = zapi.queryAdapter(next, IInterfaceBasedRegistry)
         if next is None:
             return
@@ -217,7 +219,7 @@
     """Adapter to create registrations from factory chains."""
 
     implements(IInterfaceBasedRegistry)
-    __used_for__ = IGlobalViewService
+    __used_for__ = IGlobalPresentationService
 
     def __init__(self, gvs):
         self.gvs = gvs
@@ -231,7 +233,7 @@
 
     implements(IRegistration)
 
-    serviceType = Views
+    serviceType = zapi.servicenames.Presentation
     status = ActiveStatus
 
     def __init__(self, req, ptype, factories, layer, viewName):
@@ -265,7 +267,7 @@
 
     implements(IViewRegistration)
 
-    serviceType = Views
+    serviceType = zapi.servicenames.Presentation
 
     # For usageSummary(); subclass may override
     _what = _("view-component", 'View')
@@ -310,7 +312,7 @@
     implements(IPageRegistration)
 
     # We only care about browser pages
-    presentationType = IBrowserPresentation
+    presentationType = IBrowserRequest
 
     # For usageSummary()
     _what = _("page-component", "Page")


=== Zope3/src/zope/app/services/zpt.py 1.14 => 1.14.6.1 ===
--- Zope3/src/zope/app/services/zpt.py:1.14	Sun Sep 21 13:31:12 2003
+++ Zope3/src/zope/app/services/zpt.py	Sun Nov  9 11:08:26 2003
@@ -23,7 +23,7 @@
 from zope.security.proxy import ProxyFactory
 from zope.pagetemplate.pagetemplate import PageTemplate
 from zope.app.pagetemplate.engine import AppPT
-from zope.app.interfaces.services.view import IZPTTemplate
+from zope.app.interfaces.services.presentation import IZPTTemplate
 from zope.app.interfaces.index.text import ISearchableText
 from zope.app.interfaces.file import IReadFile, IWriteFile, IFileFactory
 from zope.app.fssync.classes import ObjectEntryAdapter, AttrMapping




More information about the Zope3-Checkins mailing list