def monkeyAppAsSite(): # the python equivalent of load app as a localsite via zcml # import and call if you want to be able to treat the import OFS.Application from Products.Five.site.metaconfigure import classSiteHook from Products.Five.site.localsite import FiveSite from zope.interface import classImplements from zope.app.component.interfaces import IPossibleSite classSiteHook(OFS.Application.Application, FiveSite) classImplements(OFS.Application.Application, IPossibleSite)
def base_setup(app): """Setup without basic CA stuff because PTC already provides this""" from plone.app import relations try: zcml.load_config('configure.zcml', relations) except: # XXX: When ptc has setup plone, then the zcml product # registration causes errors when run twice :-( pass if not USE_LSM: # monkey in our hooks from Products.Five.site.metaconfigure import classSiteHook from Products.Five.site.localsite import FiveSite from zope.interface import classImplements from zope.site.interfaces import IPossibleSite klass = app.__class__ classSiteHook(klass, FiveSite) classImplements(klass, IPossibleSite) add_intids(app) add_relations(app) contentSetUp(app)
def setUp(app): # turn on all needed zcml placeless.setUp() import Products.Five from Zope2.App import zcml from plone import relations zcml.load_config('meta.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five) zcml.load_config('configure.zcml', relations) # Make a site, turn on the local site hooks, add the five.intid utility from zope.site.hooks import setSite, setHooks if not USE_LSM: # monkey in our hooks from Products.Five.site.metaconfigure import classSiteHook from Products.Five.site.localsite import FiveSite from zope.interface import classImplements from zope.site.interfaces import IPossibleSite klass = app.__class__ classSiteHook(klass, FiveSite) classImplements(klass, IPossibleSite) add_intids(app) setSite(app) setHooks() contentSetUp(app)