[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - error.zcml:1.1 configure.zcml:1.81 error.py:1.8

Anthony Baxter anthony at interlink.com.au
Sun Feb 8 21:09:03 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv16595

Modified Files:
	configure.zcml error.py 
Added Files:
	error.zcml 
Log Message:
zmi_actions menu now has an 'Errors' entry in all places that takes you
to the error log. Woo hoo!


=== Added File Zope3/src/zope/app/browser/services/error.zcml ===
<zope:configure
    xmlns:zope="http://namespaces.zope.org/zope"
    xmlns="http://namespaces.zope.org/browser">

  <pages
      for="*"
      permission="zope.ManageContent"
      class="zope.app.browser.services.error.ErrorRedirect" >

    <page name="errorRedirect.html" attribute="action" />
  </pages>

  <menuItem
      for="*"
      menu="zmi_actions"
      title="Errors"
      action="@@errorRedirect.html" />

</zope:configure>



=== Zope3/src/zope/app/browser/services/configure.zcml 1.80 => 1.81 ===
--- Zope3/src/zope/app/browser/services/configure.zcml:1.80	Sun Feb  8 20:44:05 2004
+++ Zope3/src/zope/app/browser/services/configure.zcml	Sun Feb  8 21:09:01 2004
@@ -262,4 +262,6 @@
 <!-- Local Interface Service -->
   <zope:include package=".interface" />
 
+  <zope:include file="error.zcml" />
+
 </zope:configure>


=== Zope3/src/zope/app/browser/services/error.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/browser/services/error.py:1.7	Sun Feb  8 20:44:05 2004
+++ Zope3/src/zope/app/browser/services/error.py	Sun Feb  8 21:09:01 2004
@@ -16,6 +16,9 @@
 $Id$
 """
 from zope.app.services.error import ILocalErrorReportingService
+from zope.publisher.browser import BrowserView
+from zope.app import zapi
+from zope.app.services.servicenames import ErrorLogging
 
 class EditErrorLog:
     __used_for__ = ILocalErrorReportingService
@@ -27,3 +30,12 @@
             copy_to_zlog = 0
         errorLog.setProperties(keep_entries, copy_to_zlog, ignored_exceptions)
         return self.request.response.redirect('@@configure.html')
+
+
+class ErrorRedirect(BrowserView):
+
+    def action(self):
+        err = zapi.getService(self, ErrorLogging)
+        url = str(zapi.getView(err, 'absolute_url', self.request))
+        url = url + "/@@SelectedManagementView.html"
+        self.request.response.redirect(url)




More information about the Zope3-Checkins mailing list