Exemplo n.º 1
0
def initialize(context):
    """Product Initialization
    """
    import patch, patch_cmf, patch_five
    patch.run()
    patch_cmf.run()
    patch_five.run()

    tools = (CacheTool, CSCachingPolicyManager)

    try:
        cmfutils.ToolInit(
        config.PROJECT_NAME + ' Tool',
        tools = tools,
        icon = 'cachesetup_tool_icon.gif',
        ).initialize(context)
    except TypeError:
        cmfutils.ToolInit(
        config.PROJECT_NAME + ' Tool',
        tools = tools,
        product_name = config.PROJECT_NAME,
        icon = 'cachesetup_tool_icon.gif',
        ).initialize(context)

    allow_module('Products.CacheSetup.config')

    # Ask Archetypes to handback all the type information needed
    # to make the CMF happy.
    types = atapi.listTypes(config.PROJECT_NAME)
    content_types, constructors, ftis = \
        atapi.process_types(types, config.PROJECT_NAME)
    permissions = initialize_permissions()

    # We want to register each each type with its own permission,
    # this will afford us greater control during system
    # configuration/deployment (and is a good recipe)
    # The pattern used here will create many item options in ZMI
    # menus, but is the only way that allows for things to still be
    # selectable in the UI. If they all had the same name, only the
    # first would be found.
    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        cmfutils.ContentInit(
            atype.meta_type,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)
Exemplo n.º 2
0
def initialize(context):
    ##Import Types here to register them
    from content import coreblog2
    from content import coreblogstufffolder
    from content import coreblogentry
    from content import coreblogcategory
    from content import coreblogcomment
    from content import coreblogtrackback

    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    utils.ToolInit('COREBlog Tool', tools=(COREBlogTool.COREBlog2Tool,),
            product_name=PROJECTNAME, icon='tool.gif',
            ).initialize(context)

    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME, atype.archetype_name)
        utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)
Exemplo n.º 3
0
def initialize(context):
    # Importing the content types allows for their registration
    # with the Archetypes runtime
    from Products.sampleremember import content

    # Ask Archetypes to handback all the type information needed
    # to make the CMF happy.
    types = atapi.listTypes(config.PROJECT_NAME)
    content_types, constructors, ftis = \
        atapi.process_types(types, config.PROJECT_NAME)

    # We register each type with an add permission that is set
    # in permissions.py.  By default, each content type has its
    # own permission, but this behavior can be easily overridden.
    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECT_NAME, atype.archetype_name)
        cmf_utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)

    profile_registry.registerProfile(
        'default',
        'sampleremember',
        "Installs sampleremember.",
        'profiles/default',
        'sampleremember',
        EXTENSION,
        for_=IPloneSiteRoot,)
Exemplo n.º 4
0
def initialize(context):
    ##Import Types here to register them
    from content import coreblog2
    from content import coreblogstufffolder
    from content import coreblogentry
    from content import coreblogcategory
    from content import coreblogcomment
    from content import coreblogtrackback

    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    utils.ToolInit(
        'COREBlog Tool',
        tools=(COREBlogTool.COREBlog2Tool, ),
        product_name=PROJECTNAME,
        icon='tool.gif',
    ).initialize(context)

    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME, atype.archetype_name)
        utils.ContentInit(
            kind,
            content_types=(atype, ),
            permission=permissions[atype.portal_type],
            extra_constructors=(constructor, ),
            fti=ftis,
        ).initialize(context)
