예제 #1
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)
예제 #2
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)
예제 #3
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 membership
    import interfaces
    import content
    import events
    import bills
    import debaterecord
    import groups
    import geoinfo
    import workspaces
    import government


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

    # 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])

    profile_registry.registerProfile(
        name='default',
        title=PROJECTNAME,
        description='Profile for Bungeni',
        path='profiles/default',
        product='Bungeni',
        profile_type=EXTENSION,
        for_=Products.CMFPlone.interfaces.IPloneSiteRoot)
예제 #4
0
def initialize(context):
    """initialize product (called by zope)"""

    from Products.PloneMeeting import monkey
    import Meeting
    import MeetingCategory
    import MeetingConfig
    import MeetingGroup
    import MeetingItem
    import MeetingUser
    import ToolPloneMeeting

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

    # 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])

    allow_module('collective.iconifiedcategory.safe_utils')
    allow_module('collective.contact.core')
    allow_module('collective.contact.plonegroup.safe_utils')
    allow_module('imio.annex.safe_utils')
    allow_module('imio.history.safe_utils')
    allow_module('Products.PloneMeeting.safe_utils')
    allow_module('Products.PloneMeeting.browser.meeting')
    allow_type(datetime)
예제 #5
0
def initialize(context):
    import plone
    import sitesetup

    # initialize portal tools
    tools = [plone.AnnotationTool]
    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)
예제 #6
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 bungeniremotefolder
    import bungeniremotesettings
    import bungeniremotepage

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

    # 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])
예제 #7
0
def initialize(context):
    """
    initialize product (called by zope)
    """

    # imports packages and types for registration (see above)
    #import content
    #import tool

    # Initialize portal tools
    tools = [tool.ECABTool.ECABTool]
    ToolInit(config.PROJECTNAME +' Tools', 
             tools = tools, 
             icon='ec_tool.png'
             ).initialize( context )

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

    cmfutils.ContentInit(
        config.PROJECTNAME + ' Content',
        content_types      = all_content_types,
        permission         = config.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 config.ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
                              constructors= (all_constructors[i],),
                              permission  = config.ADD_CONTENT_PERMISSIONS[klassname])
