[Zope3-checkins] CVS: Zope3/src/zope/app/browser -
onlinehelp.py:1.15.6.1 onlinehelp.zcml:1.10.10.1
traversal.zcml:1.9.8.1
Jim Fulton
cvs-admin at zope.org
Sun Nov 9 11:09:03 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/browser
Modified Files:
Tag: adaptergeddon-branch
onlinehelp.py onlinehelp.zcml traversal.zcml
Log Message:
Created a global presentation service that replaces the
global view, resource, and skin services.
Now look up presentation components by adapting from a request type,
rather than adapting to a presentation type.
=== Zope3/src/zope/app/browser/onlinehelp.py 1.15 => 1.15.6.1 ===
--- Zope3/src/zope/app/browser/onlinehelp.py:1.15 Sun Sep 21 13:30:20 2003
+++ Zope3/src/zope/app/browser/onlinehelp.py Sun Nov 9 11:08:02 2003
@@ -17,10 +17,7 @@
"""
from zope.interface import providedBy
-from zope.publisher.interfaces.browser import IBrowserPresentation
-
from zope.component import getService, getView
-from zope.component.view import viewService
from zope.app.publisher.browser import BrowserView
from zope.app.traversing import getRoot
from zope.app.traversing import getParents, getName
@@ -42,36 +39,40 @@
onlinehelp = getRoot(self.context)
return self._makeSubTree(onlinehelp)
-
-class FindRelevantHelpTopics(BrowserView):
- """This object is used as a view on a view, so that we can get all the
- required information."""
-
- def __call__(self):
-
- class FindResult:
- def __init__(self, url, topic):
- self.url = url
- self.topic = topic
-
- view_class = self.context.__class__
- obj = self.context.context
- help = getService(obj, 'OnlineHelp')
- ifaces = providedBy(obj).flattened()
- topics = []
- for iface in ifaces:
- specs = viewService.getRegisteredMatching((iface,),
- IBrowserPresentation)
- for spec in specs:
- if spec[2][0] is not view_class:
- continue
- for topic in help.getTopicsForInterfaceAndView(iface, spec[4]):
- parents = getParents(topic)
- path = map(getName, [topic]+parents[:-1])
- path.reverse()
- url = getView(obj, 'absolute_url', self.request)()
- url += '/++help++/++skin++Onlinehelp/'+'/'.join(path)
- topics.append(FindResult(url, topic))
+# XXX The view below is highly qeustionable on many levels.
+# - It uses the global view service (now refactored to presentation service
+# - It's very expensive.
+# Perhaps we'll resurrect this later when we have time to do it bit better.
+
+## class FindRelevantHelpTopics(BrowserView):
+## """This object is used as a view on a view, so that we can get all the
+## required information."""
+
+## def __call__(self):
+
+## class FindResult:
+## def __init__(self, url, topic):
+## self.url = url
+## self.topic = topic
+
+## view_class = self.context.__class__
+## obj = self.context.context
+## help = getService(obj, 'OnlineHelp')
+## ifaces = providedBy(obj).flattened()
+## topics = []
+## for iface in ifaces:
+## specs = viewService.getRegisteredMatching((iface,),
+## IBrowserRequest)
+## for spec in specs:
+## if spec[2][0] is not view_class:
+## continue
+## for topic in help.getTopicsForInterfaceAndView(iface, spec[4]):
+## parents = getParents(topic)
+## path = map(getName, [topic]+parents[:-1])
+## path.reverse()
+## url = getView(obj, 'absolute_url', self.request)()
+## url += '/++help++/++skin++Onlinehelp/'+'/'.join(path)
+## topics.append(FindResult(url, topic))
- return topics
+## return topics
=== Zope3/src/zope/app/browser/onlinehelp.zcml 1.10 => 1.10.10.1 ===
--- Zope3/src/zope/app/browser/onlinehelp.zcml:1.10 Sat Aug 23 16:37:35 2003
+++ Zope3/src/zope/app/browser/onlinehelp.zcml Sun Nov 9 11:08:02 2003
@@ -2,12 +2,15 @@
xmlns:zope="http://namespaces.zope.org/zope"
xmlns="http://namespaces.zope.org/browser">
+<!--
<page
name="find_help_topics"
for="*"
class=".onlinehelp.FindRelevantHelpTopics"
permission="zope.Public"
allowed_attributes="__call__" />
+
+-->
<pages
for="zope.app.interfaces.onlinehelp.IOnlineHelpTopic"
=== Zope3/src/zope/app/browser/traversal.zcml 1.9 => 1.9.8.1 ===
--- Zope3/src/zope/app/browser/traversal.zcml:1.9 Wed Sep 3 14:33:55 2003
+++ Zope3/src/zope/app/browser/traversal.zcml Sun Nov 9 11:08:02 2003
@@ -34,7 +34,7 @@
for="*"
name="absolute_url"
factory=".absoluteurl.AbsoluteURL"
- type="zope.publisher.interfaces.http.IHTTPPresentation"
+ type="zope.publisher.interfaces.http.IHTTPRequest"
permission="zope.Public"
allowed_interface="zope.app.interfaces.browser.absoluteurl.IAbsoluteURL"
/>
@@ -43,7 +43,7 @@
for="zope.app.interfaces.traversing.IContainmentRoot"
name="absolute_url"
factory=".absoluteurl.SiteAbsoluteURL"
- type="zope.publisher.interfaces.http.IHTTPPresentation"
+ type="zope.publisher.interfaces.http.IHTTPRequest"
permission="zope.Public"
allowed_interface="zope.app.interfaces.browser.absoluteurl.IAbsoluteURL"
/>
More information about the Zope3-Checkins
mailing list