[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/XUL - Main.py:1.1.4.2.4.1 SetLimit.py:1.1.4.2.4.1 Tree.py:1.1.4.2.4.1
Jim Fulton
jim@zope.com
Wed, 29 May 2002 11:10:11 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/XUL
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/OFS/Content/Folder/Views/XUL
Modified Files:
Tag: Zope3InWonderland-branch
Main.py SetLimit.py Tree.py
Log Message:
- Added permission_id attribute to adapter and utility directives.
- Got rid of old getView, getResource, and getDefaultViewName.
Renamed getRequestView to getView (and so on).
Changed view interface to use context, rather than getContext.
Introduced notion of presentation types (e.g. IBrowserPresentation,
which is cleaner than IBrowserPublisher).
- Began converting to get/queryFoo, which is much nicer.
- Many formatting fixups.
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/XUL/Main.py 1.1.4.2 => 1.1.4.2.4.1 ===
from Zope.App.PageTemplate import ViewPageTemplateFile
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.OFS.IContainer import IReadContainer
-class Main(AttributePublisher):
+class Main(BrowserView):
""" """
-
- __implements__ = AttributePublisher.__implements__
-
-
- def __init__(self, context):
- """Initialize form.
- """
- self._context = context
-
-
- def getContext(self):
- """ """
- return self._context
-
index = ViewPageTemplateFile('main.pt')
menu = ViewPageTemplateFile('menu.pt')
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/XUL/SetLimit.py 1.1.4.2 => 1.1.4.2.4.1 ===
def action(self, limit):
''' '''
- self.getContext().setLimit(int(limit))
+ self.context.setLimit(int(limit))
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/XUL/Tree.py 1.1.4.2 => 1.1.4.2.4.1 ===
from Zope.App.PageTemplate import ViewPageTemplateFiley
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.OFS.IContainer import IReadContainer
-class Tree(AttributePublisher):
+class Tree(BrowserView):
""" """
- __implements__ = AttributePublisher.__implements__
-
-
- def __init__(self, context):
- """Initialize form.
- """
- self._context = context
-
-
def _makeSubTree(self, base, prefix=''):
""" """
rdf = ''
@@ -45,7 +36,9 @@
rdf += _node_description %fillIn + '\n\n'
# now we add the link to the base
- local_links += '''<RDF:li resource="urn:explorer%(rdf_url)s"/>\n''' %fillIn
+ local_links += (
+ '''<RDF:li resource="urn:explorer%(rdf_url)s"/>\n'''
+ % fillIn)
if IReadContainer.isImplementedBy(item[1]):
rdf += self._makeSubTree(item[1], fillIn['rdf_url'])
@@ -63,15 +56,10 @@
def getRDFTree(self, REQUEST=None):
''' '''
rdf = _rdf_start
- rdf += self._makeSubTree(self.getContext(), '')
+ rdf += self._makeSubTree(self.context, '')
rdf += _rdf_end
REQUEST.response.setHeader('Content-Type', 'text/xml')
return rdf
-
-
- def getContext(self):
- """ """
- return self._context