[Checkins] SVN: z3c.layer/trunk/src/z3c/layer/ Implemented minimal and trusted layers

Roger Ineichen roger at projekt01.ch
Thu Aug 10 04:24:14 EDT 2006


Log message for revision 69386:
  Implemented minimal and trusted layers

Changed:
  A   z3c.layer/trunk/src/z3c/layer/minimal/
  A   z3c.layer/trunk/src/z3c/layer/minimal/README.txt
  A   z3c.layer/trunk/src/z3c/layer/minimal/SETUP.cfg
  A   z3c.layer/trunk/src/z3c/layer/minimal/__init__.py
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/__init__.py
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/notfound.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/systemerror.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/unauthorized.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/browser/user.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/__init__.py
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/error_macros.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/ftesting.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/page.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/page_macros.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/test_layer.py
  A   z3c.layer/trunk/src/z3c/layer/minimal/ftests/view_macros.pt
  A   z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-ftesting.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.app.form.browser.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.app.http.exception.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publication.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publisher.browser.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.browser.zcml
  A   z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.zcml
  A   z3c.layer/trunk/src/z3c/layer/trusted/
  A   z3c.layer/trunk/src/z3c/layer/trusted/README.txt
  A   z3c.layer/trunk/src/z3c/layer/trusted/SETUP.cfg
  A   z3c.layer/trunk/src/z3c/layer/trusted/__init__.py
  A   z3c.layer/trunk/src/z3c/layer/trusted/configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/trusted/ftesting.zcml
  A   z3c.layer/trunk/src/z3c/layer/trusted/ftests.py
  A   z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-configure.zcml
  A   z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-ftesting.zcml
  A   z3c.layer/trunk/src/z3c/layer/trusted/zope.traversing.browser.zcml

