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
1534f218
Commit
1534f218
authored
Jun 01, 2005
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Plain Diff
Merge r30591 from the trunk:
Update Five to release 1.0.1.
parents
3fe671ef
605924f7
Changes
56
Hide whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
963 additions
and
202 deletions
+963
-202
lib/python/Products/Five/CHANGES.txt
lib/python/Products/Five/CHANGES.txt
+35
-2
lib/python/Products/Five/CREDITS.txt
lib/python/Products/Five/CREDITS.txt
+2
-0
lib/python/Products/Five/README.txt
lib/python/Products/Five/README.txt
+1
-1
lib/python/Products/Five/ReuseUtils.py
lib/python/Products/Five/ReuseUtils.py
+6
-1
lib/python/Products/Five/TrustedExpression.py
lib/python/Products/Five/TrustedExpression.py
+5
-1
lib/python/Products/Five/__init__.py
lib/python/Products/Five/__init__.py
+3
-2
lib/python/Products/Five/adding.py
lib/python/Products/Five/adding.py
+27
-10
lib/python/Products/Five/bridge.py
lib/python/Products/Five/bridge.py
+3
-3
lib/python/Products/Five/browser.py
lib/python/Products/Five/browser.py
+40
-4
lib/python/Products/Five/browserconfigure.py
lib/python/Products/Five/browserconfigure.py
+3
-2
lib/python/Products/Five/configure.zcml
lib/python/Products/Five/configure.zcml
+1
-0
lib/python/Products/Five/doc/main.txt
lib/python/Products/Five/doc/main.txt
+6
-2
lib/python/Products/Five/edit.pt
lib/python/Products/Five/edit.pt
+9
-6
lib/python/Products/Five/eventconfigure.py
lib/python/Products/Five/eventconfigure.py
+3
-3
lib/python/Products/Five/fiveconfigure.py
lib/python/Products/Five/fiveconfigure.py
+3
-2
lib/python/Products/Five/fivedirectives.py
lib/python/Products/Five/fivedirectives.py
+3
-2
lib/python/Products/Five/i18n.zcml
lib/python/Products/Five/i18n.zcml
+9
-0
lib/python/Products/Five/interfaces.py
lib/python/Products/Five/interfaces.py
+2
-4
lib/python/Products/Five/metaclass.py
lib/python/Products/Five/metaclass.py
+2
-1
lib/python/Products/Five/metaconfigure.py
lib/python/Products/Five/metaconfigure.py
+3
-2
lib/python/Products/Five/pagetemplatefile.py
lib/python/Products/Five/pagetemplatefile.py
+5
-2
lib/python/Products/Five/resource.py
lib/python/Products/Five/resource.py
+2
-2
lib/python/Products/Five/security.py
lib/python/Products/Five/security.py
+3
-2
lib/python/Products/Five/sizeconfigure.py
lib/python/Products/Five/sizeconfigure.py
+3
-2
lib/python/Products/Five/skin.py
lib/python/Products/Five/skin.py
+3
-2
lib/python/Products/Five/tests/__init__.py
lib/python/Products/Five/tests/__init__.py
+1
-12
lib/python/Products/Five/tests/adding.txt
lib/python/Products/Five/tests/adding.txt
+54
-0
lib/python/Products/Five/tests/dummy.py
lib/python/Products/Five/tests/dummy.py
+6
-1
lib/python/Products/Five/tests/fivetest.py
lib/python/Products/Five/tests/fivetest.py
+5
-1
lib/python/Products/Five/tests/forms.txt
lib/python/Products/Five/tests/forms.txt
+427
-0
lib/python/Products/Five/tests/products/FiveTest/__init__.py
lib/python/Products/Five/tests/products/FiveTest/__init__.py
+0
-13
lib/python/Products/Five/tests/products/FiveTest/browser.py
lib/python/Products/Five/tests/products/FiveTest/browser.py
+6
-1
lib/python/Products/Five/tests/products/FiveTest/classes.py
lib/python/Products/Five/tests/products/FiveTest/classes.py
+5
-1
lib/python/Products/Five/tests/products/FiveTest/configure.zcml
...thon/Products/Five/tests/products/FiveTest/configure.zcml
+1
-1
lib/python/Products/Five/tests/products/FiveTest/fancycontent.py
...hon/Products/Five/tests/products/FiveTest/fancycontent.py
+6
-1
lib/python/Products/Five/tests/products/FiveTest/helpers.py
lib/python/Products/Five/tests/products/FiveTest/helpers.py
+5
-1
lib/python/Products/Five/tests/products/FiveTest/interfaces.py
...ython/Products/Five/tests/products/FiveTest/interfaces.py
+26
-7
lib/python/Products/Five/tests/products/FiveTest/metaconfigure.py
...on/Products/Five/tests/products/FiveTest/metaconfigure.py
+2
-2
lib/python/Products/Five/tests/products/FiveTest/schemacontent.py
...on/Products/Five/tests/products/FiveTest/schemacontent.py
+17
-0
lib/python/Products/Five/tests/products/FiveTest/simplecontent.py
...on/Products/Five/tests/products/FiveTest/simplecontent.py
+5
-1
lib/python/Products/Five/tests/products/FiveTest/size.py
lib/python/Products/Five/tests/products/FiveTest/size.py
+17
-0
lib/python/Products/Five/tests/products/FiveTest/subscriber.py
...ython/Products/Five/tests/products/FiveTest/subscriber.py
+5
-1
lib/python/Products/Five/tests/runalltests.py
lib/python/Products/Five/tests/runalltests.py
+0
-12
lib/python/Products/Five/tests/test_adding.py
lib/python/Products/Five/tests/test_adding.py
+30
-0
lib/python/Products/Five/tests/test_bridge.py
lib/python/Products/Five/tests/test_bridge.py
+2
-1
lib/python/Products/Five/tests/test_editform.py
lib/python/Products/Five/tests/test_editform.py
+42
-65
lib/python/Products/Five/tests/test_event.py
lib/python/Products/Five/tests/test_event.py
+8
-5
lib/python/Products/Five/tests/test_five.py
lib/python/Products/Five/tests/test_five.py
+6
-1
lib/python/Products/Five/tests/test_security.py
lib/python/Products/Five/tests/test_security.py
+6
-1
lib/python/Products/Five/tests/test_security2.py
lib/python/Products/Five/tests/test_security2.py
+7
-2
lib/python/Products/Five/tests/test_viewable.py
lib/python/Products/Five/tests/test_viewable.py
+74
-0
lib/python/Products/Five/tests/zopeconf.py
lib/python/Products/Five/tests/zopeconf.py
+6
-3
lib/python/Products/Five/traversable.py
lib/python/Products/Five/traversable.py
+3
-2
lib/python/Products/Five/version.txt
lib/python/Products/Five/version.txt
+1
-1
lib/python/Products/Five/viewable.py
lib/python/Products/Five/viewable.py
+5
-6
lib/python/Products/Five/zcml.py
lib/python/Products/Five/zcml.py
+3
-2
No files found.
lib/python/Products/Five/CHANGES.txt
View file @
1534f218
...
@@ -2,11 +2,44 @@
...
@@ -2,11 +2,44 @@
Five Changes
Five Changes
============
============
Five 1.0
(2005-04-27
)
Five 1.0
.1 (2005-05-31
)
=====================
=====================
==
This version is also included in Zope 2.8.
This version is also included in Zope 2.8.
* Changed license headers to the ones used in the Zope.org repository.
This makes merging between the main development line of Five (hosted
on codespeak.net) and the version integrated into Zope 2.8 much
easier. The actual copyright ownership isn't affected because Five
had been contributed to the Zope project anyway (which was blessed
by all Five contributors).
* Made automatically generated add and edit forms unicode-aware.
ZPublisher does not automatically decode incoming form values to
unicode, so AddView and EditView emulate this behaviour themselves
now. They also take care of setting the right charset on the
outgoing form so that ZPublisher will encode it accordingly when
sending the response to the client. (In Zope 3, all charset
negotation between the client and the server takes place in the
publisher.)
* Added ``IHTTPCharset`` adapter for ``IHTTPRequest`` so that
application can find out the preferred character set of the HTTP
client (Zope 2 applications needs to take care of their own charset
header). The adapter is used for the automatically-generated forms
when determining encodings for unicode field content.
* Modified edit.pt to make sure editforms have only one body tag.
* Fixed the ``INameChooser`` adapter for ObjectManagers (e.g. Zope 2
folders) and added unit tests.
* Fixed small bug in BrowserDefault which caused an error if the class is
defaultViewable but the object's interfaces have no defaultView.
Five 1.0 (2005-04-27)
=====================
Features
Features
--------
--------
...
...
lib/python/Products/Five/CREDITS.txt
View file @
1534f218
...
@@ -27,6 +27,8 @@ Five contributors
...
@@ -27,6 +27,8 @@ Five contributors
- Dieter Maurer (dieter@handshake.de)
- Dieter Maurer (dieter@handshake.de)
- Yvo Schubbe (y.2005-@wcm-solutions.de)
Thank you
Thank you
---------
---------
...
...
lib/python/Products/Five/README.txt
View file @
1534f218
...
@@ -43,7 +43,7 @@ For more information, see ``doc/features.txt``.
...
@@ -43,7 +43,7 @@ For more information, see ``doc/features.txt``.
How to install Five
How to install Five
-------------------
-------------------
Five should already be installed in Zope 2.8
.
See ``INSTALL.txt``
.
How to use Five
How to use Five
---------------
---------------
...
...
lib/python/Products/Five/ReuseUtils.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Utils to be reused
$Id: ReuseUtils.py 12912 2005-05-31 09:58:59Z philikon $
"""
from
new
import
function
from
new
import
function
def
rebindFunction
(
f
,
rebindDir
=
None
,
**
rebinds
):
def
rebindFunction
(
f
,
rebindDir
=
None
,
**
rebinds
):
...
...
lib/python/Products/Five/TrustedExpression.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Trusted expression
$Id: TrustedExpression.py 12912 2005-05-31 09:58:59Z philikon $
"""
from
sys
import
modules
from
sys
import
modules
from
Products.PageTemplates.PythonExpr
import
PythonExpr
from
Products.PageTemplates.PythonExpr
import
PythonExpr
...
...
lib/python/Products/Five/__init__.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Initialize the Five product
"""Initialize the Five product
$Id: __init__.py 1
0829 2005-04-18 19:18:27
Z philikon $
$Id: __init__.py 1
2915 2005-05-31 10:23:19
Z philikon $
"""
"""
import
Acquisition
import
Acquisition
from
Globals
import
INSTANCE_HOME
from
Globals
import
INSTANCE_HOME
...
...
lib/python/Products/Five/adding.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -65,7 +66,11 @@ class BasicAdding(Implicit, BrowserView):
...
@@ -65,7 +66,11 @@ class BasicAdding(Implicit, BrowserView):
name
=
chooser
.
chooseName
(
self
.
contentName
or
''
,
content
)
name
=
chooser
.
chooseName
(
self
.
contentName
or
''
,
content
)
elif
name
==
''
:
elif
name
==
''
:
name
=
chooser
.
chooseName
(
''
,
content
)
name
=
chooser
.
chooseName
(
''
,
content
)
chooser
.
checkName
(
name
,
container
)
else
:
# Invoke the name chooser even when we have a
# name. It'll do useful things with it like converting
# the incoming unicode to an ASCII string.
name
=
chooser
.
chooseName
(
name
,
container
)
content
.
id
=
name
content
.
id
=
name
container
.
_setObject
(
name
,
content
)
container
.
_setObject
(
name
,
content
)
...
@@ -210,14 +215,27 @@ class ObjectManagerNameChooser:
...
@@ -210,14 +215,27 @@ class ObjectManagerNameChooser:
self
.
context
=
context
self
.
context
=
context
def
checkName
(
self
,
name
,
object
):
def
checkName
(
self
,
name
,
object
):
# ObjectManager can only deal with ASCII names. Specially
# ObjectManager._checkId can only deal with strings.
try
:
name
=
name
.
encode
(
'ascii'
)
except
UnicodeDecodeError
:
raise
UserError
,
"Id must contain only ASCII characters."
try
:
try
:
self
.
context
.
_checkId
(
name
,
allow_dup
=
False
)
self
.
context
.
_checkId
(
name
,
allow_dup
=
False
)
except
BadRequest
:
except
BadRequest
,
e
:
raise
UserError
,
"Id is in use or invalid"
msg
=
' '
.
join
(
e
.
args
)
or
"Id is in use or invalid"
raise
UserError
,
msg
def
chooseName
(
self
,
name
,
object
):
def
chooseName
(
self
,
name
,
object
):
if
not
name
:
if
not
name
:
name
=
object
.
__class__
.
__name__
name
=
object
.
__class__
.
__name__
else
:
try
:
name
=
name
.
encode
(
'ascii'
)
except
UnicodeDecodeError
:
raise
UserError
,
"Id must contain only ASCII characters."
dot
=
name
.
rfind
(
'.'
)
dot
=
name
.
rfind
(
'.'
)
if
dot
>=
0
:
if
dot
>=
0
:
...
@@ -227,18 +245,17 @@ class ObjectManagerNameChooser:
...
@@ -227,18 +245,17 @@ class ObjectManagerNameChooser:
suffix
=
''
suffix
=
''
n
=
name
+
suffix
n
=
name
+
suffix
i
=
1
i
=
0
while
True
:
while
True
:
i
+=
1
try
:
try
:
container
.
_getOb
(
n
)
self
.
context
.
_getOb
(
n
)
except
AttributeError
:
except
AttributeError
:
pass
else
:
break
break
i
+=
1
n
=
name
+
'-'
+
str
(
i
)
+
suffix
n
=
name
+
'-'
+
str
(
i
)
+
suffix
# Make sure tha name is valid. We may have started with something bad.
# Make sure the name is valid. We may have started with
# something bad.
self
.
checkName
(
n
,
object
)
self
.
checkName
(
n
,
object
)
return
n
return
n
lib/python/Products/Five/bridge.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,9 +13,8 @@
...
@@ -12,9 +13,8 @@
##############################################################################
##############################################################################
""" Z2 -> Z3 bridge utilities.
""" Z2 -> Z3 bridge utilities.
$Id$
$Id
: bridge.py 12915 2005-05-31 10:23:19Z philikon
$
"""
"""
from
Interface._InterfaceClass
import
Interface
as
Z2_InterfaceClass
from
Interface._InterfaceClass
import
Interface
as
Z2_InterfaceClass
from
Interface
import
Interface
as
Z2_Interface
from
Interface
import
Interface
as
Z2_Interface
from
Interface
import
Attribute
as
Z2_Attribute
from
Interface
import
Attribute
as
Z2_Attribute
...
...
lib/python/Products/Five/browser.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,9 +13,8 @@
...
@@ -12,9 +13,8 @@
##############################################################################
##############################################################################
"""Provide basic browser functionality
"""Provide basic browser functionality
$Id: browser.py 1
0829 2005-04-18 19:18:27
Z philikon $
$Id: browser.py 1
2915 2005-05-31 10:23:19
Z philikon $
"""
"""
# python
# python
import
sys
import
sys
from
datetime
import
datetime
from
datetime
import
datetime
...
@@ -32,6 +32,9 @@ from interfaces import ITraversable
...
@@ -32,6 +32,9 @@ from interfaces import ITraversable
from
zope.interface
import
implements
from
zope.interface
import
implements
from
zope.component
import
getViewProviding
from
zope.component
import
getViewProviding
from
zope.app.traversing.browser.interfaces
import
IAbsoluteURL
from
zope.app.traversing.browser.interfaces
import
IAbsoluteURL
from
zope.publisher.browser
import
isCGI_NAME
from
zope.i18n.interfaces
import
IUserPreferredCharsets
from
zope.app.location.interfaces
import
ILocation
from
zope.app.location.interfaces
import
ILocation
from
zope.app.location
import
LocationProxy
from
zope.app.location
import
LocationProxy
from
zope.app.form.utility
import
setUpEditWidgets
,
applyWidgetsChanges
from
zope.app.form.utility
import
setUpEditWidgets
,
applyWidgetsChanges
...
@@ -128,6 +131,7 @@ class EditView(BrowserView):
...
@@ -128,6 +131,7 @@ class EditView(BrowserView):
errors
=
()
errors
=
()
update_status
=
None
update_status
=
None
label
=
''
label
=
''
charsets
=
None
# Fall-back field names computes from schema
# Fall-back field names computes from schema
fieldNames
=
property
(
lambda
self
:
getFieldNamesInOrder
(
self
.
schema
))
fieldNames
=
property
(
lambda
self
:
getFieldNamesInOrder
(
self
.
schema
))
...
@@ -136,6 +140,8 @@ class EditView(BrowserView):
...
@@ -136,6 +140,8 @@ class EditView(BrowserView):
def
__init__
(
self
,
context
,
request
):
def
__init__
(
self
,
context
,
request
):
BrowserView
.
__init__
(
self
,
context
,
request
)
BrowserView
.
__init__
(
self
,
context
,
request
)
self
.
_processInputs
()
self
.
_setPageEncoding
()
self
.
_setUpWidgets
()
self
.
_setUpWidgets
()
def
_setUpWidgets
(
self
):
def
_setUpWidgets
(
self
):
...
@@ -148,6 +154,36 @@ class EditView(BrowserView):
...
@@ -148,6 +154,36 @@ class EditView(BrowserView):
setUpEditWidgets
(
self
,
self
.
schema
,
source
=
self
.
adapted
,
setUpEditWidgets
(
self
,
self
.
schema
,
source
=
self
.
adapted
,
names
=
self
.
fieldNames
)
names
=
self
.
fieldNames
)
# taken from zope.publisher.browser.BrowserRequest
def
_decode
(
self
,
text
):
"""Try to decode the text using one of the available charsets."""
if
self
.
charsets
is
None
:
envadapter
=
IUserPreferredCharsets
(
self
.
request
)
self
.
charsets
=
envadapter
.
getPreferredCharsets
()
or
[
'utf-8'
]
for
charset
in
self
.
charsets
:
try
:
text
=
unicode
(
text
,
charset
)
break
except
UnicodeError
:
pass
return
text
def
_processInputs
(
self
):
request
=
self
.
request
for
name
,
value
in
request
.
form
.
items
():
if
(
not
(
isCGI_NAME
(
name
)
or
name
.
startswith
(
'HTTP_'
))
and
isinstance
(
value
,
str
)):
request
.
form
[
name
]
=
self
.
_decode
(
value
)
def
_setPageEncoding
(
self
):
"""Set the encoding of the form page via the Content-Type header.
ZPublisher uses the value of this header to determine how to
encode unicode data for the browser."""
envadapter
=
IUserPreferredCharsets
(
self
.
request
)
charsets
=
envadapter
.
getPreferredCharsets
()
or
[
'utf-8'
]
self
.
request
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html; charset=%s'
%
charsets
[
0
])
def
setPrefix
(
self
,
prefix
):
def
setPrefix
(
self
,
prefix
):
for
widget
in
self
.
widgets
():
for
widget
in
self
.
widgets
():
widget
.
setPrefix
(
prefix
)
widget
.
setPrefix
(
prefix
)
...
@@ -183,7 +219,7 @@ class EditView(BrowserView):
...
@@ -183,7 +219,7 @@ class EditView(BrowserView):
except
WidgetsError
,
errors
:
except
WidgetsError
,
errors
:
self
.
errors
=
errors
self
.
errors
=
errors
status
=
"An error occured."
status
=
"An error occured."
transaction
.
get
().
abort
()
transaction
.
abort
()
else
:
else
:
setUpEditWidgets
(
self
,
self
.
schema
,
source
=
self
.
adapted
,
setUpEditWidgets
(
self
,
self
.
schema
,
source
=
self
.
adapted
,
ignoreStickyValues
=
True
,
ignoreStickyValues
=
True
,
...
...
lib/python/Products/Five/browserconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -15,7 +16,7 @@
...
@@ -15,7 +16,7 @@
Directives to emulate the 'http://namespaces.zope.org/browser'
Directives to emulate the 'http://namespaces.zope.org/browser'
namespace in ZCML known from zope.app.
namespace in ZCML known from zope.app.
$Id: browserconfigure.py 1
1479 2005-04-26 13:47:37Z dreamcatcher
$
$Id: browserconfigure.py 1
2915 2005-05-31 10:23:19Z philikon
$
"""
"""
import
os
import
os
...
...
lib/python/Products/Five/configure.zcml
View file @
1534f218
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<include file="interfaces.zcml" />
<include file="interfaces.zcml" />
<include file="permissions.zcml" />
<include file="permissions.zcml" />
<include file="browser.zcml" />
<include file="browser.zcml" />
<include file="i18n.zcml" />
<include package="zope.app.traversing" />
<include package="zope.app.traversing" />
<include package="zope.app.form.browser" />
<include package="zope.app.form.browser" />
...
...
lib/python/Products/Five/doc/main.txt
View file @
1534f218
...
@@ -32,8 +32,12 @@ system for us all.
...
@@ -32,8 +32,12 @@ system for us all.
Download
Download
--------
--------
2005-04-27 -- We have released Five 1.0! This is also the version that
2005-05-31 -- We have released Five 1.0.1! This is also the version
will be included in Zope 2.8. Download it here:
that will be included in Zope 2.8. Download it here:
http://codespeak.net/z3/five/release/Five-1.0.1.tgz
2005-04-27 -- We have released Five 1.0! Download it here:
http://codespeak.net/z3/five/release/Five-1.0.tgz
http://codespeak.net/z3/five/release/Five-1.0.tgz
...
...
lib/python/Products/Five/edit.pt
View file @
1534f218
<tal:tag
condition=
"view/update"
/>
<tal:tag
condition=
"view/update"
/>
<html
metal:use-macro=
"context/@@standard_macros/page"
>
<html
metal:use-macro=
"context/@@standard_macros/page"
>
<body
metal:fill-slot=
"body"
>
<body>
<div
metal:fill-slot=
"body"
>
<div
metal:define-macro=
"body"
>
<div
metal:define-macro=
"body"
>
...
@@ -31,11 +32,11 @@
...
@@ -31,11 +32,11 @@
<div
class=
"label"
>
Extra top
</div>
<div
class=
"label"
>
Extra top
</div>
<div
class=
"field"
><input
type=
"text"
style=
"width:100%"
/></div>
<div
class=
"field"
><input
type=
"text"
style=
"width:100%"
/></div>
</div>
</div>
<div
metal:use-macro=
"context/@@widget_macros/widget_rows"
/>
<div
metal:use-macro=
"context/@@widget_macros/widget_rows"
/>
<div
class=
"separator"
></div>
<div
class=
"separator"
></div>
<div
class=
"row"
<div
class=
"row"
metal:define-slot=
"extra_bottom"
tal:replace=
"nothing"
>
metal:define-slot=
"extra_bottom"
tal:replace=
"nothing"
>
<div
class=
"label"
>
Extra bottom
</div>
<div
class=
"label"
>
Extra bottom
</div>
...
@@ -46,9 +47,9 @@
...
@@ -46,9 +47,9 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"controls"
>
<div
class=
"controls"
>
<input
type=
"submit"
value=
"Refresh"
<input
type=
"submit"
value=
"Refresh"
i18n:attributes=
"value refresh-button"
/>
i18n:attributes=
"value refresh-button"
/>
<input
type=
"submit"
name=
"UPDATE_SUBMIT"
value=
"Change"
<input
type=
"submit"
name=
"UPDATE_SUBMIT"
value=
"Change"
i18n:attributes=
"value submit-button"
/>
i18n:attributes=
"value submit-button"
/>
</div>
</div>
</div>
</div>
...
@@ -59,6 +60,8 @@
...
@@ -59,6 +60,8 @@
</form>
</form>
</div>
</div>
</div>
</body>
</body>
...
...
lib/python/Products/Five/eventconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -14,9 +15,8 @@
...
@@ -14,9 +15,8 @@
Use 'structured monkey patching' to enable zope.app.container event sending for
Use 'structured monkey patching' to enable zope.app.container event sending for
Zope 2 objects.
Zope 2 objects.
$Id: eventconfigure.py 1
0337 2005-04-05 16:01:21
Z philikon $
$Id: eventconfigure.py 1
2915 2005-05-31 10:23:19
Z philikon $
"""
"""
from
Products.Five.fiveconfigure
import
isFiveMethod
from
Products.Five.fiveconfigure
import
isFiveMethod
from
zope.event
import
notify
from
zope.event
import
notify
from
zope.interface
import
implements
from
zope.interface
import
implements
...
...
lib/python/Products/Five/fiveconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -14,7 +15,7 @@
...
@@ -14,7 +15,7 @@
These directives are specific to Five and have no equivalents in Zope 3.
These directives are specific to Five and have no equivalents in Zope 3.
$Id: fiveconfigure.py
8255 2005-01-13 14:05:46Z regebro
$
$Id: fiveconfigure.py
12915 2005-05-31 10:23:19Z philikon
$
"""
"""
import
os
import
os
...
...
lib/python/Products/Five/fivedirectives.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Five ZCML directive schemas
"""Five ZCML directive schemas
$Id: fivedirectives.py
8255 2005-01-13 14:05:46Z regebro
$
$Id: fivedirectives.py
12915 2005-05-31 10:23:19Z philikon
$
"""
"""
from
zope.interface
import
Interface
from
zope.interface
import
Interface
from
zope.app.publisher.browser.metadirectives
import
IBasicResourceInformation
from
zope.app.publisher.browser.metadirectives
import
IBasicResourceInformation
...
...
lib/python/Products/Five/i18n.zcml
0 → 100644
View file @
1534f218
<configure xmlns="http://namespaces.zope.org/zope">
<adapter
factory="zope.publisher.http.HTTPCharsets"
for="zope.publisher.interfaces.http.IHTTPRequest"
provides="zope.i18n.interfaces.IUserPreferredCharsets"
/>
</configure>
lib/python/Products/Five/interfaces.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2000-2003 Zope Corporation and Contributors.
# Copyright (c) 2000-2005 Zope Corporation and Contributors.
# Copyright (c) 2004 Five Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -14,7 +12,7 @@
...
@@ -14,7 +12,7 @@
##############################################################################
##############################################################################
"""Five interfaces
"""Five interfaces
$Id: interfaces.py 12
029 2005-05-06 17:04:32Z yuppie
$
$Id: interfaces.py 12
915 2005-05-31 10:23:19Z philikon
$
"""
"""
from
zope.interface
import
Interface
,
Attribute
from
zope.interface
import
Interface
,
Attribute
from
zope.interface.interfaces
import
IInterface
from
zope.interface.interfaces
import
IInterface
...
...
lib/python/Products/Five/metaclass.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
...
lib/python/Products/Five/metaconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Generic Components ZCML Handlers
"""Generic Components ZCML Handlers
$Id: metaconfigure.py
5287 2004-06-25 11:42:27
Z philikon $
$Id: metaconfigure.py
12915 2005-05-31 10:23:19
Z philikon $
"""
"""
from
types
import
ModuleType
from
types
import
ModuleType
...
...
lib/python/Products/Five/pagetemplatefile.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,8 +11,10 @@
...
@@ -10,8 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
'''A 'PageTemplateFile' without security restrictions.'''
"""A 'PageTemplateFile' without security restrictions.
$Id: pagetemplatefile.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
import
os
,
sys
# Zope 2
# Zope 2
...
...
lib/python/Products/Five/resource.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -14,7 +15,6 @@
...
@@ -14,7 +15,6 @@
$Id: browser.py 5259 2004-06-23 15:59:52Z philikon $
$Id: browser.py 5259 2004-06-23 15:59:52Z philikon $
"""
"""
import
os
import
os
import
urllib
import
urllib
...
...
lib/python/Products/Five/security.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Five security handling
"""Five security handling
$Id: security.py
8281 2005-01-14 18:20:18Z regebro
$
$Id: security.py
12915 2005-05-31 10:23:19Z philikon
$
"""
"""
from
zope.interface
import
implements
from
zope.interface
import
implements
from
zope.component
import
queryUtility
,
getUtility
from
zope.component
import
queryUtility
,
getUtility
...
...
lib/python/Products/Five/sizeconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -13,7 +14,7 @@
...
@@ -13,7 +14,7 @@
"""Use structured monkey-patching to enable ``ISized`` adapters for
"""Use structured monkey-patching to enable ``ISized`` adapters for
Zope 2 objects.
Zope 2 objects.
$Id: sizeconfigure.py 1
0365 2005-04-06 13:24:16
Z philikon $
$Id: sizeconfigure.py 1
2915 2005-05-31 10:23:19
Z philikon $
"""
"""
from
zope.app.size.interfaces
import
ISized
from
zope.app.size.interfaces
import
ISized
from
Products.Five.fiveconfigure
import
isFiveMethod
from
Products.Five.fiveconfigure
import
isFiveMethod
...
...
lib/python/Products/Five/skin.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Mimick the Zope 3 skinning system in Five.
"""Mimick the Zope 3 skinning system in Five.
$Id: skin.py 1
0830 2005-04-18 19:22:4
9Z philikon $
$Id: skin.py 1
2915 2005-05-31 10:23:1
9Z philikon $
"""
"""
from
zope.interface.common.mapping
import
IItemMapping
from
zope.interface.common.mapping
import
IItemMapping
from
zope.interface
import
implements
from
zope.interface
import
implements
...
...
lib/python/Products/Five/tests/__init__.py
View file @
1534f218
##############################################################################
# import this
#
# Copyright (c) 2005 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.
#
##############################################################################
lib/python/Products/Five/tests/adding.txt
0 → 100644
View file @
1534f218
============
Adding tests
============
ObjectManagerNameChooser
------------------------
First we need to import and setup some prerequisites:
>>> from zope.app.container.interfaces import INameChooser
>>> from Products.Five.tests.products.FiveTest.helpers import \
... manage_addFiveTraversableFolder
>>> manage_addFiveTraversableFolder(self.folder, 'testoid', 'Testoid')
>>> chooser = INameChooser(self.folder)
Now we can start. ``INameChooser`` defines a ``checkName()`` method
that checks whether a given name is valid in the container or not.
Under the hood, ``ObjectManagerNameChooser`` calls ``_checkId()`` of
the object manager. Valid names/ids are those that aren't in use yet
and don't contain invalid characters.
>>> chooser.checkName('abc', object())
>>> chooser.checkName('testoid', object())
Traceback (most recent call last):
...
UserError: The id "testoid" is invalid - it is already in use.
>>> chooser.checkName('slash/slash', object())
Traceback (most recent call last):
...
UserError: The id "slash/slash" contains characters illegal in URLs.
``INameChooser`` also promises us a ``chooseName()`` method that
chooses a name for us in case we don't have one or that chooses a
different name in case the one we chose was invalid.
>>> chooser.chooseName('', self.folder.testoid)
'FiveTraversableFolder'
>>> chooser.chooseName('abc', self.folder.testoid)
'abc'
>>> chooser.chooseName('testoid', self.folder.testoid)
'testoid-1'
Of course, if we start out with something bad, it isn't going to
become good automagically:
>>> chooser.chooseName('slash/slash', object())
Traceback (most recent call last):
...
UserError: The id "slash/slash" contains characters illegal in URLs.
lib/python/Products/Five/tests/dummy.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Dummy objects and views for the security tests
$Id: dummy.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
zope.interface
import
Interface
,
implements
from
zope.interface
import
Interface
,
implements
from
Products.Five
import
BrowserView
from
Products.Five
import
BrowserView
...
...
lib/python/Products/Five/tests/fivetest.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Five test fixtures.
$Id: fivetest.py 12915 2005-05-31 10:23:19Z philikon $
"""
# ZopeTestCase was not designed to run tests as part of the
# ZopeTestCase was not designed to run tests as part of the
# Zope test suite proper. In particular, it intercepts product
# Zope test suite proper. In particular, it intercepts product
# installation. We have to work around this for the Five tests
# installation. We have to work around this for the Five tests
...
...
lib/python/Products/Five/tests/forms.txt
0 → 100644
View file @
1534f218
Testing forms
=============
Before we can begin, we need to setup a traversable folder.
Otherwise, Five won't get to to do its view lookup:
>>> from Products.Five.tests.products.FiveTest.helpers import \
... manage_addFiveTraversableFolder
>>> manage_addFiveTraversableFolder(self.folder, 'ftf')
Add forms
---------
We can add objects to containers (object managers) through add forms.
An unprotected form can be accessed with anonymously:
>>> print http(r"""
... GET /test_folder_1_/ftf/+/addfieldcontent.html HTTP/1.1
... """, handle_errors=False)
HTTP/1.1 200 OK
...
For a protected one we need a manager account:
>>> print http(r"""
... GET /test_folder_1_/ftf/+/protectedaddform.html HTTP/1.1
... Authorization: Basic manager:r00t
... """, handle_errors=False)
HTTP/1.1 200 OK
...
otherwise we will fail to access it:
>>> print http(r"""
... GET /test_folder_1_/ftf/+/protectedaddform.html HTTP/1.1
... Authorization: Basic viewer:secret
... """, handle_errors=False)
HTTP/1.1 401 Unauthorized
...
Now let's add a piece of our sample content object to test more things
on it:
>>> print http(r"""
... POST /test_folder_1_/ftf/+/addfieldcontent.html HTTP/1.1
... Authorization: Basic manager:r00t
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 527
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... title
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Add
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="add_input_name"
...
... edittest
... -----------------------------968064918930967154199105236--
... """, handle_errors=False)
HTTP/1.1 302 Moved Temporarily
...
Location: http://localhost/test_folder_1_/ftf/manage_main
...
Having added this piece of content, we can access it under its URL:
>>> print http(r"""
... GET /test_folder_1_/ftf/edittest HTTP/1.1
... Authorization: Basic manager:r00t
... """, handle_errors=False)
HTTP/1.1 200 OK
...
We can also verify that the title was set correctly, and the not
specified attribute is the default value:
>>> edittest = self.folder.ftf.edittest
>>> edittest.title
u'title'
>>> edittest.description #XXX shouldn't we get a u'' here???
Edit forms
----------
First, it's important to note that forms validate user input.
Therefore, if we specify invalid data, our object won't change:
>>> print http(r"""
... POST /test_folder_1_/ftf/edittest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... BarDescription
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Change
... -----------------------------968064918930967154199105236--
... """, handle_errors=False)
HTTP/1.1 200 OK
...
There are <strong>1</strong> input errors.
...
We will see that nothing has changed:
>>> edittest.title
u'title'
>>> edittest.description #XXX shouldn't we get a u'' here???
However, when we specify the correct fields:
>>> print http(r"""
... POST /test_folder_1_/ftf/edittest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 426
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... FooTitle
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... FooDescription
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Change
... -----------------------------968064918930967154199105236--
... """, handle_errors=False)
HTTP/1.1 200 OK
...
We will see that nothing has changed:
>>> edittest.title
u'FooTitle'
>>> edittest.description
u'FooDescription'
Unicode-safety of forms
-----------------------
Even though ZPublisher does not support unicode, automatically
generated forms do. In the following we will enter the following two
chinese sequences (How do you do? and I'm doing good) in forms
(they're encoded in UTF-8 here):
>>> ni_hao = '\xe4\xbd\xa0\xe5\xa5\xbd'
>>> wo_hen_hao = '\346\210\221\345\276\210\345\245\275'
First, it's imaginable that we make a mistake and enter one of the
phrases in the integer field:
>>> print http(r"""
... POST /test_folder_1_/ftf/+/addfieldcontent.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... ChineseTitle
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... ChineseDescription
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Add
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="add_input_name"
...
... unicodetest
... -----------------------------968064918930967154199105236--
... """ % ni_hao, handle_errors=False)
HTTP/1.1 200 OK
...
There are <strong>1</strong> input errors.
...
When we enter the unicode data in the right fields (the text fields),
the form will submit correctly and create the object:
>>> print http(r"""
... POST /test_folder_1_/ftf/+/addfieldcontent.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... 0
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Add
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="add_input_name"
...
... unicodetest
... -----------------------------968064918930967154199105236--
... """ % (ni_hao, wo_hen_hao), handle_errors=False)
HTTP/1.1 302 Moved Temporarily
...
Location: http://localhost/test_folder_1_/ftf/manage_main
...
We can test the object has the correct values, as unicode strings, of
course:
>>> unicodetest = self.folder.ftf.unicodetest
>>> unicodetest.title == ni_hao.decode('utf-8')
True
>>> unicodetest.description == wo_hen_hao.decode('utf-8')
True
>>> unicodetest.somenumber
0
Of course, the same should apply to edit forms. First, we happen to
again make the mistake of entering unicode data in the integer field:
>>> print http(r"""
... POST /test_folder_1_/ftf/unicodetest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... ChineseTitle
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... ChineseDescription
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Change
... -----------------------------968064918930967154199105236--
... """ % ni_hao, handle_errors=False)
HTTP/1.1 200 OK
...
There are <strong>1</strong> input errors.
...
We see that the object hasn't changed:
>>> unicodetest.title == ni_hao.decode('utf-8')
True
>>> unicodetest.description == wo_hen_hao.decode('utf-8')
True
>>> unicodetest.somenumber
0
Now we provide some valid form data:
>>> print http(r"""
... POST /test_folder_1_/ftf/unicodetest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... 1
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Change
... -----------------------------968064918930967154199105236--
... """ % (wo_hen_hao, ni_hao), handle_errors=False)
HTTP/1.1 200 OK
...
We see that the object's data has changed:
>>> unicodetest.title == wo_hen_hao.decode('utf-8')
True
>>> unicodetest.description == ni_hao.decode('utf-8')
True
>>> unicodetest.somenumber
1
Let's also not forget about List widgets. Let's see if we can add an
element to the list:
>>> print http(r"""
... POST /test_folder_1_/ftf/unicodetest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... 1
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somelist.add"
...
... Add
... -----------------------------968064918930967154199105236--
... """ % (wo_hen_hao, ni_hao), handle_errors=False)
HTTP/1.1 200 OK
...
...<input class="textType" id="field.somelist.0." name="field.somelist.0." size="20" type="text" value="" />...
...
Now, let's enter some more Chinese:
>>> de_guo = '\345\276\267\345\233\275'
>>> print http(r"""
... POST /test_folder_1_/ftf/unicodetest/@@edit.html HTTP/1.1
... Authorization: Basic manager:r00t
... Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
... Content-Type: multipart/form-data; boundary=---------------------------968064918930967154199105236
... Content-Length: 418
...
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.title"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.description"
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somenumber"
...
... 1
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="field.somelist.0."
...
... %s
... -----------------------------968064918930967154199105236
... Content-Disposition: form-data; name="UPDATE_SUBMIT"
...
... Change
... -----------------------------968064918930967154199105236--
... """ % (wo_hen_hao, ni_hao, de_guo), handle_errors=False)
HTTP/1.1 200 OK
...
The object's data will have changed accordingly:
>>> unicodetest.somelist == [de_guo.decode('utf-8')]
True
Object widget:
--------------
A little more complex is the ``ObjectWidget``. Here we simply test
that the edit form works:
>>> from Products.Five.tests.products.FiveTest.schemacontent import \
... manage_addComplexSchemaContent
>>> n = manage_addComplexSchemaContent(self.folder.ftf, 'objecttest')
>>> print http(r"""
... GET /test_folder_1_/ftf/objecttest/@@edit.html HTTP/1.1
... """, handle_errors=False)
HTTP/1.1 200 OK
...
lib/python/Products/Five/tests/products/FiveTest/__init__.py
View file @
1534f218
##############################################################################
#
# Copyright (c) 2005 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.
#
##############################################################################
#import simplecontent
#import simplecontent
#import fancycontent
#import fancycontent
...
...
lib/python/Products/Five/tests/products/FiveTest/browser.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Browser views for tests.
$Id: browser.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
Products.Five
import
BrowserView
from
Products.Five
import
BrowserView
from
Products.Five
import
StandardMacros
as
BaseMacros
from
Products.Five
import
StandardMacros
as
BaseMacros
from
simplecontent
import
FieldSimpleContent
from
simplecontent
import
FieldSimpleContent
...
...
lib/python/Products/Five/tests/products/FiveTest/classes.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Adapter test classes.
$Id: classes.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
zope.interface
import
implements
from
zope.interface
import
implements
from
interfaces
import
IAdaptable
,
IAdapted
,
IOrigin
,
IDestination
from
interfaces
import
IAdaptable
,
IAdapted
,
IOrigin
,
IDestination
...
...
lib/python/Products/Five/tests/products/FiveTest/configure.zcml
View file @
1534f218
...
@@ -355,7 +355,7 @@
...
@@ -355,7 +355,7 @@
<browser:addform
<browser:addform
schema=".interfaces.IFieldSimpleContent"
schema=".interfaces.IFieldSimpleContent"
content_factory=".simplecontent.FieldSimpleContent"
content_factory=".simplecontent.FieldSimpleContent"
name="add
simple
content.html"
name="add
field
content.html"
permission="zope2.Public"
permission="zope2.Public"
/>
/>
...
...
lib/python/Products/Five/tests/products/FiveTest/fancycontent.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Fancy content
$Id: fancycontent.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
Acquisition
import
Acquisition
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
OFS.SimpleItem
import
SimpleItem
from
OFS.SimpleItem
import
SimpleItem
...
...
lib/python/Products/Five/tests/products/FiveTest/helpers.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Test helpers
$Id: helpers.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
urllib
import
urllib
def
add_and_edit
(
self
,
id
,
REQUEST
):
def
add_and_edit
(
self
,
id
,
REQUEST
):
...
...
lib/python/Products/Five/tests/products/FiveTest/interfaces.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,8 +11,12 @@
...
@@ -10,8 +11,12 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Test product interfaces
$Id: interfaces.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
zope.interface
import
Interface
from
zope.interface
import
Interface
from
zope.schema
import
Text
,
TextLine
,
Object
from
zope.schema
import
Text
,
TextLine
,
Object
,
Int
,
List
class
IAdaptable
(
Interface
):
class
IAdaptable
(
Interface
):
"""This is a Zope 3 interface.
"""This is a Zope 3 interface.
...
@@ -50,19 +55,34 @@ class IFancyContent(Interface):
...
@@ -50,19 +55,34 @@ class IFancyContent(Interface):
pass
pass
class
IFieldSimpleContent
(
ISimpleContent
):
class
IFieldSimpleContent
(
ISimpleContent
):
title
=
TextLine
(
title
=
TextLine
(
title
=
u"Title"
,
title
=
u"Title"
,
description
=
u"A short description of the event."
,
description
=
u"A short description of the event."
,
default
=
u""
,
default
=
u""
,
required
=
True
)
required
=
True
)
description
=
Text
(
description
=
Text
(
title
=
u"Description"
,
title
=
u"Description"
,
description
=
u"A long description of the event."
,
description
=
u"A long description of the event."
,
default
=
u""
,
default
=
u""
,
required
=
False
)
required
=
False
)
somenumber
=
Int
(
title
=
u"Some number"
,
default
=
0
,
required
=
False
)
somelist
=
List
(
title
=
u"Some List"
,
value_type
=
TextLine
(
title
=
u"Some item"
),
default
=
[],
required
=
False
)
class
IComplexSchemaContent
(
Interface
):
class
IComplexSchemaContent
(
Interface
):
fishtype
=
TextLine
(
fishtype
=
TextLine
(
...
@@ -76,4 +96,3 @@ class IComplexSchemaContent(Interface):
...
@@ -76,4 +96,3 @@ class IComplexSchemaContent(Interface):
schema
=
IFieldSimpleContent
,
schema
=
IFieldSimpleContent
,
description
=
u"The fishy object"
,
description
=
u"The fishy object"
,
required
=
True
)
required
=
True
)
lib/python/Products/Five/tests/products/FiveTest/metaconfigure.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -14,7 +15,6 @@
...
@@ -14,7 +15,6 @@
$Id: metaconfigure.py 5287 2004-06-25 11:42:27Z philikon $
$Id: metaconfigure.py 5287 2004-06-25 11:42:27Z philikon $
"""
"""
from
zope.interface
import
Interface
from
zope.interface
import
Interface
from
zope.configuration.fields
import
GlobalObject
from
zope.configuration.fields
import
GlobalObject
from
zope.schema
import
TextLine
from
zope.schema
import
TextLine
...
...
lib/python/Products/Five/tests/products/FiveTest/schemacontent.py
View file @
1534f218
##############################################################################
#
# Copyright (c) 2004, 2005 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.
#
##############################################################################
"""Schema content implementation
$Id: schemacontent.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
OFS.SimpleItem
import
SimpleItem
from
OFS.SimpleItem
import
SimpleItem
from
Globals
import
InitializeClass
from
Globals
import
InitializeClass
...
...
lib/python/Products/Five/tests/products/FiveTest/simplecontent.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Simple content implementationm
$Id: simplecontent.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
OFS.SimpleItem
import
SimpleItem
from
OFS.SimpleItem
import
SimpleItem
from
Globals
import
InitializeClass
from
Globals
import
InitializeClass
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
...
...
lib/python/Products/Five/tests/products/FiveTest/size.py
View file @
1534f218
##############################################################################
#
# Copyright (c) 2004, 2005 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.
#
##############################################################################
"""Size adapters
$Id: size.py 12915 2005-05-31 10:23:19Z philikon $
"""
from
zope.interface
import
implements
from
zope.interface
import
implements
from
zope.app.size.interfaces
import
ISized
from
zope.app.size.interfaces
import
ISized
...
...
lib/python/Products/Five/tests/products/FiveTest/subscriber.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Event test fixtures
$Id: subscriber.py 12915 2005-05-31 10:23:19Z philikon $
"""
class
EventCatcher
:
class
EventCatcher
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_events
=
[]
self
.
_events
=
[]
...
...
lib/python/Products/Five/tests/runalltests.py
View file @
1534f218
##############################################################################
#
#
# Copyright (c) 2005 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.
#
##############################################################################
# Runs all tests in the current directory
# Runs all tests in the current directory
#
#
# Execute like:
# Execute like:
...
...
lib/python/Products/Five/tests/test_adding.py
0 → 100644
View file @
1534f218
##############################################################################
#
# Copyright (c) 2004, 2005 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.
#
##############################################################################
"""Test adding views
$Id: test_adding.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
import
Products.Five.tests.fivetest
# starts Zope, loads Five, etc.
def
test_suite
():
from
Testing.ZopeTestCase
import
ZopeDocFileSuite
return
ZopeDocFileSuite
(
'adding.txt'
,
package
=
"Products.Five.tests"
)
if
__name__
==
'__main__'
:
framework
()
lib/python/Products/Five/tests/test_bridge.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
...
lib/python/Products/Five/tests/test_editform.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,81 +11,57 @@
...
@@ -10,81 +11,57 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Test forms
$Id$
"""
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
from
Products.Five.tests.fivetest
import
*
import
Products.Five.tests.fivetest
# starts Zope, loads Five, etc.
import
unittest
from
AccessControl
import
Unauthorized
from
Testing.ZopeTestCase
import
ZopeDocTestSuite
from
zope.app.form.browser.submit
import
Update
from
Testing.ZopeTestCase
import
FunctionalDocFileSuite
from
Products.Five.tests.products.FiveTest.simplecontent
import
manage_addFieldSimpleContent
from
Products.Five.tests.products.FiveTest.helpers
import
manage_addFiveTraversableFolder
from
Products.Five.tests.products.FiveTest.schemacontent
import
manage_addComplexSchemaContent
class
EditFormTest
(
Functional
,
FiveTestCase
):
def
test_get_widgets_for_schema_fields
():
"""
>>> from zope.schema import Choice, TextLine
>>> salutation = Choice(title=u'Salutation',
... values=("Mr.", "Mrs.", "Captain", "Don"))
>>> contactname = TextLine(title=u'Name')
>>> from Products.Five.traversable import FakeRequest
>>> request = FakeRequest()
>>> salutation = salutation.bind(request)
>>> contactname = contactname.bind(request)
def
afterSetUp
(
self
):
>>> from zope.app import zapi
manage_addFieldSimpleContent
(
self
.
folder
,
'edittest'
,
'Test'
)
>>> from zope.app.form.interfaces import IInputWidget
uf
=
self
.
folder
.
acl_users
>>> from zope.app.form.browser.textwidgets import TextWidget
uf
.
_doAddUser
(
'viewer'
,
'secret'
,
[],
[])
>>> from zope.app.form.browser.itemswidgets import DropdownWidget
uf
.
_doAddUser
(
'manager'
,
'r00t'
,
[
'Manager'
],
[])
def
test_editform
(
self
):
>>> view1 = zapi.getViewProviding(contactname, IInputWidget, request)
response
=
self
.
publish
(
'/test_folder_1_/edittest/edit.html'
,
>>> view1.__class__ == TextWidget
basic
=
'manager:r00t'
)
True
# we're using a GET request to post variables, but seems to be
# the easiest..
response
=
self
.
publish
(
'/test_folder_1_/edittest/edit.html?%s=1&field.title=FooTitle&field.description=FooDescription'
%
Update
,
basic
=
'manager:r00t'
)
self
.
assertEquals
(
'FooTitle'
,
self
.
folder
.
edittest
.
title
)
self
.
assertEquals
(
'FooDescription'
,
self
.
folder
.
edittest
.
description
)
def
test_editform_invalid
(
self
):
>>> view2 = zapi.getViewProviding(salutation, IInputWidget, request)
# missing title, which is required
>>> view2.__class__ == DropdownWidget
self
.
folder
.
edittest
.
description
=
''
True
"""
response
=
self
.
publish
(
def
setUpForms
(
self
):
'/test_folder_1_/edittest/edit.html?%s=1&field.title=&field.description=BarDescription'
%
Update
,
uf
=
self
.
folder
.
acl_users
basic
=
'manager:r00t'
)
uf
.
_doAddUser
(
'viewer'
,
'secret'
,
[],
[])
# we expect that we get a 200 Ok
uf
.
_doAddUser
(
'manager'
,
'r00t'
,
[
'Manager'
],
[])
self
.
assertEqual
(
200
,
response
.
getStatus
())
self
.
assertEquals
(
'Test'
,
self
.
folder
.
edittest
.
title
)
self
.
assertEquals
(
''
,
self
.
folder
.
edittest
.
description
)
def
test_addform
(
self
):
manage_addFiveTraversableFolder
(
self
.
folder
,
'ftf'
)
self
.
folder
=
self
.
folder
.
ftf
response
=
self
.
publish
(
'/test_folder_1_/ftf/+/addsimplecontent.html'
,
basic
=
'manager:r00t'
)
self
.
assertEquals
(
200
,
response
.
getStatus
())
# we're using a GET request to post variables, but seems to be
# the easiest..
response
=
self
.
publish
(
'/test_folder_1_/ftf/+/addsimplecontent.html?%s=1&add_input_name=alpha&field.title=FooTitle&field.description=FooDescription'
%
Update
,
basic
=
'manager:r00t'
)
# we expect to get a 302 (redirect)
self
.
assertEquals
(
302
,
response
.
getStatus
())
# we expect the object to be there with the right id
self
.
assertEquals
(
'alpha'
,
self
.
folder
.
alpha
.
id
)
self
.
assertEquals
(
'FooTitle'
,
self
.
folder
.
alpha
.
title
)
self
.
assertEquals
(
'FooDescription'
,
self
.
folder
.
alpha
.
description
)
def
test_objectWidget
(
self
):
manage_addComplexSchemaContent
(
self
.
folder
,
'csc'
)
response
=
self
.
publish
(
'/test_folder_1_/csc/edit.html'
,
basic
=
'manager:r00t'
)
self
.
assertEquals
(
200
,
response
.
getStatus
())
def
test_suite
():
def
test_suite
():
from
unittest
import
TestSuite
,
makeSuite
return
unittest
.
TestSuite
((
suite
=
TestSuite
()
ZopeDocTestSuite
(),
suite
.
addTest
(
makeSuite
(
EditFormTest
))
FunctionalDocFileSuite
(
return
suite
'forms.txt'
,
package
=
"Products.Five.tests"
,
setUp
=
setUpForms
),
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
framework
()
framework
()
lib/python/Products/Five/tests/test_event.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,8 +11,10 @@
...
@@ -10,8 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
# t
est events triggered by Five
"""T
est events triggered by Five
$Id: test_event.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
...
@@ -61,7 +64,7 @@ class EventTest(FiveTestCase):
...
@@ -61,7 +64,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent
(
self
.
folder
,
'foo'
,
'Foo'
)
manage_addSimpleContent
(
self
.
folder
,
'foo'
,
'Foo'
)
# somehow we need to at least commit a subtransaction to make
# somehow we need to at least commit a subtransaction to make
# renaming succeed
# renaming succeed
transaction
.
get
().
commit
(
1
)
transaction
.
commit
(
1
)
self
.
folder
.
manage_renameObject
(
'foo'
,
'bar'
)
self
.
folder
.
manage_renameObject
(
'foo'
,
'bar'
)
bar
=
self
.
folder
.
bar
bar
=
self
.
folder
.
bar
events
=
objectEventCatcher
.
getEvents
()
events
=
objectEventCatcher
.
getEvents
()
...
@@ -95,7 +98,7 @@ class EventTest(FiveTestCase):
...
@@ -95,7 +98,7 @@ class EventTest(FiveTestCase):
manage_addSimpleContent
(
folder1
,
'foo'
,
'Foo'
)
manage_addSimpleContent
(
folder1
,
'foo'
,
'Foo'
)
foo
=
folder1
.
foo
foo
=
folder1
.
foo
# need to trigger subtransaction before copy/paste can work
# need to trigger subtransaction before copy/paste can work
transaction
.
get
().
commit
(
1
)
transaction
.
commit
(
1
)
cb
=
folder1
.
manage_cutObjects
([
'foo'
])
cb
=
folder1
.
manage_cutObjects
([
'foo'
])
folder2
.
manage_pasteObjects
(
cb
)
folder2
.
manage_pasteObjects
(
cb
)
newfoo
=
folder2
.
foo
newfoo
=
folder2
.
foo
...
@@ -125,7 +128,7 @@ class EventTest(FiveTestCase):
...
@@ -125,7 +128,7 @@ class EventTest(FiveTestCase):
manage_addNoVerifyPasteFolder
(
self
.
folder
,
'folder1'
)
manage_addNoVerifyPasteFolder
(
self
.
folder
,
'folder1'
)
folder1
=
self
.
folder
.
folder1
folder1
=
self
.
folder
.
folder1
# need to trigger subtransaction before copy/paste can work
# need to trigger subtransaction before copy/paste can work
transaction
.
get
().
commit
(
1
)
transaction
.
commit
(
1
)
cb
=
self
.
folder
.
manage_copyObjects
([
'foo'
])
cb
=
self
.
folder
.
manage_copyObjects
([
'foo'
])
folder1
.
manage_pasteObjects
(
cb
)
folder1
.
manage_pasteObjects
(
cb
)
foo_copy
=
folder1
.
foo
foo_copy
=
folder1
.
foo
...
...
lib/python/Products/Five/tests/test_five.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Five tests.
$Id: test_five.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
...
...
lib/python/Products/Five/tests/test_security.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Test security induced by ZCML
$Id: test_security.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
...
...
lib/python/Products/Five/tests/test_security2.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,6 +11,10 @@
...
@@ -10,6 +11,10 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Test security from restricted Python interpreter
$Id: test_security2.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
...
@@ -214,7 +219,7 @@ class PublishTest(Functional, FiveTestCase):
...
@@ -214,7 +219,7 @@ class PublishTest(Functional, FiveTestCase):
manage_addFiveTraversableFolder
(
self
.
folder
,
'ftf'
)
manage_addFiveTraversableFolder
(
self
.
folder
,
'ftf'
)
# Unprotected as anonymous
# Unprotected as anonymous
response
=
self
.
publish
(
'/test_folder_1_/ftf/+/add
simple
content.html'
)
response
=
self
.
publish
(
'/test_folder_1_/ftf/+/add
field
content.html'
)
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertEqual
(
response
.
getStatus
(),
200
)
# Protected as manager
# Protected as manager
...
...
lib/python/Products/Five/tests/test_viewable.py
0 → 100644
View file @
1534f218
##############################################################################
#
# Copyright (c) 2004, 2005 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.
#
##############################################################################
"""Unit tests for the viewable module.
$Id: test_viewable.py 12948 2005-05-31 20:24:58Z philikon $
"""
import
os
,
sys
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
import
Products.Five.tests.fivetest
# starts Zope, loads Five, etc.
def
test_defaultView
():
"""
Take a class Foo and an interface I1::
>>> class Foo:
... pass
>>> from zope.interface import Interface
>>> class I1(Interface):
... pass
Set up a default view for I1::
>>> from zope.app import zapi
>>> pres = zapi.getGlobalService('Presentation')
>>> from zope.publisher.interfaces.browser import IBrowserRequest
>>> pres.setDefaultViewName(I1, IBrowserRequest, 'foo.html')
and a BrowserDefault for an instance of Foo::
>>> foo = Foo()
>>> from Products.Five.viewable import BrowserDefault
>>> bd = BrowserDefault(foo)
You'll see that no default view is returned::
>>> request = self.app.REQUEST
>>> obj, path = bd.defaultView(request)
>>> obj is foo
True
>>> path is None
True
unless you mark the object with I1::
>>> from zope.interface import directlyProvides
>>> directlyProvides(foo, I1)
>>> obj, path = bd.defaultView(request)
>>> obj is foo
True
>>> path
['foo.html']
"""
def
test_suite
():
from
Testing.ZopeTestCase
import
ZopeDocTestSuite
return
ZopeDocTestSuite
()
if
__name__
==
'__main__'
:
framework
()
lib/python/Products/Five/tests/zopeconf.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -10,11 +11,13 @@
...
@@ -10,11 +11,13 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
"""Load zope.conf for tests.
$Id: zopeconf.py 12915 2005-05-31 10:23:19Z philikon $
"""
import
os
import
os
from
os.path
import
join
,
abspath
,
dirname
,
split
,
exists
from
os.path
import
join
,
abspath
,
dirname
,
split
,
exists
def
process
():
def
process
():
"""Read in zope.conf configuration file.
"""Read in zope.conf configuration file.
...
@@ -35,5 +38,5 @@ def process():
...
@@ -35,5 +38,5 @@ def process():
_config
=
join
(
_prefix
,
'etc'
,
'zope.conf'
)
_config
=
join
(
_prefix
,
'etc'
,
'zope.conf'
)
if
exists
(
_config
):
if
exists
(
_config
):
from
Zope
2
import
configure
from
Zope
import
configure
configure
(
_config
)
configure
(
_config
)
lib/python/Products/Five/traversable.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""Machinery for making things traversable through adaptation
"""Machinery for making things traversable through adaptation
$Id: traversable.py
9786 2005-03-15 12:53:39Z efge
$
$Id: traversable.py
12915 2005-05-31 10:23:19Z philikon
$
"""
"""
from
zExceptions
import
NotFound
from
zExceptions
import
NotFound
from
zope.exceptions
import
NotFoundError
from
zope.exceptions
import
NotFoundError
...
...
lib/python/Products/Five/version.txt
View file @
1534f218
Five 1.0
-z28
Five 1.0
.1
lib/python/Products/Five/viewable.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,9 +13,8 @@
...
@@ -12,9 +13,8 @@
##############################################################################
##############################################################################
"""Machinery for making things viewable
"""Machinery for making things viewable
$Id:
traversable.py 5763 2004-07-28 20:15:11Z dreamcatcher
$
$Id:
viewable.py 12915 2005-05-31 10:23:19Z philikon
$
"""
"""
import
inspect
import
inspect
from
zExceptions
import
NotFound
from
zExceptions
import
NotFound
from
zope.exceptions
import
NotFoundError
from
zope.exceptions
import
NotFoundError
...
@@ -104,9 +104,8 @@ class BrowserDefault(object):
...
@@ -104,9 +104,8 @@ class BrowserDefault(object):
def
defaultView
(
self
,
request
):
def
defaultView
(
self
,
request
):
context
=
self
.
context
context
=
self
.
context
name
=
None
try
:
try
:
name
=
getDefaultViewName
(
context
,
request
)
name
=
getDefaultViewName
(
context
,
request
)
return
context
,
[
name
,]
except
ComponentLookupError
:
except
ComponentLookupError
:
pass
return
context
,
None
return
context
,
[
name
,]
lib/python/Products/Five/zcml.py
View file @
1534f218
##############################################################################
##############################################################################
#
#
# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
#
# This software is subject to the provisions of the Zope Public License,
# 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.
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
...
@@ -12,7 +13,7 @@
...
@@ -12,7 +13,7 @@
##############################################################################
##############################################################################
"""ZCML machinery
"""ZCML machinery
$Id: zcml.py 1
0534 2005-04-11 15:06:02Z dreamcatcher
$
$Id: zcml.py 1
2915 2005-05-31 10:23:19Z philikon
$
"""
"""
import
os
import
os
from
zope.configuration
import
xmlconfig
from
zope.configuration
import
xmlconfig
...
...
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