def initialize(context):
    utils.initializeBasesPhase2(z_bases, context)
    utils.ContentInit(
        ModuleEditor.ModuleEditor.meta_type,
        content_types=contentClasses,
        permission=permissions.AddModuleEditor,
        extra_constructors=contentConstructors).initialize(context)
예제 #2
0
def initialize(context):
    """initialization method
    """

    # generate the content types, constructors, and FTIs
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    # instatiates an object of the type ContentInit (from the CMFCore) and register the types in the CMF
    # or permission = DEFAULT_ADD_CONTENT_PERMISSION,
    utils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    if HAS_GENERICSETUP:
        profile_registry.registerProfile(PROJECTNAME,
                                         PROJECTNAME,
                                         'Extension profile for default setup',
                                         'profiles/default',
                                         PROJECTNAME,
                                         EXTENSION,
                                         for_=IPloneSiteRoot)
예제 #3
0
def initialize(context):
    ##Import Types here to register them
    import Products.Ploneboard.content

    # If we put this import line to the top of module then
    # utils will magically point to Ploneboard.utils
    from Products.CMFCore import utils
    utils.ToolInit('Ploneboard Tool',
                   tools=(PloneboardTool, ),
                   icon='tool.gif').initialize(context)

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

    # Assign an own permission to all content types
    # Heavily based on Bricolite's code from Ben Saller
    import permissions as perms

    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (PROJECTNAME, atype.archetype_name)
        utils.ContentInit(
            kind,
            content_types=(atype, ),
            # Add permissions look like perms.Add{meta_type}
            permission=getattr(perms, 'Add%s' % atype.meta_type),
            extra_constructors=(constructor, ),
            fti=ftis,
        ).initialize(context)

    from AccessControl import allow_class
    from batch import Batch
    allow_class(Batch)
    this_module.Batch = Batch
예제 #4
0
파일: __init__.py 프로젝트: yuanpli/erp5
def initialize(context):

    context.registerClass(
        HBTreeFolder2.HBTreeFolder2,
        constructors=(HBTreeFolder2.manage_addHBTreeFolder2Form,
                      HBTreeFolder2.manage_addHBTreeFolder2),
        icon='btreefolder2.gif',
        )

    #context.registerHelp()
    #context.registerHelpTitle('Zope Help')

    try:
        from Products.CMFCore import utils
    except ImportError:
        # CMF not installed
        pass
    else:
        # CMF installed; make available a special folder type.
        from . import CMFHBTreeFolder
        ADD_FOLDERS_PERMISSION = 'Add portal folders'

        utils.ContentInit(
            'CMF HBTree Folder',
            content_types=(CMFHBTreeFolder.CMFHBTreeFolder,),
            permission=ADD_FOLDERS_PERMISSION,
            extra_constructors=(CMFHBTreeFolder.manage_addCMFHBTreeFolder,),
            fti=CMFHBTreeFolder.factory_type_information
            ).initialize(context)
예제 #5
0
def initialize(context):
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration
    import content
    import tools
    import interfaces

    # Initialize portal tools
    tools = [tools.Annotations.Annotations]
    ToolInit(PROJECTNAME + ' Tools', tools=tools,
             icon='tool.gif').initialize(context)

    # Initialize portal content
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    profile_registry.registerProfile('marginalia',
                                     'Marginalia',
                                     'Bungeni',
                                     'profiles/default',
                                     'Marginalia',
                                     EXTENSION,
                                     for_=IPloneSiteRoot)
예제 #6
0
def initialize(context):
    """ Zope 2
    """

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME), PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if klassname not in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i], ),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])

    setupSchemas()
