[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Adder.py:1.1.2.8 Contents.py:1.1.2.6 add.pt:1.1.2.3 main.pt:1.1.2.4
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:37 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/OFS/Container/Views/Browser
Modified Files:
Tag: Zope-3x-branch
Adder.py Contents.py add.pt main.pt
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/OFS/Container/Views/Browser/Adder.py 1.1.2.7 => 1.1.2.8 ===
"""
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.PageTemplate import ViewPageTemplateFile
from Zope.ComponentArchitecture import createObject
from Zope.App.OFS.Services.AddableService import getAddableContent
-from Zope.ComponentArchitecture.ContextDependent import ContextDependent
from Zope.App.OFS.Container.Exceptions import DuplicateIDError
from Zope.Proxy.ProxyIntrospection import removeAllProxies
-class ContainerAdder(AttributePublisher, ContextDependent):
+class ContainerAdder(BrowserView):
def _listAddables( self ):
"""
Derived classes override this to change the registry
in which factories are looked up.
"""
- return getAddableContent(self.getContext())
+ return getAddableContent(self.context)
def listAddableInfo( self ):
"""
@@ -45,7 +43,7 @@
"""
Instantiate an object and put it in our folder.
"""
- context = self.getContext()
+ context = self.context
if id in context.objectIds():
raise DuplicateIDError, "ID '%s' already in use." % id
@@ -61,7 +59,7 @@
if REQUEST is not None:
# for unit tests
- REQUEST.getResponse().redirect(REQUEST.URL[-2])
+ REQUEST.getResponse().redirect(REQUEST.URL[-1])
return self.confirmed( type_name=type_name, id=id )
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.1.2.5 => 1.1.2.6 ===
import os
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
-from Zope.ComponentArchitecture.ContextDependent import ContextDependent
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.PageTemplate import ViewPageTemplateFile
from Zope.App.OFS.Container.IContainer import IContainer
-class Contents(ContextDependent, AttributePublisher):
+class Contents(BrowserView):
- __implements__ = AttributePublisher.__implements__
__used_for__ = IContainer
def _extractContentInfo( self, item ):
@@ -62,14 +59,14 @@
exception).
"""
try:
- self.getContext().delObject( name )
+ self.context.delObject( name )
except KeyError:
if not silent:
raise
return self.confirmRemoved( name=name )
def listContentInfo(self):
- return map(self._extractContentInfo, self.getContext().objectItems())
+ return map(self._extractContentInfo, self.context.objectItems())
index = ViewPageTemplateFile('main.pt')
confirmRemoved = ViewPageTemplateFile('remove_confirmed.pt')
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/add.pt 1.1.2.2 => 1.1.2.3 ===
<div metal:fill-slot="body">
-<form action="action.html" method="POST">
+<form action="./view::add.html" method="POST">
<table class="TypeListing">
<caption>Add Content To Folder</caption>
=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/main.pt 1.1.2.3 => 1.1.2.4 ===
<div metal:fill-slot="body">
-<form action="" method="get">
+<form action="./view::index.html" method="get">
<table class="ContentListing">
- <caption>Folder Contents <a href="../adder;view"> Add... </a> </caption>
+ <caption>Folder Contents <a href="./view::addForm.html"> Add... </a> </caption>
<tbody>