[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Formulator/Widgets/XUL - TextWidget.py:1.1.4.3 XULWidget.py:1.1.4.4 xul.zcml:1.1.4.4

Jim Fulton jim@zope.com
Fri, 7 Jun 2002 10:41:30 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Formulator/Widgets/XUL
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/Formulator/Widgets/XUL

Modified Files:
      Tag: Zope-3x-branch
	TextWidget.py XULWidget.py xul.zcml 
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals): 
- RenameAllowToRequire

- GroupClassRelatedDirectivesInClassDirective

- ViewInterfaceAndSimplification

- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes

- TwoArgumentViewConstructors

- ImplementsInZCML

- SimpleViewCreationInZCML

- RemoveGetView

- ReplaceProtectWithAllow

- ViewMethodsAsViews

- MergeProtectionAndComponentDefinitions

There were also various security fixes resulting of better integration
of security with components.


=== Zope3/lib/python/Zope/App/Formulator/Widgets/XUL/TextWidget.py 1.1.4.2 => 1.1.4.3 ===
         if displayMaxWidth > 0:
             return renderElement(self.getValue('tag'),
-                                 id = self.getContext().id,
+                                 id = self.context.id,
                                  value = self._getValueToInsert(REQUEST),
                                  cssClass = self.getValue('cssClass'),
                                  maxlength = displayMaxWidth,
                                  extra = self.getValue('extra'))
         else:
             return renderElement(self.getValue('tag'),
-                                 id = self.getContext().id,
+                                 id = self.context.id,
                                  value = self._getValueToInsert(REQUEST),
                                  cssClass = self.getValue('cssClass'),
                                  extra = self.getValue('extra'))


=== Zope3/lib/python/Zope/App/Formulator/Widgets/XUL/XULWidget.py 1.1.4.3 => 1.1.4.4 ===
     def getValueFromRequest(self, REQUEST):
         """ """
-        return REQUEST.get('field_'+self.getContext().id, None)
+        return REQUEST.get('field_'+self.context.id, None)
 
 
     def _getValueToInsert(self, REQUEST):
         """ """
-        field = self.getContext()
+        field = self.context
         if REQUEST and REQUEST.has_key('field_'+field.id):
             return REQUEST['field_'+field.id]
         else:
@@ -61,7 +61,7 @@
         """
         return renderElement(self.getValue('tag'),
                              type = self.getValue('type'),
-                             name = self.getContext().id,
+                             name = self.context.id,
                              value = self._getValueToInsert(REQUEST),
                              cssClass = self.getValue('cssClass'),
                              extra = self.getValue('extra'))
@@ -72,7 +72,7 @@
         """
         return renderElement(self.getValue('tag'),
                              type = 'hidden',
-                             name = self.getContext().id,
+                             name = self.context.id,
                              value = self._getValueToInsert(REQUEST),
                              cssClass = self.getValue('cssClass'),
                              extra = self.getValue('extra'))


=== Zope3/lib/python/Zope/App/Formulator/Widgets/XUL/xul.zcml 1.1.4.3 => 1.1.4.4 ===
 >
 
-  <security:protectClass 
-    class="Zope.App.Formulator.Widgets.XUL.TextWidget."
-    permission_id="Zope.ManageContent" 
-    names="render, getContext" />
-
+  <content class=".TextWidget.">
+    <security:require    
+        permission="Zope.ManageContent" 
+        attributes="render getContext" />
+  </content>
 </zopeConfigure>