[Zope-Checkins] SVN: Products.Five/branches/philikon-viewzpt-refactor/ New name (ViewPageTemplateFile instead of ZopeTwoPageTemplateFile)

Philipp von Weitershausen philikon at philikon.de
Sat Jun 10 14:51:29 EDT 2006


Log message for revision 68577:
  New name (ViewPageTemplateFile instead of ZopeTwoPageTemplateFile)
  

Changed:
  U   Products.Five/branches/philikon-viewzpt-refactor/browser/adding.py
  U   Products.Five/branches/philikon-viewzpt-refactor/browser/metaconfigure.py
  U   Products.Five/branches/philikon-viewzpt-refactor/form/__init__.py
  U   Products.Five/branches/philikon-viewzpt-refactor/form/metaconfigure.py
  U   Products.Five/branches/philikon-viewzpt-refactor/formlib/configure.zcml
  U   Products.Five/branches/philikon-viewzpt-refactor/formlib/formbase.py
  U   Products.Five/branches/philikon-viewzpt-refactor/formlib/tests/view.py
  U   Products.Five/branches/philikon-viewzpt-refactor/viewlet/README.txt
  U   Products.Five/branches/philikon-viewzpt-refactor/viewlet/manager.py
  U   Products.Five/branches/philikon-viewzpt-refactor/viewlet/viewlet.py

-=-
Modified: Products.Five/branches/philikon-viewzpt-refactor/browser/adding.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/browser/adding.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/browser/adding.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -37,10 +37,9 @@
 from zExceptions import BadRequest
 from OFS.SimpleItem import SimpleItem
 
-from Products.Five import BrowserView
+from Products.Five.browser import BrowserView
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
-
 class BasicAdding(Implicit, BrowserView):
     implements(IAdding, IPublishTraverse)
 
@@ -162,7 +161,7 @@
 class Adding(BasicAdding):
 
     menu_id = None
-    index = ZopeTwoPageTemplateFile("adding.pt")
+    index = ViewPageTemplateFile("adding.pt")
 
     def addingInfo(self):
         """Return menu data.

Modified: Products.Five/branches/philikon-viewzpt-refactor/browser/metaconfigure.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/browser/metaconfigure.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/browser/metaconfigure.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -38,7 +38,7 @@
 from Products.Five.browser.resource import ImageResourceFactory
 from Products.Five.browser.resource import PageTemplateResourceFactory
 from Products.Five.browser.resource import DirectoryResourceFactory
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.Five.metaclass import makeClass
 from Products.Five.security import getSecurityInfo, protectClass, protectName
 
@@ -170,7 +170,7 @@
 
         for pname, attribute, template in self.pages:
             if template:
-                cdict[pname] = ZopeTwoPageTemplateFile(template)
+                cdict[pname] = ViewPageTemplateFile(template)
                 if attribute and attribute != name:
                     cdict[attribute] = cdict[pname]
             else:
@@ -408,7 +408,7 @@
     # XXX needs to deal with security from the bases?
     if cdict is None:
         cdict = {}
-    cdict.update({'index': ZopeTwoPageTemplateFile(filename, globals),
+    cdict.update({'index': ViewPageTemplateFile(filename, globals),
                   '__name__': name})
     bases += (ViewMixinForTemplates,)
     class_ = makeClass("SimpleViewClass from %s" % filename, bases, cdict)

Modified: Products.Five/branches/philikon-viewzpt-refactor/form/__init__.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/form/__init__.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/form/__init__.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -37,7 +37,7 @@
 
 from Products.Five.browser import BrowserView
 from Products.Five.browser.decode import processInputs, setPageEncoding
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
 class EditView(BrowserView):
     """Simple edit-view base class
@@ -54,7 +54,7 @@
     # Fall-back field names computes from schema
     fieldNames = property(lambda self: getFieldNamesInOrder(self.schema))
     # Fall-back template
-    generated_form = ZopeTwoPageTemplateFile('edit.pt')
+    generated_form = ViewPageTemplateFile('edit.pt')
 
     def __init__(self, context, request):
         BrowserView.__init__(self, context, request)

