Пример #1
0
def initialize(context):

    # Import the type, which results in registerType() being called
    from content import PressRoom, PressRelease, PressClip, PressContact
    
    # initialize the content, including types and add permissions
    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    for content_type, constructor, fti in zip(content_types, constructors, ftis):
        utils.ContentInit(
            PROJECTNAME + ' Content',
            content_types      = (content_type,),
            permission         = PERMISSIONS[content_type.portal_type],
            extra_constructors = (constructor,),
            fti                = (fti,),
            ).initialize(context)

    # Register the extension profile
    profile_registry.registerProfile('default',
                                     'PressRoom',
                                     'pressroom',
                                     'profiles/default',
                                     'PressRoom',
                                     EXTENSION,
                                     IPloneSiteRoot)
Пример #2
0
def initialize(context):
    context.registerClass( LDAPUserFolder
                         , permission=add_user_folders
                         , constructors=(manage_addLDAPUserFolder,)
                         , icon='www/ldapuserfolder.gif'
                         )

    context.registerClass( LDAPUserSatellite
                         , permission=add_user_folders
                         , constructors=( addLDAPUserSatelliteForm
                                        , manage_addLDAPUserSatellite
                                        )
                         , icon='www/ldapusersatellite.gif'
                         )

    context.registerHelp()

    if have_cmf:
        profile_registry.registerProfile( 'default'
                                        , 'LDAPUserFolder CMF Tools'
                                        , 'Adds LDAP support to the CMF.'
                                        , 'profiles/default'
                                        , 'LDAPUserFolder'
                                        , EXTENSION
                                        , for_=ISiteRoot
                                        )
Пример #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,)
Пример #4
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 interfaces

    # 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('bungenihelpcenter',
                                     'BungeniHelpCenter',
                                     'BungeniHelpCenter',
                                     'profiles/default',
                                     'BungeniHelpCenter',
                                     EXTENSION,
                                     for_=IPloneSiteRoot)
Пример #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 interfaces

    # 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('bungenihelpcenter',
                                     'BungeniHelpCenter',
                                     'BungeniHelpCenter',
                                     'profiles/default',
                                     'BungeniHelpCenter',
                                     EXTENSION,
                                     for_=IPloneSiteRoot)
Пример #6
0
def setupSampleTypeProfile():
    profile_registry.registerProfile('Archetypes_sampletypes',
        'Archetypes Sample Content Types',
        'Extension profile including Archetypes sample content types',
        'profiles/sample_types',
        'Products.Archetypes',
        EXTENSION)
Пример #7
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)
Пример #8
0
def setupSampleTypeProfile():
    profile_registry.registerProfile('CMF_sampletypes',
        'CMF Sample Content Types',
        'Extension profile including CMF sample content types',
        'profiles/testing',
        'Products.contentmigration',
        EXTENSION)
Пример #9
0
def setupSampleTypeProfile():
    profile_registry.registerProfile('Archetypes_sampletypes',
                                     'Archetypes Sample Content Types',
                                     'Extension profile including Archetypes sample content types',
                                     'profiles/sample_types',
                                     'Products.Archetypes',
                                     EXTENSION)
Пример #10
0
def initialize(context):
    # If we're running under Plone, register the GenericSetup profiles that let us replace login_form:
    try:
        from Products.GenericSetup import EXTENSION, profile_registry
        from Products.CMFPlone.interfaces import IPloneSiteRoot
    except ImportError:
        pass  # We're not running under Plone. Let the user use the PAS plugin without all the inapplicable login_form overriding.
    else:
        profile_registry.registerProfile(
            "default",
            "WebServerAuth",
            "Delegates authentication to the web server.",
            "profiles/default",
            product="Products.WebServerAuth",
            profile_type=EXTENSION,
            for_=IPloneSiteRoot)
        profile_registry.registerProfile("uninstall",
                                         "WebServerAuth Uninstall",
                                         "Removes the login_form redirection.",
                                         "profiles/uninstall",
                                         product="Products.WebServerAuth",
                                         profile_type=EXTENSION,
                                         for_=IPloneSiteRoot)

    context.registerClass(MultiPlugin,
                          permission=add_user_folders,
                          constructors=(manage_addWebServerAuthForm,
                                        manage_addWebServerAuth),
                          visibility=None,
                          icon='%s/multiplugin.gif' % wwwDirectory)
