[Checkins] SVN: zamplugin.error/ Move implementation form private repos to svn.zope.org

Roger Ineichen roger at projekt01.ch
Sat Feb 16 11:19:43 EST 2008


Log message for revision 83908:
  Move implementation form private repos to svn.zope.org

Changed:
  A   zamplugin.error/branches/
  A   zamplugin.error/tags/
  A   zamplugin.error/trunk/
  A   zamplugin.error/trunk/CHANGES.txt
  A   zamplugin.error/trunk/README.txt
  A   zamplugin.error/trunk/bootstrap.py
  A   zamplugin.error/trunk/buildout.cfg
  A   zamplugin.error/trunk/externals/
  A   zamplugin.error/trunk/setup.py
  A   zamplugin.error/trunk/src/
  A   zamplugin.error/trunk/src/zamplugin/
  A   zamplugin.error/trunk/src/zamplugin/__init__.py
  A   zamplugin.error/trunk/src/zamplugin/error/
  A   zamplugin.error/trunk/src/zamplugin/error/README.txt
  A   zamplugin.error/trunk/src/zamplugin/error/__init__.py
  A   zamplugin.error/trunk/src/zamplugin/error/browser.py
  A   zamplugin.error/trunk/src/zamplugin/error/browser.zcml
  A   zamplugin.error/trunk/src/zamplugin/error/configure.zcml
  A   zamplugin.error/trunk/src/zamplugin/error/error.pt
  A   zamplugin.error/trunk/src/zamplugin/error/error_as_text.pt
  A   zamplugin.error/trunk/src/zamplugin/error/errors.pt
  A   zamplugin.error/trunk/src/zamplugin/error/ftesting.zcml
  A   zamplugin.error/trunk/src/zamplugin/error/interfaces.py
  A   zamplugin.error/trunk/src/zamplugin/error/manager.py
  A   zamplugin.error/trunk/src/zamplugin/error/menu.py
  A   zamplugin.error/trunk/src/zamplugin/error/menu.zcml
  A   zamplugin.error/trunk/src/zamplugin/error/plugin.py
  A   zamplugin.error/trunk/src/zamplugin/error/plugin.zcml
  A   zamplugin.error/trunk/src/zamplugin/error/tests.py
  A   zamplugin.error/trunk/src/zamplugin/error/text_lines_input.pt
  A   zamplugin.error/trunk/src/zamplugin/error/widget.py

-=-
Added: zamplugin.error/trunk/CHANGES.txt
===================================================================
--- zamplugin.error/trunk/CHANGES.txt	                        (rev 0)
+++ zamplugin.error/trunk/CHANGES.txt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+Version 0.5.0 (unreleased)
+-------------------------
+
+- Initial Release


Property changes on: zamplugin.error/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/README.txt
===================================================================
--- zamplugin.error/trunk/README.txt	                        (rev 0)
+++ zamplugin.error/trunk/README.txt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1 @@
+This package provides an error utiltiy for ZAM (Zope 3 Application Management).


Property changes on: zamplugin.error/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/bootstrap.py
===================================================================
--- zamplugin.error/trunk/bootstrap.py	                        (rev 0)
+++ zamplugin.error/trunk/bootstrap.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 75940 2007-05-24 14:45:00Z srichter $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                     ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+    cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+    os.P_WAIT, sys.executable, sys.executable,
+    '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+    dict(os.environ,
+         PYTHONPATH=
+         ws.find(pkg_resources.Requirement.parse('setuptools')).location
+         ),
+    ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)


