def on_before_traverse(event):
    """Subscriber to intercept traversal, and dispatch as needed to dedicated 
    request pre-processors. We intercept centrally and then call processors
    explicitly to guarantee execution order.
    """
    log.debug("IBeforeTraverseEvent:%s:%s:%s" % (
        id(event.request), event.request.getURL(), event.object))
    apply_request_layer_by_url(event)
    remember_traversed_context(event)
    check_reload_localization(event)
Example #2
0
def on_before_traverse(event):
    """Subscriber to intercept traversal, and dispatch as needed to dedicated 
    request pre-processors. We intercept centrally and then call processors
    explicitly to guarantee execution order.
    """
    log.debug("IBeforeTraverseEvent:%s:%s:%s" % (
        id(event.request), event.request.getURL(), event.object))
    apply_request_layer_by_url(event)
    remember_traversed_context(event)
    check_reload_localization(event)
Example #3
0
def on_before_traverse(event):
    """Subscriber to intercept traversal, and dispatch as needed to dedicated 
    request pre-processors. We intercept centrally and then call processors
    explicitly to guarantee execution order.
    """
    log.debug("IBeforeTraverseEvent:%s:%s:%s" % (
        id(event.request), event.request.getURL(), event.object))
    apply_request_layer_by_url(event)
    if not IUnauthenticatedPrincipal.providedBy(event.request.principal):
        interface.alsoProvides(event.request,
            interfaces.IBungeniAuthenticatedSkin)
    remember_traversed_context(event)
    if has_feature("devmode"):
        check_reload_localization(event)
Example #4
0
def on_wsgi_application_created_event(application, event):
    """Additional UI setup on IWSGIApplicationCreatedEvent.
    """
    # !+ui.app.on_wsgi_application_created_event ALWAYS called prior to core.app.
    log.debug("UI ON_WSGI_APPLICATION_CREATED_EVENT: %s, %s", application, event) 
    
    # ensure register workflow views
    import bungeni.ui.workflow
    
    # ensure register version views
    import bungeni.ui.versions
    
    import bungeni.ui.feature
    bungeni.ui.feature.setup_customization_ui()
    
    # load and apply-back UI descriptor customizations
    from bungeni.ui.descriptor import localization
    localization.check_reload_localization(None)
    
    bungeni.ui.feature.apply_customization_ui()
Example #5
0
def dump_i18n_message_ids():
    """Dump msgids from Descriptor Field labels and descriptions
    for internationalization.
    """
    # ensure localization files are loaded (and naming.MSGIDS correctly primed)
    from bungeni.ui import feature
    feature.setup_customization_ui()
    localization.check_reload_localization(None)
    from os import path
    msgids_py_source_file_path = path.join(
        path.dirname(path.abspath(__file__)), "_dumped_msgids.py")
    print
    print "Processing UI Field i18n MSGID file: %s" % (msgids_py_source_file_path)
    msgids_py_source_preamble = [
        "# automatically generated: dump_i18n_message_ids",
        "from bungeni.ui.i18n import _", 
        ""]
    msgids_py_source = "\n".join(msgids_py_source_preamble + [
            "_(%r)" % msgid for msgid in sorted(naming.MSGIDS) ])
    misc.check_overwrite_file(msgids_py_source_file_path, msgids_py_source)
Example #6
0
def dump_i18n_message_ids():
    """Dump msgids from Descriptor Field labels and descriptions
    for internationalization.
    """
    # ensure localization files are loaded (and naming.MSGIDS correctly primed)
    from bungeni.ui import feature
    feature.setup_customization_ui()
    localization.check_reload_localization(None)
    from os import path
    msgids_py_source_file_path = path.join(
        path.dirname(path.abspath(__file__)), "_dumped_msgids.py")
    print
    print "Processing UI Field i18n MSGID file: %s" % (
        msgids_py_source_file_path)
    msgids_py_source_preamble = [
        "# automatically generated: dump_i18n_message_ids",
        "from bungeni.ui.i18n import _", ""
    ]
    msgids_py_source = "\n".join(
        msgids_py_source_preamble +
        ["_(%r)" % msgid for msgid in sorted(naming.MSGIDS)])
    misc.check_overwrite_file(msgids_py_source_file_path, msgids_py_source)