Пример #11
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)
Пример #12
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


    # 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 flickrgallery',
        path='profiles/default',
        product='flickrgallery',
        profile_type=EXTENSION,
        for_=Products.CMFPlone.interfaces.IPloneSiteRoot)
Пример #13
0
def initialize( context ):
    utils.ToolInit('CMF Calendar Tool', tools=tools, icon='tool.gif',
                   ).initialize( context )

    utils.initializeBasesPhase2( z_bases, context )
    utils.ContentInit( 'CMF Event'
                     , content_types = contentClasses
                     , permission = AddPortalContent
                     , extra_constructors = contentConstructors
                     ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFCalendar',
                                     'Adds calendar support.',
                                     'profiles/default',
                                     'CMFCalendar',
                                     EXTENSION,
                                     for_=ISiteRoot,
                                    )

    profile_registry.registerProfile('views_support',
                                     'Experimental CMFCalendar Browser Views',
                                     'Hooks up the browser views.',
                                     'profiles/views_support',
                                     'CMFCalendar',
                                     EXTENSION,
                                     for_=ISiteRoot,
                                    )
Пример #14
0
def initialize(context):
    
    context.registerHelp(directory='help')
    context.registerHelpTitle('DCWorkflow')
    
    registerIcon(DCWorkflow.DCWorkflowDefinition,
                 'images/workflow.gif', globals())
    registerIcon(States.States,
                 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions,
                 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables,
                 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists,
                 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())

    profile_registry.registerProfile('revision2',
                                     'CMF Default Workflow [Revision 2]',
                                     'Adds revision 2 of default workflow.',
                                     'profiles/revision2',
                                     'DCWorkflow',
                                     EXTENSION,
                                     for_=ISiteRoot)
Пример #15
0
def initialize(context):

    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.DirectoryView import registerDirectory
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import Topic
    import SimpleStringCriterion
    import SimpleIntCriterion
    import ListCriterion
    import DateCriteria
    import SortCriterion
    from permissions import AddTopics

    context.registerHelpTitle('CMF Topic Help')
    context.registerHelp(directory='help')

    # CMF Initializers
    ContentInit('CMF Topic Objects',
                content_types=(Topic.Topic, ),
                permission=AddTopics,
                extra_constructors=(Topic.addTopic, )).initialize(context)

    registerDirectory('skins', cmftopic_globals)

    profile_registry.registerProfile('default', 'CMFTopic',
                                     'Adds topic portal type.',
                                     'profiles/default', 'CMFTopic', EXTENSION)
Пример #16
0
    def test_getImportContextID( self ):

        from Products.GenericSetup.tool import IMPORT_STEPS_XML
        from Products.GenericSetup.tool import EXPORT_STEPS_XML
        from Products.GenericSetup.tool import TOOLSET_XML
        from test_registry import _EMPTY_IMPORT_XML
        from test_registry import _EMPTY_EXPORT_XML
        from test_registry import _EMPTY_TOOLSET_XML
        from common import _makeTestFile

        tool = self._makeOne('setup_tool')

        _makeTestFile( IMPORT_STEPS_XML
                     , self._PROFILE_PATH
                     , _EMPTY_IMPORT_XML
                     )

        _makeTestFile( EXPORT_STEPS_XML
                     , self._PROFILE_PATH
                     , _EMPTY_EXPORT_XML
                     )

        _makeTestFile( TOOLSET_XML
                     , self._PROFILE_PATH
                     , _EMPTY_TOOLSET_XML
                     )

        profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH)
        tool.setImportContext('profile-other:foo')

        self.assertEqual( tool.getImportContextID(), 'profile-other:foo' )