Property changes on: zamplugin.error/trunk/bootstrap.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/buildout.cfg
===================================================================
--- zamplugin.error/trunk/buildout.cfg	                        (rev 0)
+++ zamplugin.error/trunk/buildout.cfg	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,274 @@
+[buildout]
+develop = .
+          externals/z3c.menu.ready2go
+          externals/zam.api
+          externals/zam.skin
+
+parts = app var test checker coverage
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zamplugin.error [app, test]
+
+[checker]
+recipe = lovely.recipe:importchecker
+path = src/zamplugin/error
+
+[coverage]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+
+
+[app]
+recipe = z3c.recipe.dev:app
+eggs = zamplugin.error [app]
+server = zserver
+zope.conf =
+  ${var:zconfig}
+
+  interrupt-check-interval 50
+
+  <server>
+    type WSGI-HTTP
+    address 8080
+  </server>
+
+  <eventlog>
+    <logfile>
+      path access.log
+    </logfile>
+    <logfile>
+      path STDOUT
+      formatter zope.exceptions.log.Formatter
+    </logfile>
+  </eventlog>
+
+  <accesslog>
+    <logfile>
+      path access.log
+    </logfile>
+    <logfile>
+      path STDOUT
+    </logfile>
+  </accesslog>
+
+  devmode on
+
+site.zcml =
+  <!-- Turn on the devmode -->
+  <configure
+    xmlns:meta="http://namespaces.zope.org/meta"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:mail="http://namespaces.zope.org/mail"
+    i18n_domain="zope">
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+
+  <!-- load meta configuration for exclude -->
+  <include package="zc.configuration" file="meta.zcml" />
+
+
+  <!-- exclude will prevent from include -->
+  <exclude package="zope.app.authentication" file="ftpplugins.zcml" />
+  <exclude package="zope.app.authentication" file="groupfolder.zcml" />
+  <exclude package="zope.app.authentication" file="principalfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" />
+  <exclude package="zope.app.authentication.browser" file="configure.zcml" />
+  <exclude package="zope.app.authentication.browser" file="groupfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" file="httpplugins.zcml" />
+  <exclude package="zope.app.authentication.browser" file="principalfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" file="session.zcml" />
+  <exclude package="zope.app.broken" file="browser.zcml" />
+  <exclude package="zope.app.container.browser" />
+  <exclude package="zope.app.error.browser" />
+  <exclude package="zope.app.folder.browser" />
+  <exclude package="zope.app.i18n" />
+  <exclude package="zope.app.intid.browser" />
+  <exclude package="zope.app.securitypolicy.browser" />
+  <exclude package="zope.app.session" file="browser.zcml" />
+  <exclude package="zope.dublincore.browser" />
+
+
+  <!-- load zope meta configuration -->
+  <include package="zope.app.component" file="meta.zcml" />
+  <include package="zope.app.component.browser" file="meta.zcml" />
+  <include package="zope.app.container.browser" file="meta.zcml" />
+  <include package="zope.app.pagetemplate" file="meta.zcml" />
+  <include package="zope.app.publication" file="meta.zcml" />
+  <include package="zope.app.publisher" file="meta.zcml" />
+  <include package="zope.app.security" file="meta.zcml" />
+  <include package="zope.i18n" file="meta.zcml" />
+  <include package="zope.security" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
+  <include package="zope.viewlet" file="meta.zcml" />
+
+
+  <!-- load 3rd party meta configuration -->
+  <include package="z3c.baseregistry" file="meta.zcml" />
+  <include package="z3c.form" file="meta.zcml" />
+  <include package="z3c.macro" file="meta.zcml" />
+  <include package="z3c.pagelet" file="meta.zcml" />
+  <include package="z3c.template" file="meta.zcml" />
+  <include package="z3c.zrtresource" file="meta.zcml" />
+
+
+  <!-- vocabulary setup, that's bad and weird, because this is meta configuration -->
+  <include package="zope.app.schema" />
+
+
+  <!-- bootstrap Database -->
+  <include package="zope.app.appsetup" />
+  <include package="zope.app.zopeappgenerations" />
+
+  <!-- zope server -->
+  <include package="zope.app.server" />
+  <include package="zope.app.twisted" />
+  <include package="zope.app.wsgi" />
+
+
+  <!-- zope packages -->
+  <include package="zope.annotation" />
+  <include package="zope.component" />
+  <include package="zope.contentprovider" />
+  <include package="zope.dublincore" />
+  <include package="zope.error" />
+  <include package="zope.location" />
+  <include package="zope.publisher" />
+  <include package="zope.securitypolicy" />
+  <include package="zope.session" />
+  <include package="zope.traversing" />
+  <include package="zope.traversing.browser" />
+
+
+  <!-- load zope package configuration -->
+  <include package="zope.app.authentication" />
+  <include package="zope.app.broken" />
+  <include package="zope.app.component" />
+  <include package="zope.app.container" />
+  <include package="zope.app.folder" />
+  <include package="zope.app.http" />
+  <include package="zope.app.intid" />
+  <include package="zope.app.keyreference" />
+  <include package="zope.app.principalannotation" />
+  <include package="zope.app.publication" />
+  <include package="zope.app.publisher" />
+  <include package="zope.app.publisher.browser" />
+  <include package="zope.app.security" />
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.session" />
+
+
+  <!-- load 3rd party configuration -->
+  <include package="z3c.breadcrumb" />
+  <include package="z3c.form" />
+  <include package="z3c.formui" />
+  <include package="z3c.layer.pagelet" />
+  <include package="z3c.layer.ready2go" />
+  <include package="z3c.menu.ready2go" />
+  <include package="z3c.macro" />
+  <include package="z3c.pagelet" />
+
+
+  <!-- zam configuration -->
+  <include package="zam.api" />
+  <include package="zam.skin" />
+  <include package="zamplugin.error" />
+
+
+  <!-- from zope.app.i18n move this to another package -->
+  <!-- Setup language negotiation -->
+  <utility
+      provides="zope.i18n.interfaces.INegotiator"
+      component="zope.i18n.negotiator.negotiator"
+      />
+
+  <!-- Setup charset negotiation -->
+  <adapter
+      factory="zope.publisher.http.HTTPCharsets"
+      for="zope.publisher.interfaces.http.IHTTPRequest"
+      provides="zope.i18n.interfaces.IUserPreferredCharsets"
+      />
+
+  <!-- Setup charset negotiation -->
+  <adapter
+      factory="zope.app.publisher.browser.ModifiableBrowserLanguages"
+      for="zope.publisher.interfaces.http.IHTTPRequest"
+      provides="zope.i18n.interfaces.IModifiableUserPreferredLanguages"
+      />
+
+  <class class="zope.publisher.http.HTTPRequest">
+    <implements
+        interface="zope.annotation.interfaces.IAttributeAnnotatable"
+        />
+  </class>
+
+
+  <!-- load other zcml files -->
+  <include file="securitypolicy.zcml" />
+  <include file="principals.zcml" />
+
+  <browser:defaultView name="index.html" />
+  <browser:defaultSkin name="ZAM" />
+
+  </configure>
+
+principals.zcml = 
+  <unauthenticatedPrincipal
+      id="lovelybooks.anybody"
+      title="Unauthenticated User"
+      />
+
+  <unauthenticatedGroup
+      id="zope.Anybody"
+      title="Unauthenticated Users"
+      />
+
+  <authenticatedGroup
+      id="zope.Authenticated"
+      title="Authenticated Users"
+      />
+
+  <everybodyGroup
+      id="zope.Everybody"
+      title="All Users"
+      />
+
+  <principal
+      id="zope.manager"
+      title="Manager"
+      login="Manager"
+      password="password"
+      />
+
+  <grant
+      role="zope.Manager"
+      principal="zope.manager"
+      />
+
+securitypolicy.zcml =
+  <include package="zope.app.securitypolicy" />
+
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Anonymous" title="Everybody"
+                 description="All users have this role implicitly" />
+  <role id="zope.Manager" title="Site Manager" />
+  <role id="zope.Member" title="Site Member" />
+
+  <!-- Replace the following directive if you don't want public access -->
+  <grant
+      permission="zope.View"
+      role="zope.Anonymous"
+      />
+  <grant
+      permission="zope.app.dublincore.view"
+      role="zope.Anonymous"
+      />
+
+  <grantAll role="zope.Manager" />
+
+
+[var]
+recipe = zc.recipe.filestorage