-=-
Added: z3c.layer/trunk/src/z3c/layer/minimal/README.txt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/README.txt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/README.txt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,179 @@
+======
+README
+======
+
+This package contains the minimal layer. This layer supports a correct set of 
+component registration and can be used for inheritation in custom skins.
+
+Right now the default implementation in Zope3 has different restriction in the
+traversal concept and use to much registration on the default layer.
+
+
+IMinimalBrowserLayer
+--------------------
+
+The minimal layer is useful for build custom presentation skins without access 
+to ZMI menus like zmi_views etc. This means there is no menu item registred if 
+you use this layer.
+
+This layer is NOT derived from IDefaultBrowserLayer. Therefore it provides 
+only a minimal set of the most important public views such as @@absolute_url. 
+The following packages are accounted:
+
+- zope.app.http.exception
+- zope.app.publication
+- zope.app.publisher.browser
+- zope.app.traversing
+- zope.app.traversing.browser
+
+
+Testing
+-------
+
+For testing the IMinimalBrowserLayer we use the testing skin defined in the 
+ftests package which uses the IMinimalBrowserLayer as the only base layer.
+This means, that our testing skin provides only the views defined in the 
+minimal package and it's testing views defined in ftests.
+
+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.addHeader('Authorization', 'Basic mgr:mgrpw')
+  >>> skinURL = 'http://localhost/++skin++MinimalTesting'
+  >>> manager.open(skinURL + '/page.html')
+  >>> manager.url
+  'http://localhost/++skin++MinimalTesting/page.html'
+
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <BLANKLINE>
+    test page
+  <BLANKLINE>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+Now check the not found page which is a exception view on the exception
+``zope.publisher.interfaces.INotFound``:
+
+  >>> manager.open(skinURL + '/foobar.html')
+  Traceback (most recent call last):
+  ...
+  HTTPError: HTTP Error 404: Not Found
+
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <h3>
+      The page that you are trying to access is not available
+    </h3>
+    <br />
+    <b>Please note the following:</b>
+    <br />
+    <ol>
+      <li>You might have misspelled the url </li>
+      <li>
+        You might be trying to access a non-existing page
+      </li>
+    </ol>
+    <a href="javascript:history.back(1);">
+      <span>
+        Go back and try another URL.
+      </span>
+    </a>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check the user error page which is a view registred for 
+``zope.exceptions.interfaces.IUserError`` exceptions:
+
+  >>> manager.open(skinURL + '/@@usererror.html')
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <div>simply user error</div>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check error view registred for 
+``zope.interface.common.interfaces.IException``:
+
+  >>> manager.open(skinURL + '/@@systemerror.html')
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <h3>A system error occours.</h3>
+    <br />
+    <b>Contact the administrator.</b>
+    <a href="javascript:history.back(1);">
+      <span>
+       Go back and try another URL.
+      </span>
+    </a>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check the ``zope.security.interfaces.IUnauthorized`` view, use a new 
+unregistred user (test browser) for this:
+
+  >>> unauthorized = Browser()
+  >>> unauthorized.open(skinURL + '/@@forbidden.html')
+  Traceback (most recent call last):
+  ...
+  HTTPError: HTTP Error 401: Unauthorized
+
+  >>> print unauthorized.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div>
+  <BLANKLINE>
+  <h1>Unauthorized</h1>
+  <BLANKLINE>
+  <p>You are not authorized</p>
+  <BLANKLINE>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/SETUP.cfg
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/SETUP.cfg	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/SETUP.cfg	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,3 @@
+<data-files zopeskel/etc/package-includes>
+  z3c.layer.minimal-*.zcml
+</data-files>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/SETUP.cfg
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/__init__.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/__init__.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/__init__.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""
+
+from zope.publisher.interfaces.browser import IBrowserRequest
+
+
+class IMinimalBrowserLayer(IBrowserRequest):
+    """Like IDefaultBrowserLayer but only with the most important views."""


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/__init__.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/__init__.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/__init__.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,51 @@
+<configure
+    xmlns:zope="http://namespaces.zope.org/zope"
+    xmlns="http://namespaces.zope.org/browser"
+    i18n_domain="z3c">
+
+  <page
+      for="zope.interface.common.interfaces.IException"
+      name="index.html"
+      class="zope.app.exception.systemerror.SystemErrorView"
+      template="systemerror.pt"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <page
+      for="zope.publisher.interfaces.ITraversalException"
+      name="index.html"
+      class="zope.app.exception.systemerror.SystemErrorView"
+      template="systemerror.pt"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <page
+      for="zope.security.interfaces.IUnauthorized"
+      name="index.html"
+      class="zope.app.exception.browser.unauthorized.Unauthorized"
+      template="unauthorized.pt"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <page
+      for="zope.exceptions.interfaces.IUserError"
+      name="index.html"
+      class="zope.app.exception.browser.user.UserErrorView"
+      template="user.pt"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <page
+      for="zope.publisher.interfaces.INotFound"
+      name="index.html"
+      class="zope.app.exception.browser.notfound.NotFound"
+      template="notfound.pt"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/notfound.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/notfound.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/notfound.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,23 @@
+<html metal:use-macro="context/@@standard_macros/error">
+<body>
+<div align="center" metal:fill-slot="body">
+  <h3  i18n:translate="">
+    The page that you are trying to access is not available
+  </h3>
+  <br/>
+  <b i18n:translate="">Please note the following:</b>
+  <br/>
+  <ol>
+    <li i18n:translate="">You might have misspelled the url </li>
+    <li i18n:translate="">
+      You might be trying to access a non-existing page
+    </li>
+  </ol>
+  <a href="javascript:history.back(1);">
+    <span i18n:translate="notfound_try_again">
+      Go back and try another URL.
+    </span>
+  </a>
+</div>
+</body>
+</html>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/notfound.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/systemerror.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/systemerror.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/systemerror.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,14 @@
+<html metal:use-macro="context/@@standard_macros/error">
+<body>
+<div align="center" metal:fill-slot="body">
+  <h3 i18n:translate="">A system error occours.</h3>
+  <br/>
+  <b i18n:translate="">Contact the administrator.</b>
+  <a href="javascript:history.back(1);">
+    <span i18n:translate="notfound_try_again">
+     Go back and try another URL.
+    </span>
+  </a>
+</div>
+</body>
+</html>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/systemerror.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/unauthorized.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/unauthorized.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/unauthorized.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,10 @@
+<tal:Make_sure_we_process_the_authorization_challenge_first
+  condition="view/issueChallenge"
+/><html metal:use-macro="context/@@standard_macros/error">
+<body i18n:domain="z3c">
+<div metal:fill-slot="body">
+  <h3 i18n:translate="">Unauthorized</h3>
+  <p i18n:translate="">You are not authorized</p>
+</div>
+</body>
+</html>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/unauthorized.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/browser/user.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/browser/user.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/browser/user.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,7 @@
+<html metal:use-macro="context/@@standard_macros/error">
+<body>
+<div align="center" metal:fill-slot="body">
+  <div tal:repeat="part context" tal:content="part">Error message</div>
+</div>
+</body>
+</html>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/browser/user.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,20 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <interface
+      interface="z3c.layer.minimal.IMinimalBrowserLayer"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      />
+
+  <include file="zope.app.form.browser.zcml" />
+  <include file="zope.app.http.exception.zcml" />
+  <include file="zope.app.publication.zcml" />
+  <include file="zope.app.publisher.browser.zcml" />
+  <include file="zope.traversing.zcml" />
+  <include file="zope.traversing.browser.zcml" />
+
+  <include package=".browser" />
+  <include package=".ftests" />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/__init__.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/__init__.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/__init__.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,79 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""
+
+import zope.interface
+import zope.component
+from zope.publisher.browser import BrowserView, BrowserPage
+from zope.security.interfaces import Unauthorized
+from zope.exceptions.interfaces import UserError
+
+from z3c.layer import minimal
+
+
+class IMinimalTestingSkin(minimal.IMinimalBrowserLayer):
+    """The IMinimalBrowserLayer testing skin."""
+
+
+class TestingStandardMacros(BrowserView):
+
+    zope.interface.implements(zope.interface.common.mapping.IItemMapping)
+
+    macro_pages = ('page_macros', 'view_macros', 'error_macros')
+    aliases = {
+        'view': 'page',
+        'dialog': 'page',
+        'addingdialog': 'page'
+        }
+
+    def __getitem__(self, key):
+        key = self.aliases.get(key, key)
+        context = self.context
+        request = self.request
+        for name in self.macro_pages:
+            page = zope.component.getMultiAdapter((context, request), 
+                name=name)
+            try:
+                v = page[key]
+            except KeyError:
+                pass
+            else:
+                return v
+        raise KeyError(key)
+
+
+class UnauthorizedPage(BrowserPage):
+    """Unauthorized view."""
+
+    def __call__(self):
+        raise Unauthorized('not authorized')
+        return u''
+
+
+class UserErrorPage(BrowserPage):
+    """Unauthorized view."""
+
+    def __call__(self):
+        raise UserError('simply user error')
+        return u''
+
+
+class SystemErrorPage(BrowserPage):
+    """Unauthorized view."""
+
+    def __call__(self):
+        raise Exception('simply system error')
+        return u''
\ No newline at end of file


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,7 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <include file="ftesting.zcml" />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/error_macros.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/error_macros.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/error_macros.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,10 @@
+<metal:block define-macro="error">
+<html>
+<head>
+  <title>testing</title>
+</head>
+<body>
+<metal:block define-slot="body">body</metal:block>
+</body>
+</html>
+</metal:block>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/error_macros.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/ftesting.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/ftesting.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/ftesting.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,76 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <interface
+      interface="z3c.layer.minimal.ftests.IMinimalTestingSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="MinimalTesting"
+      />
+
+  <browser:page
+      for="*"
+      name="standard_macros"
+      permission="zope.Public"
+      class=".TestingStandardMacros"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      allowed_interface="zope.interface.common.mapping.IItemMapping"
+      />
+
+  <browser:page
+      for="*"
+      name="page_macros"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      template="page_macros.pt"
+      />
+
+  <browser:page
+      for="*"
+      name="view_macros"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      template="view_macros.pt"
+      />
+
+  <browser:page
+      for="*"
+      name="error_macros"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      template="error_macros.pt"
+      />
+
+  <browser:page
+      for="*"
+      name="page.html"
+      permission="zope.ManageContent"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      template="page.pt"
+      />
+
+  <browser:page
+      for="*"
+      name="forbidden.html"
+      permission="zope.View"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      class=".UnauthorizedPage"
+      />
+
+  <browser:page
+      for="*"
+      name="usererror.html"
+      permission="zope.View"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      class=".UserErrorPage"
+      />
+
+  <browser:page
+      for="*"
+      name="systemerror.html"
+      permission="zope.View"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      class=".SystemErrorPage"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/page.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/page.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/page.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,7 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+<metal:block fill-slot="body">
+  test page
+</metal:block>
+</body>
+</html>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/page.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/page_macros.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/page_macros.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/page_macros.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,10 @@
+<metal:block define-macro="page">
+<html>
+<head>
+  <title>testing</title>
+</head>
+<body>
+<metal:block define-slot="body">body</metal:block>
+</body>
+</html>
+</metal:block>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/page_macros.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/test_layer.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/test_layer.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/test_layer.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""
+
+import unittest
+from zope.app.testing import functional
+
+
+def test_suite():
+    suite = unittest.TestSuite((
+        functional.FunctionalDocFileSuite('../README.txt'),
+        ))
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/test_layer.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/ftests/view_macros.pt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/ftests/view_macros.pt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/ftests/view_macros.pt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,10 @@
+<metal:block define-macro="view">
+<html>
+<head>
+  <title>testing</title>
+</head>
+<body>
+<metal:block define-slot="body">body</metal:block>
+</body>
+</html>
+</metal:block>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/ftests/view_macros.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1 @@
+<include package="z3c.layer.minimal" />


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-ftesting.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-ftesting.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-ftesting.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1 @@
+<include package="z3c.layer.minimal.ftests" file="ftesting.zcml" />


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/z3c.layer.minimal-ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.form.browser.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.app.form.browser.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.app.form.browser.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,14 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <!-- Views for Widget Errors -->
+  <view
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      for="zope.app.form.interfaces.IWidgetInputError"
+      provides="zope.app.form.browser.interfaces.IWidgetInputErrorView"
+      factory="zope.app.form.browser.exception.WidgetInputErrorView"
+      permission="zope.Public"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.form.browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.http.exception.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.app.http.exception.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.app.http.exception.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,19 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+  <view
+      for="zope.security.interfaces.IUnauthorized"
+      name="index.html"
+      permission="zope.Public"
+      factory="zope.app.http.exception.unauthorized.Unauthorized"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      for="zope.publisher.interfaces.ITraversalException"
+      name="index.html"
+      permission="zope.Public"
+      factory="zope.app.http.exception.notfound.NotFound"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.http.exception.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publication.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publication.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publication.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,14 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="z3c">
+
+  <browser:view
+      for="zope.app.publication.interfaces.IFileContent"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      class="zope.app.publication.traversers.FileContentTraverser"
+      permission="zope.Public"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publication.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publisher.browser.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publisher.browser.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publisher.browser.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,15 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="z3c">
+
+  <browser:page 
+      name=""
+      for="zope.app.component.interfaces.ISite"
+      class="zope.app.publisher.browser.resources.Resources"
+      permission="zope.Public"
+      allowed_interface="zope.publisher.interfaces.browser.IBrowserPublisher"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.app.publisher.browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.browser.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.browser.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.browser.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,85 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="z3c">
+
+  <adapter
+      for="zope.interface.Interface
+           z3c.layer.minimal.IMinimalBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.publication.traversers.SimpleComponentTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+  <adapter
+      for="zope.app.container.interfaces.IItemContainer
+           z3c.layer.minimal.IMinimalBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.container.traversal.ItemTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+  <adapter
+      for="zope.app.container.interfaces.ISimpleReadContainer
+           z3c.layer.minimal.IMinimalBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.container.traversal.ItemTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+  <view
+      for="*"
+      name="absolute_url"
+      factory="zope.traversing.browser.AbsoluteURL"
+      permission="zope.Public"
+      allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      for="*"
+      factory="zope.traversing.browser.AbsoluteURL"
+      permission="zope.Public"
+      provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      for="zope.traversing.interfaces.IContainmentRoot"
+      name="absolute_url"
+      factory="zope.traversing.browser.SiteAbsoluteURL"
+      permission="zope.Public"
+      allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+      
+  <view
+      for="zope.traversing.interfaces.IContainmentRoot"
+      factory="zope.traversing.browser.SiteAbsoluteURL"
+      permission="zope.Public"
+      provides="zope.traversing.browser.interfaces.IAbsoluteURL"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <browser:page
+      for="*"
+      name="absolute_url"
+      class="zope.traversing.browser.AbsoluteURL"
+      permission="zope.Public"
+      allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <browser:page
+      for="zope.traversing.interfaces.IContainmentRoot"
+      name="absolute_url"
+      class="zope.traversing.browser.SiteAbsoluteURL"
+      permission="zope.Public"
+      allowed_interface="zope.traversing.browser.interfaces.IAbsoluteURL"
+      layer="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,73 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+  <view
+      name="etc"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.etc"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="attribute"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.attr"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="adapter"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.adapter"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="item"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.item"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="acquire"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.acquire"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="view"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.view"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="resource"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.resource"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="skin"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.skin"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="vh"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.vh"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+  <view
+      name="debug"
+      provides="zope.traversing.interfaces.ITraversable" for="*"
+      factory="zope.traversing.namespace.debug"
+      type="z3c.layer.minimal.IMinimalBrowserLayer"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/minimal/zope.traversing.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/README.txt
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/README.txt	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/README.txt	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,164 @@
+======
+README
+======
+
+This package contains the trusted layer. This layer support a correct set of 
+component registration and can be used for inheritation in custom skins.
+
+The ITrustedBrowserLayer supports the same registration set like the 
+IMinimalBrowserLayer. The only difference is, that the trusted layer offers
+trusted traversal adapters. This means a skin using this layer can traverse
+over a PAU (pluggable IAuthentication utility) without to run into a 
+Unautorized exception.
+
+For more information see also the README.txt in z3c.layer.minimal.
+
+
+Testing
+-------
+
+For testing the ITrustedBrowserLayer we use the testing skin defined in the 
+ftests package which uses the ITrustedBrowserLayer. This means, that our 
+testing skin provides also the views defined in the minimal package 
+and it's testing views defined in the minimal ftests.
+
+Login as manager first:
+
+  >>> from zope.testbrowser.testing import Browser
+  >>> manager = Browser()
+  >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
+
+Check if we can access the public page.html view which is registred in the 
+ftesting.zcml file with our skin:
+
+  >>> skinURL = 'http://localhost/++skin++TrustedTesting'
+  >>> manager.open(skinURL + '/page.html')
+  >>> manager.url
+  'http://localhost/++skin++TrustedTesting/page.html'
+
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <BLANKLINE>
+    test page
+  <BLANKLINE>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+Now check the not found page which is a exception view on the exception
+``zope.publisher.interfaces.INotFound``:
+
+  >>> manager.open(skinURL + '/foobar.html')
+  Traceback (most recent call last):
+  ...
+  HTTPError: HTTP Error 404: Not Found
+
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <h3>
+      The page that you are trying to access is not available
+    </h3>
+    <br />
+    <b>Please note the following:</b>
+    <br />
+    <ol>
+      <li>You might have misspelled the url </li>
+      <li>
+        You might be trying to access a non-existing page
+      </li>
+    </ol>
+    <a href="javascript:history.back(1);">
+      <span>
+        Go back and try another URL.
+      </span>
+    </a>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check the user error page which is a view registred for 
+``zope.exceptions.interfaces.IUserError`` exceptions:
+
+  >>> manager.open(skinURL + '/@@usererror.html')
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <div>simply user error</div>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check error view registred for 
+``zope.interface.common.interfaces.IException``:
+
+  >>> manager.open(skinURL + '/@@systemerror.html')
+  >>> print manager.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div align="center">
+    <h3>A system error occours.</h3>
+    <br />
+    <b>Contact the administrator.</b>
+    <a href="javascript:history.back(1);">
+      <span>
+       Go back and try another URL.
+      </span>
+    </a>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>
+
+And check the ``zope.security.interfaces.IUnauthorized`` view, use a new 
+unregistred user (test browser) for this:
+
+  >>> unauthorized = Browser()
+  >>> unauthorized.open(skinURL + '/@@forbidden.html')
+  Traceback (most recent call last):
+  ...
+  HTTPError: HTTP Error 401: Unauthorized
+
+  >>> print unauthorized.contents
+  <BLANKLINE>
+  <html>
+  <head>
+    <title>testing</title>
+  </head>
+  <body>
+  <div>
+  <BLANKLINE>
+  <h1>Unauthorized</h1>
+  <BLANKLINE>
+  <p>You are not authorized</p>
+  <BLANKLINE>
+  </div>
+  </body>
+  </html>
+  <BLANKLINE>
+  <BLANKLINE>


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/SETUP.cfg
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/SETUP.cfg	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/SETUP.cfg	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,3 @@
+<data-files zopeskel/etc/package-includes>
+  z3c.layer.trusted-*.zcml
+</data-files>


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/SETUP.cfg
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/__init__.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/__init__.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/__init__.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""
+
+from z3c.layer import minimal
+
+
+class ITrustedBrowserLayer(minimal.IMinimalBrowserLayer):
+    """Like IMinimalBrowserLayer but with trusted traverser."""


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,12 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <interface
+      interface="z3c.layer.trusted.ITrustedBrowserLayer"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      />
+
+  <include file="zope.traversing.browser.zcml" />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/ftesting.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/ftesting.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/ftesting.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,11 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser">
+
+  <interface
+      interface="z3c.layer.trusted.ftests.ITrustedTestingSkin"
+      type="zope.publisher.interfaces.browser.IBrowserSkinType"
+      name="TrustedTesting"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/ftests.py
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/ftests.py	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/ftests.py	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,40 @@
+##############################################################################
+#
+# Copyright (c) 2005 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$
+"""
+
+import unittest
+from zope.app.testing import functional
+
+from z3c.layer import trusted
+
+
+class ITrustedTestingSkin(trusted.ITrustedBrowserLayer):
+    """The ITrustedBrowserLayer testing skin."""
+
+
+def getRootFolder():
+    return functional.FunctionalTestSetup().getRootFolder()
+
+
+def test_suite():
+    suite = unittest.TestSuite((
+        functional.FunctionalDocFileSuite('README.txt',
+            globs={'getRootFolder': getRootFolder}),
+        ))
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/ftests.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-configure.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-configure.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-configure.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1 @@
+<include package="z3c.layer.trusted" />


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-configure.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-ftesting.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-ftesting.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-ftesting.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1 @@
+<include package="z3c.layer.trusted" file="ftesting.zcml" />


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/z3c.layer.trusted-ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: z3c.layer/trunk/src/z3c/layer/trusted/zope.traversing.browser.zcml
===================================================================
--- z3c.layer/trunk/src/z3c/layer/trusted/zope.traversing.browser.zcml	2006-08-09 20:50:13 UTC (rev 69385)
+++ z3c.layer/trunk/src/z3c/layer/trusted/zope.traversing.browser.zcml	2006-08-10 08:24:12 UTC (rev 69386)
@@ -0,0 +1,33 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="z3c">
+
+  <adapter
+      for="zope.interface.Interface
+           z3c.layer.trusted.ITrustedBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.publication.traversers.SimpleComponentTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+  <adapter
+      for="zope.app.container.interfaces.IItemContainer
+           z3c.layer.trusted.ITrustedBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.container.traversal.ItemTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+  <adapter
+      for="zope.app.container.interfaces.ISimpleReadContainer
+           z3c.layer.trusted.ITrustedBrowserLayer"
+      provides="zope.publisher.interfaces.browser.IBrowserPublisher"
+      factory="zope.app.container.traversal.ItemTraverser"
+      permission="zope.Public"
+      trusted="True"
+      />
+
+</configure>


Property changes on: z3c.layer/trunk/src/z3c/layer/trusted/zope.traversing.browser.zcml
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list