Пример #17
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
Пример #18
0
    def setUpPloneSite(self, portal):
        super(PloneTestCaseFixture, self).setUpPloneSite(portal)

        # prepare structure
        if 'news' not in portal:
            setRoles(portal, TEST_USER_ID, ['Manager'])
            portal.invokeFactory('Folder', 'news', title='News Folder')
            setRoles(portal, TEST_USER_ID, ['Member'])

        # install product
        testing.applyProfile(portal, 'collective.contentrules.mail:default')

        # install testing profile
        from Products.GenericSetup import EXTENSION, profile_registry
        profile_registry.registerProfile('testing',
            "collective.contentrules.mail testing",
            'Used for testing only',
            'profiles/testing',
            'collective.contentrules.mail',
            EXTENSION)
        testing.applyProfile(portal, 'collective.contentrules.mail:testing')

        # patch mail host
        #portal._old = MailHost.MailHost
        #MailHost.MailHost = TestMailHost

        portal.manage_changeProperties(email_from_name='Site Administrator')
Пример #19
0
def initialize(context):
    import MoneyField
    import FixedPointField
    import MoneyWidget

    # As time goes by, more things will move from Python into the
    # profile.
    profile_desc = "Extra setup stuff for FinanceFields."
    profile_registry.registerProfile('default',
                                     'FinanceFields',
                                     profile_desc,
                                     'profiles/default',
                                     'FinanceFields',
                                     EXTENSION,
                                     for_=IPloneSiteRoot,
                                     )

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

    ContentInit(
        PROJECTNAME + ' Content',
        content_types      = content_types,
        permission         = ADD_CONTENT_PERMISSION,
        extra_constructors = constructors,
        fti                = ftis,
        ).initialize(context)
Пример #20
0
def register_test_profile():
    profile_registry.registerProfile('tinymce_testing',
            'TinyMCE testing profile',
            'Extension profile for testing TinyMCE including sample content types',
            'profiles/testing',
            'Products.TinyMCE',
            EXTENSION)
Пример #21
0
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)                                  
Пример #22
0
def initialize( context ):
    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.utils import ToolInit
    from Products.CMFCore.DirectoryView import registerDirectory
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import Event
    import CalendarTool
    from permissions import AddPortalContent


    tools = ( CalendarTool.CalendarTool, )
    ToolInit( 'CMF Calendar Tool'
            , tools=tools, icon='tool.gif'
            ).initialize( context )

    contentConstructors = (Event.addEvent,)
    contentClasses = (Event.Event,)
    ContentInit( 'CMF Event'
               , content_types = contentClasses
               , permission = AddPortalContent
               , extra_constructors = contentConstructors
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFCalendar',
                                     'Adds calendar support.',
                                     'profiles/default',
                                     'CMFCalendar',
                                     EXTENSION)
    registerDirectory('skins', cmfcalendar_globals)

    context.registerHelpTitle('CMF Calendar Help')
    context.registerHelp(directory='help')