Added: zamplugin.error/trunk/setup.py
===================================================================
--- zamplugin.error/trunk/setup.py	                        (rev 0)
+++ zamplugin.error/trunk/setup.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,100 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup
+
+$Id:$
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup (
+    name='zamplugin.error',
+    version='0.5.0',
+    author = "Roger Ineichen and the Zope Community",
+    author_email = "zope3-dev at zope.org",
+    description = "Error utility for Zope Application Management",
+    long_description=(
+        read('README.txt')
+        + '\n\n' +
+        read('CHANGES.txt')
+        ),
+    license = "ZPL 2.1",
+    keywords = "zope3 error utility application management user interface",
+    classifiers = [
+        'Development Status :: 4 - Beta',
+        'Environment :: Web Environment',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Internet :: WWW/HTTP',
+        'Framework :: Zope3'],
+    url = 'http://cheeseshop.python.org/pypi/zamplugin.error',
+    packages = find_packages('src'),
+    include_package_data = True,
+    package_dir = {'':'src'},
+    namespace_packages = ['zamplugin'],
+    extras_require = dict(
+        test = [
+            'z3c.coverage',
+            'z3c.testing',
+            'zope.app.testing',
+            'zope.testbrowser',
+            ],
+        app = [
+            'z3c.baseregistry',
+            'z3c.form',
+            'z3c.formui',
+            'z3c.layer.pagelet',
+            'z3c.layer.ready2go',
+            'z3c.menu.ready2go',
+            'z3c.pagelet',
+            'z3c.zrtresource',
+            'zam.api',
+            'zam.skin',
+            'zc.configuration',
+            'zope.app.component',
+            'zope.app.http',
+            'zope.app.intid',
+            'zope.app.publisher',
+            'zope.app.securitypolicy',
+            'zope.app.server',
+            'zope.app.twisted',
+            'zope.configuration',
+            'zope.interface',
+            'zope.publisher',
+            'zope.traversing',
+            'zope.viewlet',
+            ],
+        ),
+    install_requires = [
+        'setuptools',
+        'z3c.baseregistry',
+        'z3c.form',
+        'z3c.formui',
+        'z3c.menu.ready2go',
+        'z3c.pagelet',
+        'zam.api',
+        'zope.component',
+        'zope.error',
+        'zope.interface',
+        'zope.schema',
+        'zope.traversing',
+        ],
+    zip_safe = False,
+)


Property changes on: zamplugin.error/trunk/setup.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/__init__.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/__init__.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/__init__.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,7 @@
+# this is a namespace package
+try:
+    import pkg_resources
+    pkg_resources.declare_namespace(__name__)
+except ImportError:
+    import pkgutil
+    __path__ = pkgutil.extend_path(__path__, __name__)


Property changes on: zamplugin.error/trunk/src/zamplugin/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/README.txt
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/README.txt	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/README.txt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,25 @@
+======
+README
+======
+
+This package contains the Zope Application Management skin. This skin supports 
+a modular application management UI without any dependency to the old skin
+implementations. The goal of this new skin is to support a more modular
+concept which allows us to register only what we need.
+
+Login as manager first:
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> manager = Browser()
+  >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+Check if we can access the page.html view which is registred in the
+ftesting.zcml file with our skin:
+
+  >>> manager = Browser()
+  >>> manager.handleErrors = False
+  >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+  >>> skinURL = 'http://localhost/++skin++ZAM/index.html'
+  >>> manager.open(skinURL)
+  >>> manager.url
+  'http://localhost/++skin++ZAM/index.html'


