[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser -
directoryresource.py:1.3.6.1 fileresource.py:1.7.6.1
i18nfileresource.py:1.5.30.1 i18nresourcemeta.py:1.14.12.1
icon.py:1.11.12.1 meta.zcml:1.13.14.1
metaconfigure.py:1.13.12.1 metadirectives.py:1.7.2.1
pagetemplateresource.py:1.2.6.1 resource.py:1.9.6.1
resourcemeta.py:1.12.12.1 resources.py:1.10.6.1 viewmeta.py:1.33.6.1
Jim Fulton
cvs-admin at zope.org
Sun Nov 9 11:08:54 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/publisher/browser
Modified Files:
Tag: adaptergeddon-branch
directoryresource.py fileresource.py i18nfileresource.py
i18nresourcemeta.py icon.py meta.zcml metaconfigure.py
metadirectives.py pagetemplateresource.py resource.py
resourcemeta.py resources.py viewmeta.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/publisher/browser/directoryresource.py 1.3 => 1.3.6.1 ===
--- Zope3/src/zope/app/publisher/browser/directoryresource.py:1.3 Wed Sep 24 13:22:07 2003
+++ Zope3/src/zope/app/publisher/browser/directoryresource.py Sun Nov 9 11:08:22 2003
@@ -21,8 +21,7 @@
from zope.exceptions import NotFoundError
from zope.security.proxy import Proxy
from zope.publisher.browser import BrowserView
-from zope.publisher.interfaces.browser import IBrowserResource, \
- IBrowserPublisher
+from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.browser.resource import Resource
@@ -41,7 +40,7 @@
class DirectoryResource(BrowserView, Resource):
- implements(IBrowserResource, IBrowserPublisher)
+ implements(IBrowserPublisher)
resource_factories = {
'gif': ImageResourceFactory,
=== Zope3/src/zope/app/publisher/browser/fileresource.py 1.7 => 1.7.6.1 ===
--- Zope3/src/zope/app/publisher/browser/fileresource.py:1.7 Mon Sep 22 17:05:13 2003
+++ Zope3/src/zope/app/publisher/browser/fileresource.py Sun Nov 9 11:08:23 2003
@@ -20,7 +20,6 @@
from zope.exceptions import NotFoundError
from zope.publisher.browser import BrowserView
-from zope.publisher.interfaces.browser import IBrowserResource
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.fileresource import File, Image
@@ -33,7 +32,7 @@
class FileResource(BrowserView, Resource):
- implements(IBrowserResource, IBrowserPublisher)
+ implements(IBrowserPublisher)
def publishTraverse(self, request, name):
'''See interface IBrowserPublisher'''
=== Zope3/src/zope/app/publisher/browser/i18nfileresource.py 1.5 => 1.5.30.1 ===
--- Zope3/src/zope/app/publisher/browser/i18nfileresource.py:1.5 Sat Jun 7 01:46:02 2003
+++ Zope3/src/zope/app/publisher/browser/i18nfileresource.py Sun Nov 9 11:08:23 2003
@@ -18,7 +18,6 @@
"""
__metaclass__ = type # All classes are new style when run with Python 2.2+
-from zope.publisher.interfaces.browser import IBrowserResource
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.browser.fileresource import FileResource
@@ -30,7 +29,7 @@
class I18nFileResource(FileResource):
- implements(IBrowserResource, IBrowserPublisher, II18nAware)
+ implements(IBrowserPublisher, II18nAware)
def __init__(self, data, request, defaultLanguage='en'):
"""Creates an internationalized file resource. data should be
=== Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py 1.14 => 1.14.12.1 ===
--- Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py:1.14 Sun Aug 17 02:07:32 2003
+++ Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py Sun Nov 9 11:08:23 2003
@@ -20,16 +20,17 @@
from zope.security.checker import CheckerPublic, Checker
from zope.configuration.exceptions import ConfigurationError
-from zope.app.services.servicenames import Resources
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.app.services.servicenames import Presentation
from zope.app.component.metaconfigure import handler
from zope.app.publisher.fileresource import File, Image
from i18nfileresource import I18nFileResourceFactory
+from zope.publisher.interfaces.browser import IBrowserRequest
+
class I18nResource(object):
- type = IBrowserPresentation
+ type = IBrowserRequest
default_allowed_attributes = '__call__'
def __init__(self, _context, name=None, defaultLanguage='en',
@@ -102,7 +103,7 @@
self._context.action(
discriminator = ('i18n-resource', self.name, self.type, self.layer),
callable = handler,
- args = (Resources, 'provideResource', self.name, self.type,
+ args = (Presentation, 'provideResource', self.name, self.type,
factory, self.layer)
)
=== Zope3/src/zope/app/publisher/browser/icon.py 1.11 => 1.11.12.1 ===
--- Zope3/src/zope/app/publisher/browser/icon.py:1.11 Fri Aug 15 20:43:46 2003
+++ Zope3/src/zope/app/publisher/browser/icon.py Sun Nov 9 11:08:23 2003
@@ -20,10 +20,11 @@
import os
import re
+from zope.app import zapi
from zope.app.component.metaconfigure import handler
from zope.app.publisher.browser import metaconfigure
from zope.app.traversing.namespace import getResourceInContext
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.configuration.exceptions import ConfigurationError
from zope.app.services.servicenames import Interfaces
@@ -94,8 +95,8 @@
_context.action(
discriminator = ('view', name, vfactory, layer),
callable = handler,
- args = ('Views', 'provideView',
- for_, name, IBrowserPresentation,
+ args = (zapi.servicenames.Presentation, 'provideView',
+ for_, name, IBrowserRequest,
vfactory, layer)
)
_context.action(
=== Zope3/src/zope/app/publisher/browser/meta.zcml 1.13 => 1.13.14.1 ===
--- Zope3/src/zope/app/publisher/browser/meta.zcml:1.13 Mon Aug 11 10:58:07 2003
+++ Zope3/src/zope/app/publisher/browser/meta.zcml Sun Nov 9 11:08:23 2003
@@ -129,6 +129,12 @@
<!-- misc. directives -->
<meta:directive
+ name="layer"
+ schema=".metadirectives.ILayerDirective"
+ handler=".metaconfigure.layer"
+ />
+
+ <meta:directive
name="skin"
schema=".metadirectives.ISkinDirective"
handler=".metaconfigure.skin"
=== Zope3/src/zope/app/publisher/browser/metaconfigure.py 1.13 => 1.13.12.1 ===
--- Zope3/src/zope/app/publisher/browser/metaconfigure.py:1.13 Fri Aug 15 20:43:46 2003
+++ Zope3/src/zope/app/publisher/browser/metaconfigure.py Sun Nov 9 11:08:23 2003
@@ -16,10 +16,11 @@
$Id$
"""
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.app import zapi
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.app.services.servicenames import Interfaces
-from zope.app.component.metaconfigure import skin as _skin
+from zope.app.component.metaconfigure import skin, layer
from zope.app.component.metaconfigure import handler
# referred to through ZCML
@@ -29,20 +30,18 @@
from zope.app.publisher.browser.viewmeta import view
-def skin(_context, **__kw):
- return _skin(_context, type=IBrowserPresentation, **__kw)
-
def defaultView(_context, name, for_=None, **__kw):
if __kw:
view(_context, name=name, for_=for_, **__kw)()
- type = IBrowserPresentation
+ type = IBrowserRequest
_context.action(
discriminator = ('defaultViewName', for_, type, name),
callable = handler,
- args = ('Views','setDefaultViewName', for_, type, name),
+ args = (zapi.servicenames.Presentation,
+ 'setDefaultViewName', for_, type, name),
)
if for_ is not None:
=== Zope3/src/zope/app/publisher/browser/metadirectives.py 1.7 => 1.7.2.1 ===
--- Zope3/src/zope/app/publisher/browser/metadirectives.py:1.7 Mon Oct 6 18:08:53 2003
+++ Zope3/src/zope/app/publisher/browser/metadirectives.py Sun Nov 9 11:08:23 2003
@@ -472,9 +472,18 @@
# misc. directives
#
-class ISkinDirective(Interface):
+class ILayerDirective(Interface):
+ """Defines a browser layer
"""
- Defines a browser skin
+
+ name = TextLine(
+ title=u"Name",
+ description=u"The name of the skin.",
+ required=True
+ )
+
+class ISkinDirective(Interface):
+ """Defines a browser skin
"""
name = TextLine(
=== Zope3/src/zope/app/publisher/browser/pagetemplateresource.py 1.2 => 1.2.6.1 ===
--- Zope3/src/zope/app/publisher/browser/pagetemplateresource.py:1.2 Mon Sep 22 17:05:13 2003
+++ Zope3/src/zope/app/publisher/browser/pagetemplateresource.py Sun Nov 9 11:08:23 2003
@@ -20,15 +20,14 @@
from zope.exceptions import NotFoundError
from zope.security.proxy import Proxy
from zope.publisher.browser import BrowserView
-from zope.publisher.interfaces.browser import IBrowserResource, \
- IBrowserPublisher
+from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.pagetemplateresource import PageTemplate
from zope.app.publisher.browser.resource import Resource
class PageTemplateResource(BrowserView, Resource):
- implements(IBrowserResource, IBrowserPublisher)
+ implements(IBrowserPublisher)
def publishTraverse(self, request, name):
'''See interface IBrowserPublisher'''
=== Zope3/src/zope/app/publisher/browser/resource.py 1.9 => 1.9.6.1 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.9 Wed Sep 24 18:00:42 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py Sun Nov 9 11:08:23 2003
@@ -21,7 +21,7 @@
from zope.app.location import Location
from zope.app.interfaces.services.service import ISite
from zope.app.interfaces.traversing import IContainmentRoot
-from zope.component.interfaces import IResourceService, IResource
+from zope.component.interfaces import IResource
from zope.interface import implements
class Resource(Location):
=== Zope3/src/zope/app/publisher/browser/resourcemeta.py 1.12 => 1.12.12.1 ===
--- Zope3/src/zope/app/publisher/browser/resourcemeta.py:1.12 Fri Aug 15 20:43:46 2003
+++ Zope3/src/zope/app/publisher/browser/resourcemeta.py Sun Nov 9 11:08:23 2003
@@ -18,10 +18,10 @@
import os
+from zope.app import zapi
from zope.security.checker import CheckerPublic, NamesChecker
from zope.configuration.exceptions import ConfigurationError
-from zope.app.services.servicenames import Resources
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.app.component.metaconfigure import handler
from fileresource import FileResourceFactory, ImageResourceFactory
@@ -54,10 +54,10 @@
factory = PageTemplateResourceFactory(template, checker)
_context.action(
- discriminator = ('resource', name, IBrowserPresentation, layer),
+ discriminator = ('resource', name, IBrowserRequest, layer),
callable = handler,
- args = (Resources, 'provideResource',
- name, IBrowserPresentation, factory, layer),
+ args = (zapi.servicenames.Presentation, 'provideResource',
+ name, IBrowserRequest, factory, layer),
)
def resourceDirectory(_context, name, directory, layer='default',
@@ -75,8 +75,8 @@
factory = DirectoryResourceFactory(directory, checker)
_context.action(
- discriminator = ('resource', name, IBrowserPresentation, layer),
+ discriminator = ('resource', name, IBrowserRequest, layer),
callable = handler,
- args = (Resources, 'provideResource',
- name, IBrowserPresentation, factory, layer),
+ args = (zapi.servicenames.Presentation, 'provideResource',
+ name, IBrowserRequest, factory, layer),
)
=== Zope3/src/zope/app/publisher/browser/resources.py 1.10 => 1.10.6.1 ===
--- Zope3/src/zope/app/publisher/browser/resources.py:1.10 Sun Sep 21 13:32:40 2003
+++ Zope3/src/zope/app/publisher/browser/resources.py Sun Nov 9 11:08:23 2003
@@ -20,7 +20,7 @@
from zope.publisher.browser import BrowserView
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.component import getService
-from zope.app.services.servicenames import Resources as ResourceService
+from zope.app.services.servicenames import Presentation
from zope.exceptions import NotFoundError
from zope.interface import implements
from zope.app.location import locate
@@ -34,8 +34,8 @@
def publishTraverse(self, request, name):
'''See interface IBrowserPublisher'''
- resource_service = getService(self, ResourceService)
- resource = resource_service.queryResource(self, name, request)
+ resource_service = getService(self, Presentation)
+ resource = resource_service.queryResource(name, request)
if resource is None:
raise NotFoundError(self, name)
=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.33 => 1.33.6.1 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.33 Sun Sep 21 13:31:58 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py Sun Nov 9 11:08:23 2003
@@ -18,6 +18,7 @@
import os
+from zope.app import zapi
from zope.interface import implements, classImplements
from zope.publisher.interfaces.browser import IBrowserPublisher
@@ -28,9 +29,9 @@
from zope.configuration.exceptions import ConfigurationError
-from zope.app.services.servicenames import Interfaces, Views
+from zope.app.services.servicenames import Interfaces
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.app.publisher.browser import BrowserView
@@ -155,7 +156,6 @@
if hasattr(class_, '__implements__'):
classImplements(new_class, IBrowserPublisher)
- classImplements(new_class, IBrowserPresentation)
else:
# template
@@ -173,10 +173,10 @@
defineChecker(new_class, Checker(required))
_context.action(
- discriminator = ('view', for_, name, IBrowserPresentation, layer),
+ discriminator = ('view', for_, name, IBrowserRequest, layer),
callable = handler,
- args = (Views, 'provideView',
- for_, name, IBrowserPresentation, [new_class], layer),
+ args = (zapi.servicenames.Presentation, 'provideView',
+ for_, name, IBrowserRequest, [new_class], layer),
)
if not usage and menu:
@@ -353,10 +353,10 @@
defineChecker(newclass, Checker(required))
_context.action(
- discriminator = ('view', for_, name, IBrowserPresentation, layer),
+ discriminator = ('view', for_, name, IBrowserRequest, layer),
callable = handler,
- args = (Views, 'provideView',
- for_, name, IBrowserPresentation, [newclass], layer),
+ args = (zapi.servicenames.Presentation, 'provideView',
+ for_, name, IBrowserRequest, [newclass], layer),
)
def addview(_context, name, permission,
@@ -375,9 +375,10 @@
def defaultView(_context, name, for_=None):
_context.action(
- discriminator = ('defaultViewName', for_, IBrowserPresentation, name),
+ discriminator = ('defaultViewName', for_, IBrowserRequest, name),
callable = handler,
- args = (Views,'setDefaultViewName', for_, IBrowserPresentation,
+ args = (zapi.servicenames.Presentation,'setDefaultViewName',
+ for_, IBrowserRequest,
name),
)
More information about the Zope3-Checkins
mailing list