Пример #23
0
def initialize(context):

    from Products.CMFCore.utils import ToolInit
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import UniqueIdAnnotationTool
    import UniqueIdGeneratorTool
    import UniqueIdHandlerTool

    tools = ( UniqueIdAnnotationTool.UniqueIdAnnotationTool
            , UniqueIdGeneratorTool.UniqueIdGeneratorTool
            , UniqueIdHandlerTool.UniqueIdHandlerTool
            )

    ToolInit( 'CMF Unique Id Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize(context)

    profile_registry.registerProfile( 'default'
                                     , 'CMFUid'
                                     , 'Adds UID support.'
                                     , 'profiles/default'
                                     , 'CMFUid'
                                     , EXTENSION
                                     )
Пример #24
0
def initialize( context ):

    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.DirectoryView import registerDirectory
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import Topic
    import SimpleStringCriterion
    import SimpleIntCriterion
    import ListCriterion
    import DateCriteria
    import SortCriterion
    from permissions import AddTopics

    context.registerHelpTitle( 'CMF Topic Help' )
    context.registerHelp( directory='help' )

    # CMF Initializers
    ContentInit( 'CMF Topic Objects'
               , content_types = (Topic.Topic,)
               , permission = AddTopics
               , extra_constructors = (Topic.addTopic,)
               ).initialize( context )

    registerDirectory( 'skins', cmftopic_globals )

    profile_registry.registerProfile('default',
                                     'CMFTopic',
                                     'Adds topic portal type.',
                                     'profiles/default',
                                     'CMFTopic',
                                     EXTENSION)
Пример #25
0
def initialize(context):
    utils.ToolInit(
        'CMF Calendar Tool',
        tools=tools,
        icon='tool.gif',
    ).initialize(context)

    utils.initializeBasesPhase2(z_bases, context)
    utils.ContentInit(
        'CMF Event',
        content_types=contentClasses,
        permission=AddPortalContent,
        extra_constructors=contentConstructors).initialize(context)

    profile_registry.registerProfile(
        'default',
        'CMFCalendar',
        'Adds calendar support.',
        'profiles/default',
        'CMFCalendar',
        EXTENSION,
        for_=ISiteRoot,
    )

    profile_registry.registerProfile(
        'views_support',
        'Experimental CMFCalendar Browser Views',
        'Hooks up the browser views.',
        'profiles/views_support',
        'CMFCalendar',
        EXTENSION,
        for_=ISiteRoot,
    )
Пример #26
0
    def test_setImportContext(self):

        from Products.GenericSetup.tool import IMPORT_STEPS_XML
        from Products.GenericSetup.tool import EXPORT_STEPS_XML
        from Products.GenericSetup.tool import TOOLSET_XML
        from test_registry import _SINGLE_IMPORT_XML
        from test_registry import _SINGLE_EXPORT_XML
        from test_registry import _NORMAL_TOOLSET_XML
        from test_registry import ONE_FUNC
        from common import _makeTestFile

        tool = self._makeOne('setup_tool')
        tool.getExportStepRegistry().clear()

        _makeTestFile(IMPORT_STEPS_XML, self._PROFILE_PATH, _SINGLE_IMPORT_XML)

        _makeTestFile(EXPORT_STEPS_XML, self._PROFILE_PATH, _SINGLE_EXPORT_XML)

        _makeTestFile(TOOLSET_XML, self._PROFILE_PATH, _NORMAL_TOOLSET_XML)

        profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH)
        tool.setImportContext('profile-other:foo')

        self.assertEqual(tool.getImportContextID(), 'profile-other:foo')

        import_registry = tool.getImportStepRegistry()
        self.assertEqual(len(import_registry.listSteps()), 1)
        self.failUnless('one' in import_registry.listSteps())
        info = import_registry.getStepMetadata('one')
        self.assertEqual(info['id'], 'one')
        self.assertEqual(info['title'], 'One Step')
        self.assertEqual(info['version'], '1')
        self.failUnless('One small step' in info['description'])
        self.assertEqual(info['handler'],
                         'Products.GenericSetup.tests.test_registry.ONE_FUNC')

        self.assertEqual(import_registry.getStep('one'), ONE_FUNC)

        export_registry = tool.getExportStepRegistry()
        self.assertEqual(len(export_registry.listSteps()), 1)
        self.failUnless('one' in import_registry.listSteps())
        info = export_registry.getStepMetadata('one')
        self.assertEqual(info['id'], 'one')
        self.assertEqual(info['title'], 'One Step')
        self.failUnless('One small step' in info['description'])
        self.assertEqual(info['handler'],
                         'Products.GenericSetup.tests.test_registry.ONE_FUNC')

        self.assertEqual(export_registry.getStep('one'), ONE_FUNC)

        toolset = tool.getToolsetRegistry()
        self.assertEqual(len(toolset.listForbiddenTools()), 1)
        self.failUnless('doomed' in toolset.listForbiddenTools())
        self.assertEqual(len(toolset.listRequiredTools()), 2)
        self.failUnless('mandatory' in toolset.listRequiredTools())
        info = toolset.getRequiredToolInfo('mandatory')
        self.assertEqual(info['class'], 'path.to.one')
        self.failUnless('obligatory' in toolset.listRequiredTools())
        info = toolset.getRequiredToolInfo('obligatory')
        self.assertEqual(info['class'], 'path.to.another')
