Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f1d4ff20
Commit
f1d4ff20
authored
Nov 16, 2011
by
Christian Theune
Browse files
Options
Browse Files
Download
Plain Diff
re-enable the ++skin++ traverser
parents
246c1c81
c12ae55b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
9 deletions
+124
-9
doc/CHANGES.rst
doc/CHANGES.rst
+0
-9
src/Products/Five/browser/tests/skin.py
src/Products/Five/browser/tests/skin.py
+20
-0
src/Products/Five/browser/tests/skin.txt
src/Products/Five/browser/tests/skin.txt
+54
-0
src/Products/Five/browser/tests/skin.zcml
src/Products/Five/browser/tests/skin.zcml
+23
-0
src/Products/Five/browser/tests/test_skin.py
src/Products/Five/browser/tests/test_skin.py
+20
-0
src/Zope2/App/traversing.zcml
src/Zope2/App/traversing.zcml
+7
-0
No files found.
doc/CHANGES.rst
View file @
f1d4ff20
...
...
@@ -124,15 +124,6 @@ Restructuring
`lib/python` and `Products` from the default. You can continue to manually
add these back.
- Removed the rarely used support for the `++skin++` traverser. You can enable
it in your own applications by defining::
<adapter
name="skin"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.skin" />
- Five.browser: Marked `processInputs` and `setPageEncoding` as deprecated.
`processInputs` was replaced by the `postProcessInputs` request method and
the charset negotiation done by `setPageEncoding` was never fully supported.
...
...
src/Products/Five/browser/tests/skin.py
0 → 100644
View file @
f1d4ff20
##############################################################################
#
# Copyright (c) 2006 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.
#
##############################################################################
"""Test skins
"""
from
zope.publisher.interfaces.browser
import
IDefaultBrowserLayer
class
ITestSkin
(
IDefaultBrowserLayer
):
pass
src/Products/Five/browser/tests/skin.txt
0 → 100644
View file @
f1d4ff20
Test layer and skin support
===========================
Let's register a test layer and test skin:
>>> import Products.Five.browser.tests
>>> from Zope2.App import zcml
>>> zcml.load_config("configure.zcml", Products.Five)
>>> zcml.load_config("skin.zcml", package=Products.Five.browser.tests)
Let's add a test object that we'll access the test page from:
>>> from Products.Five.tests.testing.simplecontent import manage_addSimpleContent
>>> manage_addSimpleContent(self.folder, 'testoid', 'Testoid')
The view was registered on a different layer than 'default', that's
why we can't access it straight away:
>>> print http(r"""
... GET /test_folder_1_/testoid/eagle.html HTTP/1.1
... """)
HTTP/1.1 404 Not Found
...
It works when we explicitly use the skin that includes that layer:
>>> print http(r"""
... GET /test_folder_1_/testoid/++skin++TestSkin/eagle.html HTTP/1.1
... """)
HTTP/1.1 200 OK
...
The eagle has landed
Or when we make that skin the default skin:
>>> zcml.load_string('''
... <browser:defaultSkin
... xmlns:browser="http://namespaces.zope.org/browser"
... name="TestSkin" />
... ''')
>>> print http(r"""
... GET /test_folder_1_/testoid/eagle.html HTTP/1.1
... """)
HTTP/1.1 200 OK
...
The eagle has landed
Clean up
--------
>>> from zope.component.testing import tearDown
>>> tearDown()
src/Products/Five/browser/tests/skin.zcml
0 → 100644
View file @
f1d4ff20
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta"
xmlns:browser="http://namespaces.zope.org/browser">
<!-- make the zope2.Public permission work -->
<meta:redefinePermission from="zope2.Public" to="zope.Public" />
<interface
interface=".skin.ITestSkin"
type="zope.publisher.interfaces.browser.IBrowserSkinType"
name="TestSkin"
/>
<browser:page
for="Products.Five.tests.testing.simplecontent.ISimpleContent"
class=".pages.SimpleView"
attribute="eagle"
name="eagle.html"
permission="zope2.Public"
layer=".skin.ITestSkin"
/>
</configure>
src/Products/Five/browser/tests/test_skin.py
0 → 100644
View file @
f1d4ff20
##############################################################################
#
# 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.
#
##############################################################################
"""Test browser pages
"""
def
test_suite
():
from
Testing.ZopeTestCase
import
FunctionalDocFileSuite
return
FunctionalDocFileSuite
(
'skin.txt'
,
package
=
'Products.Five.browser.tests'
)
src/Zope2/App/traversing.zcml
View file @
f1d4ff20
...
...
@@ -37,6 +37,13 @@
factory="zope.traversing.namespace.adapter"
/>
<adapter
name="skin"
for="* zope.publisher.interfaces.IRequest"
provides="zope.traversing.interfaces.ITraversable"
factory="zope.traversing.namespace.skin"
/>
<adapter
name="resource"
for="* zope.publisher.interfaces.IRequest"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment