[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/Views/Browser - GenericCreatorView.py:1.1.4.5 browser.zcml:1.1.4.4
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:50 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/ZMI/Views/Browser
Modified Files:
Tag: Zope-3x-branch
GenericCreatorView.py browser.zcml
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/ZMI/Views/Browser/GenericCreatorView.py 1.1.4.4 => 1.1.4.5 ===
#
##############################################################################
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.PageTemplate import ViewPageTemplateFile
from Zope.App.ZMI.IGenericCreatorMarker import IGenericCreatorMarker
from Zope.Proxy.ContextWrapper import getWrapperContext
from Zope.App.OFS.Container.Exceptions import DuplicateIDError
from Zope.ComponentArchitecture import createObject
-class GenericCreatorView(AttributePublisher):
+class GenericCreatorView(BrowserView):
"""Provide an interface for editing a contact
"""
- # Boiler plate
- def __init__(self, context):
- self._context=context
-
- def getContext(self):
- return self._context
-
# Assert that we can only be applied to IGenericCreatorMarker
__used_for__=IGenericCreatorMarker
@@ -40,7 +33,7 @@
"""Create an item of the class identified by the Addable (held
in _context) within the container that is the parent of the
Addable"""
- addable=self.getContext()
+ addable=self.context
container=getWrapperContext(addable)
if name in container.objectIds():
=== Zope3/lib/python/Zope/App/ZMI/Views/Browser/browser.zcml 1.1.4.3 => 1.1.4.4 ===
>
- <browser:defaultView name="simple_create"
- for="Zope.App.ZMI.IGenericCreatorMarker."
- factory=".GenericCreatorView." />
+ <browser:defaultView
+ for="Zope.App.ZMI.IGenericCreatorMarker."
+ name="simple_createForm.html"
+ />
- <security:protectClass class=".GenericCreatorView."
- permission_id="Zope.View"
- names="index, action" />
+ <browser:view
+ permission="Zope.View"
+ for="Zope.App.ZMI.IGenericCreatorMarker."
+ factory=".GenericCreatorView.">
+
+ <browser:page name="simple_createForm.html" attribute="index" />
+ <browser:page name="simple_create.html" attribute="action" />
+
+ </browser:view>
</zopeConfigure>