Пример #27
0
def initialize(context):
    try:
        init = utils.ToolInit(
            "kupu Library Tool",
            tools=(PloneKupuLibraryTool, ),
            icon="kupu_icon.gif",
        )
    except TypeError:
        # Try backward compatible form of the initialisation call
        init = utils.ToolInit(
            "kupu Library Tool",
            tools=(PloneKupuLibraryTool, ),
            product_name='kupu',
            icon="kupu_icon.gif",
        )
    init.initialize(context)

    if profile_registry is not None:
        profile_registry.registerProfile(
            'default',
            'Kupu',
            'Kupu is a cross-browser visual editor.',
            'plone/profiles/default',
            'kupu',
            EXTENSION,
            for_=IPloneSiteRoot)
def setupSampleTypeProfile():
    profile_registry.registerProfile('Testing_sampletypes',
        'Archetypes Sample Content Types',
        'Extension profile of Archetypes sample content types',
        'profiles/sample_types',
        'plone.app.referenceablebehavior',
        EXTENSION)
Пример #29
0
def registerTestProfile(test):
    profile_registry.registerProfile('test',
               'CMFQI test profile',
               'Test profile for CMFQuickInstallerTool',
               'profiles/test',
               'Products.CMFQuickInstallerTool',
               EXTENSION,
               for_=None)
Пример #30
0
    def setUpPloneSite(self, portal):
        from Products.GenericSetup import EXTENSION, profile_registry
        profile_registry.registerProfile(
            'basetype', 'seantis.dir.base base type extension profile',
            'Provides a base type without special fields for testing',
            'profiles/basetype', 'seantis.dir.base', EXTENSION)

        self.applyProfile(portal, 'seantis.dir.base:basetype')
Пример #31
0
    def afterSetUp(self):
        from Products.GenericSetup import EXTENSION, profile_registry
        profile_registry.registerProfile(
            'basetype', 'seantis.dir.base base type extension profile',
            'Provides a base type without special fields for testing',
            'profiles/basetype', 'seantis.dir.base', EXTENSION)

        self.addProfile('seantis.dir.base:basetype')
Пример #32
0
 def setUp(cls):
     profile_registry.registerProfile(
         name='exportimport', title='Test Placeful Workflow Profile',
         description=(
             "Tests the placeful workflow policy handler."),
         path='profiles/exportimport',
         product='Products.CMFPlacefulWorkflow.tests',
         profile_type=EXTENSION, for_=ISiteRoot)
