Ejemplo n.º 1
0
def onWSGIApplicationCreatedEvent(application, event):
    """Subscriber to the ore.wsgiapp.interfaces.IWSGIApplicationCreatedEvent.
    """
    initializer = model_interfaces.IBungeniSetup(application)
    initializer.setUp()
    log.debug("onWSGIApplicationCreatedEvent: _features: %s" %
              (getConfigContext()._features))
Ejemplo n.º 2
0
def on_wsgi_application_created_event(application, event):
    """Additional setup on IWSGIApplicationCreatedEvent.
    """
    # !+ui.app.on_wsgi_application_created_event ALWAYS gets called prior to this
    log.debug("CORE ON_WSGI_APPLICATION_CREATED_EVENT: %s, %s", application,
              event)

    # additional workflow validation
    for type_key, ti in capi.iter_type_info():
        if ti.workflow:
            ti.workflow.validate_permissions_roles()

    #set up retract transitions in workflows
    setup_retract_transitions()

    # import events module, registering handlers
    import bungeni.core.workflows.events

    # load workspaces
    load_workspaces()

    # load notifications
    load_notifications()

    # load email notifications
    load_email()

    # set up serialization notifications
    serialization_notifications()

    # import events modules, registering handlers
    import bungeni.core.events

    app_setup = model_interfaces.IBungeniSetup(application)
    app_setup.setUp()

    # write configuration parameters to xml
    try:
        import bungeni.utils.xmlconfexport as confexp
        confexp.write_all()
    except:
        log.debug(("on_wsgi_application_created :"
                   "error while exporting config parameters to xml"))

    log.debug("on_wsgi_application_created_event: _features: %s" %
              (getConfigContext()._features))