view data/plugin/action/ @ 588:50f81f786081

Initial Version of a parser and actions for accessing a BigBlueButton instance. BigBlueButton is an open source web conferencing system for distance education. This plugin enables your wiki to keep session parameter and to manage meetings.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 31 May 2012 09:09:45 +0200
children ad72bd94694c
line wrap: on
line source
# -*- coding: utf-8 -*-
    MoinMoin - Create a Meeting for bigbluebutton (

    @copyright: 2012 MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.

from MoinMoin.PageEditor import PageEditor
from MoinMoin.Page import Page
# pip install bigbluebutton
from bigbluebutton import Meeting_Setup
import bbb_settings

def execute(pagename, request):
    Creates a bigbluebutton meeting and stores the definitions on a wiki sub page.
    This page is protected by acls for the responsible user. By reloading the Definition
    page the session becomes recreated.
    It requires a bbb_admin_group defined in Only a user of this 
    group is allowed to use this action. On same directory as you need
    a "" module with the SALT and the BBB_API_URL.

    Example Call by using

    || Meeting Name: || <<FormText(meeting_name,maxlength=50)>> ||
    || Meeting ID || <<FormText(meeting_id,maxlength=50)>> ||
    || Moderator Passwort: || <<FormText(moderator_password,maxlength=50)>> ||
    || Attendee Passwort: || <<FormText(attendee_password,maxlength=50)>> ||
    ||<-2:> <<FormSubmit(Send)>> ||

    username =
    groups = request.groups
    msg = ["Sorry you have not enough previledges", "error"]
        bbb_admin_group = groups.get(request.cfg.bbb_admin_group, [])
    except AttributeError:
        request.theme.add_msg(msg[0], msg[1])
        Page(request, pagename).send_page()

    if request.user.valid and username in bbb_admin_group:
        _ = request.getText

        attendee_password = request.form["attendee_password"]
        moderator_password = request.form["moderator_password"]

        if not attendee_password.strip() or not moderator_password.strip():
            msg = ["Sorry, we don't support empty passwords!", "error"]
            request.theme.add_msg(msg[0], msg[1])
            Page(request, pagename).send_page()

        session = Meeting_Setup(bbb_api_url=bbb_settings.BBB_API_URL,

        sub_pagename = u'%s/%s' % (pagename, request.form["meeting_name"])
        keyval = "\n".join([' %s:: %s' % (key, value) for key, value in request.form.iteritems() if not (key.startswith('labels') or key.startswith('action') or key.startswith('doit'))])
        result = """#acl %(username)s:read,write,delete,revert All:
#format bbb_create
 responsible:: %(username)s
%(keyval)s""" % {"username": username,
                 "keyval": keyval}

            # We write without acl check
            PageEditor(request, sub_pagename)._write_file(result, action='SAVE')
            msg = (_(u"OK!"), "info")
        except PageEditor.SaveError:
            msg = (_(u"A severe error occured:"), "error")
    request.theme.add_msg(msg[0], msg[1])
    Page(request, pagename).send_page()