[Checkins] SVN: zamplugin.contents/ Added initial implementation

Roger Ineichen roger at projekt01.ch
Sat Apr 12 22:20:30 EDT 2008


Log message for revision 85320:
  Added initial implementation

Changed:
  A   zamplugin.contents/branches/
  A   zamplugin.contents/tags/
  A   zamplugin.contents/trunk/
  A   zamplugin.contents/trunk/CHANGES.txt
  A   zamplugin.contents/trunk/README.txt
  A   zamplugin.contents/trunk/bootstrap.py
  A   zamplugin.contents/trunk/buildout.cfg
  A   zamplugin.contents/trunk/setup.py
  A   zamplugin.contents/trunk/src/
  A   zamplugin.contents/trunk/src/zamplugin/
  A   zamplugin.contents/trunk/src/zamplugin/__init__.py
  A   zamplugin.contents/trunk/src/zamplugin/contents/
  A   zamplugin.contents/trunk/src/zamplugin/contents/README.txt
  A   zamplugin.contents/trunk/src/zamplugin/contents/__init__.py
  A   zamplugin.contents/trunk/src/zamplugin/contents/browser.zcml
  A   zamplugin.contents/trunk/src/zamplugin/contents/configure.zcml
  A   zamplugin.contents/trunk/src/zamplugin/contents/ftesting.zcml
  A   zamplugin.contents/trunk/src/zamplugin/contents/menu.py
  A   zamplugin.contents/trunk/src/zamplugin/contents/menu.zcml
  A   zamplugin.contents/trunk/src/zamplugin/contents/plugin.py
  A   zamplugin.contents/trunk/src/zamplugin/contents/plugin.zcml
  A   zamplugin.contents/trunk/src/zamplugin/contents/tests.py

-=-

Property changes on: zamplugin.contents/trunk
___________________________________________________________________
Name: svn:ignore
   + .installed.cfg
bin
develop-eggs
parts


Added: zamplugin.contents/trunk/CHANGES.txt
===================================================================
--- zamplugin.contents/trunk/CHANGES.txt	                        (rev 0)
+++ zamplugin.contents/trunk/CHANGES.txt	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+Version 0.5.0 (2008-04-13)
+-------------------------
+
+- Initial Release


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

Added: zamplugin.contents/trunk/README.txt
===================================================================
--- zamplugin.contents/trunk/README.txt	                        (rev 0)
+++ zamplugin.contents/trunk/README.txt	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,2 @@
+This package provides a modular container management plugin for ZAM (Zope 3 
+Application Management).


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

Added: zamplugin.contents/trunk/bootstrap.py
===================================================================
--- zamplugin.contents/trunk/bootstrap.py	                        (rev 0)
+++ zamplugin.contents/trunk/bootstrap.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -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.contents/trunk/bootstrap.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.contents/trunk/buildout.cfg
===================================================================
--- zamplugin.contents/trunk/buildout.cfg	                        (rev 0)
+++ zamplugin.contents/trunk/buildout.cfg	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,151 @@
+[buildout]
+develop = .
+parts = logs app var test checker coverage-test coverage-report
+
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zam.skin [app]
+eggs = zamplugin.contents [app, test]
+
+
+[checker]
+recipe = lovely.recipe:importchecker
+path = src/zamplugin/contents
+
+
+[coverage-test]
+recipe = zc.recipe.testrunner
+eggs = zamplugin.contents [test]
+defaults = ['--coverage', '../../coverage']
+
+
+[coverage-report]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+scripts = coverage=coverage-report
+arguments = ('coverage', 'coverage/report')
+
+
+[logs]
+recipe = lovely.recipe:mkdir
+path = parts/logs
+
+
+[app]
+recipe = z3c.recipe.dev:app
+eggs = zam.skin [app]
+eggs = zamplugin.contents [app]
+server = zserver
+zope.conf =
+  ${var:zconfig}
+
+  interrupt-check-interval 50
+
+  <server>
+    type WSGI-HTTP
+    address 8080
+  </server>
+
+  <eventlog>
+    <logfile>
+      formatter zope.exceptions.log.Formatter
+      path ${buildout:directory}/parts/logs/error.log
+    </logfile>
+    <logfile>
+      formatter zope.exceptions.log.Formatter
+      path STDOUT
+    </logfile>
+  </eventlog>
+
+  <accesslog>
+    <logfile>
+      path ${buildout:directory}/parts/logs/access.log
+    </logfile>
+    <logfile>
+      path STDOUT
+    </logfile>
+  </accesslog>
+
+  devmode on
+
+site.zcml =
+  <configure
+      xmlns:meta="http://namespaces.zope.org/meta"
+      xmlns:browser="http://namespaces.zope.org/browser"
+      i18n_domain="zope">
+
+  <!-- Turn on the devmode -->
+  <meta:provides feature="devmode" />
+
+  <!-- use app configuration from zam.api -->
+  <include package="zam.skin" file="app.zcml" />
+
+  <!-- zam skin configuration -->
+  <include package="zamplugin.contents" />
+
+  <!-- load other zcml files -->
+  <include file="securitypolicy.zcml" />
+  <include file="principals.zcml" />
+
+  </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.contents/trunk/setup.py
===================================================================
--- zamplugin.contents/trunk/setup.py	                        (rev 0)
+++ zamplugin.contents/trunk/setup.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,99 @@
+##############################################################################
+#
+# 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.contents',
+    version='0.5.0',
+    author = "Roger Ineichen and the Zope Community",
+    author_email = "zope3-dev at zope.org",
+    description = "Container management for ZAM Zope 3 Application Management",
+    long_description=(
+        read('README.txt')
+        + '\n\n' +
+        read('CHANGES.txt')
+        ),
+    license = "ZPL 2.1",
+    keywords = "zope3 container 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.contents',
+    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.contents',
+            'z3c.form',
+            'z3c.formui',
+            'z3c.layer.pagelet',
+            'z3c.layer.ready2go',
+            'z3c.menu.ready2go',
+            'z3c.pagelet',
+            'z3c.zrtresource',
+            'z3c.table',
+            '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.table',
+        'z3c.contents',
+        'zam.api',
+        'zope.interface',
+        'zope.component',
+        'zope.traversing',
+        'zope.viewlet',
+        ],
+    zip_safe = False,
+)


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


