[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form -
add.py:1.33.2.1 addwizard.py:1.10.12.1
configure.zcml:1.22.12.1 editview.py:1.39.6.1
editwizard.py:1.15.6.1 metaconfigure.py:1.4.12.1
schemadisplay.py:1.11.6.1 widget.py:1.55.4.1
Jim Fulton
cvs-admin at zope.org
Sun Nov 9 11:09:06 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/browser/form
Modified Files:
Tag: adaptergeddon-branch
add.py addwizard.py configure.zcml editview.py editwizard.py
metaconfigure.py schemadisplay.py widget.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/browser/form/add.py 1.33 => 1.33.2.1 ===
--- Zope3/src/zope/app/browser/form/add.py:1.33 Mon Oct 6 18:08:51 2003
+++ Zope3/src/zope/app/browser/form/add.py Sun Nov 9 11:08:04 2003
@@ -17,6 +17,7 @@
"""
import sys
+from zope.app import zapi
from zope.app.browser.form.editview import EditView
from zope.app.browser.form.submit import Update
from zope.app.event import publish
@@ -26,9 +27,9 @@
from zope.app.interfaces.form import WidgetsError
from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
+from zope.component.servicenames import Presentation
from zope.component import getAdapter
-from zope.component.view import provideView
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.schema.interfaces import ValidationError
from zope.security.checker import defineChecker, NamesChecker
@@ -162,4 +163,5 @@
)
)
- provideView(for_, name, IBrowserPresentation, class_, layer)
+ s = zapi.getService(None, zapi.servicenames.Presentation)
+ s.provideView(for_, name, IBrowserRequest, class_, layer)
=== Zope3/src/zope/app/browser/form/addwizard.py 1.10 => 1.10.12.1 ===
--- Zope3/src/zope/app/browser/form/addwizard.py:1.10 Tue Aug 12 08:47:55 2003
+++ Zope3/src/zope/app/browser/form/addwizard.py Sun Nov 9 11:08:04 2003
@@ -17,6 +17,7 @@
"""
import sys
+from zope.app import zapi
from zope.app.event import publish
from zope.app.event.objectevent import ObjectCreatedEvent
from zope.app.form.utility import setUpWidgets
@@ -24,8 +25,7 @@
from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
from zope.component import getAdapter
-from zope.component.view import provideView
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.schema.interfaces import ValidationError
from zope.security.checker import defineChecker, NamesChecker
from editwizard import EditWizardView, WizardStorage
@@ -134,4 +134,5 @@
)
)
- provideView(for_, name, IBrowserPresentation, class_, layer)
+ s = zapi.getService(None, zapi.servicenames.Presentation)
+ s.provideView(for_, name, IBrowserRequest, class_, layer)
=== Zope3/src/zope/app/browser/form/configure.zcml 1.22 => 1.22.12.1 ===
--- Zope3/src/zope/app/browser/form/configure.zcml:1.22 Fri Aug 15 20:42:49 2003
+++ Zope3/src/zope/app/browser/form/configure.zcml Sun Nov 9 11:08:04 2003
@@ -135,7 +135,7 @@
<!-- Single selection -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyField"
name="display"
@@ -144,7 +144,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyField"
name="edit"
@@ -154,7 +154,7 @@
<!-- Bags -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyBagField"
name="display"
@@ -163,7 +163,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyBagField"
name="edit"
@@ -173,7 +173,7 @@
<!-- Lists -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyListField"
name="display"
@@ -182,7 +182,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyListField"
name="edit"
@@ -192,7 +192,7 @@
<!-- Sets -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularySetField"
name="display"
@@ -201,7 +201,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularySetField"
name="edit"
@@ -211,7 +211,7 @@
<!-- Unique lists -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyUniqueListField"
name="display"
@@ -220,7 +220,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IBrowserWidget"
for="zope.schema.vocabulary.IVocabularyUniqueListField"
name="edit"
@@ -230,7 +230,7 @@
<!-- Query view helpers -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IVocabularyQueryView"
for="zope.schema.interfaces.IIterableVocabularyQuery"
name="widget-query-helper"
@@ -239,7 +239,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
allowed_interface="zope.app.interfaces.browser.form.IVocabularyQueryView"
for="zope.schema.interfaces.IIterableVocabularyQuery"
name="widget-query-list-helper"
@@ -249,7 +249,7 @@
<!-- Vocabulary field display widgets -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyDisplayWidget"
name="field-display-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -257,7 +257,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyBagDisplayWidget"
name="field-display-bag-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -265,7 +265,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyListDisplayWidget"
name="field-display-list-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -273,7 +273,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyBagDisplayWidget"
name="field-display-set-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -281,7 +281,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyListDisplayWidget"
name="field-display-unique-list-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -290,7 +290,7 @@
<!-- Vocabulary edit widgets -->
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyEditWidget"
name="field-edit-widget"
for="zope.schema.interfaces.IVocabulary"
@@ -298,7 +298,7 @@
<view
permission="zope.Public"
- type="zope.publisher.interfaces.browser.IBrowserPresentation"
+ type="zope.publisher.interfaces.browser.IBrowserRequest"
factory=".vocabularywidget.VocabularyMultiEditWidget"
name="field-edit-list-widget"
for="zope.schema.interfaces.IVocabulary"
=== Zope3/src/zope/app/browser/form/editview.py 1.39 => 1.39.6.1 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.39 Tue Sep 23 21:12:59 2003
+++ Zope3/src/zope/app/browser/form/editview.py Sun Nov 9 11:08:04 2003
@@ -17,11 +17,11 @@
"""
from datetime import datetime
+from zope.app import zapi
from zope.schema import getFieldNamesInOrder
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.app.publisher.browser import BrowserView
from zope.security.checker import defineChecker, NamesChecker
-from zope.component.view import provideView
from zope.component import getAdapter
from zope.app.i18n import ZopeMessageIDFactory as _
@@ -138,4 +138,5 @@
"browserDefault", "publishTraverse"),
permission))
- provideView(for_, name, IBrowserPresentation, class_, layer)
+ s = zapi.getService(None, zapi.servicenames.Presentation)
+ s.provideView(for_, name, IBrowserRequest, class_, layer)
=== Zope3/src/zope/app/browser/form/editwizard.py 1.15 => 1.15.6.1 ===
--- Zope3/src/zope/app/browser/form/editwizard.py:1.15 Sun Sep 21 13:30:36 2003
+++ Zope3/src/zope/app/browser/form/editwizard.py Sun Nov 9 11:08:04 2003
@@ -15,15 +15,15 @@
$Id$
"""
+from zope.app import zapi
from zope.app.i18n import ZopeMessageIDFactory as _
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.component import getAdapter
from zope.app.publisher.browser.globalbrowsermenuservice import \
globalBrowserMenuService
from zope.app.pagetemplate.simpleviewclass import SimpleViewClass
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
from zope.security.checker import defineChecker, NamesChecker
-from zope.component.view import provideView
from zope.app.form.utility \
import setUpEditWidgets, getWidgetsData, applyWidgetsChanges
from zope.app.interfaces.form import WidgetInputError
@@ -231,6 +231,7 @@
NamesChecker(("__call__", "__getitem__", "browserDefault"), permission)
)
- provideView(for_, name, IBrowserPresentation, class_, layer)
+ s = zapi.getService(None, zapi.servicenames.Previous)
+ s.provideView(for_, name, IBrowserRequest, class_, layer)
=== Zope3/src/zope/app/browser/form/metaconfigure.py 1.4 => 1.4.12.1 ===
--- Zope3/src/zope/app/browser/form/metaconfigure.py:1.4 Tue Aug 12 08:47:55 2003
+++ Zope3/src/zope/app/browser/form/metaconfigure.py Sun Nov 9 11:08:04 2003
@@ -23,7 +23,7 @@
from zope.schema import getFieldNamesInOrder
from zope.app.interfaces.container import IAdding
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.app.publisher.browser.globalbrowsermenuservice import \
menuItemDirective
@@ -93,7 +93,7 @@
self.bases, self.for_, self.fields)
def _discriminator(self):
- return ('view', self.for_, self.name, IBrowserPresentation,
+ return ('view', self.for_, self.name, IBrowserRequest,
self.layer)
class Pane:
=== Zope3/src/zope/app/browser/form/schemadisplay.py 1.11 => 1.11.6.1 ===
--- Zope3/src/zope/app/browser/form/schemadisplay.py:1.11 Sun Sep 21 13:30:36 2003
+++ Zope3/src/zope/app/browser/form/schemadisplay.py Sun Nov 9 11:08:04 2003
@@ -15,12 +15,13 @@
$Id$
"""
+from zope.app import zapi
+
from zope.schema import getFieldNamesInOrder
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.publisher.interfaces.browser import IBrowserRequest
from zope.app.publisher.browser import BrowserView
from zope.security.checker import defineChecker, NamesChecker
-from zope.component.view import provideView
from zope.component import getAdapter
from zope.app.form.utility import setUpDisplayWidgets
@@ -82,4 +83,5 @@
defineChecker(class_,
NamesChecker(("__call__", "__getitem__", "browserDefault"),
permission))
- provideView(for_, name, IBrowserPresentation, class_, layer)
+ s = zapi.getService(None, zapi.servicenames.Prefix)
+ s.provideView(for_, name, IBrowserRequest, class_, layer)
=== Zope3/src/zope/app/browser/form/widget.py 1.55 => 1.55.4.1 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.55 Fri Sep 26 15:53:33 2003
+++ Zope3/src/zope/app/browser/form/widget.py Sun Nov 9 11:08:04 2003
@@ -23,6 +23,7 @@
from xml.sax.saxutils import quoteattr
from zope.app import zapi
+from zope.app.tests import ztapi
from zope.component import getService
from zope.interface import implements
from zope.proxy import removeAllProxies
@@ -49,17 +50,14 @@
a lot of machinery to support translation and views:
>>> setUp() # now we have to set up an error view...
- >>> from zope.component.view import provideView
>>> from zope.app.interfaces.form import IWidgetInputError
- >>> from zope.publisher.browser import IBrowserPresentation
>>> from zope.app.publisher.browser import BrowserView
>>> from cgi import escape
>>> class SnippetErrorView(BrowserView):
... def __call__(self):
... return escape(self.context.errors[0])
...
- >>> provideView(IWidgetInputError, 'snippet',
- ... IBrowserPresentation, SnippetErrorView)
+ >>> ztapi.browserView(IWidgetInputError, 'snippet', SnippetErrorView)
>>> from zope.publisher.browser import TestRequest
And now the tests proper...
More information about the Zope3-Checkins
mailing list