[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/File/Views/Browser - FileView.py:1.1.2.3.12.2 browser.zcml:1.1.2.3.2.1

Jim Fulton jim@zope.com
Sun, 2 Jun 2002 10:35:17 -0400


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

Modified Files:
      Tag: Zope3InWonderland-branch
	FileView.py browser.zcml 
Log Message:
- Added template attribute to allow views to be created from a
  template source file.

- Added beginnings of a Zope debugger. This required seperating site
  and server configuration.

- Added the ability to specify a config file package in the
  zopeConfigure directive. Made "config.zcml" a default for the file
  attribute in the include directive.

- Fixed mapply to unwrap proxied objects. This was necessary once
  views became wrapped in proxies. We need to investigate why they
  weren't being wrapped before. 

- I updated enough system page templates and zcml directives so that:

  - Zope now starts. :)

  - The root folder contents listing can be viewed.

  Many more templates and zcml files need to be updated to reflect the
  way views are now handled.



=== Zope3/lib/python/Zope/App/OFS/Content/File/Views/Browser/FileView.py 1.1.2.3.12.1 => 1.1.2.3.12.2 ===
 class FileView(BrowserView):
 
-    def index(self, REQUEST=None):
+    def __call__(self):
         """Call the File"""
-        if REQUEST is not None:
-            REQUEST.getResponse().setHeader('Content-Type',
+        request = self.request
+        if request is not None:
+            request.getResponse().setHeader('Content-Type',
                                        self.context.getContentType())
-            REQUEST.getResponse().setHeader('Content-Length',
+            request.getResponse().setHeader('Content-Length',
                                        self.context.getSize())
 
         return self.context.getData()


=== Zope3/lib/python/Zope/App/OFS/Content/File/Views/Browser/browser.zcml 1.1.2.3 => 1.1.2.3.2.1 ===
   <!-- File View Directives -->
 
-  <browser:defaultView name="view"
+  <browser:defaultView 
+    name="view"
     for="Zope.App.OFS.Content.File.IFile."
+    permission_id="Zope.View"
     factory=".FileView." />
 
-  <security:protectClass 
-    class=".FileView."
-    permission_id="Zope.View" names="index" />
-
   <browser:view name="edit"
     for="Zope.App.OFS.Content.File.IFile."
-    factory=".FileEdit." />
+    permission_id="Zope.View"
+    factory=".FileEdit.">
 
-  <security:protectClass 
-    class=".FileEdit."
-    permission_id="Zope.View" names="index, action" />
+    <browser:page name="editForm.html" attribute="index" />
+    <browser:page name="edit.html" attribute="action" />
 
+  </browser:view>
 
   <!-- Registering all the field views for the browser -->