[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/TraversalViews - AbsoluteURL.py:1.6.4.4 configure.zcml:1.2.14.2

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


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

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

=== Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py 1.6.4.3 => 1.6.4.4 ===
--- Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py:1.6.4.3	Fri Nov 22 18:16:15 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py	Sun Nov 24 12:33:28 2002
@@ -91,11 +91,13 @@
 
 class SiteAbsoluteURL(BrowserView):
 
+    name = ""
+
     def __str__(self):
         context = self.context
         dict = getInnerWrapperData(context)
         name = dict and dict.get('name') or None
-        if name:
+        if name != self.name:
             if name == '.':
                 name = dict.get('side_effect_name', name)
             container = getWrapperContainer(context)
@@ -110,7 +112,7 @@
         context = self.context
         dict = getInnerWrapperData(context)
         name = dict and dict.get('name') or None
-        if name:
+        if name != self.name:
             # The name is meaningless. There is a side-efect name
             # that we need to preserve in the urls (only)
             if name == '.':
@@ -126,53 +128,4 @@
             return base
 
         return ({'name':'', 'url': self.request.getApplicationURL()}, )
-
-
-class ApplicationControlAbsoluteURL(BrowserView):
-    """Returns the absolute URL for the ApplicationController object.
-    """
-    # XXX This is hardcoded in conjunction to the hardcoded Traversal.
-
-    name = "++etc++ApplicationController"
-
-    def __str__(self):
-        
-        context = self.context
-        dict = getInnerWrapperData(context)
-        name = dict and dict.get('name') or None
-        if name != self.name:
-            if name == '.':
-                name = dict.get('side_effect_name', name)
-            container = getWrapperContainer(context)
-            url = "%s/%s" % (getView(container, 'absolute_url', self.request),
-                              name)
-        else:
-            url = self.request.getApplicationURL()
-
-        return url+"++etc++ApplicationController"
-
-    __call__ = __str__
-
-    def breadcrumbs(self):
-        context = self.context
-        dict = getInnerWrapperData(context)
-        name = dict and dict.get('name') or None
-        if name != self.name:
-            # The name is meaningless. There is a side-efect name
-            # that we need to preserve in the urls (only)
-            if name == '.':
-                name = dict.get('side_effect_name', name)
-            container = getWrapperContainer(context)
-            base = getView(container, 'absolute_url',
-                           self.request).breadcrumbs()
-            # replace the last step in base with a step with the same
-            # name ans an augmented url
-            base = base[:-1] + (
-                {'name': base[-1]['name'],
-                 'url': ("%s/%s" % (base[-1]['url'], name))}, )
-        else:
-            base = ({'name':'', 'url': self.request.getApplicationURL()}, )
-
-        return ({'name':'++etc++ApplicationController', 'url':base[0]["url"]+"++etc++ApplicationController"}, )
-
 


=== Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/configure.zcml 1.2.14.1 => 1.2.14.2 ===
--- Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/configure.zcml:1.2.14.1	Fri Nov 22 17:38:17 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/configure.zcml	Sun Nov 24 12:33:28 2002
@@ -17,13 +17,6 @@
     allowed_interface=".AbsoluteURL.IAbsoluteURL" />
 
 <browser:view
-    for="Zope.App.OFS.ApplicationControl.IApplicationControl.IApplicationControl"
-    name="absolute_url"
-    factory=".AbsoluteURL.ApplicationControlAbsoluteURL"
-    permission='Zope.Public'
-    allowed_interface=".AbsoluteURL.IAbsoluteURL" />
-    
-<browser:view
     name="object_name"
     factory=".ObjectName.ObjectNameView"
     permission='Zope.Public'