Property changes on: zamplugin.error/trunk/src/zamplugin/error/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/__init__.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/__init__.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/__init__.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1 @@
+# Make a package.


Property changes on: zamplugin.error/trunk/src/zamplugin/error/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/browser.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/browser.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/browser.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,96 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.component
+import zope.interface
+import zope.schema
+import zope.i18nmessageid
+_ = zope.i18nmessageid.MessageFactory('zam')
+
+from z3c.form import form
+from z3c.form import field
+from z3c.form import button
+from z3c.formui import layout
+from z3c.pagelet import browser
+
+from zamplugin.error import interfaces
+from zamplugin.error import widget
+
+
+class EditErrorLog(layout.FormLayoutSupport, form.Form):
+
+    zope.interface.implements(interfaces.IErrorReportingUtilityPage)
+
+    formErrorsMessage = _('There were some errors.')
+    successMessage = _('Data successfully updated.')
+    ignoreContext = True
+
+    fields = field.Fields(interfaces.IErrorReportingUtilityManager)
+
+    fields['ignored_exceptions'].widgetFactory = widget.TextLinesFieldWidget
+
+    def updateProperties(self, keep_entries, copy_to_zlog=None,
+                         ignored_exceptions=None):
+        if copy_to_zlog is None:
+            copy_to_zlog = 0
+        self.context.setProperties(keep_entries, copy_to_zlog,
+            ignored_exceptions)
+
+    @button.buttonAndHandler(_('Apply'), name='apply')
+    def handleApply(self, action):
+        data, errors = self.extractData()
+        if errors:
+            self.status = self.formErrorsMessage
+            return
+        keep_entries = data['keep_entries']
+        copy_to_zlog = data['copy_to_zlog']
+        ignored_exceptions = data['ignored_exceptions']
+        self.updateProperties(keep_entries, copy_to_zlog, ignored_exceptions)
+        self.status = self.successMessage
+
+
+class Errors(browser.BrowserPagelet):
+    """Error listing page."""
+
+    zope.interface.implements(interfaces.IErrorReportingUtilityPage)
+
+    @property
+    def values(self):
+        return self.context.getLogEntries()
+
+
+class Error(browser.BrowserPagelet):
+    """Show error page."""
+
+    zope.interface.implements(interfaces.IErrorReportingUtilityPage)
+
+    errorId = None
+
+    @property
+    def logEntry(self):
+        """Return log entry if given in request."""
+        if self.errorId is not None:
+            return self.context.getLogEntryById(self.errorId)
+
+    def update(self):
+        self.errorId = self.request.get('id')
+        super(Error, self).update()
+
+
+class ErrorAsText(Error):
+    """Show error as text."""
\ No newline at end of file


