示例#1
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))
示例#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))
import bungeni.ui.workflow

# ensure register version views
import bungeni.ui.versions

# load and apply-back UI descriptor customizations
from bungeni.ui.descriptor import localization

localization.forms_localization_init()
import bungeni.feature.ui

bungeni.feature.ui.setup_customization_ui()
bungeni.feature.ui.apply_customization_ui()

# setup serialization threads
worker_threads = serialization_notifications()

# keep the process alive by blocking the process
# until threads have finished (or have been interrupted)
try:
    for thread in worker_threads:
        while thread.isAlive():
            thread.join(5)
except (KeyboardInterrupt, SystemExit):
    print "ctrl -c pressed ! will exit"
    raise SystemExit

print "Threads finished executing ! exiting in 3 seconds !!"

import time
示例#4
0
from bungeni.core.workflows import adapters
adapters.register_generic_workflow_adapters()

# load descriptors
import bungeni.ui.workflow
# ensure register version views
import bungeni.ui.versions
# load and apply-back UI descriptor customizations
from bungeni.ui.descriptor import localization
localization.forms_localization_init()
import bungeni.feature.ui
bungeni.feature.ui.setup_customization_ui()
bungeni.feature.ui.apply_customization_ui()

# setup serialization threads
worker_threads = serialization_notifications()

# keep the process alive by blocking the process
# until threads have finished (or have been interrupted)
try:
    for thread in worker_threads:
      while thread.isAlive():
          thread.join(5)
except (KeyboardInterrupt, SystemExit):
    print "ctrl -c pressed ! will exit"
    raise SystemExit

print "Threads finished executing ! exiting in 3 seconds !!"

import time
time.sleep(3)