Exemple #1
0
def install_xmpp(context):
    from intranett.policy.setuphandlers import setup_xmpp
    loadMigrationProfile(context, 'profile-jarn.xmpp.core:default')
    loadMigrationProfile(context, 'profile-intranett.policy:default',
        steps=('cssregistry', 'jsregistry', 'kssregistry', 'plone.app.registry', ))
    loadMigrationProfile(context, 'profile-intranett.theme:default',
        steps=('viewlets', ))
    setup_xmpp(context)
Exemple #2
0
    def setUpPloneSite(self, portal):
        applyProfile(portal, 'intranett.policy:default')

        setRoles(portal, TEST_USER_ID, ['Manager'])
        portal.invokeFactory('Folder', 'test-folder')
        # don't require secure cookies in tests
        portal.acl_users.session.secure = False
        setup_xmpp(portal)
        setRoles(portal, TEST_USER_ID, ['Member'])
Exemple #3
0
    def setUpPloneSite(self, portal):
        applyProfile(portal, 'intranett.policy:default')

        setRoles(portal, TEST_USER_ID, ['Manager'])
        portal.invokeFactory('Folder', 'test-folder')
        # don't require secure cookies in tests
        portal.acl_users.session.secure = False
        setup_xmpp(portal)
        setRoles(portal, TEST_USER_ID, ['Member'])
Exemple #4
0
def create_site(app, args):
    # Display all messages on stderr
    logger.setLevel(logging.WARN)
    logger.handlers[0].setLevel(logging.WARN)

    parser = OptionParser()
    parser.add_option('-f', '--force', action='store_true', default=False,
        help='Force creation of a site when one already exists.')
    parser.add_option('-r', '--rootpassword', default=None,
        help='Create a admin user in the Zope root with the given password.')
    parser.add_option('-l', '--language', default='en',
        help='The language used in the new site. [default: "%default"]')
    (options, args) = parser.parse_args(args=args)

    if options.rootpassword:
        acl = app.acl_users
        users = getattr(acl, 'users', None)
        if not users:
            # Non-PAS folder from a fresh database
            app.acl_users._doAddUser('admin', options.rootpassword,
                ['Manager'], [])

    existing = app.objectIds('Plone Site')
    if existing:
        if not options.force:
            logger.error('Plone site already exists. '
                'Use --force to replace it.')
            sys.exit(1)
        else:
            for id_ in existing:
                del app[id_]
                logger.info('Removed existing Plone site %r.' % id_)
            app._p_jar.db().cacheMinimize()

    app, _ = _setup(app)

    request = app.REQUEST
    request.form = {
        'extension_ids': (
            'intranett.policy:default', 'intranett.policy:content',),
        'form.submitted': True,
        'language': options.language,
    }
    from intranett.policy.browser.admin import AddIntranettSite
    addsite = AddIntranettSite(app, request)
    addsite()

    # setup initial xmpp nodes
    from intranett.policy.setuphandlers import setup_xmpp
    existing = app.objectValues('Plone Site')
    setup_xmpp(existing[0])

    transaction.get().note('Added new Plone site.')
    transaction.get().commit()
    logger.info('Added new Plone site.')
Exemple #5
0
def install_xmpp(context):
    from intranett.policy.setuphandlers import setup_xmpp

    loadMigrationProfile(context, "profile-jarn.xmpp.core:default")
    loadMigrationProfile(
        context,
        "profile-intranett.policy:default",
        steps=("cssregistry", "jsregistry", "kssregistry", "plone.app.registry"),
    )
    loadMigrationProfile(context, "profile-intranett.theme:default", steps=("viewlets",))
    setup_xmpp(context)