[Zope3-checkins] CVS: Products3/demo/messageboard/step2/browser -
configure.zcml:1.4 message.py:1.2
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Aug 20 15:03:30 EDT 2003
Update of /cvs-repository/Products3/demo/messageboard/step2/browser
In directory cvs.zope.org:/tmp/cvs-serv30024/step2/browser
Modified Files:
configure.zcml message.py
Log Message:
Updated Step 2.
=== Products3/demo/messageboard/step2/browser/configure.zcml 1.3 => 1.4 ===
--- Products3/demo/messageboard/step2/browser/configure.zcml:1.3 Sun Aug 3 14:34:36 2003
+++ Products3/demo/messageboard/step2/browser/configure.zcml Wed Aug 20 14:02:59 2003
@@ -1,8 +1,6 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- i18n_domain="messageboard"
- >
+ xmlns:browser="http://namespaces.zope.org/browser">
<!-- IMessageBoard Views -->
@@ -40,6 +38,14 @@
menu="zmi_views" title="Edit" />
<browser:page
+ name="contents.html"
+ for="zopeproducts.messageboard.interfaces.IMessageBoard"
+ permission="zope.ManageContent"
+ class="zope.app.browser.container.contents.Contents"
+ attribute="contents"
+ menu="zmi_views" title="Contents"/>
+
+ <browser:page
name="thread.html"
for="zopeproducts.messageboard.interfaces.IMessageBoard"
class=".thread.Thread"
@@ -47,11 +53,6 @@
permission="zope.View"
menu="zmi_views" title="Thread"/>
- <browser:menuItems menu="zmi_views"
- for="zopeproducts.messageboard.interfaces.IMessageBoard">
- <browser:menuItem title="Contents" action="@@contents.html" />
- </browser:menuItems>
-
<browser:defaultView
for="zopeproducts.messageboard.interfaces.IMessageBoard"
name="thread.html"/>
@@ -97,6 +98,14 @@
menu="zmi_views" title="Edit" />
<browser:page
+ name="contents.html"
+ for="zopeproducts.messageboard.interfaces.IMessage"
+ permission="zope.ManageContent"
+ class="zope.app.browser.container.contents.Contents"
+ attribute="contents"
+ menu="zmi_views" title="Contents"/>
+
+ <browser:page
name="details.html"
for="zopeproducts.messageboard.interfaces.IMessage"
class=".message.MessageDetails"
@@ -129,11 +138,6 @@
for="zope.app.interfaces.container.IAdding"
action="File"
title="File" />
-
- <browser:menuItems menu="zmi_views"
- for="zopeproducts.messageboard.interfaces.IMessage">
- <browser:menuItem title="Contents" action="@@contents.html" />
- </browser:menuItems>
<browser:defaultView
for="zopeproducts.messageboard.interfaces.IMessage"
=== Products3/demo/messageboard/step2/browser/message.py 1.1 => 1.2 ===
--- Products3/demo/messageboard/step2/browser/message.py:1.1 Sun Jun 8 20:45:19 2003
+++ Products3/demo/messageboard/step2/browser/message.py Wed Aug 20 14:02:59 2003
@@ -18,8 +18,7 @@
from zope.app.interfaces.dublincore import ICMFDublinCore
from zopeproducts.messageboard.interfaces import IMessage
-from zope.component import getAdapter
-from zope.app.traversing import getParent, objectName
+from zope.app import zapi
from zope.app.browser.container.adding import Adding
@@ -27,26 +26,26 @@
def author(self):
"""Get user who last modified the Wiki Page."""
- creators = getAdapter(self.context, ICMFDublinCore).creators
+ creators = zapi.getAdapter(self.context, ICMFDublinCore).creators
if not creators:
return 'unknown'
return creators[0]
def modified(self):
"""Get last modification date."""
- date = getAdapter(self.context, ICMFDublinCore).modified
+ date = zapi.getAdapter(self.context, ICMFDublinCore).modified
if date is None:
- date = getAdapter(self.context, ICMFDublinCore).created
+ date = zapi.getAdapter(self.context, ICMFDublinCore).created
if date is None:
return ''
return date.strftime('%d/%m/%Y %H:%M:%S')
def parent_info(self):
"""Get the parent of the message"""
- parent = getParent(self.context)
+ parent = zapi.getParent(self.context)
if not IMessage.isImplementedBy(parent):
return None
- return {'name': objectName(parent), 'title': parent.title}
+ return {'name': zapi.name(parent), 'title': parent.title}
class MessageAdding(Adding):
More information about the Zope3-Checkins
mailing list