Metadata-Version: 2.1
Name: z3c.layer.minimal
Version: 1.0.2
Summary: Minimal layer setup for Zope3
Home-page: http://pypi.python.org/pypi/z3c.layer.minimal
Author: Zope Foundation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package provides a minimal layer setup for Zope3.
        
        
        Detailed Documentation
        **********************
        
        ================================
        Minimal Browser Layer for Zope 3
        ================================
        
        This package contains the minimal layer. This layer supports a correct set of
        component registration and can be used for inheritance in custom skins.
        
        Right now the default implementation in Zope3 has different restriction in the
        traversal concept and uses to many registrations on the default layer.
        
        
        ``IMinimalBrowserLayer`` Interface
        ----------------------------------
        
        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 registered
        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`` layer we use the testing skin defined
        in the tests package which uses the ``IMinimalBrowserLayer`` layer 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 tests.
        
        Login as manager first:
        
          &gt;&gt;&gt; from zope.testbrowser.testing import Browser
          &gt;&gt;&gt; manager = Browser()
          &gt;&gt;&gt; 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:
        
          &gt;&gt;&gt; manager = Browser()
          &gt;&gt;&gt; manager.addHeader('Authorization', 'Basic mgr:mgrpw')
          &gt;&gt;&gt; skinURL = 'http://localhost/++skin++MinimalTesting'
          &gt;&gt;&gt; manager.open(skinURL + '/page.html')
          &gt;&gt;&gt; manager.url
          'http://localhost/++skin++MinimalTesting/page.html'
        
          &gt;&gt;&gt; print manager.contents
          &lt;BLANKLINE&gt;
          &lt;html&gt;
          &lt;head&gt;
            &lt;title&gt;testing&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;BLANKLINE&gt;
            test page
          &lt;BLANKLINE&gt;
          &lt;/body&gt;
          &lt;/html&gt;
          &lt;BLANKLINE&gt;
          &lt;BLANKLINE&gt;
        
        Now check the not found page which is a exception view on the exception
        ``zope.publisher.interfaces.INotFound``:
        
          &gt;&gt;&gt; manager.open(skinURL + '/foobar.html')
          Traceback (most recent call last):
          ...
          httperror_seek_wrapper: HTTP Error 404: Not Found
        
          &gt;&gt;&gt; print manager.contents
          &lt;BLANKLINE&gt;
          &lt;html&gt;
          &lt;head&gt;
            &lt;title&gt;testing&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div&gt;
            &lt;br /&gt;
            &lt;br /&gt;
            &lt;h3&gt;
              The page you are trying to access is not available
            &lt;/h3&gt;
            &lt;br /&gt;
            &lt;b&gt;
              Please try the following:
            &lt;/b&gt;
            &lt;br /&gt;
            &lt;ol&gt;
              &lt;li&gt;
                Make sure that the Web site address is spelled correctly.
              &lt;/li&gt;
              &lt;li&gt;
                &lt;a href="javascript:history.back(1);"&gt;
                  Go back and try another URL.
                &lt;/a&gt;
              &lt;/li&gt;
            &lt;/ol&gt;
          &lt;/div&gt;
          &lt;/body&gt;
          &lt;/html&gt;
          &lt;BLANKLINE&gt;
          &lt;BLANKLINE&gt;
        
        And check the user error page which is a view registred for
        ``zope.exceptions.interfaces.IUserError`` exceptions:
        
          &gt;&gt;&gt; manager.open(skinURL + '/@@usererror.html')
          &gt;&gt;&gt; print manager.contents
          &lt;BLANKLINE&gt;
          &lt;html&gt;
          &lt;head&gt;
            &lt;title&gt;testing&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div&gt;
            &lt;div&gt;simply user error&lt;/div&gt;
          &lt;/div&gt;
          &lt;/body&gt;
          &lt;/html&gt;
          &lt;BLANKLINE&gt;
          &lt;BLANKLINE&gt;
        
        And check error view registred for
        ``zope.interface.common.interfaces.IException``:
        
          &gt;&gt;&gt; manager.open(skinURL + '/@@systemerror.html')
          &gt;&gt;&gt; print manager.contents
          &lt;BLANKLINE&gt;
          &lt;html&gt;
          &lt;head&gt;
            &lt;title&gt;testing&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div&gt;
            &lt;br /&gt;
            &lt;br /&gt;
            &lt;h3&gt;A system error occurred&lt;/h3&gt;
            &lt;br /&gt;
            &lt;b&gt;Please contact the administrator.&lt;/b&gt;
            &lt;a href="javascript:history.back(1);"&gt;
              Go back and try another URL.
            &lt;/a&gt;
          &lt;/div&gt;
          &lt;/body&gt;
          &lt;/html&gt;
          &lt;BLANKLINE&gt;
          &lt;BLANKLINE&gt;
        
        And check the ``zope.security.interfaces.IUnauthorized`` view, use a new
        unregistred user (test browser) for this:
        
          &gt;&gt;&gt; unauthorized = Browser()
          &gt;&gt;&gt; unauthorized.open(skinURL + '/@@forbidden.html')
          Traceback (most recent call last):
          ...
          httperror_seek_wrapper: HTTP Error 401: Unauthorized
        
          &gt;&gt;&gt; print unauthorized.contents
          &lt;BLANKLINE&gt;
          &lt;html&gt;
          &lt;head&gt;
            &lt;title&gt;testing&lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div&gt;
          &lt;BLANKLINE&gt;
          &lt;h1&gt;Unauthorized&lt;/h1&gt;
          &lt;BLANKLINE&gt;
          &lt;p&gt;You are not authorized&lt;/p&gt;
          &lt;BLANKLINE&gt;
          &lt;/div&gt;
          &lt;/body&gt;
          &lt;/html&gt;
          &lt;BLANKLINE&gt;
          &lt;BLANKLINE&gt;
        
        
        =======
        CHANGES
        =======
        
        1.0.2 (2010-04-18)
        ------------------
        
        - **Security issue:** The traverser defined for
          ``IPageletBrowserLayer`` was a trusted adapter, so the security
          proxy got removed from each traversed object. Thus all sub-objects
          were publically accessable, too.
        
          Making this change might BREAK your application!
          That means if security is not well declared.
        
        
        1.0.1 (2008-01-24)
        ------------------
        
        - Bug: Improved meta-data.
        
        
        1.0.0 (2008-01-21)
        ------------------
        
        - Restructure: Move ``z3c.layer.minimal`` package to it's own top level
          package form ``zope.layer`` to ``z3c.layer.minimal``.
        
        - Restructure: Moved implementation from ``z3c.layer`` to
          ``z3c.layer.minimal``
        
        
        0.2.3 (2007-11-07)
        ------------------
        
        - Forward-Bug: Due to a bug in mechanize, the testbrowser throws
          ``httperror_seek_wrapper`` instead of ``HTTPError`` errors. Thanks to RE
          normalizers, the code will now work whether the bug is fixed or not in
          mechanize.
        
        
        0.2.2 (2007-10-31)
        ------------------
        
        - Bug: Fixed package meta-data.
        
        - Bug: Fixed test failures due to depency updates.
        
        - Restructure: Fixed deprecation warning for ``ZopeSecurityPolicy``.
        
        
        0.2.1 (2007-??-??)
        ------------------
        
        - Changes unknown.
        
        
        0.2.0 (2007-??-??)
        ------------------
        
        - Initial release.
        
Keywords: z3c minimal layer zope zope3
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
Provides-Extra: test