Modified: Products.Five/branches/philikon-viewzpt-refactor/form/metaconfigure.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/form/metaconfigure.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/form/metaconfigure.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -31,7 +31,7 @@
 from Products.Five.form import EditView, AddView
 from Products.Five.metaclass import makeClass
 from Products.Five.security import protectClass
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.Five.browser.metaconfigure import makeClassForTemplate
 
 def EditViewFactory(name, schema, label, permission, layer,
@@ -49,7 +49,7 @@
 
     class_.fulledit_label = fulledit_label
 
-    class_.generated_form = ZopeTwoPageTemplateFile(default_template)
+    class_.generated_form = ViewPageTemplateFile(default_template)
 
     if layer is None:
         layer = IDefaultBrowserLayer
@@ -112,7 +112,7 @@
     class_._set_before_add = set_before_add
     class_._set_after_add = set_after_add
 
-    class_.generated_form = ZopeTwoPageTemplateFile(default_template)
+    class_.generated_form = ViewPageTemplateFile(default_template)
 
     if layer is None:
         layer = IDefaultBrowserLayer

Modified: Products.Five/branches/philikon-viewzpt-refactor/formlib/configure.zcml
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/formlib/configure.zcml	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/formlib/configure.zcml	2006-06-10 18:51:27 UTC (rev 68577)
@@ -1,6 +1,3 @@
-<configure
-    xmlns="http://namespaces.zope.org/zope"
-    xmlns:zc="http://namespaces.zope.com/zc"
-    i18n_domain="zope.formlib">
-  <adapter factory="zope.formlib.form.render_submit_button" name="render" />
+<configure xmlns="http://namespaces.zope.org/zope">
+  <include package="zope.formlib" />
 </configure>

Modified: Products.Five/branches/philikon-viewzpt-refactor/formlib/formbase.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/formlib/formbase.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/formlib/formbase.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -25,22 +25,21 @@
 from zope.i18nmessageid import MessageFactory
 _ = MessageFactory("zope")
 
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 from Products.Five.browser.decode import processInputs, setPageEncoding
 
 class FiveFormlibMixin(Acquisition.Explicit):
-
     # Overrides the formlib.form.FormBase.template attributes implemented 
     # using NamedTemplates. NamedTemplates using ViewPageTemplateFile (like
     # formlib does by default) cannot work in Zope2.
-    
+
     # XXX Maybe we need to have Five-compatible NamedTemplates?
-    
-    template = ZopeTwoPageTemplateFile('pageform.pt')
-    
+
+    template = ViewPageTemplateFile('pageform.pt')
+
     # Overrides formlib.form.FormBase.update. Make sure user input is
     # decoded first and the page encoding is set before proceeding.
-    
+
     def update(self):
         processInputs(self.request)
         setPageEncoding(self.request)
@@ -53,7 +52,7 @@
 
     # Overrides formlib.form.EditFormBase.handle_edit_action, to remove
     # dependecy on request.locale
-    
+
     @form.action(_("Apply"), condition=form.haveInputWidgets)
     def handle_edit_action(self, action, data):
         if form.applyChanges(
@@ -69,51 +68,41 @@
                 )
         else:
             self.status = _('No changes')
-    
+
 class DisplayFormBase(FiveFormlibMixin, form.DisplayFormBase):
     pass
 
 class AddFormBase(FiveFormlibMixin, form.AddFormBase):
     pass
-    
-class PageForm(FormBase):
 
+class PageForm(FormBase):
     interface.implements(interfaces.IPageForm)
 
 Form = PageForm
 
 class PageEditForm(EditFormBase):
-
     interface.implements(interfaces.IPageForm)
 
 EditForm = PageEditForm
 
 class PageDisplayForm(DisplayFormBase):
-
     interface.implements(interfaces.IPageForm)
 
 DisplayForm = PageDisplayForm
 
 class PageAddForm(AddFormBase):
-
     interface.implements(interfaces.IPageForm)
 
 AddForm = PageAddForm
 
 class SubPageForm(FormBase):
-
-    template = ZopeTwoPageTemplateFile('subpageform.pt')
-    
     interface.implements(interfaces.ISubPageForm)
+    template = ViewPageTemplateFile('subpageform.pt')
 
 class SubPageEditForm(EditFormBase):
-
-    template = ZopeTwoPageTemplateFile('subpageform.pt')
-    
     interface.implements(interfaces.ISubPageForm)
+    template = ViewPageTemplateFile('subpageform.pt')
 
 class SubPageDisplayForm(DisplayFormBase):
-
-    template = ZopeTwoPageTemplateFile('subpageform.pt')
-    
     interface.implements(interfaces.ISubPageForm)
+    template = ViewPageTemplateFile('subpageform.pt')

Modified: Products.Five/branches/philikon-viewzpt-refactor/formlib/tests/view.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/formlib/tests/view.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/formlib/tests/view.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -19,7 +19,7 @@
 
 from Products.Five.browser import BrowserView
 from Products.Five.formlib.formbase import AddForm, EditForm, Form
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
 from Products.Five.formlib.tests.content import IContent, Content
 

Modified: Products.Five/branches/philikon-viewzpt-refactor/viewlet/README.txt
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/viewlet/README.txt	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/viewlet/README.txt	2006-06-10 18:51:27 UTC (rev 68577)
@@ -526,10 +526,10 @@
 From the two pieces above, we can generate the final viewlet manager class and
 register it (it's a bit tedious, I know):
 
-  >>> from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+  >>> from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
   >>> ContentsViewletManager = type(
   ...     'ContentsViewletManager', (ContentsViewletManager,),
-  ...     {'index': ZopeTwoPageTemplateFile('table.pt', temp_dir)})
+  ...     {'index': ViewPageTemplateFile('table.pt', temp_dir)})
 
   >>> zope.component.provideAdapter(
   ...     ContentsViewletManager,
@@ -811,7 +811,7 @@
 
   >>> SortedContentsViewletManager = type(
   ...     'SortedContentsViewletManager', (SortedContentsViewletManager,),
-  ...     {'index': ZopeTwoPageTemplateFile('table.pt', temp_dir)})
+  ...     {'index': ViewPageTemplateFile('table.pt', temp_dir)})
 
   >>> zope.component.provideAdapter(
   ...     SortedContentsViewletManager,

Modified: Products.Five/branches/philikon-viewzpt-refactor/viewlet/manager.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/viewlet/manager.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/viewlet/manager.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -5,7 +5,7 @@
 from zope.viewlet import interfaces
 from zope.viewlet.manager import ViewletManagerBase as origManagerBase
 
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
 
 class ViewletManagerBase(origManagerBase, Acquisition.Explicit):
@@ -48,7 +48,7 @@
 def ViewletManager(name, interface, template=None, bases=()):
 
     if template is not None:
-        template = ZopeTwoPageTemplateFile(template)
+        template = ViewPageTemplateFile(template)
 
     if ViewletManagerBase not in bases:
         # Make sure that we do not get a default viewlet manager mixin, if the

Modified: Products.Five/branches/philikon-viewzpt-refactor/viewlet/viewlet.py
===================================================================
--- Products.Five/branches/philikon-viewzpt-refactor/viewlet/viewlet.py	2006-06-10 18:50:36 UTC (rev 68576)
+++ Products.Five/branches/philikon-viewzpt-refactor/viewlet/viewlet.py	2006-06-10 18:51:27 UTC (rev 68577)
@@ -3,7 +3,7 @@
 from zope.viewlet import interfaces
 from zope.viewlet import viewlet as orig_viewlet
 
-from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
 # We add Acquisition to all the base classes to enable security machinery
 class ViewletBase(orig_viewlet.ViewletBase, Explicit):
@@ -25,7 +25,7 @@
     # Create the base class hierarchy
     bases += (simple, ViewletBase)
 
-    attrs = {'index' : ZopeTwoPageTemplateFile(template),
+    attrs = {'index' : ViewPageTemplateFile(template),
              '__name__' : name}
     if attributes:
         attrs.update(attributes)
@@ -45,7 +45,7 @@
 
     klass = type('JavaScriptViewlet',
                  (ResourceViewletBase, ViewletBase),
-                  {'index': ZopeTwoPageTemplateFile(src),
+                  {'index': ViewPageTemplateFile(src),
                    '_path': path})
 
     return klass
@@ -60,7 +60,7 @@
 
     klass = type('CSSViewlet',
                  (CSSResourceViewletBase, ViewletBase),
-                  {'index': ZopeTwoPageTemplateFile(src),
+                  {'index': ViewPageTemplateFile(src),
                    '_path': path,
                    '_media':media,
                    '_rel':rel})



More information about the Zope-Checkins mailing list