Property changes on: zamplugin.contents/trunk/src
___________________________________________________________________
Name: svn:ignore
   + zamplugin.contents.egg-info


Added: zamplugin.contents/trunk/src/zamplugin/__init__.py
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/__init__.py	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/__init__.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -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.contents/trunk/src/zamplugin/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.contents/trunk/src/zamplugin/contents/README.txt
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/README.txt	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/README.txt	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,97 @@
+======
+README
+======
+
+This package contains a container managment view for the Zope Application 
+Management.
+
+Login as mgr first:
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> mgr = Browser()
+  >>> mgr.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+Check if we can access the index.html view which is registred within the ZAM 
+skin:
+
+  >>> mgr = Browser()
+  >>> mgr.handleErrors = False
+  >>> mgr.addHeader('Authorization', 'Basic mgr:mgrpw')
+  >>> rootURL = 'http://localhost/++skin++ZAM'
+  >>> mgr.open(rootURL + '/index.html')
+  >>> mgr.url
+  'http://localhost/++skin++ZAM/index.html'
+
+  >>> 'There is no index.html page registered for this object' in  mgr.contents
+  True
+
+As you can see there is no real ``contents.hml`` page available only the default
+one from the skin configuration which shows the following message:
+
+  >>> mgr.open(rootURL + '/contents.html')
+  >>> 'There is no contents.html page registered for this object' in mgr.contents
+  True
+
+Go to the plugins page at the site root:
+
+  >>> mgr.open(rootURL + '/plugins.html')
+  >>> mgr.url
+  'http://localhost/++skin++ZAM/plugins.html'
+
+and install the contents plugins:
+
+  >>> mgr.getControl(name='zamplugin.contents.buttons.install').click()
+  >>> print mgr.contents
+  <!DOCTYPE ...
+  ...
+  <h1>ZAM Plugin Management</h1>
+   <fieldset id="pluginManagement">
+     <strong class="installedPlugin">Container management page</strong>
+     <div class="description">This container management page is configured for IReadContainer.</div>
+  ...
+
+Now you can see there is ``contents.html`` page at the site root:
+
+  >>> mgr.open(rootURL + '/contents.html')
+  >>> print mgr.contents
+  <!DOCTYPE ...
+  ...
+  <table>
+  <tr>
+  <td class="row">
+    <label for="search-widgets-searchterm">Search</label>
+    <input type="text" id="search-widgets-searchterm"
+         name="search.widgets.searchterm"
+         class="text-widget required textline-field" value="" />
+  </td>
+  <td class="action">
+    <input type="submit" id="search-buttons-search"
+         name="search.buttons.search"
+         class="submit-widget button-field" value="Search" />
+  </td>
+  </tr>
+  </table>
+      </fieldset>
+      <table class="contents">
+    <thead>
+      <tr>
+        <th>X</th>
+        <th><a href="?contents-sortOn=contents-renameColumn-1&contents-sortOrder=descending" title="Sort">Name</a></th>
+        <th><a href="?contents-sortOn=contents-createdColumn-2&contents-sortOrder=ascending" title="Sort">Created</a></th>
+        <th><a href="?contents-sortOn=contents-modifiedColumn-3&contents-sortOrder=ascending" title="Sort">Modified</a></th>
+      </tr>
+    </thead>
+    <tbody>
+    </tbody>
+  </table>
+    </div>
+    </div>
+    <div>
+      <div class="buttons">
+      </div>
+    </div>
+  </form>
+      </div>
+    </div>
+  </div>
+  ...


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/__init__.py
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/__init__.py	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/__init__.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1 @@
+# Make a package.


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/browser.zcml
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/browser.zcml	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/browser.zcml	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,19 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <zope:registerIn registry="zamplugin.contents.plugin.ContentsBaseRegistry">
+
+    <z3c:pagelet
+        name="contents.html"
+        for="zope.app.container.interfaces.IReadContainer"
+        class="z3c.contents.browser.Contents"
+        permission="zope.ManageContent"
+        layer="zam.api.layer.IContentsPluginLayer"
+        />
+
+  </zope:registerIn>
+
+</configure>


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/configure.zcml
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/configure.zcml	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/configure.zcml	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,19 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="zam">
+
+  <include file="plugin.zcml" />
+
+  <!-- plugin management for IContentsPluginLayer -->
+  <adapter
+      factory="zam.api.browser.plugin.PluginManagement"
+      for="zamplugin.contents.plugin.ContentsPlugin
+           zam.api.layer.IContentsPluginLayer
+           zope.app.component.interfaces.ISite"
+      provides="zam.api.interfaces.IPluginManagement"
+      />
+
+  <include file="browser.zcml" />
+  <include file="menu.zcml" />
+
+</configure>


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/ftesting.zcml
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/ftesting.zcml	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/ftesting.zcml	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,17 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zope">
+
+  <!-- use ftesting configuration from zam.api -->
+  <include package="zam.skin" file="ftesting.zcml" />
+
+  <!-- include z3c configuration -->
+  <include package="z3c.table" />
+  <include package="z3c.contents" />
+
+  <!-- zamplugin configuration -->
+  <include package="zamplugin.contents" />
+
+</configure>


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/menu.py
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/menu.py	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/menu.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# 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: layer.py 197 2007-04-13 05:03:32Z rineichen $
+"""
+
+from z3c.menu.ready2go import item
+
+import zam.api.interfaces
+
+
+class ContentsMenuItem(item.ContextMenuItem):
+    """ZAM global contents.html menu item."""
+
+    viewName = 'contents.html'
+    viewInterface = zam.api.interfaces.IRootMenuItemPage
+    weight = 1


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/menu.zcml
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/menu.zcml	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/menu.zcml	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,20 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    i18n_domain="zam">
+
+  <zope:registerIn registry="zamplugin.contents.plugin.ContentsBaseRegistry">
+
+    <!-- IContextMenu -->
+    <viewlet
+        name="Contents"
+        for="zope.app.container.interfaces.IReadContainer"
+        class=".menu.ContentsMenuItem"
+        manager="zam.api.menu.IContextMenu"
+        layer="zam.api.layer.IContentsPluginLayer"
+        permission="zope.ManageContent"
+        />
+
+  </zope:registerIn>
+
+</configure>


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/plugin.py
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/plugin.py	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/plugin.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# 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
+
+
+ContentsBaseRegistry = baseregistry.BaseComponents(
+    zope.component.globalSiteManager, 'zamplugin.contents')
+
+
+class ContentsPlugin(plugin.BaseRegistryPlugin):
+    """ZAM contents.html plugin for IContainer."""
+
+    registry = ContentsBaseRegistry
+
+    title = _("Container management page")
+
+    description = _("This container management page is configured for "
+                    "IReadContainer.")


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/plugin.zcml
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/plugin.zcml	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/plugin.zcml	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,17 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="zam">
+
+  <utility
+      component=".plugin.ContentsBaseRegistry"
+      provides="zope.component.interfaces.IComponents"
+      name="zamplugin.contents"
+      />
+
+  <utility
+      factory=".plugin.ContentsPlugin"
+      provides="zam.api.interfaces.IPlugin"
+      name="zamplugin.contents"
+      />
+
+</configure>


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

Added: zamplugin.contents/trunk/src/zamplugin/contents/tests.py
===================================================================
--- zamplugin.contents/trunk/src/zamplugin/contents/tests.py	                        (rev 0)
+++ zamplugin.contents/trunk/src/zamplugin/contents/tests.py	2008-04-13 02:20:29 UTC (rev 85320)
@@ -0,0 +1,47 @@
+##############################################################################
+#
+# 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
+import z3c.testing
+
+from zam.api.interfaces import IBaseRegistryPlugin
+from zamplugin.contents import plugin
+
+functional.defineLayer('TestLayer', 'ftesting.zcml')
+
+
+class TestNavigationPlugin(z3c.testing.InterfaceBaseTest):
+
+    def getTestInterface(self):
+        return IBaseRegistryPlugin
+
+    def getTestClass(self):
+        return plugin.ContentsPlugin
+
+
+def test_suite():
+    suite = unittest.TestSuite()
+    s = functional.FunctionalDocFileSuite('README.txt')
+    s.layer = TestLayer
+    suite.addTest(s)
+    suite.addTest(unittest.makeSuite(TestNavigationPlugin))
+    return suite
+
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


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



More information about the Checkins mailing list