Property changes on: zamplugin.error/trunk/src/zamplugin/error/browser.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/browser.zcml
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/browser.zcml	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/browser.zcml	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,56 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <z3c:pagelet
+      name="index.html"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".browser.Errors"
+      permission="zope.ManageServices"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:template
+      for=".browser.Errors"
+      template="errors.pt"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:pagelet
+      name="edit.html"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".browser.EditErrorLog"
+      permission="zope.ManageServices"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:pagelet
+      name="error.html"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".browser.Error"
+      permission="zope.ManageServices"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:template
+      for=".browser.Error"
+      template="error.pt"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:pagelet
+      name="errorAsText.html"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".browser.ErrorAsText"
+      permission="zope.ManageServices"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+  <z3c:template
+      for=".browser.ErrorAsText"
+      template="error_as_text.pt"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      />
+
+</configure>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/configure.zcml
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/configure.zcml	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/configure.zcml	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,29 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <include file="plugin.zcml" />
+
+  <registerIn registry="zamplugin.error.plugin.ErrorBaseRegistry">
+    <adapter
+       factory=".manager.ErrorReportingUtilityManager"
+       />
+
+    <adapter
+        factory=".widget.TextLinesConverter"
+        />
+
+    <z3c:widgetTemplate
+        mode="input"
+        widget=".interfaces.ITextLinesWidget"
+        layer="zam.api.layer.IZAMBrowserLayer"
+        template="text_lines_input.pt"
+        />
+
+    <include file="browser.zcml" />
+    <include file="menu.zcml" />
+
+  </registerIn>
+
+</configure>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/error.pt
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/error.pt	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/error.pt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,74 @@
+<div tal:define="entry view/logEntry">
+
+  <h1 i18n:translate="">Header</h1>
+
+  <h3 i18n:translate="">Exception traceback</h3>
+
+  <em tal:condition="not:entry" i18n:translate="">
+    The specified log entry was not found.  It may have expired.
+  </em>
+
+  <div tal:condition="entry">
+
+    <div class="row">
+      <div class="label" i18n:translate="">Time</div>
+      <div class="field" tal:content="entry/time">Time</div>
+    </div>
+
+    <div class="row">
+      <div class="label" i18n:translate="">User</div>
+      <div class="field" tal:content="entry/username">joe</div>
+    </div>
+
+    <div class="row">
+      <div class="label" i18n:translate="">Request URL</div>
+      <div class="field" tal:content="entry/url">http://zeomega.com</div>
+    </div>
+
+    <div class="row">
+      <div class="label" i18n:translate="">Exception Type</div>
+      <div class="field" tal:content="entry/type">AttributeError</div>
+    </div>
+
+    <div class="row">
+      <div class="label" i18n:translate="">Exception Value</div>
+      <div class="field" tal:content="entry/value">zzope</div>
+    </div>
+
+    <div class="row">
+      <div class="label" i18n:translate="">Traceback</div>
+      <div class="field">&nbsp;</div>
+    </div>
+    <br/>
+
+    <div tal:condition="entry/tb_html" tal:content="structure entry/tb_html">
+      Traceback (HTML)
+    </div>
+
+    <pre tal:condition="not:entry/tb_html" tal:content="entry/tb_text">
+      Traceback (text)
+    </pre>
+
+    <p tal:condition="entry/tb_text">
+      <a href="" 
+         tal:attributes="href string:errorAsText.html?id=${entry/id}" 
+         i18n:translate="">Display traceback as text</a>
+    </p>
+
+
+    <div tal:condition="entry/req_html">
+
+      <h3 i18n:translate="">REQUEST</h3>
+
+      <div tal:replace="structure entry/req_html"></div>
+
+    </div>
+
+  </div>
+
+  <p>
+    <a href="./index.html" i18n:translate="">Return to error log</a>
+  </p>
+  <br/>
+
+</div>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/error.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/error_as_text.pt
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/error_as_text.pt	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/error_as_text.pt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,12 @@
+<div tal:define="entry view/logEntry">
+  <pre tal:content="entry/tb_text">
+        Traceback (text)
+  </pre>
+  <p>
+    <a href="javascript:history.back()" i18n:translate="">Return to error entry</a>
+  </p>
+  <p>
+    <a href="./index.html" i18n:translate="">Return to error log</a>
+  </p>
+  <br/>
+</div>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/error_as_text.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/errors.pt
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/errors.pt	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/errors.pt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,49 @@
+<div>
+  <h3 i18n:translate="">Exception Log (most recent first)</h3>
+  <p i18n:translate="">This page lists the exceptions that have occurred in this
+    site recently.</p>
+  <div tal:define="entries view/values">
+    <em tal:condition="not:entries" i18n:translate=""> No exceptions logged. </em>
+    <table tal:condition="entries">
+      <tr>
+        <th align="left" i18n:translate="">
+          Time
+        </th>
+        <th align="left" i18n:translate="">
+          User
+        </th>
+        <th align="left" i18n:translate="">
+          Exception
+        </th>
+      </tr>
+      <tr tal:repeat="entry entries">
+        <td valign="top" nowrap="nowrap">
+          <span tal:content="entry/time">Time</span>
+        </td>
+        <td>
+          <span tal:content="entry/username">joe</span>
+        </td>
+        <td valign="top">
+          <a href="showEntry" 
+             tal:attributes="href string:error.html?id=${entry/id}">
+          <span tal:content="entry/type">AttributeError</span>
+          :
+          <span tal:define="value entry/value"
+                tal:content="python: len(value) < 70 and value or value[:70] + '...'">
+                Application object has no attribute "zzope"
+              </span>
+          </a>
+        </td>
+      </tr>
+    </table>
+  </div>
+  <!-- just offer reload button -->
+  <form action="." method="get">
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="submit" value="Refresh" 
+               i18n:attributes="value refresh-button" />
+      </div>
+    </div>
+  </form>
+</div>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/errors.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/ftesting.zcml
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/ftesting.zcml	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/ftesting.zcml	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,207 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:meta="http://namespaces.zope.org/meta"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zope">
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+
+  <!-- load meta configuration for exclude -->
+  <include package="zc.configuration" file="meta.zcml" />
+
+  <!-- exclude will prevent from include -->
+  <exclude package="zope.app.authentication" file="ftpplugins.zcml" />
+  <exclude package="zope.app.authentication" file="groupfolder.zcml" />
+  <exclude package="zope.app.authentication" file="principalfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" />
+  <exclude package="zope.app.authentication.browser" file="configure.zcml" />
+  <exclude package="zope.app.authentication.browser" file="groupfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" file="httpplugins.zcml" />
+  <exclude package="zope.app.authentication.browser" file="principalfolder.zcml" />
+  <exclude package="zope.app.authentication.browser" file="session.zcml" />
+  <exclude package="zope.app.broken" file="browser.zcml" />
+  <exclude package="zope.app.container.browser" />
+  <exclude package="zope.app.error.browser" />
+  <exclude package="zope.app.folder.browser" />
+  <exclude package="zope.app.i18n.browser" />
+  <exclude package="zope.app.intid.browser" />
+  <exclude package="zope.app.securitypolicy.browser" />
+  <exclude package="zope.app.session" file="browser.zcml" />
+  <exclude package="zope.dublincore.browser" />
+
+
+  <!-- meta configure -->
+  <include package="zope.app.component" file="meta.zcml" />
+  <include package="zope.app.component.browser" file="meta.zcml" />
+  <include package="zope.app.container.browser" file="meta.zcml" />
+  <include package="zope.app.pagetemplate" file="meta.zcml" />
+  <include package="zope.app.publication" file="meta.zcml" />
+  <include package="zope.app.publisher" file="meta.zcml" />
+  <include package="zope.app.security" file="meta.zcml" />
+  <include package="zope.i18n" file="meta.zcml" />
+  <include package="zope.security" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
+  <include package="zope.viewlet" file="meta.zcml" />
+
+
+  <!-- load 3rd party meta configuration -->
+  <include package="z3c.baseregistry" file="meta.zcml" />
+  <include package="z3c.form" file="meta.zcml" />
+  <include package="z3c.macro" file="meta.zcml" />
+  <include package="z3c.pagelet" file="meta.zcml" />
+  <include package="z3c.template" file="meta.zcml" />
+  <include package="z3c.zrtresource" file="meta.zcml" />
+
+
+  <!-- vocabulary setup, that's bad and weird, because this is meta configuration -->
+  <include package="zope.app.schema" />
+
+
+  <!-- bootstrap Database -->
+  <include package="zope.app.appsetup" />
+  <include package="zope.app.zopeappgenerations" />
+
+  <!-- zope server -->
+  <include package="zope.app.server" />
+  <include package="zope.app.twisted" />
+  <include package="zope.app.wsgi" />
+
+
+  <!-- zope packages -->
+  <include package="zope.annotation" />
+  <include package="zope.component" />
+  <include package="zope.contentprovider" />
+  <include package="zope.dublincore" />
+  <include package="zope.error" />
+  <include package="zope.location" />
+  <include package="zope.publisher" />
+  <include package="zope.securitypolicy" />
+  <include package="zope.session" />
+  <include package="zope.traversing" />
+  <include package="zope.traversing.browser" />
+
+
+  <!-- zope app package configuration -->
+  <include package="zope.app.authentication" />
+  <include package="zope.app.broken" />
+  <include package="zope.app.component" />
+  <include package="zope.app.container" />
+  <include package="zope.app.folder" />
+  <include package="zope.app.http" />
+  <include package="zope.app.intid" />
+  <include package="zope.app.keyreference" />
+  <include package="zope.app.principalannotation" />
+  <include package="zope.app.publication" />
+  <include package="zope.app.publisher" />
+  <include package="zope.app.publisher.browser" />
+  <include package="zope.app.security" />
+  <include package="zope.app.securitypolicy" />
+  <include package="zope.app.session" />
+
+
+  <!-- z3c component -->
+  <include package="z3c.breadcrumb" />
+  <include package="z3c.form" />
+  <include package="z3c.formui" />
+  <include package="z3c.layer.pagelet" />
+  <include package="z3c.layer.ready2go" />
+  <include package="z3c.menu.ready2go" />
+  <include package="z3c.macro" />
+  <include package="z3c.pagelet" />
+
+
+  <!-- zam configuration -->
+  <include package="zam.api" />
+  <include package="zam.skin" />
+  <include package="zamplugin.error" />
+
+
+  <browser:defaultSkin name="ZAM" />
+
+  <!-- default view points to TestPage -->
+  <browser:defaultView name="index.html" />
+
+
+  <!-- from zope.app.i18n move this to another package -->
+  <!-- Setup charset negotiation -->
+  <adapter
+      factory="zope.publisher.http.HTTPCharsets"
+      for="zope.publisher.interfaces.http.IHTTPRequest"
+      provides="zope.i18n.interfaces.IUserPreferredCharsets"
+      />
+
+  <!-- Setup charset negotiation --><!-- move this to another package -->
+  <adapter
+      factory="zope.app.publisher.browser.ModifiableBrowserLanguages"
+      for="zope.publisher.interfaces.http.IHTTPRequest"
+      provides="zope.i18n.interfaces.IModifiableUserPreferredLanguages"
+      />
+
+  <class class="zope.publisher.http.HTTPRequest">
+    <implements
+        interface="zope.annotation.interfaces.IAttributeAnnotatable"
+        />
+  </class>
+
+
+  <!-- load security policy -->
+  <include package="zope.securitypolicy" />
+
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+  <role id="zope.Anonymous"
+      title="Everybody"
+      description="All users have this role implicitly"
+      />
+  <role id="zope.Manager" title="Site Manager" />
+  <role id="zope.Member" title="Site Member" />
+
+  <grant permission="zope.View"
+                  role="zope.Anonymous" />
+  <grant permission="zope.app.dublincore.view"
+                  role="zope.Anonymous" />
+
+  <grantAll role="zope.Manager" />
+
+
+  <!-- setup principals -->
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <unauthenticatedGroup
+    id="zope.Anybody"
+    title="Unauthenticated Users"
+    />
+
+  <authenticatedGroup
+    id="zope.Authenticated"
+    title="Authenticated Users"
+    />
+
+  <everybodyGroup
+    id="zope.Everybody"
+    title="All Users"
+    />
+
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw" />
+
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+  <principal
+      id="zope.globalmgr"
+      title="Manager"
+      login="globalmgr"
+      password="globalmgrpw" />
+
+  <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/interfaces.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/interfaces.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/interfaces.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,58 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.interface
+import zope.schema
+
+from z3c.form.interfaces import ITextAreaWidget
+
+from zam.api.i18n import MessageFactory as _
+
+
+
+class IErrorReportingUtilityManager(zope.interface.Interface):
+    """Error reporting utility schema."""
+
+    keep_entries = zope.schema.Int(
+        title=_("Keep entries"),
+        description=_("Count of entries in history"),
+        default=20,
+        required=True)
+
+    copy_to_zlog = zope.schema.Bool(
+        title=_("Copy to log"),
+        description=_("Flag for copy errors to log"),
+        default=False)
+
+    ignored_exceptions = zope.schema.Tuple(
+        title=_("Ignore exceptions"),
+        description=_("List of ignored exceptions"),
+        value_type=zope.schema.TextLine(
+            title=_("Ignored exception"),
+            description=_("Name of the ignored exception."),
+            default=u''),
+        default=(),
+        )
+
+
+class ITextLinesWidget(ITextAreaWidget):
+    """TextLine sequence widget."""
+
+
+class IErrorReportingUtilityPage(zope.interface.Interface):
+    """Error reporting utility page marker (used for menu item)."""