Пример #33
0
    def test_setImportContext( self ):

        from Products.GenericSetup.tool import IMPORT_STEPS_XML
        from Products.GenericSetup.tool import EXPORT_STEPS_XML
        from Products.GenericSetup.tool import TOOLSET_XML
        from test_registry import _SINGLE_IMPORT_XML
        from test_registry import _SINGLE_EXPORT_XML
        from test_registry import _NORMAL_TOOLSET_XML
        from test_registry import ONE_FUNC
        from common import _makeTestFile

        tool = self._makeOne('setup_tool')
        tool.getExportStepRegistry().clear()

        _makeTestFile( IMPORT_STEPS_XML
                     , self._PROFILE_PATH
                     , _SINGLE_IMPORT_XML
                     )

        _makeTestFile( EXPORT_STEPS_XML
                     , self._PROFILE_PATH
                     , _SINGLE_EXPORT_XML
                     )

        _makeTestFile( TOOLSET_XML
                     , self._PROFILE_PATH
                     , _NORMAL_TOOLSET_XML
                     )

        profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH)
        tool.setImportContext('profile-other:foo')

        self.assertEqual( tool.getImportContextID(), 'profile-other:foo' )

        import_registry = tool.getImportStepRegistry()
        self.assertEqual( len( import_registry.listSteps() ), 1 )
        self.failUnless( 'one' in import_registry.listSteps() )
        info = import_registry.getStepMetadata( 'one' )
        self.assertEqual( info[ 'id' ], 'one' )
        self.assertEqual( info[ 'title' ], 'One Step' )
        self.assertEqual( info[ 'version' ], '1' )
        self.failUnless( 'One small step' in info[ 'description' ] )
        self.assertEqual( info[ 'handler' ]
                        , 'Products.GenericSetup.tests.test_registry.ONE_FUNC')

        self.assertEqual( import_registry.getStep( 'one' ), ONE_FUNC )

        export_registry = tool.getExportStepRegistry()
        self.assertEqual( len( export_registry.listSteps() ), 1 )
        self.failUnless( 'one' in import_registry.listSteps() )
        info = export_registry.getStepMetadata( 'one' )
        self.assertEqual( info[ 'id' ], 'one' )
        self.assertEqual( info[ 'title' ], 'One Step' )
        self.failUnless( 'One small step' in info[ 'description' ] )
        self.assertEqual( info[ 'handler' ]
                        , 'Products.GenericSetup.tests.test_registry.ONE_FUNC')

        self.assertEqual( export_registry.getStep( 'one' ), ONE_FUNC )
Пример #34
0
 def afterSetUp(self):
     profile_registry.registerProfile(
         'Archetypes_sampletypes', 'Archetypes Sample Content Types',
         'Extension profile incl. Archetypes sample content types',
         os.path.join(at_root, 'profiles/sample_types'),
         'Products.Archetypes', EXTENSION)
     setup = getToolByName(self.portal, 'portal_setup')
     setup.runAllImportStepsFromProfile('profile-Products.Archetypes:'
                                        'Archetypes_sampletypes')
Пример #35
0
def initialize(context):
    """ The 'initialize' function of this Product.
        It is called when Zope is restarted with these files in the Products 
        directory. (I'm not sure what it does or if it is neccessary 
        at all. Best leave it alone.)
    """
    log('Start: "initialize()"\n')
    try:
        content_types, constructors, ftis = process_types(
            listTypes(PROJECTNAME),
            PROJECTNAME)
        
        utils.ContentInit(
            PROJECTNAME + ' Content',
            content_types      = content_types,
            permission         = PERMISSION_ADD_MCTEST,
            extra_constructors = constructors,
            fti                = ftis,
        ).initialize(context)
        
        log('\tWorked: "ContentInit()"\n')

        # Add permissions to allow control on a per-class basis
        for i in range(0, len(content_types)):
            content_type = content_types[i].__name__
            if ADD_CONTENT_PERMISSIONS.has_key(content_type):
                context.registerClass(meta_type    = ftis[i]['meta_type'],
                                      constructors = (constructors[i],),
                                      permission   = ADD_CONTENT_PERMISSIONS[content_type])

        from ECQTool import ECQTool

        utils.ToolInit(
            ECQTool.meta_type,
            tools = (ECQTool,),
            product_name = PROJECTNAME,
            icon = 'ECQTool.png',
            ).initialize(context)




	if profile_registry is not None:
            profile_registry.registerProfile('default',
                                     'ECQuiz',
                                     'Extension profile for ECQuiz',
                                     'profiles/default',
                                     'ECQuiz',
                                     EXTENSION,
                                     for_=IPloneSiteRoot)  

        #~ parsers.initialize(context)
        #~ renderers.initialize(context)
        log('Worked: "initialize()"\n')
    except Exception, e:
        # Log any errors that occurred in 'initialize()'
        log('Failed: "initialize()": ' + str(e) + '\n')
