[Zope-CVS] CVS: Packages/Moztop/moztopsupport/rdf - container.py:1.3
Sidnei da Silva
sidnei@x3ng.com.br
Fri, 21 Mar 2003 09:29:55 -0500
Update of /cvs-repository/Packages/Moztop/moztopsupport/rdf
In directory cvs.zope.org:/tmp/cvs-serv26388/moztopsupport/rdf
Modified Files:
container.py
Log Message:
A site *must* have a Local ServiceManager
=== Packages/Moztop/moztopsupport/rdf/container.py 1.2 => 1.3 ===
--- Packages/Moztop/moztopsupport/rdf/container.py:1.2 Fri Mar 21 08:53:51 2003
+++ Packages/Moztop/moztopsupport/rdf/container.py Fri Mar 21 09:29:24 2003
@@ -27,9 +27,9 @@
from zope.proxy.introspection import removeAllProxies
from zope.proxy.context import ContextWrapper
from zope.publisher.browser import BrowserView
-
+from zope.component.exceptions import ComponentLookupError
from moztopsupport.rdf.interfaces import IRDFNode, IRDFContainer
-from moztopsupport.interfaces import IResourceTypesUtility
+from moztopsupport.interfaces import IResourceTypesUtility, IServiceManagerUtility
class Contents(BrowserView):
@@ -140,12 +140,14 @@
def contents(self):
+ smut = getUtility(self.context, IServiceManagerUtility)
+ if not smut.hasLocalServiceManager(self.context):
+ raise ComponentLookupError('Local ServiceManager could not be found')
self.request.response.setHeader('content-type', 'text/xml')
return self._template()
_template = ViewPageTemplateFile("contents.pt")
-
class ResourceTypes(BrowserView):
"""A view that manages the RDF listing of all available resource types."""
@@ -162,6 +164,9 @@
return rdf
def resource_types(self):
+ smut = getUtility(self.context, IServiceManagerUtility)
+ if not smut.hasLocalServiceManager(self.context):
+ raise ComponentLookupError('Local ServiceManager could not be found')
self.request.response.setHeader('content-type', 'text/xml')
return self._template()
@@ -190,5 +195,4 @@
</rdf:Description>
'''
-