[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser - FolderContents.py:1.1.4.2 FolderLimitEdit.py:1.1.4.2 LoadedFolderContents.py:1.1.4.2

Jim Fulton jim@zope.com
Thu, 23 May 2002 14:01:42 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv26429/lib/python/Zope/App/OFS/Content/Folder/Views/Browser

Modified Files:
      Tag: Zope-3x-branch
	FolderContents.py FolderLimitEdit.py LoadedFolderContents.py 
Log Message:
This all started with wanting to be able to use url;view in a ZPT path. :)

That lead me to:

- Massive traversal refactoring.

  Namespace handling is now centralized in Zope.App.Traversing. 

- ZPT refactoring, including some renaming that touches pretty much everything. :)

  - The application specific ZPT support was moved into
    Zope.App.PageTemplate. 

  - To get page template files (for use in views):

    from Zope.App.PageTemplate import ViewPageTemplateFile

  - Fixed up security so that ZPT expressions only have access to 
    safe builtins and so that modules namespace does imports safely.

  - Got ZPTPage working!

- renaming url to absolute_url and got absolute_url to work in paths.

- Cleaned up the (as yet unused) RestrictedInterpreter module in
  Zope.Security. In particular, changed to use a separate
  RestrictedBuiltins module.



=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderContents.py 1.1.4.1 => 1.1.4.2 ===
 import os
 
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.App.OFS.ServiceManager.ServiceManager import ServiceManager
 from Zope.App.OFS.Container.Views.Browser.Contents import Contents
 
@@ -27,6 +27,7 @@
 
     def addServiceManager(self, REQUEST=None):
         """Create a service manager then add it to the folder."""
+
         sm = ServiceManager()
         if self.getContext().hasServiceManager():
             raise 'HasServiceManager', (
@@ -35,4 +36,4 @@
         if REQUEST is not None:
             return self.index(REQUEST)
 
-    index = PageTemplateFile('contents.pt')
+    index = ViewPageTemplateFile('contents.pt')


=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/FolderLimitEdit.py 1.1.4.1 => 1.1.4.2 ===
 
 from Zope.App.Formulator.Form import Form
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.App.PageTemplate import ViewPageTemplateFile
 
 
 class FolderLimitEdit(Form):
@@ -30,7 +30,7 @@
 
     _fieldViewNames = ['LimitFieldView']
 
-    template = PageTemplateFile('limit.pt')  
+    template = ViewPageTemplateFile('limit.pt')  
 
 
 class FolderLimitXULEdit(Form):
@@ -43,4 +43,4 @@
 
     _fieldViewNames = ['XULLimitFieldView']
 
-    template = PageTemplateFile('limit_xul.pt')
+    template = ViewPageTemplateFile('limit_xul.pt')


=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/LoadedFolderContents.py 1.1.4.1 => 1.1.4.2 ===
 """
 
-from Zope.PageTemplate.PageTemplateFile import PageTemplateFile
+from Zope.App.PageTemplate import ViewPageTemplateFile
 from FolderContents import FolderContents
 
 
 class LoadedFolderContents( FolderContents ):
 
-    index = PageTemplateFile( 'loaded_folder_contents.pt' )
+    index = ViewPageTemplateFile( 'loaded_folder_contents.pt' )
 
 
     # OrderedFolder functionality