[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - PublicationTraverse.py:1.1.2.6 Traversers.py:1.1.2.14 ZopePublication.py:1.1.2.32 __init__.py:1.1.2.4
Stephan Richter
srichter@cbu.edu
Wed, 27 Mar 2002 17:32:27 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv1969
Modified Files:
Tag: Zope-3x-branch
PublicationTraverse.py Traversers.py ZopePublication.py
__init__.py
Log Message:
This is more of this bug fixing business. I basically started all over again. Atleast so far the tests pass.
=== Zope3/lib/python/Zope/App/ZopePublication/PublicationTraverse.py 1.1.2.5 => 1.1.2.6 ===
if IBrowserPublisher.isImplementedBy(ob):
- ob2 = ob.publishTraverse(request, nm)
+ ob2 = ob.browser_traverse(request, nm)
else:
adapter = getRequestView(ob, '_traverse', request, self # marker
)
if adapter is not self:
- ob2 = adapter.publishTraverse(request, nm)
+ ob2 = adapter.browser_traverse(request, nm)
else:
raise NotFound(ob, name, request)
=== Zope3/lib/python/Zope/App/ZopePublication/Traversers.py 1.1.2.13 => 1.1.2.14 ===
self.target = target
- def browserDefault(self, request):
+ def browser_default(self, request):
#XXX: (hack), we really need this to be component
# specific.
ob = self.target
@@ -34,7 +34,7 @@
view_uri = "%s;view" % view_name
return ob, (view_uri,)
- def publishTraverse(self, request, name):
+ def browser_traverse(self, request, name):
""" """
# TODO: Look for default view
ob = self.target
@@ -52,3 +52,4 @@
raise NotFound(ob, name, request)
return subob
+
=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.1.2.31 => 1.1.2.32 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# Version 1.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-"""
-
-$Id$
-"""
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
import sys
from types import StringType, ClassType
-from zLOG import LOG, INFO
+from zLOG import LOG, ERROR, INFO
+from Zope.ComponentArchitecture import getRequestView
from Zope.Publisher.DefaultPublication import DefaultPublication
from Zope.Publisher.mapply import mapply
from Zope.Publisher.Exceptions import Retry
@@ -29,7 +21,11 @@
from Zope.Exceptions import Unauthorized
from ZODB.POSException import ConflictError
+from Zope.App.OFS.Folder.RootFolder import RootFolder
+from Zope.ContextWrapper import wrapper
+from PublicationTraverse import PublicationTraverse
+from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
class RequestContainer:
# TODO: add security assertion declaring access to REQUEST
@@ -43,8 +39,7 @@
self.__del__ = f
-try:
- get_transaction
+try: get_transaction
except NameError:
class get_transaction:
def abort(self): pass
@@ -52,7 +47,7 @@
def commit(self): pass
-class ZopePublication(DefaultPublication):
+class ZopePublication(PublicationTraverse, DefaultPublication):
"""Base Zope publication specification."""
version_cookie = 'Zope-Version'
@@ -62,7 +57,6 @@
# db is a ZODB.DB.DB object.
self.db = db
-
def beforeTraversal(self, request):
id = prin_reg.authenticate(request)
if id is None:
@@ -72,12 +66,10 @@
newSecurityManager(id)
get_transaction().begin()
-
def openedConnection(self, conn):
# Hook for auto-refresh
pass
-
def getApplication(self, request):
# Open the database.
version = request.get(self.version_cookie, '')
@@ -97,7 +89,6 @@
return app
-
def callTraversalHooks(self, request, ob):
# Call __before_publishing_traverse__ hooks
pass
@@ -105,20 +96,16 @@
def getDefaultTraversal(self, request, ob):
return ob, None
-
def afterTraversal(self, request, ob):
#recordMetaData(object, request)
pass
-
def callObject(self, request, ob):
return mapply(ob, request.getPositionalArguments(), request)
-
def afterCall(self, request):
get_transaction().commit()
-
def handleException(self, request, exc_info, retry_allowed=1):
try:
# Abort the transaction.
@@ -133,6 +120,7 @@
prin_reg.unauthorized(id, request) # May issue challenge
request.getResponse().handleException(exc_info)
return
+
# XXX This is wrong. Should use getRequstView:
#
=== Zope3/lib/python/Zope/App/ZopePublication/__init__.py 1.1.2.3 => 1.1.2.4 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# Version 1.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
-#
-##############################################################################
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+
"""
Zope publication package.
-
-$Id$
"""