예제 #7
0
파일: __init__.py 프로젝트: dnessorga/LDP
def initialize(context):
    """Initialize the Lampadas product."""

    #    context.registerClass(
    #        PloneCVSFile.PloneCVSFile,
    #        constructors = (
    #            PloneCVSFile.manage_addForm,
    #            PloneCVSFile.cvsregistry_formpart,
    #            PloneCVSFile.cvssandbox_formpart,
    #            create_externalfile_formpart,
    #            create_standard_formpart,
    #            findCVSSandboxRegistry,
    #            manage_add_via_gui,
    #            confirm_create_form,
    #            confirm_create_action,
    #            gethostname,
    #            PloneCVSFile.manage_add,
    #            PloneCVSFile.manage_add_with_upload
    #        ),
    #        icon = 'www/fish.gif'
    #    )

    # CMF Initialization
    utils.initializeBasesPhase2(z_bases, context)
    utils.ContentInit(
        meta_type=META_TYPE,
        content_types=(PloneCVSFile.PloneCVSFile, ),
        permission=CMFCorePermissions.ModifyPortalContent,
        extra_constructors=(PloneCVSFile.manage_add, ),
        fti=factory_type_information,
    ).initialize(context)
예제 #8
0
def initialize(context):

    # from Products.validation import validation
    # validation.register(validators.CourseNumberValidator('CourseNumberValidator'))

    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

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

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        utils.ContentInit(
            '%s: %s' % (config.PROJECTNAME, atype.portal_type),
            content_types=(atype, ),
            permission=config.ADD_PERMISSIONS[atype.portal_type],
            extra_constructors=(constructor, ),
        ).initialize(context)
예제 #9
0
def initialize(context):

    utils.initializeBasesPhase2(z_bases, context)
    utils.initializeBasesPhase2(z_tool_bases, context)
    utils.ToolInit(
        'CMFDefault Tool',
        tools=tools,
        product_name='CMFDefault',
        icon='tool.gif',
    ).initialize(context)

    utils.ContentInit('CMFDefault Content',
                      content_types=contentClasses,
                      permission=ADD_CONTENT_PERMISSION,
                      extra_constructors=contentConstructors,
                      fti=Portal.factory_type_information).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(
                              Portal.manage_addCMFSiteForm,
                              Portal.manage_addCMFSite,
                          ),
                          icon='portal.gif')

    reg = Products.CMFCore.PortalFolder.addPortalTypeHandler
    reg('text/html', Document.Document)
    reg('text/plain', Document.Document)
    reg('image/png', Image.Image)
    reg('image/gif', Image.Image)
    reg('image/jpeg', Image.Image)
    reg('image/unknown', Image.Image)
예제 #10
0
파일: __init__.py 프로젝트: bendavis78/zope
def initialize(context):

    utils.initializeBasesPhase2(z_bases, context)
    utils.initializeBasesPhase2(z_tool_bases, context)
    utils.ToolInit(
        'CMFDefault Tool',
        tools=tools,
        product_name='CMFDefault',
        icon='tool.gif',
    ).initialize(context)

    utils.ContentInit('CMFDefault Content',
                      content_types=contentClasses,
                      permission=ADD_CONTENT_PERMISSION,
                      extra_constructors=contentConstructors,
                      fti=Portal.factory_type_information).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(
                              Portal.manage_addCMFSiteForm,
                              Portal.manage_addCMFSite,
                          ),
                          icon='portal.gif')
    utils.registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                       'images/workflow.gif', globals())

    context.registerHelp()
    context.registerHelpTitle('CMF Default Help')
예제 #11
0
파일: __init__.py 프로젝트: eea/eea.sparql
def initialize(context):
    """Initializer called when used as a Zope 2 product.

    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
    is necessary for GenericSetup profiles to work, for example.

    Here, we call the Archetypes machinery to register our content types
    with Zope and the CMF.
    """

    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

    content_types, constructors, _ftis = atapi.process_types(
        atapi.listTypes(config.PROJECTNAME), config.PROJECTNAME)

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        utils.ContentInit(
            '%s: %s' % (config.PROJECTNAME, atype.portal_type),
            content_types=(atype, ),
            permission=config.ADD_PERMISSIONS[atype.portal_type],
            extra_constructors=(constructor, ),
        ).initialize(context)