Property changes on: zamplugin.error/trunk/src/zamplugin/error/interfaces.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/manager.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/manager.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/manager.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,76 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.interface
+import zope.component
+import zope.schema
+
+from zope.error.interfaces import IErrorReportingUtility
+from zope.error.interfaces import ILocalErrorReportingUtility
+from zamplugin.error import interfaces
+
+
+class ErrorReportingUtilityManager(object):
+    """Error reporting utility schema."""
+
+    zope.interface.implements(interfaces.IErrorReportingUtilityManager)
+    zope.component.adapts(ILocalErrorReportingUtility)
+
+    def __init__(self, context):
+        self.context = context
+
+    @apply
+    def keep_entries():
+        def get(self):
+            data = self.context.getProperties()
+            return data['keep_entries']
+        def set(self, value):
+            data = self.context.getProperties()
+            keep_entries = value
+            copy_to_zlog = data['copy_to_zlog']
+            ignored_exceptions = data['ignored_exceptions']
+            setProperties(keep_entries, copy_to_zlog, ignored_exceptions)
+        return property(get, set)
+
+    @apply
+    def copy_to_zlog():
+        def get(self):
+            data = self.context.getProperties()
+            return data['copy_to_zlog']
+        def set(self, value):
+            data = self.context.getProperties()
+            keep_entries = data['keep_entries']
+            copy_to_zlog = value
+            ignored_exceptions = data['ignored_exceptions']
+            self.context.setProperties(keep_entries, copy_to_zlog,
+                ignored_exceptions)
+        return property(get, set)
+
+    @apply
+    def ignored_exceptions():
+        def get(self):
+            data = self.context.getProperties()
+            return data['ignored_exceptions']
+        def set(self, value):
+            data = self.context.getProperties()
+            keep_entries = data['keep_entries']
+            copy_to_zlog = data['copy_to_zlog']
+            ignored_exceptions = value
+            self.context.setProperties(keep_entries, copy_to_zlog,
+                ignored_exceptions)
+        return property(get, set)


