Search in sources :

Example 1 with WindowControlInfo

use of org.olat.core.gui.control.info.WindowControlInfo in project OpenOLAT by OpenOLAT.

the class ValidatingVisitor method appendDispatchDebugInfos.

private void appendDispatchDebugInfos(Component target, StringBuilder debugMsg) {
    Controller c = target.getLatestDispatchedController();
    if (c != null) {
        WindowControl wCo = null;
        try {
            wCo = c.getWindowControlForDebug();
        } catch (Exception e) {
        // getWindowControl throw an Assertion if wControl = null
        }
        if (wCo != null) {
            String coInfo = "";
            WindowControlInfo wci = wCo.getWindowControlInfo();
            while (wci != null) {
                String cName = wci.getControllerClassName();
                coInfo = cName + ":" + coInfo;
                wci = wci.getParentWindowControlInfo();
            }
            BusinessControl bc = wCo.getBusinessControl();
            String businessPath = bc == null ? "n/a" : bc.getAsString();
            String compName = target.getComponentName();
            String msg = "wci:" + coInfo + "%%" + compName + "%%" + businessPath + "%%";
            // allowed for debugging, dispatching is already over
            Event ev = target.getAndClearLatestFiredEvent();
            if (ev != null) {
                msg += ev.getClass().getName() + ":" + ev.getCommand() + "%%";
            }
            String targetInfo = target.getExtendedDebugInfo();
            msg += targetInfo + "%%";
            debugMsg.append(msg).append(LOG_SEPARATOR);
        } else {
        // no windowcontrol -> ignore
        }
    }
// else: a component with -no- controller as listener, makes no sense in 99.99% of the cases; ignore in those rare cases
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) Event(org.olat.core.gui.control.Event) ChiefController(org.olat.core.gui.control.ChiefController) Controller(org.olat.core.gui.control.Controller) WindowControl(org.olat.core.gui.control.WindowControl) AssertException(org.olat.core.logging.AssertException) JSONException(org.json.JSONException) InvalidRequestParameterException(org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) IOException(java.io.IOException) WindowControlInfo(org.olat.core.gui.control.info.WindowControlInfo)

Example 2 with WindowControlInfo

use of org.olat.core.gui.control.info.WindowControlInfo in project openolat by klemens.

the class ValidatingVisitor method appendDispatchDebugInfos.

private void appendDispatchDebugInfos(Component target, StringBuilder debugMsg) {
    Controller c = target.getLatestDispatchedController();
    if (c != null) {
        WindowControl wCo = null;
        try {
            wCo = c.getWindowControlForDebug();
        } catch (Exception e) {
        // getWindowControl throw an Assertion if wControl = null
        }
        if (wCo != null) {
            String coInfo = "";
            WindowControlInfo wci = wCo.getWindowControlInfo();
            while (wci != null) {
                String cName = wci.getControllerClassName();
                coInfo = cName + ":" + coInfo;
                wci = wci.getParentWindowControlInfo();
            }
            BusinessControl bc = wCo.getBusinessControl();
            String businessPath = bc == null ? "n/a" : bc.getAsString();
            String compName = target.getComponentName();
            String msg = "wci:" + coInfo + "%%" + compName + "%%" + businessPath + "%%";
            // allowed for debugging, dispatching is already over
            Event ev = target.getAndClearLatestFiredEvent();
            if (ev != null) {
                msg += ev.getClass().getName() + ":" + ev.getCommand() + "%%";
            }
            String targetInfo = target.getExtendedDebugInfo();
            msg += targetInfo + "%%";
            debugMsg.append(msg).append(LOG_SEPARATOR);
        } else {
        // no windowcontrol -> ignore
        }
    }
// else: a component with -no- controller as listener, makes no sense in 99.99% of the cases; ignore in those rare cases
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) Event(org.olat.core.gui.control.Event) ChiefController(org.olat.core.gui.control.ChiefController) Controller(org.olat.core.gui.control.Controller) WindowControl(org.olat.core.gui.control.WindowControl) AssertException(org.olat.core.logging.AssertException) JSONException(org.json.JSONException) InvalidRequestParameterException(org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) IOException(java.io.IOException) WindowControlInfo(org.olat.core.gui.control.info.WindowControlInfo)

Aggregations

IOException (java.io.IOException)2 JSONException (org.json.JSONException)2 InvalidRequestParameterException (org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException)2 ChiefController (org.olat.core.gui.control.ChiefController)2 Controller (org.olat.core.gui.control.Controller)2 Event (org.olat.core.gui.control.Event)2 WindowControl (org.olat.core.gui.control.WindowControl)2 WindowControlInfo (org.olat.core.gui.control.info.WindowControlInfo)2 BusinessControl (org.olat.core.id.context.BusinessControl)2 AssertException (org.olat.core.logging.AssertException)2 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)2