예제 #12
0
파일: __init__.py 프로젝트: viona/Easyshop
def initialize(context):
    """Initializer called when used as a Zope 2 product.
    """
    import easymall.mall.content
    import easymall.catalog.content
    import easymall.shop.content

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME), PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if not klassname in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i], ),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])
예제 #13
0
파일: __init__.py 프로젝트: viona/Easyshop
def initialize(context):
    """Initializer called when used as a Zope 2 product.
    """
    import easyshop.nochex.content

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types      = all_content_types,
        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors = all_constructors,
        fti                = all_ftis,
        ).initialize(context)

    # register profile
    profile_registry.registerProfile(
        name         = 'default',
        title        = 'easyshop.nochex',
        description  = 'Nochex payment processing for EasyShop',
        path         = 'profiles/default',
        product      = 'easyshop.nochex',
        profile_type = EXTENSION,
        for_         = IPloneSiteRoot)                                  
예제 #14
0
def initialize(context):
    """load up content types"""
    from Products.CMFCore import utils as cmf_utils
    #app = context._ProductContext__app
    #patch_listDefaultTypeInformation(app)

    from ironicwiki import IronicWiki
    try:
        from wickeddoc import WickedDoc
    except ImportError: # no ATCT
        pass

    types = atapi.listTypes(PROJECTNAME)
    content_types, constructors, ftis = atapi.process_types( types,
                                                             PROJECTNAME)
    permissions = {}
    types = atapi.listTypes(PROJECTNAME)

    for atype in  types:
        permission = "%s: Add %s" % (PROJECTNAME, atype['portal_type'])
        permissions[atype['portal_type']] = permission

        # Assign default roles
        setDefaultRoles(permission, ('Manager', 'Owner'))

    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)
예제 #15
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)
def initialize(context):
    """Intializer called when used as a Zope 2 product."""
    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

    content_types, constructors, ftis = atapi.process_types(
        atapi.listTypes('archetypes.z3crelationfield'),
        'archetypes.z3crelationfield')

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        cmfutils.ContentInit(
            '%s: %s' % ('archetypes.z3crelationfield', atype.portal_type),
            content_types=(atype, ),
            permission='Add portal content',
            extra_constructors=(constructor, ),
        ).initialize(context)
예제 #17
0
def initialize(context):
    registerMultiPlugin(plugin.JWTAuthenticationPlugin.meta_type)
    context.registerClass(
        plugin.JWTAuthenticationPlugin,
        permission=add_user_folders,
        constructors=(plugin.manage_addJWTAuthenticationPlugin,
                      plugin.addJWTAuthenticationPlugin),
        visibility=None,
    )

    if REGISTER_TEST_TYPES:
        from Products.Archetypes.ArchetypeTool import process_types, listTypes
        from Products.CMFCore import permissions
        from Products.CMFCore import utils
        from plone.restapi.tests.attypes import PROJECTNAME

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

        utils.ContentInit(
            '%s Content' % PROJECTNAME,
            content_types=content_types,
            permission=permissions.AddPortalContent,
            extra_constructors=constructors,
            fti=ftis,
        ).initialize(context)