Property changes on: zamplugin.error/trunk/src/zamplugin/error/manager.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/menu.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/menu.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/menu.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,58 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.component
+from zope.traversing.browser import absoluteURL
+from zope.traversing.interfaces import IContainmentRoot
+from zope.error.interfaces import IErrorReportingUtility
+
+from z3c.menu.ready2go import item
+from zamplugin.error import interfaces
+
+
+class ErrorsMenuItem(item.GlobalMenuItem):
+    """Errors menu item."""
+
+    viewName = 'index.html'
+    viewInterface = interfaces.IErrorReportingUtilityPage
+    weight = 2
+    
+    @property
+    def available(self):
+        util = zope.component.getUtility(IErrorReportingUtility)
+        #TODO: this sucks here, but could not solve it differently
+        return util.__parent__ is not None 
+
+    def getURLContext(self):
+        return zope.component.getUtility(IErrorReportingUtility)
+
+
+class IndexMenuItem(item.ContextMenuItem):
+    """Index menu item."""
+
+    viewName = 'index.html'
+    contextInterface = IErrorReportingUtility
+    weight = 1
+
+
+class EditMenuItem(item.ContextMenuItem):
+    """Edit menu item."""
+
+    viewName = 'edit.html'
+    contextInterface = IErrorReportingUtility
+    weight = 2


Property changes on: zamplugin.error/trunk/src/zamplugin/error/menu.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/menu.zcml
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/menu.zcml	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/menu.zcml	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,36 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    i18n_domain="zam">
+
+  <!-- global menu item -->
+  <viewlet
+      name="Errors"
+      for="*"
+      class=".menu.ErrorsMenuItem"
+      manager="zam.api.menu.IGlobalMenu"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- context menu item -->
+  <viewlet
+      name="Index"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".menu.IndexMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      permission="zope.ManageServices"
+      />
+
+  <viewlet
+      name="Edit"
+      for="zope.error.interfaces.IErrorReportingUtility"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IZAMBrowserLayer"
+      permission="zope.ManageServices"
+      />
+
+</configure>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/menu.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/plugin.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/plugin.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/plugin.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,38 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.component
+
+from z3c.baseregistry import baseregistry
+
+from zam.api.i18n import MessageFactory as _
+from zam.api import plugin
+
+
+ErrorBaseRegistry = baseregistry.BaseComponents(
+    zope.component.globalSiteManager, 'zamplugin.error')
+
+
+class ErrorPlugin(plugin.BaseRegistryPlugin):
+    """ZAM Error reporting utility plugin."""
+
+    registry = ErrorBaseRegistry
+
+    title = _("Error reporting utility")
+
+    description = _("ZAM Error reporting utility.")


