summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Fulton <jim@zope.com>2002-12-20 19:45:46 +0000
committerJim Fulton <jim@zope.com>2002-12-20 19:45:46 +0000
commit39f33fc469d47ca281cc2b39075072fe65b77681 (patch)
treecbc42e89f62a88830a6a0a6de355d6fb480bf7b3
parent4f4f6a411d16b7aa8b7ce7fd452e181e5740085a (diff)
downloadzope-traversing-39f33fc469d47ca281cc2b39075072fe65b77681.tar.gz
Refactored ApplicationControl so that the application controller is no
longer a root object. Rather, to avoid traversing a database object to get to it, we create a separate RootFolder just so we can traverse it to get to the application controller. We (Guido and I) also renamed the global instance to have a name starting with a lower case name. This caused the most file changes. To do: rip out the application controller view registry in favor of the actions menu.
-rw-r--r--EtcNamespace.py10
-rw-r--r--SkinNamespace.py4
-rw-r--r--tests/testEtc.py9
3 files changed, 12 insertions, 11 deletions
diff --git a/EtcNamespace.py b/EtcNamespace.py
index 269927f..2b3b605 100644
--- a/EtcNamespace.py
+++ b/EtcNamespace.py
@@ -13,14 +13,16 @@
##############################################################################
"""
-$Id: EtcNamespace.py,v 1.4 2002/07/12 19:28:32 jim Exp $
+$Id: EtcNamespace.py,v 1.5 2002/12/20 19:45:45 jim Exp $
"""
from Zope.App.OFS.ApplicationControl.ApplicationControl \
- import ApplicationController
+ import applicationController
from Namespaces import provideNamespaceHandler
from Exceptions import UnexpectedParameters
from Zope.Exceptions import NotFoundError
+from Zope.App.OFS.Content.Folder.RootFolder import RootFolder
+
def etc(name, parameters, pname, ob, request):
# XXX
@@ -37,8 +39,8 @@ def etc(name, parameters, pname, ob, request):
if parameters:
raise UnexpectedParameters(parameters)
- if name == 'ApplicationController' and ob is None:
- return ApplicationController
+ if name == 'ApplicationController' and ob.__class__ == RootFolder:
+ return applicationController
if name != 'Services':
diff --git a/SkinNamespace.py b/SkinNamespace.py
index 64b29c6..7dd451c 100644
--- a/SkinNamespace.py
+++ b/SkinNamespace.py
@@ -13,11 +13,9 @@
##############################################################################
"""
-$Id: SkinNamespace.py,v 1.2 2002/07/13 14:18:36 jim Exp $
+$Id: SkinNamespace.py,v 1.3 2002/12/20 19:45:45 jim Exp $
"""
-from Zope.App.OFS.ApplicationControl.ApplicationControl \
- import ApplicationController
from Namespaces import provideNamespaceHandler
from Exceptions import UnexpectedParameters
from Zope.Exceptions import NotFoundError
diff --git a/tests/testEtc.py b/tests/testEtc.py
index 5f5de78..0b20823 100644
--- a/tests/testEtc.py
+++ b/tests/testEtc.py
@@ -14,7 +14,7 @@
"""
Revision information:
-$Id: testEtc.py,v 1.3 2002/07/17 16:54:20 jeremy Exp $
+$Id: testEtc.py,v 1.4 2002/12/20 19:45:46 jim Exp $
"""
from unittest import TestCase, TestSuite, main, makeSuite
@@ -25,11 +25,12 @@ class Test(CleanUp, TestCase):
def testApplicationControl(self):
from Zope.App.Traversing.EtcNamespace import etc
from Zope.App.OFS.ApplicationControl.ApplicationControl \
- import ApplicationController
+ import applicationController, applicationControllerRoot
self.assertEqual(
- etc('ApplicationController', (), '++etc++Services', None, None),
- ApplicationController)
+ etc('ApplicationController', (), '++etc++ApplicationController',
+ applicationControllerRoot, None),
+ applicationController)
def testServices(self):
from Zope.App.Traversing.EtcNamespace import etc