[Zope3-checkins] CVS: Zope3/src/zope/app/browser/utilities - configure.zcml:1.13 content.py:1.6 schema.py:1.6

Garrett Smith garrett at mojave-corp.com
Fri Mar 5 23:17:52 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/browser/utilities
In directory cvs.zope.org:/tmp/cvs-serv15646/src/zope/app/browser/utilities

Modified Files:
	configure.zcml content.py schema.py 
Log Message:
Merged changes from garrett-widgets2-branch:

- Changed the way widgets are looked up to use interfaces instead of 
  names.
  
- Refactor of zope/app/form/utility.py -- see 

    http://dev.zope.org/Zope3/WidgetsAndMultiwayAdapters
    
  for details.
  
- Moved configuration of vocab widgets to its own zcml file
  (zope/app/browser/form/vocabularywidget.zcml).

- Removed 'propertyNames' and 'getValue' from widgets. This  is replaced
  by accessing the widget attributes directly.
  
- Deleted depreated methods from widget interface: haveData and getData.


=== Zope3/src/zope/app/browser/utilities/configure.zcml 1.12 => 1.13 ===
--- Zope3/src/zope/app/browser/utilities/configure.zcml:1.12	Wed Mar  3 05:38:38 2004
+++ Zope3/src/zope/app/browser/utilities/configure.zcml	Fri Mar  5 23:17:21 2004
@@ -98,30 +98,39 @@
 
   <!-- Widgets for the MutableSchemaField -->
 
-  <page
-      class="zope.app.browser.component.interfacewidget.InterfaceWidget"
+  <zope:view
       for="zope.app.interfaces.utilities.schema.IMutableSchemaField"
-      name="edit"
-      permission="zope.Public" />
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.app.interfaces.form.IInputWidget"
+      factory="zope.app.browser.component.interfacewidget.InterfaceWidget"
+      permission="zope.Public"
+      />
 
-  <page
-      class="zope.app.browser.component.interfacewidget.InterfaceDisplayWidget"
+  <zope:view
       for="zope.app.interfaces.utilities.schema.IMutableSchemaField"
-      name="display"
-      permission="zope.Public" />
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.app.interfaces.form.IDisplayWidget"
+      factory="
+           zope.app.browser.component.interfacewidget.InterfaceDisplayWidget"
+      permission="zope.Public"
+      />
 
-  <page
-      class="zope.app.browser.component.interfacewidget.MultiInterfaceWidget"
+  <zope:view
       for="zope.app.interfaces.utilities.schema.IMutableSchemasField"
-      name="edit"
-      permission="zope.Public" />
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.app.interfaces.form.IInputWidget"
+      factory="zope.app.browser.component.interfacewidget.MultiInterfaceWidget"
+      permission="zope.Public"
+      />
 
-  <page
-      class="
-      zope.app.browser.component.interfacewidget.MultiInterfaceDisplayWidget"
+  <zope:view
       for="zope.app.interfaces.utilities.schema.IMutableSchemasField"
-      name="display"
-      permission="zope.Public" />
+      type="zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.app.interfaces.form.IDisplayWidget"
+      factory="
+      zope.app.browser.component.interfacewidget.MultiInterfaceDisplayWidget"
+      permission="zope.Public"
+      />
 
   <editform
      schema="zope.app.utilities.interfaces.IMutableSchemaContent"


=== Zope3/src/zope/app/browser/utilities/content.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/utilities/content.py:1.5	Wed Mar  3 05:38:38 2004
+++ Zope3/src/zope/app/browser/utilities/content.py	Fri Mar  5 23:17:21 2004
@@ -21,6 +21,7 @@
 from zope.app.browser.form.editview import EditView
 from zope.app.browser.form.submit import Update
 from zope.app.form.utility import setUpWidget
+from zope.app.interfaces.form import IInputWidget
 from zope.app.interfaces.utilities.content import IContentComponentDefinition
 from zope.app.security.permission import PermissionField
 from zope.app.services.servicenames import Utilities
@@ -53,7 +54,8 @@
                 title=u"Accessor Permission",
                 default=CheckerPublic,
                 required=False)
-            setUpWidget(self, name+'_get_perm', permField, value=get_perm)
+            setUpWidget(self, name+'_get_perm', permField, IInputWidget,
+                        value=get_perm)
 
             # Create the Mutator Permission Widget for this field
             permField = PermissionField(
@@ -61,7 +63,8 @@
                 title=u"Mutator Permission",
                 default=CheckerPublic,
                 required=False)
-            setUpWidget(self, name+'_set_perm', permField, value=set_perm)
+            setUpWidget(self, name+'_set_perm', permField, IInputWidget,
+                        value=set_perm)
 
     def update(self):
         status = ''


=== Zope3/src/zope/app/browser/utilities/schema.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/utilities/schema.py:1.5	Wed Nov 12 13:46:30 2003
+++ Zope3/src/zope/app/browser/utilities/schema.py	Fri Mar  5 23:17:21 2004
@@ -83,5 +83,5 @@
         adapted = zapi.getAdapter(self.context, self.schema)
         if adapted is not self.context:
             adapted.__parent__ = self.context
-        setUpEditWidgets(self, self.schema, names=self.fieldNames,
-                         content=self.adapted)
+        setUpEditWidgets(self, self.schema, source=self.adapted,
+                         names=self.fieldNames)




More information about the Zope3-Checkins mailing list