Property changes on: zamplugin.error/trunk/src/zamplugin/error/plugin.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/plugin.zcml
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/plugin.zcml	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/plugin.zcml	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,17 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="zam">
+
+  <utility
+      component=".plugin.ErrorBaseRegistry"
+      provides="zope.component.interfaces.IComponents"
+      name="zamplugin.error"
+      />
+
+  <utility
+      factory=".plugin.ErrorPlugin"
+      provides="zam.api.interfaces.IPlugin"
+      name="zamplugin.error"
+      />
+
+</configure>


Property changes on: zamplugin.error/trunk/src/zamplugin/error/plugin.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/tests.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/tests.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/tests.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+
+import unittest
+from zope.app.testing import functional
+
+functional.defineLayer('TestLayer', 'ftesting.zcml')
+
+
+def test_suite():
+    suite = unittest.TestSuite()
+    s = functional.FunctionalDocFileSuite('README.txt')
+    s.layer = TestLayer
+    suite.addTest(s)
+
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: zamplugin.error/trunk/src/zamplugin/error/tests.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/text_lines_input.pt
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/text_lines_input.pt	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/text_lines_input.pt	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,30 @@
+<textarea
+    id="" name="" class="" cols="" rows=""
+    tabindex="" disabled="" readonly="" accesskey=""
+    tal:attributes="id view/id;
+                    name view/name;
+                    class view/klass;
+                    style view/style;
+                    title view/title;
+                    lang view/lang;
+                    onclick view/onclick;
+                    ondblclick view/ondblclick;
+                    onmousedown view/onmousedown;
+                    onmouseup view/onmouseup;
+                    onmouseover view/onmouseover;
+                    onmousemove view/onmousemove;
+                    onmouseout view/onmouseout;
+                    onkeypress view/onkeypress;
+                    onkeydown view/onkeydown;
+                    onkeyup view/onkeyup;
+                    disabled view/disabled;
+                    tabindex view/tabindex;
+                    onfocus view/onfocus;
+                    onblur view/onblur;
+                    onchange view/onchange;
+                    cols view/cols;
+                    rows view/rows;
+                    readonly view/readonly;
+                    accesskey view/accesskey;
+                    onselect view/onselect"
+    tal:content="structure view/value" />


Property changes on: zamplugin.error/trunk/src/zamplugin/error/text_lines_input.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.error/trunk/src/zamplugin/error/widget.py
===================================================================
--- zamplugin.error/trunk/src/zamplugin/error/widget.py	                        (rev 0)
+++ zamplugin.error/trunk/src/zamplugin/error/widget.py	2008-02-16 16:19:43 UTC (rev 83908)
@@ -0,0 +1,68 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 97 2007-03-29 22:58:27Z rineichen $
+"""
+__docformat__ = "reStructuredText"
+
+import zope.component
+import zope.interface
+import zope.schema
+import zope.schema.interfaces
+
+from z3c.form import widget
+
+from z3c.form.interfaces import IFormLayer
+from z3c.form.interfaces import IFieldWidget
+from z3c.form.interfaces import IDataConverter
+from z3c.form import widget
+from z3c.form import converter
+from z3c.form.browser import textarea
+
+from z3c.form.i18n import MessageFactory as _
+from zamplugin.error import interfaces
+
+
+class TextLinesWidget(textarea.TextAreaWidget):
+    """Input type sequence widget implementation."""
+    zope.interface.implementsOnly(interfaces.ITextLinesWidget)
+
+
+ at zope.component.adapter(zope.schema.interfaces.ITuple, IFormLayer)
+ at zope.interface.implementer(IFieldWidget)
+def TextLinesFieldWidget(field, request):
+    """IFieldWidget factory for TextLinesWidget."""
+    return widget.FieldWidget(field, TextLinesWidget(request))
+
+
+class TextLinesConverter(converter.BaseDataConverter):
+    """Data converter for IOfficeIdsWidget."""
+
+    zope.component.adapts(
+        zope.schema.interfaces.ITuple, interfaces.ITextLinesWidget)
+
+    def toWidgetValue(self, value):
+        """Convert from text lines to HTML representation."""
+        widget = self.widget
+        # if the value is the missing value, then an empty list is produced.
+        if value is self.field.missing_value:
+            return u''
+        return "\n".join(value)
+
+    def toFieldValue(self, value):
+        """See interfaces.IDataConverter"""
+        widget = self.widget
+        if not len(value):
+            return self.field.missing_value or ()
+        return tuple(value.split())


Property changes on: zamplugin.error/trunk/src/zamplugin/error/widget.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list