예제 #18
0
def initialize(context):
    """initialize product (called by zope)"""
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration
    import content

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME), PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if not klassname in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i], ),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])
예제 #19
0
def initialize(context):
    """initialize product (called by zope)"""
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration

    import csvreplicataTool

    # Initialize portal tools
    tools = [csvreplicataTool.csvreplicataTool]
    ToolInit(PROJECTNAME + ' Tools', tools=tools,
             icon='tool.gif').initialize(context)

    # Initialize portal content
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)
예제 #20
0
def initialize(context):
    # imports packages and types for registration
    import interfaces
    import psc
    import content

    interfaces, psc, content  # pyflakes

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if klassname not in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i],),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])
예제 #21
0
def initialize(context):
    """ Initialize product (standard Zope hook)
    """
    registerPermissions([(ADD_DESIGN_PERMISSION, []),
                         (ADD_CONTENT_PERMISSION, []), (READ_PERMISSION, []),
                         (EDIT_PERMISSION, []), (CREATE_PERMISSION, []),
                         (REMOVE_PERMISSION, []), (DESIGN_PERMISSION, []),
                         (ACL_PERMISSION, [])])
    from .document import PlominoDocument, addPlominoDocument

    all_content_types = (PlominoDocument, )
    all_constructors = (addPlominoDocument, )
    all_ftis = ({
        'meta_type': 'PlominoDocument',
        'allowed_content_types': [],
        'allow_discussion': 0,
        'global_allow': 0,
        'filter_content_types': 1,
    }, )

    cmfutils.ContentInit(
        'CMFPlomino Content',
        content_types=all_content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)
예제 #22
0
def initialize(context):

    from Products.CompositePack import viewlet
    from Products.CompositePack.composite import archetype
    from Products.CompositePack.composite import fragments
    from Products.CompositePack.composite import navigationpage
    from Products.CompositePack.composite import portlets
    from Products.CompositePack.composite import titles
    from Products.CompositePack.viewlet import container

    if config.INSTALL_DEMO_TYPES:
        from Products.CompositePack.demo import ATCompositeDocument

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

    utils.ContentInit(
        "%s Content" % config.PROJECTNAME,
        content_types=content_types,
        permission=config.ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    utils.ToolInit(
        config.TOOL_NAME,
        tools=tools,
        icon=config.TOOL_ICON,
    ).initialize(context)
예제 #23
0
def initialize(context):
    from Products.CMFCore import utils

    utils.ToolInit(
        "%s Tool" % PKG_NAME,
        tools=tools,
        icon="tool.gif",
    ).initialize(context)

    if REGISTER_DEMO_TYPES:
        import Products.Archetypes.examples

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

        utils.ContentInit(
            '%s Content' % PKG_NAME,
            content_types=content_types,
            permission=permissions.AddPortalContent,
            extra_constructors=constructors,
            fti=ftis,
        ).initialize(context)
    try:
        from Products.CMFCore.FSFile import FSFile
        from Products.CMFCore.DirectoryView import registerFileExtension
        registerFileExtension('xsl', FSFile)
        registerFileExtension('xul', FSFile)
    except ImportError:
        pass
예제 #24
0
def initialize(context):
    """initialize product (called by zope)"""

    # imports packages and types for registration
    import content

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes('upfront.versioning'), 'upfront.versioning')

    cmfutils.ContentInit(
        'upfront.versioning' + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if not klassname in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i], ),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])
예제 #25
0
def initialize(context):
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration

    import LookAndFeel

    # Initialize portal content
    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types      = content_types,
        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors = constructors,
        fti                = ftis,
        ).initialize(context)

    # Apply customization-policy, if theres any
    if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
        CustomizationPolicy.register(context)
        print 'Customization policy for BungeniSkin installed'
예제 #26
0
def initialize(context):
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration

    from . import CalendarXFolder

    # Initialize portal content
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    profile_registry.registerProfile(
        name='default',
        title=PROJECTNAME,
        description='Profile for CalendarX',
        path='profiles/default',
        product='CalendarX',
        profile_type=EXTENSION,
        for_=Products.CMFPlone.interfaces.IPloneSiteRoot)

    ##code-section custom-init-bottom #fill in your manual code here
    ##/code-section custom-init-bottom
    return
예제 #27
0
def initialize(context):
    product = utils.ContentInit(product_name,
                                content_types=contentClasses,
                                permission=add_permission,
                                extra_constructors=contentConstructors,
                                fti=contentFTI)
    product.initialize(context)
