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

Roger Ineichen roger at projekt01.ch
Sun Mar 23 07:10:49 EDT 2008


Log message for revision 84865:
  Added initial implementation

Changed:
  A   zamplugin.authenticator/branches/
  A   zamplugin.authenticator/tags/
  A   zamplugin.authenticator/trunk/
  A   zamplugin.authenticator/trunk/CHANGES.txt
  A   zamplugin.authenticator/trunk/README.txt
  A   zamplugin.authenticator/trunk/bootstrap.py
  A   zamplugin.authenticator/trunk/buildout.cfg
  A   zamplugin.authenticator/trunk/externals/
  A   zamplugin.authenticator/trunk/setup.py
  A   zamplugin.authenticator/trunk/src/
  A   zamplugin.authenticator/trunk/src/zamplugin/
  A   zamplugin.authenticator/trunk/src/zamplugin/__init__.py
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/README.txt
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/__init__.py
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/__init__.py
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/authenticator.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/configure.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/credential.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/group.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/login.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/user.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/configure.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/ftesting.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.py
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.py
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.zcml
  A   zamplugin.authenticator/trunk/src/zamplugin/authenticator/tests.py

-=-
Added: zamplugin.authenticator/trunk/CHANGES.txt
===================================================================
--- zamplugin.authenticator/trunk/CHANGES.txt	                        (rev 0)
+++ zamplugin.authenticator/trunk/CHANGES.txt	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+Version 0.5.0 (unreleased)
+-------------------------
+
+- Initial Release


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

Added: zamplugin.authenticator/trunk/README.txt
===================================================================
--- zamplugin.authenticator/trunk/README.txt	                        (rev 0)
+++ zamplugin.authenticator/trunk/README.txt	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,2 @@
+This package provides a z3c.authenticator management for ZAM 
+(Zope 3 Application Management).


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

Added: zamplugin.authenticator/trunk/bootstrap.py
===================================================================
--- zamplugin.authenticator/trunk/bootstrap.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/bootstrap.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -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.authenticator/trunk/bootstrap.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.authenticator/trunk/buildout.cfg
===================================================================
--- zamplugin.authenticator/trunk/buildout.cfg	                        (rev 0)
+++ zamplugin.authenticator/trunk/buildout.cfg	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,153 @@
+[buildout]
+develop = .
+          externals/z3c.authenticator
+          externals/z3c.contents
+          externals/z3c.menu.ready2go
+          externals/z3c.table
+          externals/zam.api
+          externals/zam.skin
+
+parts = logs app var test checker coverage
+
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zamplugin.authenticator [test]
+
+
+[checker]
+recipe = lovely.recipe:importchecker
+path = src/zamplugin/authenticator
+
+
+[coverage]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+
+
+[logs]
+recipe = lovely.recipe:mkdir
+path = parts/logs
+
+
+[app]
+recipe = z3c.recipe.dev:app
+eggs = zamplugin.authenticator
+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.skin -->
+  <include package="zam.skin" file="app.zcml" />
+
+  <!-- load 3rd party configuration -->
+  <include package="z3c.table" />
+  <include package="z3c.contents" />
+
+  <!-- zamplugin configuration -->
+  <include package="zamplugin.authenticator" />
+
+
+  <!-- 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.authenticator/trunk/setup.py
===================================================================
--- zamplugin.authenticator/trunk/setup.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/setup.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,106 @@
+##############################################################################
+#
+# 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.authenticator',
+    version='0.5.0',
+    author = "Roger Ineichen and the Zope Community",
+    author_email = "zope3-dev at zope.org",
+    description = "Site manager support for Zope Application Management",
+    long_description=(
+        read('README.txt')
+        + '\n\n' +
+        read('CHANGES.txt')
+        ),
+    license = "ZPL 2.1",
+    keywords = "zope zope3 z3c authenticator 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.authenticator',
+    packages = find_packages('src'),
+    include_package_data = True,
+    package_dir = {'':'src'},
+    namespace_packages = ['zamplugin'],
+    extras_require = dict(
+        test = [
+            'z3c.coverage',
+            'z3c.testing',
+            'zope.app.appsetup',
+            'zope.app.authentication',
+            'zope.app.component',
+            'zope.app.keyreference',
+            'zope.app.publication',
+            'zope.app.schema',
+            'zope.app.testing',
+            'zope.copypastemove',
+            'zope.i18n',
+            'zope.publisher',
+            'zope.schema',
+            'zope.security',
+            'zope.securitypolicy',
+            'zope.session',
+            'zope.testing',
+            'zope.testbrowser',
+            ],
+        ),
+    install_requires = [
+        'setuptools',
+        'z3c.baseregistry',
+        'z3c.batching',
+        'z3c.form',
+        'z3c.formui',
+        'z3c.layer.pagelet',
+        'z3c.layer.ready2go',
+        'z3c.menu.ready2go',
+        'z3c.pagelet',
+        'z3c.table',
+        'z3c.contents',
+        'z3c.batching',
+        'z3c.authenticator',
+        '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',
+        ],
+    zip_safe = False,
+)


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