Exemplo n.º 5
0
def initialize(context):
    # Importing the content types allows for their registration
    # with the Archetypes runtime
    import content
    import tools
    
    types = listTypes(PROJECTNAME)
    content_types, constructors, ftis = \
       process_types(types, PROJECTNAME)
    
    tools=[tools.admanager.AdManager, tools.adcatalog.AdCatalog]
    cmf_utils.ToolInit(PROJECTNAME+' Tools',
                tools = tools,
                icon='tool.gif'
                ).initialize(context)

    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
       kind = "%s: %s" % (PROJECTNAME, atype.archetype_name)
       cmf_utils.ContentInit(
           kind,
           content_types      = (atype,),
           permission         = permissions[atype.portal_type],
           extra_constructors = (constructor,),
           fti                = ftis,
           ).initialize(context)
    registerClasses(context, PROJECTNAME)
Exemplo n.º 6
0
def initialize(context):
    # import types from this project to register them.
    import content

    # get content type list, content constructor list, and file type
    # information (fti) list.
    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    # initializing permissions.
    permissions = initialize_permissions()

    # make 'content type' and 'consturctor' tuples list to use easly
    # at next process.
    allTypes = zip(content_types, constructors)

    # Registration per content type.
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME, atype.archetype_name)
        # Call CMFCore.utils.ContentInit to register content types.
        utils.ContentInit(
            # Name that display in ADD drop-down menu on ZMI is 
            # specified. This is used as meta_type in internal. However, 
            # there is no relation to meta_type set in each contents type 
            # implementation class.
            kind,

            # The tupple of the contents type implementation class object 
            # that can be added with kind(meta_type) is specified. The 
            # menu panel to select it is displayed to add the object of 
            # which contents type with ZMI when the plural is specified 
            # when the addition is executed.
            content_types = (atype,),

            # Permission information on the contents type that tries to 
            # be registered now is specified among information acquired 
            # with initialize_permissions().
            permission = permissions[atype.portal_type],

            # The constructor executed when the object is added is 
            # specified. Constructors of the same number as the number of 
            # elements set to the content_types argument are necessary.
            extra_constructors = (constructor,),

            # FileTypeInformation is specified.
            fti = ftis,

            # The initialization execution function of ContentInit is 
            # called. After necessary processing is done as CMFCore, the 
            # product registration function to Zope is called.
            ).initialize(context)
Exemplo n.º 7
0
def initialize(context):
    # register the CMFMember migrators, if necessary
    if config.CMFMEMBER_MIGRATION_SUPPORT:
        registerMigrators()

    # Register a PAS plugin
    pas_install.register_pas_plugin_class(context)
    # Some methods are needed in restricted python:
    allow_module('Products.remember.pas.utils')

    # Importing the content types allows for their registration
    # with the Archetypes runtime
    import content
    content  # pyflakes

    # Ask Archetypes to handback all the type information needed
    # to make the CMF happy.
    types = atapi.listTypes(config.PROJECT_NAME)
    content_types, constructors, ftis = \
        atapi.process_types(types, config.PROJECT_NAME)

    # We register each type with an add permission that is set
    # in permissions.py.  By default, each content type has its
    # own permission, but this behavior can be easily overridden.
    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECT_NAME, atype.archetype_name)
        cmf_utils.ContentInit(
            kind,
            content_types=(atype, ),
            permission=permissions[atype.portal_type],
            extra_constructors=(constructor, ),
            fti=ftis,
        ).initialize(context)

    profile_registry.registerProfile('uninstall',
                                     'uninstall remember',
                                     'Uninstall remember.',
                                     'profiles/uninstall',
                                     'remember',
                                     EXTENSION,
                                     for_=ISiteRoot,
                                     )

    # register image property type for user property sheets
    PropertySchema.addType('image',
                           lambda x: x is None or isinstance(x, Image))
Exemplo n.º 8
0
def initialize(context):
    ##Import Types here to register them
    import content

    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)

    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME, atype.archetype_name)
        utils.ContentInit(
            kind,
            content_types=(atype,),
            permission=permissions[atype.portal_type],
            extra_constructors=(constructor,),
            fti=ftis,
        ).initialize(context)