예제 #28
0
def initialize(context):
    """ Initialize product (standard Zope hook)
    """
    ##code-section custom-init-top #fill in your manual code here
    registerPermissions([(ADD_DESIGN_PERMISSION, []),
                         (ADD_CONTENT_PERMISSION, []), (READ_PERMISSION, []),
                         (EDIT_PERMISSION, []), (CREATE_PERMISSION, []),
                         (REMOVE_PERMISSION, []), (DESIGN_PERMISSION, []),
                         (ACL_PERMISSION, [])])
    ##/code-section custom-init-top

    # imports packages and types for registration

    import PlominoDatabase
    import PlominoAction
    import PlominoForm
    import PlominoField
    import PlominoView
    import PlominoColumn
    import PlominoDocument
    import PlominoHidewhen
    import PlominoAgent
    import PlominoCache
    from PlominoDocument import addPlominoDocument

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME), PROJECTNAME)

    all_content_types += (PlominoDocument.PlominoDocument, )
    all_constructors += (addPlominoDocument, )
    all_ftis += ({
        'meta_type': 'PlominoDocument',
        'allowed_content_types': [],
        'allow_discussion': 0,
        'immediate_view': 'checkBeforeOpenDocument',
        'global_allow': 0,
        'filter_content_types': 1,
    }, )
    #EXAMPLE: {'factory': 'addPlominoAction', 'product': 'CMFPlomino', 'immediate_view': 'base_edit', 'content_icon': 'document_icon.gif', 'global_allow': True, 'filter_content_types': False, 'actions': ({'action': <Products.CMFCore.Expression.Expression object at 0x6bee8c0>, 'title': 'View', 'id': 'view', 'permissions': ('View',)}, {'action': <Products.CMFCore.Expression.Expression object at 0x6bee758>, 'title': 'Edit', 'id': 'edit', 'condition': <Products.CMFCore.Expression.Expression object at 0x6e247d0>, 'permissions': ('Modify portal content',)}, {'action': <Products.CMFCore.Expression.Expression object at 0x6d9dd70>, 'title': 'Properties', 'id': 'metadata', 'permissions': ('Modify portal content',)}), 'fti_meta_type': 'Factory-based Type Information with dynamic views', 'default_view': 'base_view', 'meta_type': 'PlominoAction', 'allow_discussion': False, 'view_methods': ('base_view',), 'aliases': {'sharing': 'folder_localrole_form', 'gethtml': '', '(Default)': '(dynamic view)', 'edit': 'base_edit', 'mkdir': '', 'properties': 'base_metadata', 'view': '(selected layout)'}, 'id': 'PlominoAction', 'description': '\n    '}

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types=all_content_types,
        permission=DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors=all_constructors,
        fti=all_ftis,
    ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0, len(all_content_types)):
        klassname = all_content_types[i].__name__
        if not klassname in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type=all_ftis[i]['meta_type'],
                              constructors=(all_constructors[i], ),
                              permission=ADD_CONTENT_PERMISSIONS[klassname])
예제 #29
0
def initialize(context):
    utils.initializeBasesPhase2(z_bases, context)
    context.registerHelpTitle('CMF Calendar Help')
    context.registerHelp(directory='help')
    utils.ContentInit('CMF Event',
                      content_types=contentClasses,
                      permission=CMFCorePermissions.AddPortalContent,
                      extra_constructors=contentConstructors,
                      fti=Event.factory_type_information).initialize(context)
예제 #30
0
파일: __init__.py 프로젝트: bendavis78/zope
def initialize(context):
    # CMF Initializers
    utils.ContentInit(
        'CMF Wiki Content',
        content_types=(CMFWikiPage.CMFWikiPage, PortalFolder),
        permission=Create,
        extra_constructors=(CMFWikiPage.addCMFWikiPage,
                            CMFWikiPage.addCMFWikiFolder),
        fti=CMFWikiPage.factory_type_information,
    ).initialize(context)