Added: zamplugin.authenticator/trunk/src/zamplugin/__init__.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/__init__.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/__init__.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -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.authenticator/trunk/src/zamplugin/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/README.txt
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/README.txt	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/README.txt	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,23 @@
+======
+README
+======
+
+This package contains the site manager part for the Zope Application 
+Management.
+
+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.authenticator/trunk/src/zamplugin/authenticator/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/__init__.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/__init__.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/__init__.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1 @@
+# Make a package.


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/__init__.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/__init__.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/__init__.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1 @@
+# Make a package.


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/authenticator.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/authenticator.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/authenticator.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,42 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <configure package="z3c.authenticator.browser">
+
+    <!-- IAuthenticator -->
+    <z3c:pagelet
+        name="addAuthenticator.html"
+        for="..interfaces.IAuthenticator"
+        class=".authenticator.AuthenticatorAddForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="edit.html"
+        for="..interfaces.IAuthenticator"
+        class=".authenticator.AuthenticatorEditForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="contents.html"
+        for="..interfaces.IAuthenticator"
+        class="z3c.contents.browser.ContentsPage"
+        permission="zope.ManageSite"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.IAuthenticator"
+        name="contents.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+  </configure>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/configure.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/configure.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/configure.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,13 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <include file="authenticator.zcml" />
+  <include file="credential.zcml" />
+  <include file="group.zcml" />
+  <include file="user.zcml" />
+  <include file="login.zcml" />
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/credential.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/credential.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/credential.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,33 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <configure package="z3c.authenticator.browser">
+
+    <!-- ICredentialsPlugin -->
+    <z3c:pagelet
+        name="edit.html"
+        for="..interfaces.ISessionCredentialsPlugin"
+        class=".credential.SessionCredentialsPluginEditForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+    <z3c:pagelet
+        name="edit.html"
+        for="..interfaces.IHTTPBasicAuthCredentialsPlugin"
+        class=".credential.HTTPBasicAuthCredentialsPluginEditForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.ICredentialsPlugin"
+        name="edit.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+  </configure>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/group.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/group.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/group.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,59 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <configure package="z3c.authenticator.browser">
+
+    <!-- GroupContainer -->
+    <z3c:pagelet
+        name="addGroupContainer.html"
+        for="..interfaces.IAuthenticator"
+        class=".group.GroupContainerAddForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="contents.html"
+        for="..interfaces.IGroupContainer"
+        class="z3c.contents.browser.ContentsPage"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.IGroupContainer"
+        name="contents.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+
+    <!-- Group -->
+    <z3c:pagelet
+        name="addGroup.html"
+        for="..interfaces.IGroupContainer"
+        class=".group.GroupAddForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="edit.html"
+        for="..interfaces.IGroup"
+        class=".group.GroupEditForm"
+        menu="zmi_views" title="Edit"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.IGroup"
+        name="edit.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+  </configure>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/login.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/login.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/login.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,34 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <configure package="z3c.authenticator.browser">
+
+    <!-- login form -->
+    <z3c:pagelet
+        name="loginForm.html"
+        for="*"
+        class=".login.LoginForm"
+        permission="zope.Public"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+  
+    <z3c:template
+        template="login.pt"
+        for=".login.LoginForm"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+  
+    <!-- logout form -->
+    <page
+        name="logout.html"
+        for="*"
+        class=".login.SiteLogout"
+        permission="zope.Public"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+  </configure>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/user.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/user.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/browser/user.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,58 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    xmlns:z3c="http://namespaces.zope.org/z3c"
+    i18n_domain="zam">
+
+  <configure package="z3c.authenticator.browser">
+
+    <!-- IUserContainer -->
+    <z3c:pagelet
+        name="addUser.html"
+        for="..interfaces.IUserContainer"
+        class=".user.UserAddForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="contents.html"
+        for="..interfaces.IUserContainer"
+        class="z3c.contents.browser.ContentsPage"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.IUserContainer"
+        name="contents.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+
+    <!-- IUser -->
+    <z3c:pagelet
+        name="addUserContainer.html"
+        for="..interfaces.IAuthenticator"
+        class=".user.UserContainerAddForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <z3c:pagelet
+        name="edit.html"
+        for="..interfaces.IUser"
+        class=".user.UserEditForm"
+        permission="zope.ManageServices"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+    <defaultView
+        for="..interfaces.IUser"
+        name="edit.html"
+        layer="zam.api.layer.IAuthenticatorPluginLayer"
+        />
+
+  </configure>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/configure.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/configure.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/configure.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,29 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="zam">
+
+  <include file="plugin.zcml" />
+
+  <!-- plugin management for IAuthenticatorPluginLayer -->
+  <adapter
+      factory="zam.api.browser.plugin.PluginManagement"
+      for="zamplugin.authenticator.plugin.AuthenticatorPlugin
+           zam.api.layer.IAuthenticatorPluginLayer
+           zope.app.component.interfaces.ISite"
+      provides="zam.api.interfaces.IPluginManagement"
+      />
+
+  <registerIn registry="zamplugin.authenticator.plugin.AuthenticatorBaseRegistry">
+    <view
+        name="etc"
+        type="zam.api.layer.IAuthenticatorPluginLayer"
+        provides="zope.traversing.interfaces.ITraversable" for="*"
+        factory="zope.traversing.namespace.etc"
+        />
+  
+    <include package=".browser" />
+    <include file="menu.zcml" />
+
+  </registerIn>
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/ftesting.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/ftesting.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/ftesting.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,16 @@
+<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" />
+
+  <!-- load 3rd party configuration -->
+  <include package="z3c.contents" />
+
+  <!-- zamplugin configuration -->
+  <include package="zamplugin.authenticator" />
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,64 @@
+##############################################################################
+#
+# 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"
+
+from z3c.menu.ready2go import item
+
+
+
+# IAddMenu
+class AddUserContainerMenuItem(item.AddMenuItem):
+    """Add user container menu item."""
+
+    viewName = 'addUserContainer.html'
+    weight = 1
+
+
+class AddGroupContainerMenuItem(item.AddMenuItem):
+    """Add user container menu item."""
+
+    viewName = 'addGrouContainer.html'
+    weight = 1
+
+
+class AddGroupMenuItem(item.AddMenuItem):
+    """Add user menu item."""
+
+    viewName = 'addGroup.html'
+    weight = 1
+
+
+class AddUserMenuItem(item.AddMenuItem):
+    """Add user menu item."""
+
+    viewName = 'addUser.html'
+    weight = 1
+
+
+# IContextMenu
+class ContentsMenuItem(item.ContextMenuItem):
+    """Contents menu item."""
+
+    viewName = 'contents.html'
+    weight = 1
+
+
+class EditMenuItem(item.ContextMenuItem):
+    """Edit menu item."""
+
+    viewName = 'edit.html'
+    weight = 2


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/menu.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,122 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    i18n_domain="zam">
+
+  <!-- IAuthenticator -->
+  <viewlet
+      name="Group Container"
+      for="z3c.authenticator.interfaces.IAuthenticator"
+      class=".menu.AddGroupContainerMenuItem"
+      manager="zam.api.menu.IAddMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+  <viewlet
+      name="User Container"
+      for="z3c.authenticator.interfaces.IAuthenticator"
+      class=".menu.AddUserContainerMenuItem"
+      manager="zam.api.menu.IAddMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+  <viewlet
+      name="Contents"
+      for="z3c.authenticator.interfaces.IAuthenticator"
+      class=".menu.ContentsMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+  <viewlet
+      name="Edit"
+      for="z3c.authenticator.interfaces.IAuthenticator"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- IUserContainer -->
+  <viewlet
+      name="User"
+      for="z3c.authenticator.interfaces.IUserContainer"
+      class=".menu.AddUserMenuItem"
+      manager="zam.api.menu.IAddMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+  <viewlet
+      name="Contents"
+      for="z3c.authenticator.interfaces.IUserContainer"
+      class=".menu.ContentsMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- IUser -->
+  <viewlet
+      name="Edit"
+      for="z3c.authenticator.interfaces.IUser"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- IGroupContainer -->
+  <viewlet
+      name="Group"
+      for="z3c.authenticator.interfaces.IGroupContainer"
+      class=".menu.AddGroupMenuItem"
+      manager="zam.api.menu.IAddMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+  <viewlet
+      name="Contents"
+      for="z3c.authenticator.interfaces.IGroupContainer"
+      class=".menu.ContentsMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- IGroup -->
+  <viewlet
+      name="Edit"
+      for="z3c.authenticator.interfaces.IGroup"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- ISessionCredentialsPlugin -->
+  <viewlet
+      name="Edit"
+      for="z3c.authenticator.interfaces.ISessionCredentialsPlugin"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+
+  <!-- IHTTPBasicAuthCredentialsPlugin -->
+  <viewlet
+      name="Edit"
+      for="z3c.authenticator.interfaces.IHTTPBasicAuthCredentialsPlugin"
+      class=".menu.EditMenuItem"
+      manager="zam.api.menu.IContextMenu"
+      layer="zam.api.layer.IAuthenticatorPluginLayer"
+      permission="zope.ManageServices"
+      />
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -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
+
+
+AuthenticatorBaseRegistry = baseregistry.BaseComponents(
+    zope.component.globalSiteManager, 'zamplugin.authenticator')
+
+
+class AuthenticatorPlugin(plugin.BaseRegistryPlugin):
+    """ZAM authenticator plugin."""
+
+    registry = AuthenticatorBaseRegistry
+
+    title = _("Z3C Authenticator management")
+
+    description = _("ZAM Authenticator Management.")


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.zcml
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.zcml	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/plugin.zcml	2008-03-23 11:10:49 UTC (rev 84865)
@@ -0,0 +1,17 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    i18n_domain="zam">
+
+  <utility
+      component=".plugin.AuthenticatorBaseRegistry"
+      provides="zope.component.interfaces.IComponents"
+      name="zamplugin.authenticator"
+      />
+
+  <utility
+      factory=".plugin.AuthenticatorPlugin"
+      provides="zam.api.interfaces.IPlugin"
+      name="zamplugin.authenticator"
+      />
+
+</configure>


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

Added: zamplugin.authenticator/trunk/src/zamplugin/authenticator/tests.py
===================================================================
--- zamplugin.authenticator/trunk/src/zamplugin/authenticator/tests.py	                        (rev 0)
+++ zamplugin.authenticator/trunk/src/zamplugin/authenticator/tests.py	2008-03-23 11:10:49 UTC (rev 84865)
@@ -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.authenticator/trunk/src/zamplugin/authenticator/tests.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list