Exemplo n.º 9
0
def initialize(context):
    # register the CMFMember migrators, if necessary
    if config.CMFMEMBER_MIGRATION_SUPPORT:
        registerMigrators()
    
    # Importing the content types allows for their registration
    # with the Archetypes runtime
    import content

    # Ask Archetypes to handback all the type information needed
    # to make the CMF happy.
    types = atapi.listTypes(config.PROJECT_NAME)
    content_types, constructors, ftis = \
        atapi.process_types(types, config.PROJECT_NAME)

    # We register each type with an add permission that is set
    # in permissions.py.  By default, each content type has its
    # own permission, but this behavior can be easily overridden.
    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECT_NAME, atype.archetype_name)
        cmf_utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)


    profile_desc = "Installs membrane-based Plone member implementation."
    profile_registry.registerProfile('default',
                                     'remember',
                                     profile_desc,
                                     'profiles/default',
                                     'remember',
                                     EXTENSION,
                                     for_=IPloneSiteRoot,
                                     )

    # register image property type for user property sheets
    PropertySchema.addType('image',
                           lambda x: x is None or isinstance(x, Image))
Exemplo n.º 10
0
def initialize(context):

    import Weblog
    import WeblogEntry

    Weblog, WeblogEntry  # PYFLAKES

    content_types, constructors, ftis = process_types(listTypes(config.PROJECTNAME), config.PROJECTNAME)

    permissions = initialize_permissions()
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME, atype.archetype_name)
        utils.ContentInit(
            kind,
            content_types=(atype,),
            permission=permissions[atype.portal_type],
            extra_constructors=(constructor,),
            fti=ftis,
        ).initialize(context)
Exemplo n.º 11
0
def initialize(context):
    lrinit(context)
    # Importing the content types allows for their registration
    # with the Archetypes runtime
    from content import *
    from opencore.content import *
    from opencore.listen import mailinglist

    from AccessControl import ModuleSecurityInfo

    msi = ModuleSecurityInfo('Products.OpenPlans.interfaces')
    msi.declarePublic('IWriteWorkflowPolicySupport')

    # Ask Archetypes to handback all the type information needed
    # to make the CMF happy.
    types = atapi.listTypes(config.PROJECTNAME)
    content_types, constructors, ftis = atapi.process_types(types,
                                                            config.PROJECTNAME)

    # XXX make this a 'z3types' data structure
    content_types = content_types + (mailinglist.OpenMailingList,)
    constructors = constructors + (mailinglist.addOpenMailingList,)
    ftis = ftis + z3ftis

    permissions = initialize_permissions()
    permissions['Open Mailing List'] = AddMailingList
    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (config.PROJECTNAME,
                           getattr(atype,'archetype_name','portal_type'))
        cmf_utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)

    from opencore.auth import SignedCookieAuthHelper
    from AccessControl.Permissions import add_user_folders
    context.registerClass( SignedCookieAuthHelper.SignedCookieAuthHelper,
                           permission = add_user_folders,
                           constructors = ( SignedCookieAuthHelper.manage_addSignedCookieAuthHelperForm,
                                            SignedCookieAuthHelper.manage_addSignedCookieAuthHelper ),
                           visibility = None
                           )

    # do all at import cataloging setup
    indexing.register_indexable_attrs()

    # bbb
    import opencore.bbb
    do_aliases()

    # note to future generations: as far as I can tell doing a component lookup here is brittle.
    # the opencore configuration should consistently be loaded before this method is run
    # but that is only because the OpenPlans product is alphabetically after the Five product and
    # so Zope loads it after loading Five; Five in turn installs opencore's configuration.
    if not queryUtility(IProvideSiteConfig):
        raise ComponentLookupError("""No utility was found to provide IProvideSiteConfig. """
                                   """You really should not start your site without one. """
                                   """If you built your stack with Fassembler, just """
                                   """`easy_install https://svn.openplans.org/svn/fassembler/configparser` """
                                   """in your opencore environment to install Fassembler's configuration provider.""")