예제 #8
0
def initialize(context):

    # Stuff has been moved from module level to this method for a
    # better separation of import and installation.
    # For the general user this change does not make a difference.
    # For test authors (and people who use parts of Plone only)
    # it does speed up import *significantly*.

    from AccessControl import ModuleSecurityInfo
    from AccessControl import allow_class
    from AccessControl import allow_module
    from AccessControl import allow_type

    # protect OFS.ObjectManager
    ModuleSecurityInfo('OFS.ObjectManager').setDefaultAccess(0)
    ModuleSecurityInfo('OFS.ObjectManager').declareObjectPrivate()
    ModuleSecurityInfo('OFS.ObjectManager').declarePublic(
        'BeforeDeleteException')

    # allow logging
    ModuleSecurityInfo('logging').declarePublic('getLogger')
    from logging import Logger
    allow_class(Logger)

    # various small utils functions
    # added for unescaping view names in urls when finding selected action
    ModuleSecurityInfo('urllib').declarePublic('unquote')

    allow_module('Products.CMFPlone.utils')

    # For content_status_modify
    from Products.CMFCore.WorkflowCore import ObjectDeleted
    from Products.CMFCore.WorkflowCore import ObjectMoved
    from Products.CMFCore.WorkflowCore import WorkflowException
    ModuleSecurityInfo(
        'Products.CMFCore.WorkflowCore').declarePublic('ObjectDeleted')
    ModuleSecurityInfo(
        'Products.CMFCore.WorkflowCore').declarePublic('ObjectMoved')
    ModuleSecurityInfo(
        'Products.CMFCore.WorkflowCore').declarePublic('WorkflowException')
    allow_class(ObjectDeleted)
    allow_class(ObjectMoved)
    allow_class(WorkflowException)

    from Products.CMFPlone.PloneBatch import Batch
    allow_class(Batch)

    # Make Batch available at module level
    this_module.Batch = Batch

    ModuleSecurityInfo('StringIO').declarePublic('StringIO')
    from six import StringIO
    allow_class(StringIO)

    # Make Unauthorized importable TTW
    ModuleSecurityInfo('AccessControl').declarePublic('Unauthorized')

    # Make Forbidden importable TTW
    ModuleSecurityInfo('zExceptions').declarePublic('Forbidden')

    # Make ConflictError importable TTW
    ModuleSecurityInfo('ZODB.POSException').declarePublic('ConflictError')

    # Make ZCTextIndex ParseError importable TTW
    ModuleSecurityInfo('Products.ZCTextIndex.ParseTree') \
        .declarePublic('ParseError')

    # Make DateTimeError importable TTW
    ModuleSecurityInfo('DateTime.interfaces').declarePublic('DateTimeError')
    ModuleSecurityInfo('DateTime.interfaces').declarePublic('SyntaxError')

    # BBB support for DateTime < 3
    ModuleSecurityInfo('DateTime.DateTime').declarePublic('DateTimeError')
    ModuleSecurityInfo('DateTime.DateTime').declarePublic('SyntaxError')

    # Make CopyError importable TTW
    ModuleSecurityInfo('OFS.CopySupport').declarePublic('CopyError')

    # Make AllowSendto importable TTW
    ModuleSecurityInfo('Products.CMFPlone.PloneTool') \
        .declarePublic('AllowSendto')

    # Make ZCatalog's mergeResults importable TTW
    ModuleSecurityInfo('Products.ZCatalog.Catalog') \
        .declarePublic('mergeResults')

    # Make the navtree constructs available TTW
    allow_module('Products.CMFPlone.browser.navtree')

    # Allow access to the exception in the folder_delete script
    from OFS.ObjectManager import BeforeDeleteException
    allow_module('OFS.ObjectManager')
    allow_class(BeforeDeleteException)

    # Make cgi.escape available TTW
    ModuleSecurityInfo('cgi').declarePublic('escape')

    # We want to allow all methods on string type except 'format'.
    # That one needs special handling to avoid access to attributes.
    from Products.CMFPlone.utils import _safe_format
    rules = dict([(m, True) for m in dir(str) if not m.startswith('_')])
    rules['format'] = _safe_format
    allow_type(str, rules)

    # Same for unicode instead of str.
    rules = dict([(m, True) for m in dir(unicode) if not m.startswith('_')])
    rules['format'] = _safe_format
    allow_type(unicode, rules)

    # Apply monkey patches
    from Products.CMFPlone import patches  # noqa

    # Register unicode splitter w/ ZCTextIndex
    # pipeline registry
    from Products.CMFPlone import UnicodeSplitter  # noqa

    # Plone content

    # Usage of PloneFolder is discouraged.
    from Products.CMFPlone import PloneFolder

    contentClasses = (PloneFolder.PloneFolder, )
    contentConstructors = (PloneFolder.addPloneFolder, )

    # CMFCore tools
    from Products.CMFCore import CachingPolicyManager

    # Plone tools
    from Products.CMFPlone import PloneTool
    from Products.CMFPlone import MigrationTool
    from Products.CMFPlone import PloneControlPanel
    from Products.CMFPlone import WorkflowTool
    from Products.CMFPlone import URLTool
    from Products.CMFPlone import RegistrationTool
    from Products.CMFPlone import PropertiesTool
    from Products.CMFPlone import ActionsTool
    from Products.CMFPlone import TypesTool
    from Products.CMFPlone import CatalogTool
    from Products.CMFPlone import SkinsTool
    from Products.CMFPlone import QuickInstallerTool
    from Products.CMFPlone import TranslationServiceTool

    tools = (
        PloneTool.PloneTool,
        WorkflowTool.WorkflowTool,
        CachingPolicyManager.CachingPolicyManager,
        PropertiesTool.PropertiesTool,
        MigrationTool.MigrationTool,
        PloneControlPanel.PloneControlPanel,
        RegistrationTool.RegistrationTool,
        URLTool.URLTool,
        ActionsTool.ActionsTool,
        TypesTool.TypesTool,
        CatalogTool.CatalogTool,
        SkinsTool.SkinsTool,
        QuickInstallerTool.QuickInstallerTool,
        TranslationServiceTool.TranslationServiceTool,
    )

    from Products.CMFCore.utils import ContentInit
    from Products.CMFPlone.utils import ToolInit

    # Register tools and content
    ToolInit(
        'Plone Tool',
        tools=tools,
        icon='tool.gif',
    ).initialize(context)

    ContentInit(
        'Plone Content',
        content_types=contentClasses,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=contentConstructors,
    ).initialize(context)

    from AccessControl.Permissions import view_management_screens
    from Products.CMFPlone.Portal import PloneSite
    from Products.CMFPlone.factory import zmi_constructor
    context.registerClass(
        instance_class=PloneSite,
        permission=view_management_screens,
        constructors=(zmi_constructor, ),
    )

    from plone.app.folder import nogopip
    context.registerClass(
        nogopip.GopipIndex,
        permission='Add Pluggable Index',
        constructors=(nogopip.manage_addGopipForm,
                      nogopip.manage_addGopipIndex),
        icon='index.gif',
        visibility=None
    )