Пример #36
0
def register_test_profile():
    profile_registry.registerProfile(
        "tinymce_testing",
        "TinyMCE testing profile",
        "Extension profile for testing TinyMCE including sample content types",
        "profiles/testing",
        "Products.TinyMCE",
        EXTENSION,
    )
Пример #37
0
def initialize(context):

    utils.initializeBasesPhase2(z_tool_bases, context)

    utils.ToolInit("CMF Unique Id Tool", tools=tools, icon="tool.gif").initialize(context)

    profile_registry.registerProfile(
        "default", "CMFUid", "Adds UID support.", "profiles/default", "CMFUid", EXTENSION, for_=ISiteRoot
    )
Пример #38
0
def initialize(context):

    utils.initializeBasesPhase2(z_tool_bases, context)

    utils.ToolInit('CMF Unique Id Tool', tools=tools,
                   icon='tool.gif').initialize(context)

    profile_registry.registerProfile('default', 'CMFUid', 'Adds UID support.',
                                     'profiles/default', 'CMFUid', EXTENSION)
Пример #39
0
def initialize( context ):

    initializeBasesPhase2( z_bases, context )
    initializeBasesPhase2( z_tool_bases, context )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default',
                                     'CMFDefault',
                                     BASE,
                                     for_=ISiteRoot,
                                    )

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content',
                                     'CMFDefault',
                                     EXTENSION,
                                     for_=ISiteRoot,
                                    )

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
Пример #40
0
 def setUpZope(self, app, configurationContext):
     super(PlacefulWorkflowLayer, self).setUpZope(app, configurationContext)
     profile_registry.registerProfile(
         name='exportimport', title='Test Placeful Workflow Profile',
         description=(
             "Tests the placeful workflow policy handler."),
         path='profiles/exportimport',
         product='Products.CMFPlacefulWorkflow.tests',
         profile_type=EXTENSION, for_=ISiteRoot)
     z2.installProduct(app, 'Products.CMFPlacefulWorkflow')
Пример #41
0
 def setUpZope(self, app, configurationContext):
     profile_registry.registerProfile('testing',
         'Collective.portletpage testing profile',
         'Extension profile including collective.portletpage testing additions',
         'profiles/testing',
         'collective.portletpage',
         EXTENSION)
     self.loadZCML('testing.zcml', package=collective.portletpage.tests)
     self.loadZCML(package=collective.portletpage)
     z2.installProduct(app, 'collective.portletpage')
Пример #42
0
 def test_relativePath(self):
     profile_id = 'dummy_profile2'
     product_name = 'GenericSetup'
     profile_registry.registerProfile(
         profile_id, 'Dummy Profile', 'This is a dummy profile',
         'tests/metadata_profile', product=product_name)
     profile_info = profile_registry.getProfileInfo(
         '%s:%s' % (product_name, profile_id))
     self.assertEqual(profile_info['description'],
                      'Description from metadata')
Пример #43
0
 def test_relativePath(self):
     profile_id = 'dummy_profile2'
     product_name = 'GenericSetup'
     profile_registry.registerProfile(
         profile_id, 'Dummy Profile', 'This is a dummy profile',
         'tests/metadata_profile', product=product_name)
     profile_info = profile_registry.getProfileInfo(
         '%s:%s' % (product_name, profile_id))
     self.assertEqual(profile_info['description'],
                      'Description from metadata')
Пример #44
0
def setupSampleTypeProfile():
    profile_registry.registerProfile(
        "CMFDVFTI_sampletypes",
        "CMFDynamicViewFTI Sample Content Types",
        "Extension profile including CMFDVFTI sample content types",
        "profiles/sample_types",
        "CMFDynamicViewFTI",
        EXTENSION,
        for_=ISiteRoot,
    )
Пример #45
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)
Пример #46
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 votes
    import geoinfo
    import workspaces


    # 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)
