def setup_local_tools(portal, out):
    from Acquisition import aq_base
    from Acquisition import aq_parent
    from Products.Archetypes import ArchetypeTool
    from Products.Archetypes.ReferenceEngine import ReferenceCatalog
    from Products.Archetypes.UIDCatalog import UIDCatalog
    from Products.Archetypes.setuphandlers import install_uidcatalog
    from Products.Archetypes.setuphandlers import install_referenceCatalog
    public = portal.public_website
    # Hack around acquisition so that tools get setup correctly
    public = aq_base(public).__of__(aq_parent(portal))
    public.archetype_tool = ArchetypeTool()
    public.reference_catalog = ReferenceCatalog(id='reference_catalog')
    public.uid_catalog = UIDCatalog(id='uid_catalog')
    install_uidcatalog(out, public)
    install_referenceCatalog(out, public)
示例#2
0
def setup_referenceablebehavior(context):
    if context.readDataFile('referenceablebehavior.txt') is None:
        return
    site = context.getSite()
    install_uidcatalog([], site)
    install_referenceCatalog([], site)