[Zope3-checkins] CVS: Products3/demo/messageboard/step5/browser -
configure.zcml:1.3 message.py:1.2
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Aug 21 15:40:52 EDT 2003
Update of /cvs-repository/Products3/demo/messageboard/step5/browser
In directory cvs.zope.org:/tmp/cvs-serv24801/step5/browser
Modified Files:
configure.zcml message.py
Log Message:
Updated Step 5
=== Products3/demo/messageboard/step5/browser/configure.zcml 1.2 => 1.3 ===
--- Products3/demo/messageboard/step5/browser/configure.zcml:1.2 Sun Aug 3 14:34:54 2003
+++ Products3/demo/messageboard/step5/browser/configure.zcml Thu Aug 21 14:40:22 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="zopeproducts.messageboard.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"
@@ -113,10 +122,10 @@
menu="zmi_views" title="Thread"/>
<browser:menuItem
- menu="add_message"
- for="zope.app.interfaces.container.IAdding"
- action="AddMessage"
- title="Message"/>
+ menu="add_message"
+ for="zope.app.interfaces.container.IAdding"
+ action="AddMessage"
+ title="Message"/>
<browser:menuItem
menu="add_message"
@@ -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/step5/browser/message.py 1.1 => 1.2 ===
--- Products3/demo/messageboard/step5/browser/message.py:1.1 Tue Jun 10 17:49:50 2003
+++ Products3/demo/messageboard/step5/browser/message.py Thu Aug 21 14:40:22 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