Пример #47
0
def setup_product():
    PloneTestCase.installPackage('plone.browserlayer', quiet=1)
    fiveconfigure.debug_mode = True
    import Products.LinguaPlone.tests
    zcml.load_config('configure.zcml', Products.LinguaPlone.tests)
    fiveconfigure.debug_mode = False

    profile_registry.registerProfile(
        'LinguaPlone_tests', 'LinguaPlone test content types',
        'Extension profile including dummy types to test LinguaPlone',
        'profiles/test_types', 'Products.LinguaPlone', EXTENSION)
Пример #48
0
 def setUpZope(self, app, configurationContext):
     super(PlacefulWorkflowLayer, self).setUpZope(app, configurationContext)
     profile_registry.registerProfile(
         name='exportimport',
         title='Test Placeful Workflow Profile',
         description=("Tests the placeful workflow policy handler."),
         path='profiles/exportimport',
         product='Products.CMFPlacefulWorkflow.tests',
         profile_type=EXTENSION,
         for_=ISiteRoot)
     z2.installProduct(app, 'Products.CMFPlacefulWorkflow')
Пример #49
0
def initialize( context ):

    initializeBasesPhase2( z_bases, context )
    initializeBasesPhase2( z_tool_bases, context )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               , fti=Portal.factory_type_information
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default',
                                     'CMFDefault',
                                     BASE)

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content',
                                     'CMFDefault',
                                     EXTENSION)

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite,
                                         Portal.manage_addCMFSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
Пример #50
0
 def setUpZope(self, app, configurationContext):
     profile_registry.registerProfile('CMFDVFTI_sampletypes',
         'CMFDynamicViewFTI Sample Content Types',
         'Extension profile including CMFDVFTI sample content types',
         'profiles/sample_types',
         'CMFDynamicViewFTI',
         EXTENSION,
         for_=ISiteRoot)
     import Products.CMFDynamicViewFTI.tests
     self.loadZCML(name='browserdefault.zcml',
                   package=Products.CMFDynamicViewFTI.tests)
def setup_sample_types():
    # setup sample types
    if not WITH_SAMPLE_TYPES:
        # if WITH_SAMPLE_TYPES is True the the profile is registered in
        # __init__.py already
        from Products.GenericSetup import EXTENSION, profile_registry
        profile_registry.registerProfile(
            'referencebrowserwidget_sampletypes',
            'ReferenceBrowserWidget Sample Content Types',
            'Extension profile including referencebrowserwidget sample content types',
            'profiles/sample_types', 'archetypes.referencebrowserwidget',
            EXTENSION)
Пример #52
0
    def setUpZope(self, app, configurationContext):
        sm = zope.component.getSiteManager()
        sm.registerHandler(handleBeforeProfileImportEvent)
        sm.registerHandler(handleProfileImportedEvent)

        profile_registry.registerProfile(
            'test',
            'CMFQI test profile',
            'Test profile for CMFQuickInstallerTool',
            'profiles/test',
            'Products.CMFQuickInstallerTool',
            EXTENSION,
            for_=None)
Пример #53
0
def initialize(context):
    app = context._ProductContext__app
    if not app.hasProperty('management_page_charset'):
        app.manage_addProperty('management_page_charset', 'utf-8', 'string')

    if HAS_GENERICSETUP:
        profile_registry.registerProfile('ZopeChinaPak',
                'Chinese Plone Site',
                'Extension profile for default Chinese Plone setup',
                'profiles/default',
                'ZopeChinaPak',
                EXTENSION,
                for_=IPloneSiteRoot)
Пример #54
0
 def test_listContextInfos_with_registered_extension_profile(self):
     from Products.GenericSetup.interfaces import EXTENSION
     profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH,
                                      'Foo', EXTENSION)
     site = self._makeSite()
     site.setup_tool = self._makeOne('setup_tool')
     tool = site.setup_tool
     infos = tool.listContextInfos()
     self.assertEqual(len(infos), 1)
     info = infos[0]
     self.assertEqual(info['id'], 'profile-Foo:foo')
     self.assertEqual(info['title'], 'Foo')
     self.assertEqual(info['type'], 'extension')