[Zope3-checkins] CVS: Products3/demo/messageboard/step6/browser - configure.zcml:1.3 message.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 21 15:46:30 EDT 2003


Update of /cvs-repository/Products3/demo/messageboard/step6/browser
In directory cvs.zope.org:/tmp/cvs-serv28812/step6/browser

Modified Files:
	configure.zcml message.py 
Log Message:
Updated Step 6


=== Products3/demo/messageboard/step6/browser/configure.zcml 1.2 => 1.3 ===
--- Products3/demo/messageboard/step6/browser/configure.zcml:1.2	Sun Aug  3 14:34:58 2003
+++ Products3/demo/messageboard/step6/browser/configure.zcml	Thu Aug 21 14:45:59 2003
@@ -40,6 +40,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 +55,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 +100,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 +140,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/step6/browser/message.py 1.1 => 1.2 ===
--- Products3/demo/messageboard/step6/browser/message.py:1.1	Thu Jul 10 16:33:57 2003
+++ Products3/demo/messageboard/step6/browser/message.py	Thu Aug 21 14:45: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,16 +26,16 @@
 
     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 ''
         formatter = self.request.locale.getDateTimeFormatter('medium')
@@ -44,10 +43,10 @@
 
     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