[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/ApplicationControl - ApplicationControl.py:1.2.20.1 configure.zcml:1.2.14.1

Christian Theune ct@gocept.com
Sun, 24 Nov 2002 12:33:57 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/ApplicationControl
In directory cvs.zope.org:/tmp/cvs-serv31106/App/OFS/ApplicationControl

Modified Files:
      Tag: ctheune-fix_appcontrol-branch
	ApplicationControl.py configure.zcml 
Log Message:
Moved ApplicationControlAbsoluteURL view into the ApplicationControl package

=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/ApplicationControl.py 1.2 => 1.2.20.1 ===
--- Zope3/lib/python/Zope/App/OFS/ApplicationControl/ApplicationControl.py:1.2	Mon Jun 10 19:27:51 2002
+++ Zope3/lib/python/Zope/App/OFS/ApplicationControl/ApplicationControl.py	Sun Nov 24 12:33:26 2002
@@ -16,6 +16,7 @@
 $Id$"""
 
 from IApplicationControl import IApplicationControl
+from Zope.App.ZopePublication.TraversalViews.AbsoluteURL import SiteAbsoluteURL
 
 import time
 
@@ -46,6 +47,25 @@
 
     #
     ############################################################
+
+# The AbsoluteURL traversal view
+#
+# Beeing manually hooked into the traversal process, the 
+# application controller needs some extra work, to provide the AbsoluteURL view.
+
+class ApplicationControlAbsoluteURL(SiteAbsoluteURL):
+    """Returns the absolute URL for the ApplicationController object.
+    """
+    
+    # XXX This is hardcoded in conjunction to the hardcoded Traversal.
+    name = "++etc++ApplicationController"
+
+    def __str__(self):
+        return "++etc++ApplicationController"
+
+    def breadcrumbs(self):
+        crumb = SiteAbsoluteURL.breadcrumbs(self)
+        return ({'name':'++etc++ApplicationController', 'url':crumb[0]["url"]+"/++etc++ApplicationController"}, )
 
 ApplicationController = ApplicationControl()
 


=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/configure.zcml 1.2 => 1.2.14.1 ===
--- Zope3/lib/python/Zope/App/OFS/ApplicationControl/configure.zcml:1.2	Thu Jun 20 11:54:48 2002
+++ Zope3/lib/python/Zope/App/OFS/ApplicationControl/configure.zcml	Sun Nov 24 12:33:26 2002
@@ -1,4 +1,5 @@
-<zopeConfigure xmlns='http://namespaces.zope.org/zope'>
+<zopeConfigure xmlns='http://namespaces.zope.org/zope'
+        xmlns:browser='http://namespaces.zope.org/browser'>
 
   <content class=".ApplicationControl.">
     <require
@@ -14,7 +15,15 @@
   <utility component=".ZopeVersion.ZopeVersionUtility"
            provides=".IZopeVersion." />
 
+  <browser:view
+    for=".IApplicationControl.IApplicationControl"
+    name="absolute_url"
+    factory=".ApplicationControl.ApplicationControlAbsoluteURL"
+    permission='Zope.Public'
+    allowed_interface="Zope.App.ZopePublication.TraversalViews.AbsoluteURL.IAbsoluteURL" />
+    
   <include package=".Views" />
   <include package=".ServerControl" />
+  <include package=".ZODBControl" />
 
 </zopeConfigure>