예제 #9
0
def initialize(context):

    # Stuff has been moved from module level to this method for a
    # better separation of import and installation.
    # For the general user this change does not make a difference.
    # For test authors (and people who use parts of Plone only)
    # it does speed up import *significantly*.

    from AccessControl import ModuleSecurityInfo
    from AccessControl import allow_module, allow_class

    # allow logging
    ModuleSecurityInfo('logging').declarePublic('getLogger')
    from logging import Logger
    allow_class(Logger)

    # Register kss extension to allow it used from fs skins
    from Products.CMFCore.DirectoryView import registerFileExtension
    from Products.CMFCore.FSFile import FSFile
    registerFileExtension('kss', FSFile)

    # various small utils functions
    # added for unescaping view names in urls when finding selected action
    ModuleSecurityInfo('urllib').declarePublic('unquote')

    allow_module('Products.CMFPlone.utils')

    # For content_status_modify
    from Products.CMFCore.WorkflowCore import ObjectMoved, ObjectDeleted, \
                                              WorkflowException
    ModuleSecurityInfo('Products.CMFCore.WorkflowCore').declarePublic(
        'ObjectMoved')
    ModuleSecurityInfo('Products.CMFCore.WorkflowCore').declarePublic(
        'ObjectDeleted')
    ModuleSecurityInfo('Products.CMFCore.WorkflowCore').declarePublic(
        'WorkflowException')
    allow_class(ObjectMoved)
    allow_class(ObjectDeleted)
    allow_class(WorkflowException)

    from PloneBatch import Batch
    allow_class(Batch)

    # Make Batch available at module level
    this_module.Batch = Batch

    from StringIO import StringIO
    allow_class(StringIO)

    # Make Unauthorized importable TTW
    ModuleSecurityInfo('AccessControl').declarePublic('Unauthorized')

    # Make Forbidden importable TTW
    ModuleSecurityInfo('zExceptions').declarePublic('Forbidden')

    # Make ConflictError importable TTW
    ModuleSecurityInfo('ZODB.POSException').declarePublic('ConflictError')

    # Make ZCTextIndex ParseError importable TTW
    ModuleSecurityInfo('Products.ZCTextIndex.ParseTree').declarePublic(
        'ParseError')

    # Make DateTimeError importable TTW
    ModuleSecurityInfo('DateTime.interfaces').declarePublic('DateTimeError')
    ModuleSecurityInfo('DateTime.interfaces').declarePublic('SyntaxError')

    # BBB support for DateTime < 3
    ModuleSecurityInfo('DateTime.DateTime').declarePublic('DateTimeError')
    ModuleSecurityInfo('DateTime.DateTime').declarePublic('SyntaxError')

    # Make CopyError importable TTW
    ModuleSecurityInfo('OFS.CopySupport').declarePublic('CopyError')

    # Make DiscussionNotAllowed importable TTW
    ModuleSecurityInfo('Products.CMFDefault.DiscussionTool').declarePublic(
        'DiscussionNotAllowed')

    # Make AllowSendto importable TTW
    ModuleSecurityInfo('Products.CMFPlone.PloneTool').declarePublic(
        'AllowSendto')

    # Make ZCatalog's mergeResults importable TTW
    ModuleSecurityInfo('Products.ZCatalog.Catalog').declarePublic(
        'mergeResults')

    # Make the navtree constructs available TTW
    allow_module('Products.CMFPlone.browser.navtree')

    # Allow access to the exception in the folder_delete script
    from OFS.ObjectManager import BeforeDeleteException
    allow_module('OFS.ObjectManager')
    allow_class(BeforeDeleteException)

    # Make cgi.escape available TTW
    ModuleSecurityInfo('cgi').declarePublic('escape')

    # Apply monkey patches
    import patches

    # Register unicode splitter w/ ZCTextIndex
    # pipeline registry
    import UnicodeSplitter

    # Plone content

    # Usage of PloneFolder is discouraged.
    import PloneFolder

    contentClasses = (PloneFolder.PloneFolder, )
    contentConstructors = (PloneFolder.addPloneFolder, )

    # CMFCore and CMFDefault tools
    from Products.CMFCore import CachingPolicyManager

    # Plone tools
    import PloneTool
    import FactoryTool
    import InterfaceTool
    import MigrationTool
    import PloneControlPanel
    import WorkflowTool
    import URLTool
    import MetadataTool
    import RegistrationTool
    import SyndicationTool
    import PropertiesTool
    import ActionsTool
    import TypesTool
    import UndoTool
    import CatalogTool
    import SkinsTool
    import DiscussionTool
    import CalendarTool
    import ActionIconsTool
    import QuickInstallerTool
    import TranslationServiceTool

    tools = (
        PloneTool.PloneTool,
        WorkflowTool.WorkflowTool,
        CachingPolicyManager.CachingPolicyManager,
        FactoryTool.FactoryTool,
        PropertiesTool.PropertiesTool,
        MigrationTool.MigrationTool,
        InterfaceTool.InterfaceTool,
        PloneControlPanel.PloneControlPanel,
        RegistrationTool.RegistrationTool,
        URLTool.URLTool,
        MetadataTool.MetadataTool,
        ActionsTool.ActionsTool,
        TypesTool.TypesTool,
        UndoTool.UndoTool,
        SyndicationTool.SyndicationTool,
        CatalogTool.CatalogTool,
        SkinsTool.SkinsTool,
        DiscussionTool.DiscussionTool,
        ActionIconsTool.ActionIconsTool,
        CalendarTool.CalendarTool,
        QuickInstallerTool.QuickInstallerTool,
        TranslationServiceTool.TranslationServiceTool,
    )

    from Products.CMFCore.utils import ContentInit
    from Products.CMFPlone.utils import ToolInit

    # Register tools and content
    ToolInit(
        'Plone Tool',
        tools=tools,
        icon='tool.gif',
    ).initialize(context)

    ContentInit(
        'Plone Content',
        content_types=contentClasses,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=contentConstructors,
    ).initialize(context)

    from Products.CMFPlone.Portal import PloneSite
    from Products.CMFPlone.factory import zmi_constructor
    from AccessControl.Permissions import view_management_screens
    context.registerClass(
        instance_class=PloneSite,
        permission=view_management_screens,
        constructors=(zmi_constructor, ),
    )

    from plone.app.folder import nogopip
    context.registerClass(nogopip.GopipIndex,
                          permission='Add Pluggable Index',
                          constructors=(nogopip.manage_addGopipForm,
                                        nogopip.manage_addGopipIndex),
                          icon='index.gif',
                          visibility=None)
예제 #10
0
<dtml-var "protected_init_section_top">
    # imports packages and types for registration
<dtml-in "package_imports">
<dtml-if sequence-item>
    import <dtml-var sequence-item>
</dtml-if>
</dtml-in>

<dtml-in "class_imports">
    import <dtml-var sequence-item>
</dtml-in>

<dtml-if "has_tools">
    # Initialize portal tools
    tools = [<dtml-var "', '.join (tool_names)">]
    ToolInit( PROJECTNAME +' Tools',
                tools = tools,
<dtml-if "generator.getOption('cmf_target_version', package, '1.5') == '1.4'">
                product_name = PROJECTNAME,
</dtml-if>
<dtml-if "generator.getOption('cmf_target_version', package, '1.5') >= '1.4'">
                icon='tool.gif'
</dtml-if>
                ).initialize( context )

</dtml-if>
    # Initialize portal content
<dtml-if "creation_permissions">
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)