[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/Views/Browser - ZPTPageEval.py:1.1.2.5 browser.zcml:1.1.2.4 edit.pt:1.1.2.3
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:43 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/OFS/Content/ZPTPage/Views/Browser
Modified Files:
Tag: Zope-3x-branch
ZPTPageEval.py browser.zcml edit.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/Content/ZPTPage/Views/Browser/ZPTPageEval.py 1.1.2.4 => 1.1.2.5 ===
"""
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.Proxy.ContextWrapper import getWrapperContainer
-class ZPTPageEval(AttributePublisher):
-
- __implements__ = AttributePublisher.__implements__
-
- def __init__(self, zptpage):
- self._zptpage = zptpage
-
-
- def getContext(self):
- return self._zptpage
-
+class ZPTPageEval(BrowserView):
def index(self, REQUEST=None, **kw):
"""Call a Page Template"""
- template = self.getContext()
+ template = self.context
if REQUEST is not None:
REQUEST.getResponse().setHeader('content-type',
=== Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/Views/Browser/browser.zcml 1.1.2.3 => 1.1.2.4 ===
<!-- ZPT Page View Directives -->
- <browser:defaultView name="eval"
- for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
- factory=".ZPTPageEval." />
-
- <security:protectClass
- class=".ZPTPageEval."
- permission_id="Zope.View" names="index" />
-
- <browser:view name="edit"
- for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
- factory=".ZPTPageEdit." />
-
- <security:protectClass
- class=".ZPTPageEdit."
- permission_id="Zope.View" names="index, action" />
+ <browser:defaultView
+ name="index.html"
+ for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
+ />
+
+ <browser:view
+ permission="Zope.View"
+ for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
+ factory=".ZPTPageEval.">
+
+ <browser:page name="index.html" attribute="index" />
+ </browser:view>
+
+ <browser:view
+ permission="Zope.ManageContent"
+ for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
+ factory=".ZPTPageEdit." >
+ <browser:page name="editForm.html" attribute="index" />
+ <browser:page name="edit.html" attribute="action" />
+
+ </browser:view>
<!-- Registering all the field views for the browser -->
- <browser:view name="SourceFieldView"
- for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
- factory="Zope.App.OFS.Content.ZPTPage.ZPTPageFields.SourceField.
- Zope.App.Formulator.Widgets.Browser.TextAreaWidget." />
+ <browser:view
+ name="SourceFieldView"
+ for="Zope.App.OFS.Content.ZPTPage.ZPTPage.IZPTPage."
+ factory="Zope.App.OFS.Content.ZPTPage.ZPTPageFields.SourceField.
+ Zope.App.Formulator.Widgets.Browser.TextAreaWidget." />
</zopeConfigure>
=== Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/Views/Browser/edit.pt 1.1.2.2 => 1.1.2.3 ===
</div>
- <form action="action" method="post">
+ <form action="edit.html" method="post">
<table class="EditTable">
<tbody>